-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Render final frame of MPEG-TS video #7909
Comments
I tried to reproduce with your provided file in the ExoPlayer demo app built from dev-v2 branch on a Pixel 3a XL running R. Playback seems to complete fine and I don't see any errors in logcat. Can you provide the info requested in the issue template?
|
Device name & OS version: STB Based on the Hisilicon chip mv310, android4.4.2 The previous mistake was due to my negligence,Ignore the previous error. |
I agree no image is shown. I don't see any image when I play the .ts video file in VLC either. For such a short video what image are you expecting to see? |
You can see the picture with FFPlay. |
Thanks - I looked deeper into what's going on here. When parsing MPEG-TS we use the start of the next frame as the trigger for calling ExoPlayer/library/extractor/src/main/java/com/google/android/exoplayer2/extractor/ts/H264Reader.java Line 466 in 744c57c
We probably always fail to output the final frame properly. It just happens to be more visible when the final frame is also the first and only frame. We do it this way because MPEG-TS doesn't clearly indicate where the end of each sample is, unlike something like MP4/MKV. We could use end-of-stream as a signal to flush out the final sample, but given MPEG-TS is often clipped in random places, that would quite likely cause a new problem where we output a partial frame as the last sample in some cases. So, I guess the question is whether upon seeing end-of-stream, there's a good way to determine whether the sample data that has been output is a complete sample, in which case we could call sampleMetadata conditionally on that check passing. |
Thanks very much. |
This should be resolved by androidx/media#419 |
This TS contains only one I frame,android Error while playing.
bjws-20655436911.zip
The error log:
09-15 10:07:06.325 6394-6394/com.google.android.exoplayer2.demo E/EventLogger: playerFailed [eventTime=4.32, mediaPos=0.00, window=0, period=0
com.google.android.exoplayer2.ExoPlaybackException: Source error
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:487)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:136)
at android.os.HandlerThread.run(HandlerThread.java:61)
Caused by: com.google.android.exoplayer2.ParserException: Loading finished before preparation is complete.
at com.google.android.exoplayer2.source.ProgressiveMediaPeriod.maybeThrowPrepareError(ProgressiveMediaPeriod.java:239)
at com.google.android.exoplayer2.source.MaskingMediaPeriod.maybeThrowPrepareError(MaskingMediaPeriod.java:144)
at com.google.android.exoplayer2.ExoPlayerImplInternal.doSomeWork(ExoPlayerImplInternal.java:838)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:410)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:136)
at android.os.HandlerThread.run(HandlerThread.java:61)
]
The text was updated successfully, but these errors were encountered: