FFMpeg error with some flac files
See original GitHub issueExoPlayer Version
2.18.1
Devices that reproduce the issue
All
Devices that do not reproduce the issue
None
Reproducible in the demo app?
Not tested
Reproduction steps
Play the file send by mail with the ffmpeg extension enabled. Skip or wait until near the end of the file and see an error.
Expected result
No error (And no error with default Android mediacodec)
Actual result
ExoPlayerImplInternal - Playback error
com.google.android.exoplayer2.ExoPlaybackException: FfmpegAudioRenderer error, index=0, format=Format(null, null, null, audio/flac, null, -1, null, [-1, -1, -1.0], [2, 48000]), format_supported=YES
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:566)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: com.google.android.exoplayer2.ext.ffmpeg.FfmpegDecoderException: Unexpected decode error
at com.google.android.exoplayer2.ext.ffmpeg.FfmpegAudioDecoder.createUnexpectedDecodeException(FfmpegAudioDecoder.java:95)
at com.google.android.exoplayer2.ext.ffmpeg.FfmpegAudioDecoder.createUnexpectedDecodeException(FfmpegAudioDecoder.java:32)
at com.google.android.exoplayer2.decoder.SimpleDecoder.decode(SimpleDecoder.java:245)
at com.google.android.exoplayer2.decoder.SimpleDecoder.run(SimpleDecoder.java:202)
at com.google.android.exoplayer2.decoder.SimpleDecoder.access$000(SimpleDecoder.java:29)
at com.google.android.exoplayer2.decoder.SimpleDecoder$1.run(SimpleDecoder.java:73)
Caused by: java.lang.IllegalArgumentException
at java.nio.Buffer.limit(Buffer.java:290)
at java.nio.ByteBuffer.limit(ByteBuffer.java:820)
at com.google.android.exoplayer2.ext.ffmpeg.FfmpegAudioDecoder.decode(FfmpegAudioDecoder.java:139)
at com.google.android.exoplayer2.ext.ffmpeg.FfmpegAudioDecoder.decode(FfmpegAudioDecoder.java:32)
at com.google.android.exoplayer2.decoder.SimpleDecoder.decode(SimpleDecoder.java:241)
at com.google.android.exoplayer2.decoder.SimpleDecoder.run(SimpleDecoder.java:202)
at com.google.android.exoplayer2.decoder.SimpleDecoder.access$000(SimpleDecoder.java:29)
at com.google.android.exoplayer2.decoder.SimpleDecoder$1.run(SimpleDecoder.java:73)
Media
Send by mail.
Bug Report
- You will email the zip file produced by
adb bugreport
to dev.exoplayer@gmail.com after filing this issue.
Issue Analytics
- State:
- Created 10 months ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
ffmpeg FLAC decoding error - audio - Super User
I am using ffmpeg to convert some FLAC files to other format, ... The error happens regardless of output format and it works...
Read more >Dealing with problems in FLAC audio files with ffmpeg
When I try to convert FLAC to ALAC, I get a terminal failure due to the "Video", stream 0:1 . The error is:...
Read more >9185 (ffmpeg flac decoder incorrectly finds junk frame)
Summary of the bug: Raw flac demuxer seems to incorrectly discard frames. Example file was cut out from longer FLAC file that i ......
Read more >ffmpeg: Failed to download resource "flac" : r/ispyconnect
When I run the Agent DVR install routine, I get an error… ... usually this is some server hosting ffmpeg install files is...
Read more >VSE:Sound Clip with some .flac sound file show as length=0
It's an issue of mixdown by the looks of it. The file doesn't contain proper duration or timebase. Re-assigning to our audio guru....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@rohitjoins actually there’s nothing more to do, the fix does return the proper code that is supported by the decoder and in the case of that file properly ignore the invalid data at the end of it.
So simple fix to greatly improve resilience of the ffmpeg extension.
@Tolriq Thank you for sending the PR. I agree with the fix in the error message and will accept the PR soon. Overriding behaviour of ffmpeg to handle invalid data seems tricky and hard to maintain in the future. I believe we should mirror the ffmpeg extension when enabled.