{"id":14985080,"url":"https://github.com/caffco/get-video-duration","last_synced_at":"2025-04-08T11:12:07.575Z","repository":{"id":37381966,"uuid":"44536638","full_name":"caffco/get-video-duration","owner":"caffco","description":"Get the duration of a video file","archived":false,"fork":false,"pushed_at":"2025-03-04T04:47:05.000Z","size":1697,"stargazers_count":139,"open_issues_count":2,"forks_count":18,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-01T10:08:34.165Z","etag":null,"topics":["ffprobe","typescript","video","video-duration"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/caffco.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-10-19T13:27:44.000Z","updated_at":"2025-03-15T11:55:17.000Z","dependencies_parsed_at":"2024-06-04T06:23:03.393Z","dependency_job_id":"981208ec-0f10-4231-833d-5c199d2608b8","html_url":"https://github.com/caffco/get-video-duration","commit_stats":{"total_commits":332,"total_committers":4,"mean_commits":83.0,"dds":"0.29518072289156627","last_synced_commit":"c1b90182e2e32437a7b1a1ac49bd3b607756c42e"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caffco%2Fget-video-duration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caffco%2Fget-video-duration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caffco%2Fget-video-duration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caffco%2Fget-video-duration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/caffco","download_url":"https://codeload.github.com/caffco/get-video-duration/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247451646,"owners_count":20940939,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ffprobe","typescript","video","video-duration"],"created_at":"2024-09-24T14:10:15.952Z","updated_at":"2025-04-08T11:12:07.554Z","avatar_url":"https://github.com/caffco.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# get-video-duration\n\n[![NPM version][npm-image]][npm-url]\n![Build Status](https://github.com/caffco/get-video-duration/workflows/test/badge.svg)\n[![Maintainability](https://api.codeclimate.com/v1/badges/d66b9477ad4f7a14b5c9/maintainability)](https://codeclimate.com/github/caffco/get-video-duration/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/d66b9477ad4f7a14b5c9/test_coverage)](https://codeclimate.com/github/caffco/get-video-duration/test_coverage)\n[![License][license-image]][license-url]\n[![NPM bundle size (minified)][bundle-size-image]][npm-url]\n[![Downloads][downloads-image]][downloads-url]\n\nGet the duration of video files/streams with `ffprobe`.\n\n# Supported platforms\n\nCurrently this package only supports Linux, Windows 7+, and MacOS 10.9+. **This package does not work in the browser**, iOS or Android.\n\n# Install\n\n```bash\n$ npm install --save get-video-duration\n```\n\n# Usage\n\n```js\nconst { getVideoDurationInSeconds } = require('get-video-duration')\n\n// From a local path...\ngetVideoDurationInSeconds('video.mov').then((duration) =\u003e {\n  console.log(duration)\n})\n\n// From a URL...\ngetVideoDurationInSeconds(\n  'http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4'\n).then((duration) =\u003e {\n  console.log(duration)\n})\n\n// From a readable stream...\n\nconst fs = require('fs')\nconst stream = fs.createReadStream('video.mov')\n\ngetVideoDurationInSeconds(stream).then((duration) =\u003e {\n  console.log(duration)\n})\n\n// If you need to customize the path to ffprobe...\ngetVideoDurationInSeconds('video.mov', '/path/to/ffprobe').then((duration) =\u003e {\n  console.log(duration)\n})\n```\n\n# FAQ\n\n## I get a segmentation fault when trying to download a URL\n\nThis is a limitation of the underlying ffprobe binary, which has glibc statically linked and that prevents DNS resolution. Install `nscd` package through your package manager to solve this issue.\n\n# License\n\nMIT. Based on [get-video-dimensions](https://github.com/mgmtio/get-video-dimensions).\n\n[npm-image]: https://img.shields.io/npm/v/get-video-duration.svg\n[npm-url]: https://npmjs.org/package/get-video-duration\n[bundle-size-image]: https://img.shields.io/bundlephobia/min/get-video-duration.svg\n[license-image]: http://img.shields.io/npm/l/get-video-duration.svg\n[license-url]: LICENSE\n[downloads-image]: http://img.shields.io/npm/dm/get-video-duration.svg\n[downloads-url]: https://npmjs.org/package/get-video-duration\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaffco%2Fget-video-duration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaffco%2Fget-video-duration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaffco%2Fget-video-duration/lists"}