Open how8570 opened 3 months ago
Hmm I cannot reproduce locally, can you try turn on the DebugTraceUtil
, capture the log and report it here?
After turning on DebugTraceUtil
(setting enableTracing
to true),
the issue with clear dash HD (MP4, H265)
is hard to reproduce. 🤔
However, the issue with UHD (MP4, H265)
can still be reproduced.
Here's the bugreport: bugreport-BRAVIA_ATV2_TW-PTT1.190515.001.S38-2024-08-20-10-55-17.zip
Here's the partial logcat: filter_package_logcat.txt
The issue happened around 10:58:40. It seems that the system was performing GC at that time. I'm not sure if the issue is related to the GC. 🤔
I have another question:
Should I provide an adb bugreport
, or is it enough to just paste the logcat dump?
With package filter (androidx.media3.demo.main
) or full dump?
There lots MtkOmxVenc
or other seems not relative log in logcat if without filter, I'm not really sure which one better.
Back to the old issue google/ExoPlayer#11038
I tested the old app that was provided earlier, which would cause the content to go in the wrong orination (the version without the workaround applied), and the expected direction error occurred.
I noticed something strange: when using the Running Devices function in Android Studio to mirror the TV, the content orientation appears correctly on the IDE, but the real device display content in wrong orientation. 🤔
I'm not sure how the old issue is related, it seems this issue is about the video didn't end at the correct moment?
Also I didn't see the DebugTrace in the log - maybe you didn't call the method to generate the trace string and log it? (The method to call is here)
Note though android Log
has a line limit, so you need to break the line down and you could use this code snippet to do it
public static List<String> breakString(String longString, int x) {
List<String> substrings = new ArrayList<>();
int length = longString.length();
for (int start = 0; start < length; start += x) {
int end = Math.min(start + x, length);
substrings.add(longString.substring(start, end));
}
return substrings;
}
So, should I call generateTraceSummary()
then logging strings to somewhere them provide it?
I'm not sure what you mean call the method to generate the trace string and log it
and where to insert this part of code. 🤔
Did you mean call this after issue happend, then print it out?
If so, I can return to a reproducible environment in about 12 hours to prepare these.
So, should I call generateTraceSummary() then logging strings to somewhere them provide it?
Yes, it's not automatically logged. I think you can call it when you exit the PlayerView, maybe onDestroy()
?
No rush!
I put it on onDestroy()
, here is what I get
when issue occur(video stuck on some frame), press back leave activity immediately.
when issue occur(video stuck on some frame), Let it keep playing until the timer displays a time that exceeds the video length Then press back leave activity to log.
Ah I wonder if you are using an adaptive stream? We have not extensively tested player.setVideoEffects()
with adaptive streams, but I'll take a closer look.
Also I noticed the stream adaptation occurred more (by looking at RegisterNewInputStream
), any idea why that's the case? Maybe just network issues?
Could you confirm that the isLastBuffer
is set to true on your last sample?
I'm not sure if the demo is using adaptive stream or not. (Clear Dash UHD (mp4, H.265))
But I replaced the mediaItems in PlayerActivity.java initializePlayer() like this, and I can still reproduce the issue.
"https://www.libde265.org/hevc-bitstreams/bbb-1280x720-cfg02.mkv"
"https://www.libde265.org/hevc-bitstreams/tos-1720x720-cfg01.mkv"
It seems that whether it's an adaptive stream or not might not be very relevant. 🤔 Only need a HEVC video?
I also tried simply adding log isLastBuffer
in processOutputBuffer(...)
Then check the log, it seems it has not been set to true.
Last log still isLastBuffer: false
And I also found that when the playback time exceeds the video duration, processOutputBuffer(...) still being called even I click the pause.
Then, when clicking seek backward and then clicking play, isLastBuffer turns true.
I guess processOutputBuffer(...)
has been called somewhere too many times, causing the issue? 🤔
Clear Dash UHD (mp4, H.265)
This one is an adaptive stream - meaning the resolution could switch during playback, as you can see from the log.
Then check the log, it seems it has not been set to true.
I think this might be an extractor/decoder issue then rather than a video frame processing issue. It seems the problem is the decoder/extractor didn't mark the last frame in the file as the last one. But before I can be 100% sure, could you double check this only happens when you use setVideoEffects()
?
processOutputBuffer()
has been called somewhere too many times, causing the issue?
It actually can be called multiple times on one buffer before that buffer is fully processed. So the fact that it is called multiple times doesn't necessarily mean there's a problem in there
Okay, I will test without setVideoEffects()
when I get back to the place where I can reproduce the issue.
sorry this comment make the bot update labels
I tried 5-7 times to play the whole video through.
Unfortunately, after I removed setVideoEffects()
, I can no longer reproduce the issue. 😢
isLastBuffer
is set to true correctly, and generateTraceSummary()
gives all fields "No events".
And also tried on main branch(b95b534f), got the same result.
Any other idea or some change wanna try?
generateTraceSummary() gives all fields "No events".
This is expected - it only works when effects are used.
isLastBuffer is set to true correctly
This is very strange - it should be set regardless of video effects, let me try to see if something's obviously wrong, but I'm very surprised to see this.
Version
Media3 1.4.0
More version details
commit hash: b01c6ffcb3fca3d038476dab5d3bc9c9f2010781
Devices that reproduce the issue
Sony BRAVIA device build-in Android 9
Devices that do not reproduce the issue
CCwGTV
Reproducible in the demo app?
Yes
Reproduction steps
This is a workaround from https://github.com/google/ExoPlayer/issues/11038
This can be reproduce on demo app.
Add the
lib-effect
dependency tobuild.gradle
(:demo).Add
player.setVideoEffects(new ArrayList<>());
toPlayerActivity#initializePlayer()
.Build the demo app and select any H.265 codec video to play. (Here, I selected
clear dash HD (mp4, H.265)
).Observe the issue.
Expected result
play correctly, each frame correct and player will stop(ended) when content finish.
Actual result
PlayerView frame display stucked, but (progress bar time /upper log
rb:<value>
) keep growing.When Play to end, the progress bar time still go over (e.g. timer display will show
13:38-12:14
, even video only got 12m14s)Media
demo app
clear dash HD (mp4, H.265)
Bug Report
adb bugreport
to android-media-github@google.com after filing this issue.