mplayer reports two values for ID_AUDIO_BITRATE on some, but not all, MP3 files
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
mplayer reports two values for ID_AUDIO_BITRATE on some, but not all, MP3 files
Hi,
In How to show bit-rate on mp3 files from the command line?, there was shown a midentify.sh script that uses mplayer to show information about .mp3 files. However, I see that, for some files but not all files, mplayer reports two values for ID_AUDIO_BITRATE using the command arguments in that script. I would like to know why there are two values being reported.
For example:
Code:
$ mplayer -vo null -ao null -frames 0 -identify "./[CENSORED].mp3"
MPlayer dev-SVN-r29532Can't open joystick device /dev/input/js0: No such file or directory
Can't init input joystick
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.
Playing ./[CENSORED].mp3.
ID_AUDIO_ID=0
Audio only file format detected.
Clip info:
Title: [CENSORED]
ID_CLIP_INFO_NAME0=Title
ID_CLIP_INFO_VALUE0=[CENSORED]
Artist: [CENSORED]
ID_CLIP_INFO_NAME1=Artist
ID_CLIP_INFO_VALUE1=[CENSORED]
Album: [CENSORED]
ID_CLIP_INFO_NAME2=Album
ID_CLIP_INFO_VALUE2=[CENSORED]
Year: 1969
ID_CLIP_INFO_NAME3=Year
ID_CLIP_INFO_VALUE3=1969
Comment: [CENSORED]
ID_CLIP_INFO_NAME4=Comment
ID_CLIP_INFO_VALUE4=[CENSORED]
Track: 1
ID_CLIP_INFO_NAME5=Track
ID_CLIP_INFO_VALUE5=1
Genre: Jazz
ID_CLIP_INFO_NAME6=Genre
ID_CLIP_INFO_VALUE6=Jazz
ID_CLIP_INFO_N=7
ID_FILENAME=./[CENSORED].mp3
ID_DEMUXER=audio
ID_AUDIO_FORMAT=85
ID_AUDIO_BITRATE=32000
ID_AUDIO_RATE=44100
ID_AUDIO_NCH=0
ID_LENGTH=9473.00
ID_SEEKABLE=1
ID_CHAPTERS=0
==========================================================================
Opening audio decoder: [mp3lib] MPEG layer-2, layer-3
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
ID_AUDIO_BITRATE=128000
ID_AUDIO_RATE=44100
ID_AUDIO_NCH=2
Selected audio codec: [mp3] afm: mp3lib (mp3lib MPEG layer-2, layer-3)
==========================================================================
AO: [null] 44100Hz 2ch s16le (2 bytes per sample)
ID_AUDIO_CODEC=mp3
Video: no video
Starting playback...
Exiting... (End of file)
ID_EXIT=EOF
The version of mplayer I am running on my 64-bit Debian Linux "testing" box is:
Code:
$ dpkg --list mplayer\*
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name Version Description
+++-=====================================================-=====================================================-==========================================================================================================================
ii mplayer 1:1.0.rc2svn20090823-0.0 The Ultimate Movie Player For Linux
un mplayer-amd64 <none> (no description available)
un mplayer-custom <none> (no description available)
un mplayer-doc <none> (no description available)
un mplayer-nogui <none> (no description available)
un mplayer-skin <none> (no description available)
ii mplayer-skin-blue 1.6-2 blue skin for mplayer
bgoodr -- you gave us the output of one with only one bitrate, right? The more interesting one would be the edge case, when you get the repeated output. Without seeing it myself, I would guess that the two bit rates might be the upper and lower bounds for a VBR-encoded (variable bit rate) MP3. When you see two bitrate values, is one merely a repeat of the other, or are they distinct?
Last edited by jhwilliams; 09-19-2009 at 07:54 PM.
bgoodr -- you gave us the output of one with only one bitrate, right? The more interesting one would be the edge case, when you get the repeated output. Without seeing it myself, I would guess that the two bit rates might be the upper and lower bounds for a VBR-encoded (variable bit rate) MP3. When you see two bitrate values, is one merely a repeat of the other, or are they distinct?
I was expecting that mplayer would emit only one bitrate, not two. But if you look in the first output I showed, we see two settings for ID_AUDIO_BITRATE with different values in different places in the output:
I'm puzzled by that. If this is a VBR file, then how would I be able to tell that from the output? I would have expected to see some indication that the lower value is for the lower bound and the other value for the upper, and certainly would not expect to see both be shown as the same value for ID_AUDIO_BITRATE repeated twice with two different values like it did.
Oh, my apologies --- I hadn't seen the 32000 line. 128000 = 4 * 32000. Hm, 4: Does that mean anything to you? It doesn't to me. It looks like a bug to me ... see what they have to say about it in #mplayer on freenode, maybe? But, I bet 32000 probably is meaningful, maybe mp3's are quadrature encoded or something of the like. None-the-less, if that were the true AUDIO_BITRATE, I don't think you'd want to listen to the thing. ;-)
Oh, my apologies --- I hadn't seen the 32000 line. 128000 = 4 * 32000. Hm, 4: Does that mean anything to you? It doesn't to me. It looks like a bug to me ... see what they have to say about it in #mplayer on freenode, maybe? But, I bet 32000 probably is meaningful, maybe mp3's are quadrature encoded or something of the like. None-the-less, if that were the true AUDIO_BITRATE, I don't think you'd want to listen to the thing. ;-)
I'm not sure it is a bug in mplayer, per se. It may be that I am misunderstanding the meaning of the two bitrates coming out. If the measurements are calculated differently, then I would have expected a different variable name to be used for each so as to clarify their difference.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.