FLAC to mp3 without ffmpeg for proper joint_stereo

I am trying to encode flac files to mp3.

When using the command ffmpeg -i "$source" -codec:a libmp3lame -qscale:a 0 -joint_stereo 1 -ar 44100 -y "$dest" I get an mp3 file but it is stereo and not a joint_stereo. The reason is a 3 years old bug https://trac.ffmpeg.org/ticket/4954

I tried using this command flac --silent --decode --stdout "$source" | lame -V0 -m j -s 44.1 --silent -y "$dest" but it fails.

Has anyone here addressed this issue?
I can use the stereo, but with joint_stereo you have more available bandwidth for the file.

Hi! Welcome to beets!!

You might get a few more bites here if you explain more what you mean by “fails.” What error do you get?

Hi Adrian, thanks for the warm welcome.

When transcoding it prints these. It never finishes and I have to exit.


It feels as if the pipe is leaking.
Is there anyone that has a solution for the joint_stereo issue?

Maybe you just need to pipe the result to a file? Like, add > $dest to the end?

I tried both flac -cd "$source" | lame -V0 -m j -s 44.1 > "$dest" and flac -cd "$source" | lame -V0 -m j -s 44.1 -- > "$dest" but was giving me errors.

Then I created a file named flac2mp3:
flac --decode --stdout "$1" | lame -V0 -m j -s 44.1 - "$2"

and I changed the command in beets
command: /config/flac2mp3 "$source" "$dest"

now it works :slight_smile:

1 Like