get-video-duration
    TypeScript icon, indicating that this package has built-in type declarations

    4.0.0 • Public • Published

    get-video-duration

    NPM version Build Status Maintainability Test Coverage 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.

      This feature is exclusive to Teams

      Illustration of wombats

      The package file explorer is only available for Teams at the moment.

      We may support exploring this package in the future. Check back soon.

      Install

      npm i get-video-duration

      DownloadsWeekly Downloads

      6,477

      Version

      4.0.0

      License

      MIT

      Unpacked Size

      15.5 kB

      Total Files

      14

      Last publish

      Collaborators

      • lluis