FFMPEG: Convert multiple files using xargs
I stumbled upon this post (Google cache link) when I was trying to process multiple files via xargs
.
ls *.webm | xargs -I % ffmpeg -i % %.m4a
The key part of this one-liner is xargs
-i %
. This means that each line of STDIN passed to xargs is put into a variable and can be referenced as%
. Hence, the following text which specifiesffmpeg -i x.webm x.m4a
to make it convert.