audioread icon indicating copy to clipboard operation
audioread copied to clipboard

ffmpeg succeeds for broken FLAC

Open pscn opened this issue 12 years ago • 3 comments
trafficstars

The same file as #3 succeeds in ffmpeg:

ffmpeg output

ffmpeg -i test/Somefile.flac -f s16le - > x
ffmpeg version 0.8.5-4:0.8.5-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
built on Jan 24 2013 18:01:36 with gcc 4.6.3
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
[flac @ 0x25c39c0] max_analyze_duration reached
Input #0, flac, from 'test/Somefile.flac':
[ ... ]
Press ctrl-c to stop encoding
[flac @ 0x25c5940] overread: 1
Error while decoding stream #0.0
Multiple frames in a packet from stream 0
[flac @ 0x25c5940] invalid sync code
[flac @ 0x25c5940] invalid frame header
[flac @ 0x25c5940] decode_frame() failed
Error while decoding stream #0.0
[flac @ 0x25c5940] invalid sync code
[flac @ 0x25c5940] invalid frame header
[flac @ 0x25c5940] decode_frame() failed
Error while decoding stream #0.0
[flac @ 0x25c5940] qlevel -8 not supported, maybe buggy stream
[flac @ 0x25c5940] decode_frame() failed
Error while decoding stream #0.0
[flac @ 0x25c5940] qlevel -10 not supported, maybe buggy stream
[flac @ 0x25c5940] decode_frame() failed
Error while decoding stream #0.0
[flac @ 0x25c5940] invalid sync code
[flac @ 0x25c5940] invalid frame header
[flac @ 0x25c5940] decode_frame() failed
[ ... ]
[flac @ 0x25c5940] invalid sync code
[flac @ 0x25c5940] invalid frame header
[flac @ 0x25c5940] decode_frame() failed
Error while decoding stream #0.0
size= 33218kB time=192.83 bitrate=1411.2kbits/s

video:0kB audio:33218kB global headers:0kB muxing overhead 0.000000%

and the best:

echo $? 0

pscn avatar Feb 28 '13 09:02 pscn

Aha, interesting. Any guesses what the "red flag" is that we should look for? "Error decoding stream...?"

sampsyo avatar Feb 28 '13 16:02 sampsyo

A actually gave this a try and, despite all the warnings, it looks like FFmpeg (on my system, at least) successfully decodes the file. (I tested using the decode.py script included with audioread and it produced a .wav that sounds fine all the way through.)

This should be fine for fingerprinting, although I see that you might want to get a warning if you're checking for file integrity.

sampsyo avatar Feb 28 '13 18:02 sampsyo

A actually gave this a try and, despite all the warnings, it looks like FFmpeg (on my system, at least) successfully decodes the file. (I tested using the decode.py script included with audioread and it produced a .wav that sounds fine all the way through.)

This should be fine for fingerprinting, although I see that you might want to get a warning if you're checking for file integrity.

I guess this is due to the different ways flac file encoding is taken, one is lavf encoding and the other is libflac encoding. FFMPEG does not warn if LAVF is encoded, and FFMPEG will warn if it is encoded with libflac. Although both encoded files can be decoded correctly and do not affect the playback of the sound card, it is obvious that FFMPEG prefers to use LAVF encoding for FLAC files.

anyboywhose avatar May 10 '24 23:05 anyboywhose