Skip to content

StillKonfuzed/cordova-plugin-ffmpeg-with-progress

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cordova FFMPEG Plugin

A feature add-on to get progress of running ffmpeg command.

Install the plugin (ios/android) :

$ cordova plugin add https://github.com/StillKonfuzed/cordova-plugin-ffmpeg-with-progress.git

Install the plugin (android Only branch) - (plugin size under 50MB out of 201MB) :

$ cordova plugin add https://github.com/StillKonfuzed/cordova-plugin-ffmpeg-with-progress.git#android-only

Usage :

ffmpeg.exec("-i file:///emulated/0/Downloads/meinput.mp4 -vn -c:a copy file:///emulated/0/Downloads/out.mp3", (success) => alert(success), (failure) => alert(failure));

//then ...

setInterval(()=>{
      //pass "string" or "json" as response type
      ffmpeg.progress("json", (progressDetails) => {
        console.log(progressDetails); 
        //if "json" =>

        // {
        //     "frames": <number>,
        //     "fps": <number>,
        //     "size": <number>,
        //     "bitrate": <number>,
        //     "speed": <number>,
        //     "duration": <number>
        // }

        //if "string" => "Frames : 1234, Time: 100 sec, New Size: 700 MB, Speed: 1.5 x"
      },(error) => {
        console.log(error); // cannot get progress
      }); 
},2000);

Detailed instructions on main repo : MaximBelov

Packages

No packages published

Languages

  • C 93.0%
  • Objective-C 6.7%
  • Other 0.3%