cordova-plugin-video-editor icon indicating copy to clipboard operation
cordova-plugin-video-editor copied to clipboard

Error transcoding video

Open ComBarnea opened this issue 8 years ago • 4 comments

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?

ComBarnea avatar Oct 27 '16 10:10 ComBarnea

Same for me, Android 6.0.0 and same package version.

scopsy avatar Oct 30 '16 08:10 scopsy

Same for me, Android 6.0 on LG K8 4G

christian-forgacs avatar Jan 02 '17 18:01 christian-forgacs

I found a quickfix:

  1. Open src/android/VideoEditor.java and change line 243
  2. Change remove argument new CustomAndroidFormatStrategy(videoBitrate, fps, width, height)
  3. platform remove android
  4. platform add andoird
  5. enjoy :tada:

Its a dirty fix. The constructer without a MediaFormatStrategy is deprecated. Please fix the CustomAndroidFormatStrategy from this package.

christian-forgacs avatar Jan 02 '17 19:01 christian-forgacs

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

christian-forgacs avatar Jan 02 '17 20:01 christian-forgacs