Closed OsmanYalin closed 2 years ago
Hi,
Happy to hear you are enjoying LiTr!
I will take a look at this. Are you doing the exact same thing (trimming, bitmap) in Transcode Video/Audio (GL Renderers)
?
Hi İzzat,
Thanks for the fast reply. Yes I am marking both Transcode
and Overlay
checkboxes in Transcode Video/Audio (GL Renderers)
, and also trimming the video. I am not transcoding the audio track by the way.
I am also able to apply filter in Video Filters Preview
to my video, but it is not responding to transcoding when I try in Video Filters
fragment.
Which device are you trying this on? Can you send me logs? I am trying to reproduce on my device (Samsung Galaxy Note 10) and can't.
The operation fails for both emulators which are Nexus 6 (API 30)
and Pixel 3 (API28)
Here is the log:
2020-12-16 13:26:49.769 2827-4918/com.osmanyalin.litrcapsdemo E/ACodec: [OMX.google.h264.encoder] configureCodec returning error -38
2020-12-16 13:26:49.769 2827-4918/com.osmanyalin.litrcapsdemo E/ACodec: signalError(omxError 0x80001001, internalError -2147483648)
2020-12-16 13:26:49.770 2827-4917/com.osmanyalin.litrcapsdemo E/MediaCodec: Codec reported err 0x80001001, actionCode 0, while in state 3
2020-12-16 13:26:49.770 2827-4916/com.osmanyalin.litrcapsdemo E/MediaCodec: configure failed with err 0x80001001, resetting...
2020-12-16 13:26:49.776 2827-4918/com.osmanyalin.litrcapsdemo I/OMXClient: IOmx service obtained
2020-12-16 13:26:49.780 2827-4916/com.osmanyalin.litrcapsdemo E/com.linkedin.android.litr.exception.TrackTranscoderException: Failed to retrieve media codec info.
2020-12-16 13:26:49.780 2827-4917/com.osmanyalin.litrcapsdemo I/BpBinder: onLastStrongRef automatically unlinking death recipients: android.media.IResourceManagerService
2020-12-16 13:26:49.781 2827-4916/com.osmanyalin.litrcapsdemo E/TransformationJob: Transformation job error
com.linkedin.android.litr.exception.TrackTranscoderException: Failed to configure encoder codec.Media transformation failed for job id: null
Media format: {color-format=2130708361, i-frame-interval=5, durationUs=273306666, mime=video/avc, profile=65536, width=640, bitrate=739253, frame-rate=30, height=360}
Selected media codec info:
Available media codec info list (Name, IsEncoder, Supported Types):
MediaCodecInfo: c2.android.aac.decoder,false,[audio/mp4a-latm]
MediaCodecInfo: OMX.google.aac.decoder,false,[audio/mp4a-latm]
MediaCodecInfo: c2.android.aac.encoder,true,[audio/mp4a-latm]
MediaCodecInfo: OMX.google.aac.encoder,true,[audio/mp4a-latm]
MediaCodecInfo: c2.android.amrnb.decoder,false,[audio/3gpp]
MediaCodecInfo: OMX.google.amrnb.decoder,false,[audio/3gpp]
MediaCodecInfo: c2.android.amrnb.encoder,true,[audio/3gpp]
MediaCodecInfo: OMX.google.amrnb.encoder,true,[audio/3gpp]
MediaCodecInfo: c2.android.amrwb.decoder,false,[audio/amr-wb]
MediaCodecInfo: OMX.google.amrwb.decoder,false,[audio/amr-wb]
MediaCodecInfo: c2.android.amrwb.encoder,true,[audio/amr-wb]
MediaCodecInfo: OMX.google.amrwb.encoder,true,[audio/amr-wb]
MediaCodecInfo: c2.android.flac.decoder,false,[audio/flac]
MediaCodecInfo: OMX.google.flac.decoder,false,[audio/flac]
MediaCodecInfo: c2.android.flac.encoder,true,[audio/flac]
MediaCodecInfo: OMX.google.flac.encoder,true,[audio/flac]
MediaCodecInfo: c2.android.g711.alaw.decoder,false,[audio/g711-alaw]
MediaCodecInfo: OMX.google.g711.alaw.decoder,false,[audio/g711-alaw]
MediaCodecInfo: c2.android.g711.mlaw.decoder,false,[audio/g711-mlaw]
MediaCodecInfo: OMX.google.g711.mlaw.decoder,false,[audio/g711-mlaw]
MediaCodecInfo: c2.android.mp3.decoder,false,[audio/mpeg]
MediaCodecInfo: OMX.google.mp3.decoder,false,[audio/mpeg]
MediaCodecInfo: c2.android.opus.decoder,false,[audio/opus]
MediaCodecInfo: OMX.google.opus.decoder,false,[audio/opus]
MediaCodecInfo: c2.android.opus.encoder,true,[audio/opus]
MediaCodecInfo: c2.android.raw.decoder,false,[audio/raw]
MediaCodecInfo: OMX.google.raw.decoder,false,[audio/raw]
MediaCodecInfo: c2.android.vorbis.decoder,false,[audio/vorbis]
MediaCodecInfo: OMX.google.vorbis.decoder,false,[audio/vorbis]
MediaCodecInfo: OMX.google.gsm.decoder,false,[audio/gsm]
MediaCodecInfo: OMX.android.goldfish.h264.decoder,false,[video/avc]
MediaCodecInfo: OMX.android.goldfish.vp8.decoder,false,[video/x-vnd.on2.vp8]
MediaCodecInfo: OMX.android.goldfish.vp9.decoder,false,[video/x-vnd.on2.vp9]
MediaCodecInfo: OMX.google.h264.decoder,false,[video/avc]
MediaCodecInfo: OMX.google.h263.decoder,false,[video/3gpp]
MediaCodecInfo: OMX.google.hevc.decoder,false,[video/hevc]
MediaCodecInfo: OMX.google.mpeg4.decoder,false,[video/mp4v-es]
MediaCodecInfo: OMX.google.vp8.decoder,false,[video/x-vnd.on2.vp8]
MediaCodecInfo: OMX.google.vp9.decoder,false,[video/x-vnd.on2.vp9]
MediaCodecInfo: OMX.google.h264.encoder,true,[video/avc]
MediaCodecInfo: OMX.google.h263.encoder,true,[video/3gpp]
MediaCodecInfo: OMX.google.mpeg4.encoder,true,[video/mp4v-es]
MediaCodecInfo: OMX.google.vp8.encoder,true,[video/x-vnd.on2.vp8]Diagnostic info: android.media.MediaCodec.error_neg_2147479551
at com.linkedin.android.litr.codec.MediaCodecEncoder.init(MediaCodecEncoder.java:70)
at com.linkedin.android.litr.transcoder.VideoTrackTranscoder.initCodecs(VideoTrackTranscoder.java:74)
at com.linkedin.android.litr.transcoder.VideoTrackTranscoder.<init>(VideoTrackTranscoder.java:64)
at com.linkedin.android.litr.transcoder.TrackTranscoderFactory.create(TrackTranscoderFactory.java:80)
at com.linkedin.android.litr.TransformationJob.createTrackTranscoders(TransformationJob.java:171)
at com.linkedin.android.litr.TransformationJob.transform(TransformationJob.java:94)
at com.linkedin.android.litr.TransformationJob.run(TransformationJob.java:74)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2020-12-16 13:26:49.782 2827-4916/com.osmanyalin.litrcapsdemo E/TransformationJob: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
Caused by: android.media.MediaCodec$CodecException: Error 0x80001001
at android.media.MediaCodec.native_configure(Native Method)
at android.media.MediaCodec.configure(MediaCodec.java:2127)
at android.media.MediaCodec.configure(MediaCodec.java:2043)
at com.linkedin.android.litr.codec.MediaCodecEncoder.init(MediaCodecEncoder.java:54)
... 11 more
Hi Izzat,
Do you have any update about this issue? Thanks!
Not yet. Sorry, I was finishing up some things before the end of the year. I will try to get to this soon, but will probably not have an update for you until early January.
Thank you for being so patient. There is a PR with a fix, which might fix your issue as well: https://github.com/linkedin/LiTr/pull/77
Just to clarify, are you making code changes in TransformationPresenter
to pass in custom MediaRange
? I am trying to reproduce your problem locally and can't so far. Can you attach a snippet of your code with how you call transform
method?
Seems like latest fixes didnt help and demo project still doesnt work with applying filters (Xiaomi Mi 9, Android 10). I think here problem with some MediaFormat
properties setting, e.g. KEY_COLOR_FORMAT
I/OMXClient: IOmx service obtained
I/ExtendedACodec: setupVideoEncoder()
W/OMXUtils: do not know color format 0x7fa30c06 = 2141391878
do not know color format 0x7fa30c04 = 2141391876
do not know color format 0x7fa30c00 = 2141391872
W/OMXUtils: do not know color format 0x7fa30c09 = 2141391881
do not know color format 0x7fa30c0a = 2141391882
do not know color format 0x7fa30c08 = 2141391880
W/OMXUtils: do not know color format 0x7fa30c07 = 2141391879
do not know color format 0x7f000789 = 2130708361
E/ExtendedACodec: [OMX.qcom.video.encoder.avc] configureCodec returning error -38
E/ACodec: signalError(omxError 0x80001001, internalError -2147483648)
[OMX.qcom.video.encoder.avc] configureCodec returning error -38
signalError(omxError 0x80001001, internalError -2147483648)
E/MediaCodec: Codec reported err 0x80001001, actionCode 0, while in state 3
E/MediaCodec: Codec reported err 0x80001001, actionCode 0, while in state 0
E/MediaCodec: configure failed with err 0x80001001, resetting...
I/OMXClient: IOmx service obtained
E/com.linkedin.android.litr.exception.TrackTranscoderException: Failed to retrieve media codec info.
E/TransformationJob: Transformation job error
com.linkedin.android.litr.exception.TrackTranscoderException: Failed to configure encoder codec.Media transformation failed for job id: null
Media format: {color-format=2130708361, i-frame-interval=5, durationUs=9633333, mime=video/avc, profile=8, width=540, bitrate=1199402, frame-rate=30, height=960}
Selected media codec info:
Available media codec info list (Name, IsEncoder, Supported Types):
MediaCodecInfo: OMX.qti.audio.decoder.flac,false,[audio/flac]
MediaCodecInfo: OMX.qcom.video.encoder.heic,true,[image/vnd.android.heic]
MediaCodecInfo: OMX.qcom.video.decoder.avc,false,[video/avc]
MediaCodecInfo: OMX.qcom.video.decoder.avc.secure,false,[video/avc]
MediaCodecInfo: OMX.qti.video.decoder.divxsw,false,[video/divx]
MediaCodecInfo: OMX.qti.video.decoder.divx4sw,false,[video/divx4]
MediaCodecInfo: OMX.qti.video.decoder.h263sw,false,[video/3gpp]
MediaCodecInfo: OMX.qcom.video.decoder.hevc,false,[video/hevc]
MediaCodecInfo: OMX.qcom.video.decoder.hevc.secure,false,[video/hevc]
MediaCodecInfo: OMX.qcom.video.decoder.mpeg2,false,[video/mpeg2]
MediaCodecInfo: OMX.qcom.video.decoder.mpeg2.secure,false,[video/mpeg2]
MediaCodecInfo: OMX.qti.video.decoder.mpeg4sw,false,[video/mp4v-es]
MediaCodecInfo: OMX.qti.video.decoder.vc1sw,false,[video/x-ms-wmv]
MediaCodecInfo: OMX.qcom.video.decoder.vp8,false,[video/x-vnd.on2.vp8]
MediaCodecInfo: OMX.qcom.video.decoder.vp9,false,[video/x-vnd.on2.vp9]
MediaCodecInfo: OMX.qcom.video.decoder.vp9.secure,false,[video/x-vnd.on2.vp9]
MediaCodecInfo: OMX.qcom.video.encoder.avc,true,[video/avc]
MediaCodecInfo: OMX.qcom.video.encoder.h263sw,true,[video/3gpp]
MediaCodecInfo: OMX.qcom.video.encoder.hevc,true,[video/hevc]
MediaCodecInfo: OMX.qcom.video.encoder.hevc.cq,true,[video/hevc]
MediaCodecInfo: OMX.qcom.video.encoder.mpeg4sw,true,[video/mp4v-es]
MediaCodecInfo: OMX.qcom.video.encoder.vp8,true,[video/x-vnd.on2.vp8]
MediaCodecInfo: OMX.google.aac.decoder,false,[audio/mp4a-latm]
MediaCodecInfo: OMX.google.amrnb.decoder,false,[audio/3gpp]
MediaCodecInfo: OMX.google.amrwb.decoder,false,[audio/amr-wb]
MediaCodecInfo: OMX.google.flac.decoder,false,[audio/flac]
MediaCodecInfo: OMX.google.g711.alaw.decoder,false,[audio/g711-alaw]
MediaCodecInfo: OMX.google.g711.mlaw.decoder,false,[audio/g711-mlaw]
MediaCodecInfo: OMX.google.gsm.decoder,false,[audio/gsm]
MediaCodecInfo: OMX.google.mp3.decoder,false,[audio/mpeg]
MediaCodecInfo: OMX.google.raw.decoder,false,[audio/raw]
MediaCodecInfo: OMX.google.vorbis.decoder,false,[audio/vorbis]
MediaCodecInfo: OMX.google.aac.encoder,true,[audio/mp4a-latm]
MediaCodecInfo: OMX.google.amrnb.encoder,true,[audio/3gpp]
MediaCodecInfo: OMX.google.amrwb.encoder,true,[audio/amr-wb]
MediaCodecInfo: OMX.google.flac.encoder,true,[audio/flac]
MediaCodecInfo: c2.android.aac.decoder,false,[audio/mp4a-latm]
MediaCodecInfo: c2.android.aac.encoder,true,[audio/mp4a-latm]
MediaCodecInfo: c2.android.amrnb.decoder,false,[audio/3gpp]
MediaCodecInfo: c2.android.amrnb.encoder,true,[audio/3gpp]
MediaCodecInfo: c2.android.amrwb.decoder,false,[audio/amr-wb]
MediaCodecInfo: c2.android.amrwb.encoder,true,[audio/amr-wb]
MediaCodecInfo: c2.android.flac.decoder,false,[audio/flac]
MediaCodecInfo: c2.android.flac.encoder,true,[audio/flac]
MediaCodecInfo: c2.android.g711.alaw.decoder,false,[audio/g711-alaw]
MediaCodecInfo: c2.android.g711.mlaw.decoder,false,[audio/g711-mlaw]
MediaCodecInfo: c2.android.mp3.decoder,false,[audio/mpeg]
MediaCodecInfo: c2.android.opus.decoder,false,[audio/opus]
MediaCodecInfo: OMX.google.opus.decoder,false,[audio/opus]
MediaCodecInfo: c2.android.opus.encoder,true,[audio/opus]
MediaCodecInfo: c2.android.raw.decoder,false,[audio/raw]
MediaCodecInfo: c2.android.vorbis.decoder,false,[audio/vorbis]
MediaCodecInfo: c2.android.av1.decoder,false,[video/av01]
MediaCodecInfo: c2.android.avc.decoder,false,[video/avc]
MediaCodecInfo: OMX.google.h264.decoder,false,[video/avc]
MediaCodecInfo: c2.android.avc.encoder,true,[video/avc]
MediaCodecInfo: OMX.google.h264.encoder,true,[video/avc]
E/TransformationJob: MediaCodecInfo: c2.android.h263.decoder,false,[video/3gpp]
MediaCodecInfo: OMX.google.h263.decoder,false,[video/3gpp]
MediaCodecInfo: c2.android.h263.encoder,true,[video/3gpp]
MediaCodecInfo: OMX.google.h263.encoder,true,[video/3gpp]
MediaCodecInfo: c2.android.hevc.decoder,false,[video/hevc]
MediaCodecInfo: OMX.google.hevc.decoder,false,[video/hevc]
MediaCodecInfo: c2.android.hevc.encoder,true,[video/hevc]
MediaCodecInfo: c2.android.mpeg4.decoder,false,[video/mp4v-es]
MediaCodecInfo: OMX.google.mpeg4.decoder,false,[video/mp4v-es]
MediaCodecInfo: c2.android.mpeg4.encoder,true,[video/mp4v-es]
MediaCodecInfo: OMX.google.mpeg4.encoder,true,[video/mp4v-es]
MediaCodecInfo: c2.android.vp8.decoder,false,[video/x-vnd.on2.vp8]
MediaCodecInfo: OMX.google.vp8.decoder,false,[video/x-vnd.on2.vp8]
MediaCodecInfo: c2.android.vp8.encoder,true,[video/x-vnd.on2.vp8]
MediaCodecInfo: OMX.google.vp8.encoder,true,[video/x-vnd.on2.vp8]
MediaCodecInfo: c2.android.vp9.decoder,false,[video/x-vnd.on2.vp9]
MediaCodecInfo: OMX.google.vp9.decoder,false,[video/x-vnd.on2.vp9]
MediaCodecInfo: c2.android.vp9.encoder,true,[video/x-vnd.on2.vp9]
MediaCodecInfo: OMX.google.vp9.encoder,true,[video/x-vnd.on2.vp9]
MediaCodecInfo: c2.qti.avc.decoder,false,[video/avc]
MediaCodecInfo: c2.qti.avc.encoder,true,[video/avc]Diagnostic info: android.media.MediaCodec.error_neg_2147479551
at com.linkedin.android.litr.codec.MediaCodecEncoder.init(MediaCodecEncoder.java:70)
at com.linkedin.android.litr.transcoder.VideoTrackTranscoder.initCodecs(VideoTrackTranscoder.java:74)
at com.linkedin.android.litr.transcoder.VideoTrackTranscoder.<init>(VideoTrackTranscoder.java:64)
at com.linkedin.android.litr.transcoder.TrackTranscoderFactory.create(TrackTranscoderFactory.java:80)
at com.linkedin.android.litr.TransformationJob.createTrackTranscoders(TransformationJob.java:171)
at com.linkedin.android.litr.TransformationJob.transform(TransformationJob.java:94)
at com.linkedin.android.litr.TransformationJob.run(TransformationJob.java:74)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
Caused by: android.media.MediaCodec$CodecException: Error 0x80001001
at android.media.MediaCodec.native_configure(Native Method)
at android.media.MediaCodec.configure(MediaCodec.java:2023)
at android.media.MediaCodec.configure(MediaCodec.java:1951)
at com.linkedin.android.litr.codec.MediaCodecEncoder.init(MediaCodecEncoder.java:54)
at com.linkedin.android.litr.transcoder.VideoTrackTranscoder.initCodecs(VideoTrackTranscoder.java:74)
at com.linkedin.android.litr.transcoder.VideoTrackTranscoder.<init>(VideoTrackTranscoder.java:64)
at com.linkedin.android.litr.transcoder.TrackTranscoderFactory.create(TrackTranscoderFactory.java:80)
at com.linkedin.android.litr.TransformationJob.createTrackTranscoders(TransformationJob.java:171)
at com.linkedin.android.litr.TransformationJob.transform(TransformationJob.java:94)
at com.linkedin.android.litr.TransformationJob.run(TransformationJob.java:74)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
@khoben this is a different error than was originally reported. I wish I had that phone so I could debug... This is very strange error because that color format is very standard. Are you using the demo app? Are you setting custom KEY_PROFILE on MediaFormat by any chance?
@khoben this is a different error than was originally reported. I wish I had that phone so I could debug... This is very strange error because that color format is very standard. Are you using the demo app? Are you setting custom KEY_PROFILE on MediaFormat by any chance?
I just cloned the repository and am trying to run the demo project
@izzytwosheds any updates?
Is the video recorded on that phone? Would it be possible to send that video (or another video) to me? I am trying to figure out if it is a file issue or a device issue.
I have tried with various videos (mostly from tiktok), also the test bunny video, and all of them fail.
I was not able to reproduce with that video. This looks like a device issue. One more request. Can you try with videos recorded by device camera?
I was not able to reproduce with that video. This looks like a device issue. One more request. Can you try with videos recorded by device camera?
All videos, even recorded video, fail, thats hardware encoder issue definitely.
I'm using https://github.com/MasayukiSuda/Mp4Composer-android currently, trying to figure out why it works and LiTr doesn't. It looks like we need to set some proper parameter for the codec.
I'm using https://github.com/MasayukiSuda/Mp4Composer-android currently, trying to figure out why it works and LiTr doesn't. It looks like we need to set some proper parameter for the codec.
This is an excellent find! Does https://github.com/ypresto/android-transcoder work, too? I will check differences in codec configuration.
@khoben Why don't you use Mp4Composer?
@khoben Why don't you use Mp4Composer?
@MasayukiSuda actually i'm using it. Just doing some research with another solutions.
I'm using https://github.com/MasayukiSuda/Mp4Composer-android currently, trying to figure out why it works and LiTr doesn't. It looks like we need to set some proper parameter for the codec.
This is an excellent find! Does https://github.com/ypresto/android-transcoder work, too? I will check differences in codec configuration.
Demo project from https://github.com/ypresto/android-transcoder works too
@khoben I am merging a pull request, which might fix the issue on your device: https://github.com/linkedin/LiTr/pull/87 Let me know how it works out for you! Only first option in demo app (Transcode Video/Audio) should work, others should still fail.
@khoben I am merging a pull request, which might fix the issue on your device: #87 Let me know how it works out for you! Only first option in demo app (Transcode Video/Audio) should work, others should still fail.
From latest commit (114d622c) two options work:
@khoben that is expected behavior. I introduced a fix, but made it configurable, since I want to run some experiments and collect data on my end before I make it default. Only two demos have that fix enabled, I wanted to verify old vs. new behavior on your device. Looks like it works as intended. Thank you for finding this issue and helping to debug it! Latest LiTr release (1.4.5) has this fix.
Few more fixes went in. This should work now. Let me know if it doesn't.
Hi LiTr team, First of all thanks for this innovative library to make video transforming easier. I downloaded your demo project to understand how it is working before I use it in my project and I tried the features it includes. Transcode Video/Audio (GL Renderers) and Free Transform Video (GL Renderers) features are working well. But the progress bar sticks at the initial point and it never starts when I try to apply watermark and video filtering features. I debugged to see what is going on there. The trace finally arrives to transform operation at MediaTransform.java line:259 and successfully handling operations of that method. I didn't see any exceptional case and also the trace never fails to a catch block.
I am using a 5 minutes mp4 video and trimming just 2 or 3 seconds of the video to fasten the operation. There is no progress even after 10 minutes. Do you know what is the problem about the demo?
Thanks, Osman