I want to convert a bunch of FLAC files to OPUS, keeping the folder structure and all metadata (including the cover art). Does anyone know the best way to do that? All the finished scripts I found don't fulfill all of those requirements.

Needs to be something for Linux

@LilaHexe every time I do this I whip out a custom ffmpeg invocation… probably something like this could work (didn’t test, use with caution)

find '.' -name '*.flac' -type f -exec ffmpeg -i {} -acodec libopus -b:a 192k {}.opus \;

and then another pass to rename all .flac.opus files into .opus

@domi yep that seems to work :D

hehehe uhhhhh any way to multi-thread it?
👀

@LilaHexe i would add echo before ffmpeg, and then | parallel at the end

i’m like 45% sure this will just work, you have to check, i’m not good at GNU parallel XD

@domi @LilaHexe using `find '.' -name '*.flac' -type f -print0 | parallel -0 ffmpeg -i {} -acodec libopus -b:a 192k {}.opus`
should be more robust in regards to newlines in file names, but otherwise perform the same stuff
@fogti @domi lmao, I shit you not, I got it working with something very similar about 20 seconds ago. But mine involved saving the find results to a file, cuz I couldn't figure out how to pass it to parallel. Thanks!
@fogti @domi nooooo it doesn't transfer the album art ​​

@LilaHexe @fogti i tested it and it worked for me…

can you try -vcodec copy ?

@domi @fogti no luck. picard shows the album art on the FLAC, but on the OPUS it needs to fetch it from the internet first :(

@LilaHexe @fogti oh, okay, mpv goofed me and i didn’t actually have it working

one moment please

@LilaHexe @fogti okay, i found the issue:

  • opus doesn’t allow for embedding album art
  • webm only allows certain formats (not a static JPG)
  • mka works if you add -vcodec copy -map 0:v:0

mka is matroska audio if you haven’t heard of it before

@LilaHexe @fogti correction: -vcodec copy -map 0:v:0 -map 0:a:0, otherwise there’s no audio

but now i’m having weird slowdowns when playing those files… wth