Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

get-video-duration

3.0.2 • Public • Published

get-video-duration

NPM version Build status Test coverage Dependency Status License NPM bundle size (minified) Downloads

Get the duration of video files/streams with ffprobe.

Install

$ npm install --save get-video-duration

Usage

const { getVideoDurationInSeconds } = require('get-video-duration')
 
// From a local path...
getVideoDurationInSeconds('video.mov').then((duration) => {
  console.log(duration)
})
 
// From a URL...
getVideoDurationInSeconds('http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4').then((duration) => {
  console.log(duration)
})
 
// From a readable stream...
 
const fs = require('fs')
const stream = fs.createReadStream('video.mov')
 
getVideoDurationInSeconds(stream).then((duration) => {
  console.log(duration)
})

License

MIT. Based on get-video-dimensions.

Install

npm i get-video-duration

DownloadsWeekly Downloads

2,346

Version

3.0.2

License

MIT

Unpacked Size

15.6 kB

Total Files

14

Last publish

Collaborators

  • avatar