This is a cordova plugin to assist in several video editing tasks such as:
- Transcoding
- Trimming
- Taking still images from time moments (currently the start of a video)
After looking at an article on How Vine Satisfied Its Need for Speed, it was clear Cordova/Phonegap needed a way to modify videos to be faster for app's that need that speed.
This plugin will address those concerns, hopefully.
Installation
cordova plugin add https://github.com/jbavari/cordova-plugin-video-editor.git
VideoEditor
and VideoEditorOptions
will be available in the window after deviceready.
Usage
Transcode###
// parameters passed to transcodeVideoVideoEditor
// options used with transcodeVideo functionvar VideoEditorOptions = Quality: HIGH_QUALITY: 0 MEDIUM_QUALITY: 1 LOW_QUALITY: 2 OptimizeForNetworkUse: NO: 0 YES: 1 OutputFileType: M4V: 0 MPEG4: 1 M4A: 2 QUICK_TIME: 3 ;
// this example uses the cordova media capture pluginnavigatordevicecapture; { var file = mediaFiles0; var videoFileName = 'video-name-here'; // I suggest a uuid // Wrap this call in a ~100 ms timeout on Android if // you just recorded the video using the capture plugin. // For some reason it is not available immediately in the file system. VideoEditor;} { // result is the path to the transcoded video on the device console;} { console;}
Create JPEG Image From Video###
VideoEditor
// this example uses the cordova media capture pluginnavigatordevicecapture; { var file = mediaFiles0; var videoFileName = 'video-name-here'; // I suggest a uuid // Wrap this call in a ~100 ms timeout on Android if // you just recorded the video using the capture plugin. // For some reason it is not available immediately in the file system. VideoEditor} { // result is the path to the jpeg image on the device console;}
On iOS
iOS Developer AVFoundation Documentation
Video compression in AVFoundation
AVFoundation slides - tips/tricks
Bob McCune's AVFoundation Editor - ios app example
Saving videos after recording videos
On Android
How to Port ffmpeg (the Program) to Android–Ideas and Thoughts
How to Build Android Applications Based on FFmpeg by An Example
License
Android: GPL
iOS: MIT