'Recurse with ffmpeg
I'm trying to recurse through a directory structure and batch convert WAVs to MP3 – conserving the original WAV filename.
find . -type f -exec sh -c 'ffmpeg -i "$0" -acodec mp3 -ab 128k /Users/me/"$0".mp3' {} \;
While this seems to be grabbing the WAV files correctly, the output path throws an error because I am apparently grabbing the entire path of the file, which is creating an output string that doesn't work.
How do I grab just the filename as a variable to prepend to my .mp3 output? I can't figure out how I'm misusing my $0 variable in this command.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
