-
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
Switching audio/subtitle track in HTTP/MPEG-TS stream restarts playback at the beginning #2956
Comments
This is because changing tracks currently triggers a seek, and MPEG-TS is not seekable. We are considering avoiding seeking on track selection, at the cost of using more memory, but right now this is working as intended. |
Many other player I know of can seek within MPEG-TS. I understand it's imperfect, but still better than nothing. Anyway, thanks for the clarification. I hope you guys will actually implement smoother track switching. |
This change allows you to enable/disable tracks within which all samples are key-frames without any re-buffering (e.g. audio, text and metadata). This effectively reverts V2 back to the behavior in V1, only this time we're doing it properly. []ly disabling/enabling, or disabling/enabling whilst paused, no longer cause samples to get "lost" between the source and renderers. Note it also becomes really easy to support a few other things, although support is not exposed in this change: - Enable/disable video tracks without any re-buffering, by changing the toKeyframe argument passed to discardTo to true. - Retain media in the buffer for some time after it's been played (e.g. to support a single back-5s-seek efficiently), by subtracting the desired back-buffer time from the value that's passed to discardTo. Issue: #2956 Issue: #2926 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=160128586
This is fixed in |
I've tried the demo app from branch dev-v2, playing a MPEG-TS stream through plain HTTP, but I get an exception. Here are the logs, using this sample stream https://drive.google.com/open?id=0BwljeX6541LubUVmbGZad0QzcWM
I also tried this stream, https://drive.google.com/open?id=0BwljeX6541Lud1pzWWx6SWFXRU0 , playback starts, but when I try to enable a subtitle track, I get another exception:
|
Thanks for testing. Please sync and try again; I submitted a one line indexing fix that I think resolves this problem. |
Fix is here: 076a77e |
@ojw28 Thanks, the fixed the exception. Quick question, though. When playing MPEG-TS through HTTP, switching audio/subtitle track is completely smooth, no interruption. However when I do track switching with HLS, I get an interruption. Is there still a seek operation when using HLS? For the record, my HLS sample stream is that same as the plain MPEG-TS referenced above, but segmented using ffmpeg. |
Actually, the commit only targets ExtractorMediaPediod, so obviously it wouldn't affect HLS. So the question should be: will the same changes be applied to HLS too? |
Yes, the same benefits will be coming to HLS soon. We're using #2718 for tracking. |
Using the demo app, I'm playing a MPEG-TS stream through HTTP. The stream contains multiple audio and subtitle tracks. Whenever I switch the audio/subtitle track in the demo app, the playback restarts at the beginning.
The text was updated successfully, but these errors were encountered: