domingo, 10 de setembro de 2023

Converting multiple video files recursively and in parallel on linux - Using ffmpeg and parallel

After starting using linux for gaming instead of windows, i needed to bring my games to linux, including clone hero. Most things worked flawlessly but some video background didn't. After searching, i found that linux clone hero backgroud videos should be webm, and some of mine where in mp4. 

After looking for some answers, i did find one here

There's one in particular where you can convert files parralelly, which is pretty cool.

Install ffmpeg and parallel using:

sudo apt install ffmpeg parralel

Then, you can run this in terminal after you navigated to the folder you want to convert the files. It uses find, so it runs recursively:

find -type f -name '*.mp4' -not -empty -print0 |
    parallel -0 -j -1 ffmpeg -loglevel fatal -i {} {.}.webm
 


Hope it helps!