Skip to content
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

Getting java.io.EOFException while streaming from a HLS media #2355

Closed
pratikjk opened this issue Jan 21, 2017 · 3 comments
Closed

Getting java.io.EOFException while streaming from a HLS media #2355

pratikjk opened this issue Jan 21, 2017 · 3 comments
Assignees
Labels

Comments

@pratikjk
Copy link

pratikjk commented Jan 21, 2017

E/ExoPlayerImplInternal: Internal track renderer error.
                                                                          com.google.android.exoplayer.ExoPlaybackException: java.io.EOFException
                                                                              at com.google.android.exoplayer.SampleSourceTrackRenderer.maybeThrowError(SampleSourceTrackRenderer.java:263)
                                                                              at com.google.android.exoplayer.SampleSourceTrackRenderer.maybeThrowError(SampleSourceTrackRenderer.java:149)
                                                                              at com.google.android.exoplayer.ExoPlayerImplInternal.incrementalPrepareInternal(ExoPlayerImplInternal.java:275)
                                                                              at com.google.android.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:205)
                                                                              at android.os.Handler.dispatchMessage(Handler.java:98)
                                                                              at android.os.Looper.loop(Looper.java:135)
                                                                              at android.os.HandlerThread.run(HandlerThread.java:61)
                                                                              at com.google.android.exoplayer.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40)
                                                                           Caused by: java.io.EOFException
                                                                              at com.google.android.exoplayer.extractor.DefaultExtractorInput.readFromDataSource(DefaultExtractorInput.java:245)
                                                                              at com.google.android.exoplayer.extractor.DefaultExtractorInput.readFully(DefaultExtractorInput.java:67)
                                                                              at com.google.android.exoplayer.extractor.ts.TsExtractor.read(TsExtractor.java:134)
                                                                              at com.google.android.exoplayer.hls.HlsExtractorWrapper.read(HlsExtractorWrapper.java:249)
                                                                              at com.google.android.exoplayer.hls.TsChunk.load(TsChunk.java:115)
                                                                              at com.google.android.exoplayer.upstream.Loader$LoadTask.run(Loader.java:209)
                                                                              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
                                                                              at java.util.concurrent.FutureTask.run(FutureTask.java:237)
                                                                              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
                                                                              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
                                                                              at java.lang.Thread.run(Thread.java:818)

While in the ExoPlayer Demo app, doesnt show any subtitles despite enabling it.

Looking the exception, seems to me that ExoPlayer is trying to use TsExtractor but the subtitles are in WebVtt format

WEBVTT
X-TIMESTAMP-MAP=MPEGTS:900000,LOCAL:00:00:00.000
1
00:00:01.000 --> 00:00:05.000 line:-3
Captioning in progress...

@AquilesCanta
Copy link
Contributor

This is a duplicate of #2025. The quickest way to fix this is adding a .vtt extension to each media segment. We will also provide a fix for this for Webvtt tracks soon.

@pratikjk
Copy link
Author

@AquilesCanta thanks for the response. The media we are trying to play is external to us and won't be possible to ask the provider to update their extension for each media segment.
Is there any easy fix that can be patched in ExoPlayer?

@AquilesCanta
Copy link
Contributor

AquilesCanta commented Jan 23, 2017

My best advice, if you can't modify the stream(by the way, this should be trivial for the producers), is to switch to Exoplayer V2. A fix will be available in the next push, as it's already available internally. If you can't wait until next push, in HlsMediaChunk (r2.1.1) you should change the

if (lastPathSegment.endsWith(WEBVTT_FILE_EXTENSION) || lastPathSegment.endsWith(VTT_FILE_EXTENSION)) {

condition in buildExtractorByExtension to

if (MimeTypes.TEXT_VTT.equals(hlsUrl.format.sampleMimeType) || lastPathSegment.endsWith(WEBVTT_FILE_EXTENSION) || lastPathSegment.endsWith(VTT_FILE_EXTENSION))

This is for the last V2 available subversion. If you don't want to migrate to V2 you'll have to work out an equivalent solution, since we have not decided whether we are going to backport this. At this point, we only backport straightforward bugfixes. Unfortunately, this is not the case here. I will write back to let you know what the plan is, or close should we decide not to backport the fix.

ojw28 pushed a commit that referenced this issue Jan 24, 2017
According to the spec, subtitle renditions must be Webvtt media
segments.

Issue:#2025
Issue:#2355

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=145289266
@ojw28 ojw28 closed this as completed Jan 24, 2017
@google google locked and limited conversation to collaborators Jun 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants