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

java.io.EOFException: ExoPlayer does not play local short MP4 file #3351

Closed
AndroVid opened this issue Oct 13, 2017 · 4 comments
Closed

java.io.EOFException: ExoPlayer does not play local short MP4 file #3351

AndroVid opened this issue Oct 13, 2017 · 4 comments
Labels

Comments

@AndroVid
Copy link

AndroVid commented Oct 13, 2017

Hi, we are moving from MediaPlayer to ExoPlayer but when we try to play the attached file ExoPlayer fails with the following exception. The same file is succesfully played with MediaPlayer. ExoPlayer plays all other files successfully, but there is a problem with this file.

ExoPlayer version: 2.5.3
TEsted on: 1. Android-26 (X86 Emulator) 2. Samsung Galaxy J7 (SM-J710FQ) Android 7.0

ExoPlayer is created with default settings:

        m_BandwidthMeter = new DefaultBandwidthMeter();

        m_VideoTrackSelectionFactory =
                new AdaptiveTrackSelection.Factory(m_BandwidthMeter);

        // Produces DataSource instances through which media data is loaded.
        String appName = getApplicationContext().getPackageName();
        m_DataSourceFactory = new DefaultDataSourceFactory(this,
                Util.getUserAgent(this, appName), m_BandwidthMeter );

        // Produces Extractor instances for parsing the media data.
        m_ExtractorsFactory = new DefaultExtractorsFactory();
		
        m_TrackSelector = new DefaultTrackSelector( m_VideoTrackSelectionFactory);

        m_VideoPlayer = ExoPlayerFactory.newSimpleInstance(this, m_TrackSelector );
I/ExoPlayerImpl: Init 7b1e44d [ExoPlayerLib/2.5.3] [generic_x86, Android SDK built for x86, Google, 26]
E/ExoPlayerImplInternal: Source error.
                                                                         java.io.EOFException
                                                                             at com.google.android.exoplayer2.extractor.DefaultExtractorInput.readFromDataSource(DefaultExtractorInput.java:262)
                                                                             at com.google.android.exoplayer2.extractor.DefaultExtractorInput.readFully(DefaultExtractorInput.java:70)
                                                                             at com.google.android.exoplayer2.extractor.DefaultExtractorInput.readFully(DefaultExtractorInput.java:79)
                                                                             at com.google.android.exoplayer2.extractor.mp4.Mp4Extractor.readAtomPayload(Mp4Extractor.java:266)
                                                                             at com.google.android.exoplayer2.extractor.mp4.Mp4Extractor.read(Mp4Extractor.java:147)
                                                                             at com.google.android.exoplayer2.source.ExtractorMediaPeriod$ExtractingLoadable.load(ExtractorMediaPeriod.java:704)
                                                                             at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:315)
                                                                             at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
                                                                             at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
                                                                             at java.lang.Thread.run(Thread.java:764)

big_buck_bunny_720p_ExoPlayer_not_play.zip

@ojw28
Copy link
Contributor

ojw28 commented Oct 13, 2017

The file has a strange edit list that we don't handle, which is causing the failure. We're going to relax our handling of such edit lists to play the file as though the edit list didn't exist, rather than failing, on the basis that most often this type of edit list is unintentional/broken.

@ojw28 ojw28 added the bug label Oct 13, 2017
@AndroVid
Copy link
Author

Is there any work-around solution to this problem until we get the fixed version?

ojw28 added a commit that referenced this issue Oct 13, 2017
1. Ignore edit list where the sequence doesn't contain a sync
   sample, rather than failing.
2. Make Mp4Extractor.readAtomPayload so it doesn't try and read
   the same payload twice if a failure occurs parsing it.
3. Make processAtomEnded so that it doesn't pop the moov if
   parsing it fails.

Issue: #3351

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172106244
@ojw28
Copy link
Contributor

ojw28 commented Oct 13, 2017

Fix is in the dev-v2 branch. The only workaround would be to patch the fix into the version of ExoPlayer included in your app.

@ojw28 ojw28 closed this as completed Oct 13, 2017
@AndroVid
Copy link
Author

Thank you.

ojw28 added a commit that referenced this issue Oct 17, 2017
1. Ignore edit list where the sequence doesn't contain a sync
   sample, rather than failing.
2. Make Mp4Extractor.readAtomPayload so it doesn't try and read
   the same payload twice if a failure occurs parsing it.
3. Make processAtomEnded so that it doesn't pop the moov if
   parsing it fails.

Issue: #3351

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=172106244
@google google locked and limited conversation to collaborators Feb 11, 2018
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

2 participants