0

I'm working in linux mint.

I have single directory containing fifteen other directories all containing .wav files. I want to use ffmpeg to recursively go through all directories and for every .wav file it finds, convert that file to .flac with the same name and in the same directory as the original.

I'm pretty new to this so I'm just experimenting. This what I've pulled together so far but I keep getting '.wav no such file or directory error'. I dont think I'm capturing the file name correctly. Can somebody please tell me what I need to do to get this to work:

find . -name "*.wav" -exec ffmpeg {} -i "*.wav" "*.flac" \;

Edit: Thanks to llogan

This what works:

find . -name "*.wav" -exec ffmpeg -i {} "{}.flac" \;

Whoever marked this question as already answered is wrong as the code in that link only works in the current directory, not recursive.

  • Why doesn't it work? What it's output? – Alex R Jul 24 '20 at 16:44
  • See [answer](https://stackoverflow.com/a/41105794/) by user2707001. – llogan Jul 24 '20 at 17:42
  • I marked it as a duplicate. The accepted "answer" in the duplicate link is not the answer I intended for you to try. There are 22 answers, so that is why I added a comment pointing out an answer in that thread that uses `find`. – llogan Jul 24 '20 at 19:08

0 Answers0