Transcode AVC with odds resolution
- Dominant language
- Java
- Stars
- 663
- Forks
- 92
- PR merge metrics
- No merged PRs in 30d
Description
Hi, thanks for this great library!
I'm facing an issue when overlay image onto empty video (much like `Empty Video` on your demo app), but for my case, I'm basically only transforming image into static .mp4 video. The issue happens when I'm using AVD emulator and when the targeted MediaFormat resolution is odd number e.g. : 1281, 1283, so on. The transformation would encounter `IllegalStateException` with logs attached below.
The issue didn't happen in real device I have Vivo s1, but I have received report where the error occurred on xiaomi device. I'm not sure if this also happens in some other device, hence want to find the root cause of this. For temporary solution, now I make the target resolution to even numbers when the source image have odd resolution.
P.S. : the issue also happens in your demo app, when I try to run it in emulator.
```E/TransformationJob: Transformation job error
java.lang.IllegalStateException
at android.media.MediaCodec.native_dequeueOutputBuffer(Native Method)
at android.media.MediaCodec.dequeueOutputBuffer(MediaCodec.java:2789)
at com.linkedin.android.litr.codec.MediaCodecEncoder.dequeueOutputFrame(MediaCodecEncoder.java:108)
at com.linkedin.android.litr.transcoder.VideoTrackTranscoder.writeEncodedOutputFrame(VideoTrackTranscoder.java:223)
at com.linkedin.android.litr.transcoder.VideoTrackTranscoder.processNextFrame(VideoTrackTranscoder.java:117)
at com.linkedin.android.litr.TransformationJob.processNextFrame(TransformationJob.java:211)
at com.linkedin.android.litr.TransformationJob.transform(TransformationJob.java:108)
at com.linkedin.android.litr.TransformationJob.run(TransformationJob.java:77)
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)```
Contributor guide
Research direction
Start with the attached stack trace and inspect MediaCodecEncoder.java:108, VideoTrackTranscoder.java:117 and :223, and TransformationJob.java. Reproduce the empty-video image transformation in the demo app with odd target resolutions on an emulator; done means the failure is understood and odd resolutions are handled without the reported IllegalStateException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100