Search code examples
ffmpegparallel-processinggnu-parallel

recursively convert files using ffmpeg in parallel


I have the following two commands:

parallel --eta ffmpeg -loglevel 0 -i {} -c:a aac -b:a 64k {.}.aac ::: *

that converts all files (audio) in current folder to aac format in parallel (file.mp3>file.aac), and

find . -type f -not -name "*.jpg" -exec bash -c 'ffmpeg -loglevel 0 -i "{}" -c:a aac -b:a 64k "{}".aac' \;

that converts all files in all subdirectories to aac format (file.mp3>file.mp3.aac), but not in parallel.

So I want to accomplish two things:

  1. execute command 2 in parallel
  2. that the result is saved as in command 1, ie, file.mp3>files.aac instead of file.mp3>file.mp3.aac.

I've tried some combinations but they didn't work.


Solution

  • OK,

    I think I finally got it like this:

    find . -type f -not -name "*.jpg" -not -name "*.png" -not -name "*.aac" -print0 | parallel -0 --eta ffmpeg -loglevel 0 -i {} -c:a aac -b:a 64k {.}.aac