ExoPlayer icon indicating copy to clipboard operation
ExoPlayer copied to clipboard

MP4 video not playing in exoplayer

Open vishal105 opened this issue 8 years ago • 7 comments

Hello, I tried to play .mp4 video using exoplayer but I am getting this error

Here is my code code snippet

***************************************** Code snippet************************************* MediaSource videoSourceMp4 = new ExtractorMediaSource( Uri.parse(videoURI), dataSourceFactory, new DefaultExtractorsFactory(), mainHandler, new ExtractorMediaSource.EventListener() { @Override public void onLoadError(IOException error) { Log.e(TAG, "onLoadError: ", error); } }); player.prepare(videoSourceMp4);

********************************************** Error ********************************************************

onLoadError: com.google.android.exoplayer2.upstream.FileDataSource$FileDataSourceException: java.io.EOFException at com.google.android.exoplayer2.upstream.FileDataSource.open(FileDataSource.java:70) at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:147) at com.google.android.exoplayer2.source.ExtractorMediaPeriod$ExtractingLoadable.load(ExtractorMediaPeriod.java:841) at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:315) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) at java.lang.Thread.run(Thread.java:818) Caused by: java.io.EOFException at com.google.android.exoplayer2.upstream.FileDataSource.open(FileDataSource.java:67) at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:147)  at com.google.android.exoplayer2.source.ExtractorMediaPeriod$ExtractingLoadable.load(ExtractorMediaPeriod.java:841)  at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:315)  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)  at java.lang.Thread.run(Thread.java:818)  0

***************************** video codec ****************************************************************** ffmpeg version 3.3.3 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3) configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --mandir=/usr/share/man --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libfreetype --enable-gnutls --disable-ffserver --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libtheora --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvidstab --enable-libwavpack --enable-nvenc --enable-libzimg libavutil 55. 58.100 / 55. 58.100 libavcodec 57. 89.100 / 57. 89.100 libavformat 57. 71.100 / 57. 71.100 libavdevice 57. 6.100 / 57. 6.100 libavfilter 6. 82.100 / 6. 82.100 libavresample 3. 5. 0 / 3. 5. 0 libswscale 4. 6.100 / 4. 6.100 libswresample 2. 7.100 / 2. 7.100 libpostproc 54. 5.100 / 54. 5.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'Class2-1080p.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 creation_time : 2017-05-26T09:14:14.000000Z Duration: 03:17:00.84, start: 0.000000, bitrate: 666 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 537 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc (default) Metadata: creation_time : 2017-05-26T09:14:14.000000Z handler_name : VideoHandler Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 125 kb/s (default) Metadata: creation_time : 2017-05-26T09:16:15.000000Z handler_name : SoundHandler

vishal105 avatar Feb 14 '18 10:02 vishal105

Sounds as if your file is broken when it causes an end-of-file exception when trying to read it. If you want us to take a closer look, please provide an example file as requested in the issue template.

tonihei avatar Feb 14 '18 11:02 tonihei

@vishal105 Use recent lib

sachinGirish avatar Feb 16 '18 06:02 sachinGirish

I am using 2.6.1 lib.

vishal105 avatar Feb 16 '18 08:02 vishal105

i also face same problem. is compatible_brands: isomiso2avc1mp41 creating any issue ??

ankuradhikari08 avatar Feb 22 '18 09:02 ankuradhikari08

Just to iterate what I said above: Please send us an example media file and reproduction steps for the bug in our demo app to allow us to take a closer look.

tonihei avatar Feb 22 '18 09:02 tonihei

Closing due to lack of information required to debug the issue.

ojw28 avatar Mar 18 '18 19:03 ojw28

how to play mp4 video online

Waleedasim avatar May 09 '18 11:05 Waleedasim