Saturday, March 13, 2021

How Do You Process Large Number Of Files with FFmpeg?

Photo by Graham Walker from Pexels


Suppose you have a large number of media files you wish to convert to an alternative container or format.  This post will focus on how you author a single, specifying a FFmpeg command, to be run on all the files resulted from a find command.

You could absolutely author a quick bash file, feel free to do so, but you may find this is quicker and easier;

I'd recommend you take a peek at this post XXXX as it lays out the background on utilizing Find/Exec and leads up to the final command.

This command will find all AVI containers and reformat into an MP4 container.  It shows the simplest of file conversions, it can be expanded as needed, perhaps to provide a consistent encoding scheme for all files in a subdir.

$ find . -name *.avi -exec sh -c ffmpeg -i "$0" -acodec copy "${0%.avi}.mp4" {} ;


For more details, refer to FFmpeg Official Site: http://ffmpeg.org/

 

Hope this helps.

Cheers

No comments:

Post a Comment