Closed mikekudzin closed 3 days ago
Hi @mikekudzin , The issue #1029 with ordering of EditedMediaItems was fixed in this commit and it is a part of the next 1.4.0 release. This should provide a fix for the bug you see.
I quickly looked through the code you have provided. You can also use TextOverlay as an effect and apply it to your video. This might be another approach on how to do it.
Thank you! Switching to 1.4.0-beta1
containing #1029 fixed the issue.
Version
Media3 1.3.1
More version details
-
Devices that reproduce the issue
Pixel 4a running Android 13 Pixel 6a running 14
Devices that do not reproduce the issue
No response
Reproducible in the demo app?
Not tested
Reproduction steps
I am trying to generate output video using following inputs:
Code is pretty straightforward
Output of the code above:
https://github.com/androidx/media/assets/7223881/72b8e185-c28b-423e-9ad0-9651bed6fe32
There is no original video in output. BUT SOMETIMES (rare) it produces expected output.
If I remove background from the composition
The output is nearly what I am expecting except the background (sic!)
https://github.com/androidx/media/assets/7223881/1ec220d9-0cdf-488c-a253-c8d3601239d4
And finally, setting alphaScale to 0.9
https://github.com/androidx/media/assets/7223881/7f77c769-42fe-46b6-979d-e78fd1d410c9
It looks like the video EditedMediaItemSequence get's overlaid by background EditedMediaItemSequence at some point.
Documentation for DefaultVideoCompositor states:
I can be mistaken here, though, since Composition class itself doesn't provide explicit statement about rendering order. If so, what API/approach I can use to force rendering order?
Expected result
Textures are drawn in the reverse order they provided to Composition
Actual result
Order is not preserved, some medias got overlapped. Unpredictable output.
Media
-
![27 Jun 2024 17:41:20 GMT_frame](https://github.com/androidx/media/assets/7223881/806a85f0-aed5-4159-a439-bf2ce9c7d71c)
Bug Report
adb bugreport
to android-media-github@google.com after filing this issue.