[MPlayer-users] wrong length and bitrate with FLAC

Ilja Sekler ilja_sekler_ at gmx.de
Fri Nov 23 11:39:43 CET 2012


Am 23.11.2012 08:02, schrieb Reimar Döffinger:

> On 22 Nov 2012, at 23:54, Ilja Sekler <ilja_sekler_ at gmx.de> wrote:
> 
>> Am 22.11.2012 22:56, schrieb Reimar Döffinger:
>> 
>>> On Wed, Nov 21, 2012 at 09:35:14PM +0100, Ilja Sekler wrote:
>>> 
>>>> Am 16.11.2012 20:35, schrieb wbrana:
>>>> 
>>>>> MPlayer 1.1 returns correct values
>>>>> 
>>>>> ID_AUDIO_BITRATE=1018008
>>>>> ID_LENGTH=277.00
>>>>> 
>>>>> but revision 35421 returns wrong values
>>>>> 
>>>>> ID_AUDIO_BITRATE=8
>>>>> ID_LENGTH=35330017.00
>>>> 
>>>> 
>>>> Already r35368 got the bitrate and thus the length of FLAC
>>>> files wrong. The bug is still there in MPlayer as of r35437, a
>>>> fix would be highly appreciated.
>>>> 
>>>> The current ffmpeg (N-44472-gb93c933) is not affected.
>>> 
>>> Please provide sample file and example command-line and output.
>>> I cannot reproduce the issue with e.g.
>>> http://samples.mplayerhq.hu/A-codecs/lossless/luckynight.flac
>> 
>> This sample is just too short. Make it at least 4x as long (just
>> open it in Audacity, copy the content, paste it at the end of the
>> original sample three times and export the whole as FLAC) and you
>> will be able to reproduce the bug. Otherwise I'll upload the file
>> (26MB). I just didn't have anything shorter th_a_n 5 minutes to
>> test with, so I hit the bug immediately.
> 
> That seems highly unlikely, the problem should be that another field 
> sneaks into our num_samples, the length of the file should not make
> the slightest difference to whether that happens.

You are right, the length is only relevant for getting completely crazy
values like those cited by wbrana. Even if you use only

<http://samples.mplayerhq.hu/A-codecs/lossless/luckynight.flac>

you could see that MPlayer gets ID_AUDIO_BITRATE and ID_LENGTH wrong:


##########################################################################


./mplayer-r35447-unpatched -identify -frames 0 samples/luckynight.flac
MPlayer SVN-r35447-4.7.2 (C) 2000-2012 MPlayer Team

Playing samples/luckynight.flac.
libavformat version 54.37.100 (internal)
ID_AUDIO_ID=0
Audio only file format detected.
Load subtitles in samples/
ID_FILENAME=samples/luckynight.flac
ID_DEMUXER=audio
ID_AUDIO_FORMAT=fLaC
ID_AUDIO_BITRATE=524288
ID_AUDIO_RATE=0
ID_AUDIO_NCH=0
ID_START_TIME=0.00
ID_LENGTH=101.00     // Wrong! Should be 60.00!
ID_SEEKABLE=1
ID_CHAPTERS=0
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
libavcodec version 54.76.100 (internal)
AUDIO: 44100 Hz, 2 ch, s16le, 524.3 kbit/37.15% (ratio: 65536->176400)
ID_AUDIO_BITRATE=524288
ID_AUDIO_RATE=44100
ID_AUDIO_NCH=2
Selected audio codec: [ffflac] afm: ffmpeg (FFmpeg FLAC audio)
==========================================================================
AO: [pulse] 44100Hz 2ch s16le (2 bytes per sample)
ID_AUDIO_CODEC=ffflac
Video: no video
Starting playback...


Exiting... (End of file)
ID_EXIT=EOF


##########################################################################


With r35333 reverted, it shows correct values:


##########################################################################


mplayer -identify -frames 0 samples/luckynight.flac
MPlayer SVN-r35447-4.7.2 (C) 2000-2012 MPlayer Team

Playing samples/luckynight.flac.
libavformat version 54.37.100 (internal)
ID_AUDIO_ID=0
Audio only file format detected.
Load subtitles in samples/
ID_FILENAME=samples/luckynight.flac
ID_DEMUXER=audio
ID_AUDIO_FORMAT=fLaC
ID_AUDIO_BITRATE=881416
ID_AUDIO_RATE=0
ID_AUDIO_NCH=0
ID_START_TIME=0.00
ID_LENGTH=60.00
ID_SEEKABLE=1
ID_CHAPTERS=0
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
libavcodec version 54.75.100 (internal)
AUDIO: 44100 Hz, 2 ch, s16le, 881.4 kbit/62.46% (ratio: 110177->176400)
ID_AUDIO_BITRATE=881416
ID_AUDIO_RATE=44100
ID_AUDIO_NCH=2
Selected audio codec: [ffflac] afm: ffmpeg (FFmpeg FLAC audio)
==========================================================================
AO: [pulse] 44100Hz 2ch s16le (2 bytes per sample)
ID_AUDIO_CODEC=ffflac
Video: no video
Starting playback...


Exiting... (End of file)
ID_EXIT=EOF


##########################################################################

>> As stated in
>> <http://lists.mplayerhq.hu/pipermail/mplayer-users/2012-November/085621.html>,
>> reverting the checkin from r35333 fixes the issue with long FLAC
>> files.
> 
> That would be wrong, you just don't notice because now _your_ files
> are too short :-) (the issue would become visible for files around
> 100 hours long).

It is IMHO quite safe to assume that no one would ever get FLAC files
with such an incredible length :-) For real life cases, it just works right.

Thanks,

-- 
Regards

Ilja


More information about the MPlayer-users mailing list