
Speaking of variables, you’re going to need a couple more. The whole thing is comprised of variables. You know the basic FFMPEG syntax, but that doesn’t go too far here. The whole thing together looks like this: for filename in "$srcDir"/*.$srcExt do The quotes are necessary around $srcDir to prevent it from treating the whole thing as a string and not working properly. $srcExt gives it the complete extension to look for. The wildcard( *) tells it to all files, then the. So, the combination you’re looking for looks like this: "$srcDir"/*.$srcExt You also need to tell it that it needs to only loop through the files with a specific extension, srcExt. You need to set up the loop to iterate over the contents of a directory, and that directory is stored in srcDir. This script centers around a for loop to iterate over the contents of the specified directory. There are other ways to do this, but just passing them in as a string works, and it’s super simple. The options are any options that you want in your FFMPEG command. You have five variables in total a source extension, a destination or resulting extension, a source directory, a destination directory, and your options. Sure, you can use the raw inputs, but it’ll be much harder to keep track. Because of that, you’re going to need quite a few variables.

You’re going to need to pass multiple arguments to your script if you want it to be flexible enough to handle most scenarios that you’d use FFMPEG for. Open the file up, and set it up to start writing. The script will be less than 20 lines of Bash. While that might sound like a lot, it really isn’t. So, you can write a simple Bash script to loop through the contents of a specified directory and perform the conversion that you want on each file. You’re not going to sit there and manually type in the same command over and over, are you?įFMPEG is entirely scriptable. So, what can you do about it? You’re a Linux user. FFMPEG doesn’t have the ability to handle multiple files at once.
#LINUX FFMPEG BATCH CONVERT INSTALL#
RequirementsĪ working Linux install with FFMPEG installed. This will work on all Linux distributions. Write a simple Bash script for FFMPEG batch file conversion.
