You are not logged in.
My goal - convert library of flac files to alac formatted m4a files in a recursive fashion.
I'm almost there using the following but am unsure of the right syntax to allow me to discard to old .flac extension. in the output file. Here is what I'm using:
find -name *.flac -exec ffmpeg -i "{}" -acodec alac "{}".m4a \;
So, 01-name.flac becomes 01-name.flac.m4a -- I want to adjust my line to omit the old extension ".flac" from the filename.
The following is incorrect and only writes out "{%.flac}.m4a" to the root of my library where I started.
find -name *.flac -exec ffmpeg -i "{}" -acodec alac {%.flac}.m4a \;
Advice is appreciated.
Last edited by graysky (2012-07-01 18:32:55)
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
...perhaps more efficient would be using xargs or parallel but since the output of the first command becomes the last thing on the shell to xargs and parallel...
find -name *.flac | parallel -X echo {} goes to {.}.m4a
works but when I change the echo command to the ffmpeg command it does not.
Last edited by graysky (2012-07-01 18:16:18)
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
Got a not dissimilar project on the go myself - and immediately bottled it and did a rename at the end
From my (not particularly exhaustive) investigations at the time I found most "gui converters" write out to a temp file and then rename after the event...
Last edited by satanselbow (2012-07-01 18:24:48)
Offline
Got it! My mistake was using the -X switch with parallel; this works as expected (and amazingly fast on quad core):
find -name *.flac | parallel ffmpeg -i "{}" -acodec alac "{.}".m4a
Last edited by graysky (2012-07-01 18:33:30)
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
Good work that man :thumb: ... might have to steal that one
Offline
Thank you for this command! Switched it for the inverse and it works great. Super speedy on my quad core too!
Offline