cordova-plugin-video-editor
cordova-plugin-video-editor copied to clipboard
Error transcoding video
While transcoding video I get java.lang.IllegalArgumentException error.
Plugin version 1.1.2
Tested devices: Galaxy s7 edge, One plus 2.
The function get success and error functions as well as options object, all options are by the docs.
example of options generated is: { audioBitrate: 128000, audioChannels: 2, audioSampleRate: 44100, fileUri: "file://storage/emulated/0/DCIM/Camera/20161027_132541.mp4", maintainAspectRatio: true, optimizeForNetworkUse: 1, outputFileName: "video_modified_1477564247901", outputFileType: 1, progress: function, saveToLibrary: false, videoBitrate: 1000000 }
Tested with different size videos and resolution from 1mb to 20mb.
is this a new issue? any know resolution?
Same for me, Android 6.0.0 and same package version.
Same for me, Android 6.0 on LG K8 4G
I found a quickfix:
- Open src/android/VideoEditor.java and change line 243
- Change remove argument
new CustomAndroidFormatStrategy(videoBitrate, fps, width, height)
- platform remove android
- platform add andoird
- enjoy :tada:
Its a dirty fix. The constructer without a MediaFormatStrategy is deprecated. Please fix the CustomAndroidFormatStrategy from this package.
I found the correct problem:
On the CustomAndroidFormatStrategy the given option from width and height used for the format. In my case i don't set the width and height. If I set this 2 options it works but it the documentation for this options is they are optional and android use the same dimensions as the input video...? I think this is not correct with this custom format strategy...
https://github.com/jbavari/cordova-plugin-video-editor#a-note-on-width-and-height-used-by-transcodevideo