My Research Notes

GNU Parallel

About this Devlog

For previous devlogs refer devlog archive.

October 21, 2025

Using GNU Parallel

A forall parallel looping construct for unix/linux systems, needed to be installed on mac via homebrew

this is the general pattern of the gpu parallel command

command = 'ffmpeg -y -i {} \
        -vf "scale=512:512:force_original_aspect_ratio=decrease:flags=lanczos,pad=512:512:(ow-iw)/2:(oh-ih)/2:black,setsar=1:1" \
        -q:v 2 -update 1 after/{/}'

parallel --bar -j $(nproc) ${command} ::: *.jpeg

note $() -> for command substition and ${} -> for variable substition and {/} is to extract the file name from the path, is specific to gpu parallel