I have some FLAC files in my collection and since my car can read files I need to transcode them to MP3. Although with the current version of amarok, the create files have peaks with bitrate higher than 320kbps (has the specs say, this is the maximum allowed bitrate), so my car fails to read them. Since amarok uses ffmpeg to transcode you may need to pass a maximum bitrate parameter to ensure the files are valid. Even with the 175Kbps level the resulting files have peaks higher than 320Kbps. When i use lame encoder, even in the higher profile the files play pretty decent, Reproducible: Always
(In reply to comment #0) > I have some FLAC files in my collection and since my car can read files I > need to transcode them to MP3. Although with the current version of amarok, > the create files have peaks with bitrate higher than 320kbps (has the specs > say, this is the maximum allowed bitrate), so my car fails to read them. I see. > Since amarok uses ffmpeg to transcode you may need to pass a maximum bitrate > parameter to ensure the files are valid. Oh, do you know of some specific command-line arg to do this? We'd like to support both original ffmpeg and libav's ffmpeg compatibility wrapper. Can you check that both of these support the option? If you're brave enough and modify the passed arguments [Mp3Format::ffmpegParameters() in src/core/transcoding/formats/TranscodingMp3Format.cpp], do the tracks play in your car? > Even with the 175Kbps level the resulting files have peaks higher than > 320Kbps. When i use lame encoder, even in the higher profile the files play > pretty decent, Interesting Amarok actually uses lame (through ffmpeg), but perhaps ffmpeg uses liblame differently that it is used by the lame command-line tool.
Any news on this?
I'm still experience this. I've tried to find a way to get every frame's bitrate, but I can't find any tool. The only way I've got is to look in VLC codec statistics and see if the value goes beyond 320kbps.
Then could you please answer the questions from comment #1?
(In reply to Matěj Laitl from comment #1) > (In reply to comment #0) > > I have some FLAC files in my collection and since my car can read files I > > need to transcode them to MP3. Although with the current version of amarok, > > the create files have peaks with bitrate higher than 320kbps (has the specs > > say, this is the maximum allowed bitrate), so my car fails to read them. > > I see. > > > Since amarok uses ffmpeg to transcode you may need to pass a maximum bitrate > > parameter to ensure the files are valid. > > Oh, do you know of some specific command-line arg to do this? We'd like to > support both original ffmpeg and libav's ffmpeg compatibility wrapper. Can > you check that both of these support the option? No, even after reading the documentation: https://trac.ffmpeg.org/wiki/Encode/MP3 I can't found a way to limit it. > > If you're brave enough and modify the passed arguments > [Mp3Format::ffmpegParameters() in > src/core/transcoding/formats/TranscodingMp3Format.cpp], do the tracks play > in your car? > > > Even with the 175Kbps level the resulting files have peaks higher than > > 320Kbps. When i use lame encoder, even in the higher profile the files play > > pretty decent, > > Interesting Amarok actually uses lame (through ffmpeg), but perhaps ffmpeg > uses liblame differently that it is used by the lame command-line tool. I will try to find a way to print the information... and check if I can get the information via VLC. If somebody knows any script or program for analysing the mp3 and check the bitrate please let me know. NOTE: this seems to be a bug in ffmepg, not in Amarok, but I'm still trying to find the source of the problem.
I've opened a bug on FFMPEG bug tracking... and I'm awaiting for developers comments. https://trac.ffmpeg.org/ticket/4055 If anybody want to leave a comment, with more details or questions, please do, so the developers could give more attention to the issue.
I've sorted the problem, but the I can only get it working in a recent ffmpeg version, That behaviour is caused by Xing Headers, so disabling it with "-write_xing 0" parameter I can play the audio files normally. You can see more information about it here: https://ffmpeg.org/ffmpeg-formats.html#mp3 So regarding amarok, the only way to get this properly solved is to allow changing the parameters of the encoder or if make sense use that parameter permanently.
(In reply to Paulo Fidalgo from comment #7) > I've sorted the problem, but the I can only get it working in a recent > ffmpeg version, > > That behaviour is caused by Xing Headers, so disabling it with "-write_xing > 0" parameter I can play the audio files normally. You can see more > information about it here: https://ffmpeg.org/ffmpeg-formats.html#mp3 > > So regarding amarok, the only way to get this properly solved is to allow > changing the parameters of the encoder or if make sense use that parameter > permanently. Thanks a lot for your research, now we have a good hint on how to solve the issue.
This bug is still present (in 3.0.0-git) - I tried transcoding some flac files to mp3 at 175Kbps, the mp3s were created but they are unplayable - and the transcode removes the originals :(
I tried adding parameters << QStringLiteral("-write_xing") << QStringLiteral("0"); to Mp3Format::ffmpegParameters() and although I can observe some differences in tracks transcoded with and without that parameter, I haven't yet found a way to measure what is the maximal bitrate. Any hints welcome. "and the transcode removes the originals" sounds strange, doesn't happen here when I'm doing the transcoding via "Copy to Collection"; the original remains in place
"and the transcode removes the originals" - no that was my own fault - I removed the originals - should have checked the transcode was ok first!