strawberrymusicplayer / strawberry

:strawberry: Strawberry Music Player
https://www.strawberrymusicplayer.org/
GNU General Public License v3.0
2.76k stars 194 forks source link

Strawberry does not respect the bitrate settings when transcoding to .mp3 #1108

Closed glaubersm closed 1 year ago

glaubersm commented 1 year ago

Describe the bug When I transcode a .flac file to .mp3, Strawberry generates a .mp3 file whose bitrate is 280 Kbps despite Strawberry is set to constant 320 Kbps bitrate.

To Reproduce

  1. open Strawberry settings and click on 'Transcoding' in the left side
  2. click on 'MP3' tab, select 'Optimize for bitrate", set 'Bitrate' to '320' and check 'Constant bitrate'
  3. apply the settings by clicking on 'OK' button
  4. click on 'Tools' menu and choose 'Transcode music'
  5. add a .flac file and set 'Audio format' to 'MP3 (.mp3)'
  6. click on 'Start transcoding' button

Expected behavior A .mp3 file with constant 320 Kbps bitrate should be generated

System Information:

jonaski commented 1 year ago

It works here. What does the log in the details button say?

Thu Jan 12 19:37:41 2023: Transcoding 1 files using 8 threads
Thu Jan 12 19:37:41 2023: Starting /home/jonas/Test-Music/FLAC/Test1/Acoustic Strawbs/Full Bloom/01 - Acoustic Strawbs - Full Bloom - Autumn.flac
Thu Jan 12 19:37:41 2023: Using 'lamemp3enc' (rank 256)
Thu Jan 12 19:37:41 2023: Adding xingmux and id3v2mux to the pipeline
Thu Jan 12 19:37:41 2023: Setting lamemp3enc property: target = 1
Thu Jan 12 19:37:41 2023: Setting lamemp3enc property: bitrate = 320
Thu Jan 12 19:37:41 2023: Setting lamemp3enc property: cbr = true
Thu Jan 12 19:37:41 2023: Setting lamemp3enc property: quality = 9.99
Thu Jan 12 19:37:41 2023: Setting lamemp3enc property: encoding-engine-quality = 2
Thu Jan 12 19:37:41 2023: Setting lamemp3enc property: mono = false
Thu Jan 12 19:37:58 2023: Successfully written /home/jonas/Test-Music/FLAC/Test1/Acoustic Strawbs/Full Bloom/01 - Acoustic Strawbs - Full Bloom - Autumn.mp3
glaubersm commented 1 year ago

The output says that the bitrate is 320. But when I add the generated .mp3 file to a playlist, the 'Bitrate' column of Strawberry says that the bitrate is 280 Kbps.

Thu Jan 12 15:46:40 2023: Transcoding 1 files using 2 threads
Thu Jan 12 15:46:40 2023: Starting /home/stalker/Músicas/06 - Take Up Thy Stethoscope And Walk.flac
Thu Jan 12 15:46:40 2023: Using 'lamemp3enc' (rank 256)
Thu Jan 12 15:46:40 2023: Adding xingmux and id3v2mux to the pipeline
Thu Jan 12 15:46:40 2023: Setting lamemp3enc property: target = 1
Thu Jan 12 15:46:40 2023: Setting lamemp3enc property: bitrate = 320
Thu Jan 12 15:46:40 2023: Setting lamemp3enc property: cbr = true
Thu Jan 12 15:46:40 2023: Setting lamemp3enc property: quality = 9.99
Thu Jan 12 15:46:40 2023: Setting lamemp3enc property: encoding-engine-quality = 2
Thu Jan 12 15:46:40 2023: Setting lamemp3enc property: mono = false
Thu Jan 12 15:46:49 2023: Successfully written /home/stalker/Músicas/06 - Take Up Thy Stethoscope And Walk.mp3
jonaski commented 1 year ago

280 sounds like it could be using variable bitrate, the cbr does not take affect. Is it consistently doing the same each time? Is it 280 for all songs?

glaubersm commented 1 year ago

I have just transcoded some .flac files for test purposes, the bitrate varies: 286, 290, 288, 293, 285, 289, 284. Audacious player reports variable bitrate in its status bar when I play these .mp3 files with it.

jonaski commented 1 year ago

Can you re-check with 1.0.14 if it has the same issue, I did some changes to the data type conversions when setting properties.

glaubersm commented 1 year ago

I can't reproduce with 1.0.14. :)

jonaski commented 1 year ago

OK. I assume I fixed it then. Thanks.