jbavari / cordova-plugin-video-editor

A cordova plugin to edit videos.
Other
289 stars 235 forks source link

Unable to transcode to new resolution on Android 11 #173

Open jomorr2 opened 3 years ago

jomorr2 commented 3 years ago

I am trying to reduce the video resolution to 720p. Some videos are landscape and others are portrait. If the original video is portrait, I set the outputHeight to 720. If it's landscape I calculate the outputHeight based on the original aspect ratio. In this case the original video is 480x848, and the output video should be 407x720

fileUri: fileURI,
outputFileName: videoFileName,
outputFileType: 1,
optimizeForNetworkUse: 1,
saveToLibrary: false,
maintainAspectRatio: true,
height: outputHeight,
width: outputWidth,
videoBitrate: 4000000,
audioChannels: 2,
audioSampleRate: 44100,
audioBitrate: 128000,
progress: function(info) {
  // Progress value for Android and iOS are different   https://github.com/jbavari/cordova-plugin-video-editor/issues/165
  if (platform == 'Android'){var complete = info * 100;}
  else {var complete = info;}
  complete = Math.round(complete);
  document.getElementById('progressPercent').innerHTML = complete+"%";
}

I don't get any error output, but looking through logcat I see the following: 2021-05-31 09:25:42.127 1057-25174/? I/QC2Registry: Build pipelined codec for session 2021-05-31 09:25:42.127 1057-25174/? I/QC2Registry: Getting stages for pipelined codec 2021-05-31 09:25:42.128 1057-25174/? I/QC2Registry: Pipelining enabled 2021-05-31 09:25:42.128 1057-25174/? I/QC2Registry: Doesn't support pipelining. Create standalone codec 2021-05-31 09:25:42.209 1057-25174/? I/QC2V4l2Driver: [avcE_602] Device /dev/video33 opened with fd: 18 2021-05-31 09:25:42.210 1057-25174/? E/QC2V4l2Driver: [avcE_602] failed to set buffer size limit to 4 2021-05-31 09:25:42.210 1057-25174/? E/QC2V4l2Caps: c2 format not found for v4l2 format 0x34363248 2021-05-31 09:25:42.210 1057-25174/? E/QC2V4l2Caps: c2 format not found for v4l2 format 0x43564548 2021-05-31 09:25:42.211 1057-25174/? W/QC2V4l2Codec: [avcE_602] unknown/unsupported param coding.sync-frame-interval index = 0x52002005 2021-05-31 09:25:42.211 1057-25174/? W/QC2V4l2Codec: [avcE_602] unknown/unsupported param coded.p-frame-count index = 0x5200C001 2021-05-31 09:25:42.211 1057-25174/? W/QC2V4l2Driver: [avcE_602] Frame QP not set as qpEnable is false! 2021-05-31 09:25:42.211 1057-25174/? E/QC2V4l2Driver: [avcE_602] failed to set format on port:IN 2021-05-31 09:25:42.211 1057-25174/? E/QC2V4l2Codec: [avcE_602] Failed to set resolution and buffer size for IN port 2021-05-31 09:25:42.211 1057-25174/? E/QC2Comp: [avcE_602] configureCodec: Failed to set updated param raw.size 2021-05-31 09:25:42.211 1057-25174/? E/QC2V4l2Codec: [avcE_602] OPAQUE is not a supported pixel format! 2021-05-31 09:25:42.211 1057-25174/? E/QC2V4l2Driver: [avcE_602] failed to set format on port:IN 2021-05-31 09:25:42.211 1057-25174/? E/QC2V4l2Codec: [avcE_602] Failed to set resolution and buffer size for IN port 2021-05-31 09:25:42.211 1057-25174/? E/QC2Comp: [avcE_602] configureCodec: Failed to set updated param raw.pixel-format 2021-05-31 09:25:42.306 1057-25174/? I/QC2ImageConverter: Constructing QC2C2D engine for image conversion 2021-05-31 09:25:42.307 1057-25174/? I/QC2ImageConverter: created QC2ImageConverter: [407x720, RGBA8888_UBWC] -- {do flip 0, then rotate 0} --> [407x720, VENUS_NV12] 2021-05-31 09:25:42.307 1057-25174/? I/QC2C2DEngine: calcYSize: unsupported or RGB color format, RGBA8888_UBWC(-1040187392) 2021-05-31 09:25:42.309 1057-25174/? E/QC2V4l2Driver: [avcE_602] failed to set format on port:IN 2021-05-31 09:25:42.309 1057-25174/? E/QC2V4l2Codec: [avcE_602] Failed to set resolution and buffer size for IN port 2021-05-31 09:25:42.309 1057-25174/? E/QC2Comp: [avcE_602] configureCodec: Failed to set updated param raw.size 2021-05-31 09:25:42.309 1057-25174/? E/QC2V4l2Driver: [avcE_602] failed to set format on port:IN 2021-05-31 09:25:42.309 1057-25174/? E/QC2V4l2Codec: [avcE_602] Failed to set resolution and buffer size for IN port 2021-05-31 09:25:42.309 1057-25174/? E/QC2Comp: [avcE_602] configureCodec: Failed to set updated param raw.pixel-format 2021-05-31 09:25:42.309 1057-25174/? E/QC2V4l2Driver: [avcE_602] failed to set format on port:OUT 2021-05-31 09:25:42.309 1057-25174/? E/QC2V4l2Codec: [avcE_602] Failed to set resolution and buffer size for OUT port 2021-05-31 09:25:42.309 1057-25174/? E/QC2Comp: [avcE_602] configureCodec: Failed to set updated param coded.size 2021-05-31 09:25:42.309 1057-25174/? E/QC2Comp: [avcE_602] Delayed start: Encoder failed to configure !! 2021-05-31 09:25:43.323 1057-25174/? E/QC2V4l2Driver: [avcE_602] failed to streamon for port:OUT 2021-05-31 09:25:43.323 1057-25174/? E/QC2V4l2Encoder: [avcE_602] Failed to streamon the output port 2021-05-31 09:25:43.323 1057-25174/? E/QC2Comp: [avcE_602] startCodec: Codec failed to start !! 2021-05-31 09:25:43.323 1057-25174/? E/QC2Comp: [avcE_602] Delayed codec start: failed 2021-05-31 09:25:43.323 1057-25174/? E/QC2Comp: [avcE_602] handleQueue: Codec has not started ! 2021-05-31 09:25:43.324 1057-25174/? E/QC2Comp: [avcE_602][ERROR] entered

Commenting out the height and width from the options allows the transcoding, but at the original resolution

jomorr2 commented 3 years ago

I just verified this is not an issue on iOS.

aiynmm commented 1 year ago

@jomorr2 Did you have solve this problem? I have the same output log.

jomorr-jkl commented 1 year ago

I have not. I had to stop using this and not do any transcoding until I have time to work on it in more details