get-video-duration-apple-silicon
v3.0.3
Published
Get the duration of a video file, with darwin-arm64 support (Apple Silicon)
Downloads
3
Maintainers
Readme
get-video-duration
Get the duration of video files/streams with ffprobe
. This package is a patch of get-video-duration with darwin-arm64 support (Apple Silicon).
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.