Ive been researching all of today and yesterday trying to find a solution, none have worked for me so far.
For example: https://stackoverflow.com/questions/5784661/how-do-you-convert-an-entire-directory-with-ffmpeg
I want to be able to loop over all files in a folder (such as /Music/
), find any files in any directory or subdirectory that ends with .flac
, then convert those flac files to alac files using this command:
ffmpeg -i "$i" -c copy -acodec alac "${i%.*}.m4a"
the $i variable is the "name" of the file from the for loop. ${i%.*}
should just return the name, not the .flac portion.
Anyways, after that command has been run, I want all of those saved .m4a alac files to then be sent to a "new library"... IE: Ill have two /Music/
libraries.
One has all the flac files
One has all the alac (m4a) files
Is this possible?
This is the commmand I have so far, definitely doesnt work, and even if it did, it doesnt create a new library like I want: for i in *.flac; do ffmpeg -i "$i" -c copy -acodec alac "${i%.*}.m4a"; done
Currently that command just throws the error *.flac: No such file or directory
, which I assume is because its not searching subdirectories?...
find
and maybexargs
. Note: Unix does not have file-name-extensions. It is just a naming convention. (This is also true of MS windows, since Windows-95. But the file-explorer still uses them. )Music/one/two/song.flac
should be repeated inNew_Music
, likeNew_Music/one/two/song.m4a
? OrNew_Music
should have just heap of files?