Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including get-video-duration with all npm packages installed. Try it out:

var getVideoDuration = require("get-video-duration")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

get-video-duration v3.0.2

Get the duration of a video file


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

Get the duration of video files/streams with ffprobe.


$ npm install --save get-video-duration


const { getVideoDurationInSeconds } = require('get-video-duration')

// From a local path...
getVideoDurationInSeconds('').then((duration) => {

// From a URL...
getVideoDurationInSeconds('').then((duration) => {

// From a readable stream...

const fs = require('fs')
const stream = fs.createReadStream('')

getVideoDurationInSeconds(stream).then((duration) => {


MIT. Based on get-video-dimensions.


RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free