LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 09-18-2009, 11:12 AM   #1
bgoodr
Member
 
Registered: Dec 2006
Location: Oregon
Distribution: RHEL[567] x86_64, Ubuntu 17.10 x86_64
Posts: 221

Rep: Reputation: 36
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
Thanks,
bgoodr
 
Old 09-19-2009, 07:53 PM   #2
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 211Reputation: 211Reputation: 211
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.
 
Old 09-19-2009, 08:17 PM   #3
bgoodr
Member
 
Registered: Dec 2006
Location: Oregon
Distribution: RHEL[567] x86_64, Ubuntu 17.10 x86_64
Posts: 221

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by jhwilliams View Post
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:

Code:
...
ID_AUDIO_BITRATE=32000
...
ID_AUDIO_BITRATE=128000
...
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.

bg
 
Old 09-19-2009, 08:26 PM   #4
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 211Reputation: 211Reputation: 211
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. ;-)
 
Old 09-20-2009, 08:58 AM   #5
bgoodr
Member
 
Registered: Dec 2006
Location: Oregon
Distribution: RHEL[567] x86_64, Ubuntu 17.10 x86_64
Posts: 221

Original Poster
Rep: Reputation: 36
Quote:
Originally Posted by jhwilliams View Post
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.

bg
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
not able to play mp3 files and install vlc & mp3 players in fedora 8 harit agarwal Linux - Software 5 12-22-2008 04:50 PM
bash script--variables have unexpected values on invoking mplayer stairwayoflight Programming 5 07-08-2007 11:17 AM
How to convert .rm files to mp3 without MPlayer? tabnaka Linux - Software 3 09-29-2006 10:20 PM
Samsung YP-CZ1 mp3 player reports incorrect size Jefficus Linux - Hardware 10 01-24-2006 06:33 AM
Adding values of 2 files lluciano Programming 1 01-20-2006 02:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration