4.1.0 • Published 3 years ago
get-video-duration v4.1.0
get-video-duration
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)
})
// If you need to customize the path to ffprobe...
getVideoDurationInSeconds('video.mov', '/path/to/ffprobe').then((duration) => {
console.log(duration)
})
License
MIT. Based on get-video-dimensions.
4.1.0
3 years ago
4.0.0
4 years ago
3.1.0
4 years ago
3.0.2
5 years ago
3.0.2-beta.0
5 years ago
3.0.1
5 years ago
3.0.1-beta.0
5 years ago
3.0.0
5 years ago
3.0.0-beta.1
5 years ago
2.0.0
5 years ago
1.0.3
6 years ago
1.0.2
7 years ago
1.0.1
7 years ago
1.0.0
7 years ago
0.4.0
7 years ago
0.3.0
7 years ago
0.2.0
8 years ago
0.1.0
9 years ago
0.0.1
10 years ago