Project

General

Profile

Bug #937

Bitrate in playlist is incorrect

Added by Jeroen Steenhuis over 4 years ago. Updated over 4 years ago.

Status:
Rejected
Priority:
Minor
Assignee:
-
Category:
-
Target version:
-
Start date:
January 13, 2020
Due date:
% Done:

0%

Estimated time:
Affects version:

Description

In 4.0-beta1 it is possible to add the bitrate column (nice feature!) into the playlist, but the bitrate is (slightly) incorrect reporting for example 340kbps for a 320kbps mp3 file and 127kbps for a 128kbps and 191kbps for a 192kbps file.

History

#1 Updated by John Lindgren over 4 years ago

Are you certain that the exact bitrate is actually 320 kbps and 192 kbps? What is the length of each file (to the millisecond) and the size in bytes of each file?

#2 Updated by Jeroen Steenhuis over 4 years ago

Yes, because when it is played audacious shows the correct bitrate in the bottom status bar. Also other players show the correct bitrate.

#3 Updated by John Lindgren over 4 years ago

The immediate bitrate (shown in the status bar) is expected to be slightly different from the overall bitrate.

You didn't answer my second question. Please tell us what the exact length and size of the file are. Otherwise I will just go ahead and close this as "working as intended".

#4 Updated by Jeroen Steenhuis over 4 years ago

File1 (MPEG-1 layer 3, stereo, 128kbps)
Length: 3:35 (215794 in songinfo)
Filesize: 3,4 MB (3444913 bytes)
Bitrate: 128kbps (127kbps in playlist and songinfo)

File2 (MPEG-1 layer 3, stereo, 320kbps)
Length: 4:10 (250133 in songinfo)
Filesize: 10,6 MB (10630957 bytes)
Bitrate: 320kbps (340kbps in playlist and songinfo)

File3 (MPEG-1 layer 3, stereo, 192kbps)
Length: 6:47 (407125 in songinfo)
Filesize: 9,8 MB (9756512 bytes)
Bitrate: 192kbps (191kbps in playlist and songinfo)

#5 Updated by Jeroen Steenhuis over 4 years ago

Also tested with current HEAD version from GitHub, same behavior.

#6 Updated by Jeroen Steenhuis over 4 years ago

I now see that dividing size by milliseconds times 8 gives the kbps in playlist and songinfo.

Than still it's strange that the status bar gives another value (which is afaik the selected one while encoded).

It would be a good thing if the status bar and the playlist and song info give the same kbps.

Rythmbox, VLC and QMMP both report 192 kbps which I think is the right thing to display..

Only Xplayer reports 191 kbps.

#7 Updated by Jeroen Steenhuis over 4 years ago

I had a look in the code and I see that in the mpg123 plugin on line 266 the bitrate is calculated for the playlist (I suppose) but at line 309 the bitrate is obtained from the s.init function.

Probably is this causing a difference between the 2 shown bitrates.

After changing line 266 to tuple.set_int (Tuple::Bitrate, s.info.bitrate); the bitrate in playlist is correct.

#8 Updated by Jeroen Steenhuis over 4 years ago

My solution doesn't work for VBR MP3's because it gives the bit rate of the first frame I think...

I will create another solution and do a pull request on GitHub if preferred.

#9 Updated by John Lindgren over 4 years ago

  • Estimated time deleted (1.00 h)
  • Target version deleted (4.0)
  • Status changed from New to Rejected

Than still it's strange that the status bar gives another value (which is afaik the selected one while encoded).

The status bar shows the instantaneous bitrate. You will see it change every 500 ms or so for VBR files. We can't do that in the playlist, so we display the overall bitrate instead.

My solution doesn't work for VBR MP3's because it gives the bit rate of the first frame I think...

Exactly, now you are beginning to understand why the current solution was chosen :)

I will create another solution and do a pull request on GitHub if preferred.

Okay, I will close this report and wait for the pull request.

Also available in: Atom PDF