Skip to content

WebNinjaDeveloper.com

Programming Tutorials




Menu
  • Home
  • Youtube Channel
  • Official Blog
  • Nearby Places Finder
  • Direction Route Finder
  • Distance & Time Calculator
Menu

Node.js Fluent-FFMPEG Example to Get Duration,Size,Codec & Metadata of File Using FFPROBE Library

Posted on January 24, 2023

 

 

Welcome folks today in this blog post we will be using the fluent-ffmpeg library to get duration,size and codec and metadata of video mp4 video in command line using node.js. All the full source code of the application is shown below.

 

 

Get Started

 

 

In order to get started you need to make a new node.js project using the below command as shown below

 

 

npm init -y

 

 

npm i fluent-ffmpeg

 

 

And now we need to create the index.js file and copy paste the following code

 

 

index.js

 

 

JavaScript
1
2
3
4
5
6
7
const ffmpeg = require('fluent-ffmpeg')
 
let path = "video.mp4"
 
ffmpeg.ffprobe(path,(error,data) => {
    console.log(data)
})

 

 

As you can see we are importing the fluent-ffmpeg library and then we are using the ffproble method to get the information about the video.mp4 file. Now in order to run this node.js app you need to execute the below command as shown below

 

 

nodemon index.js

 

 

 

 

Recent Posts

  • Android Java Project to Download Multiple Images From URL With Progressbar & Save it inside Gallery
  • Android Java Project to Capture Image From Camera & Save it inside Gallery
  • Android Java Project to Crop,Scale & Rotate Images Selected From Gallery and Save it inside SD Card
  • Android Kotlin Project to Load Image From URL into ImageView Widget
  • Android Java Project to Make HTTP Call to JSONPlaceholder API and Display Data in RecyclerView Using GSON & Volley Library
  • Angular
  • Bunjs
  • C#
  • Deno
  • django
  • Electronjs
  • java
  • javascript
  • Koajs
  • kotlin
  • Laravel
  • meteorjs
  • Nestjs
  • Nextjs
  • Nodejs
  • PHP
  • Python
  • React
  • ReactNative
  • Svelte
  • Tutorials
  • Vuejs




©2023 WebNinjaDeveloper.com | Design: Newspaperly WordPress Theme