diff --git a/index.html b/index.html index 837786b..5d64178 100644 --- a/index.html +++ b/index.html @@ -677,17 +677,17 @@

for file in *.MXF; do ffmpeg -i "$file" -map 0 -c copy "${file%.MXF}.mov"; done

for file in *.MXF
starts the loop, and states what the input files will be. Here, the ffmpeg command within the loop will be applied to all files with an extension of .MXF.
- The word ‘file’ is an arbitrary variable which will represent each .MXF file in turn as it is looped over.
- Per Bash syntax, within the command this variable is referenced with a dollar sign, e.g. as $file
-
do ffmpeg -i "$file"
carry out the following ffmpeg command for each input file
+ The word ‘file’ is an arbitrary variable which will represent each .MXF file in turn as it is looped over. +
do ffmpeg -i "$file"
carry out the following ffmpeg command for each input file.
+ Per Bash syntax, within the command the variable is referred to by “$file”. The dollar sign is used to reference the variable ‘file’, and the enclosing quotation marks prevents reinterpretation of any special characters that may occur within the filename, ensuring that the original filename is retained.
-map 0
retain all streams
-c copy
enable stream copy (no re-encode)
-
"${file%.MXF}.mov";
retaining the original file name, set the output file wrapper as Quicktime (.mov)
+
"${file%.MXF}.mov";
retaining the original file name, set the output file wrapper as .mov
done
complete; all items have been processed.

Note: the shell script (.sh file) and all .MXF files to be processed must be contained within the same directory, and the script must be run from that directory.
Execute the .sh file with the command sh Rewrap-MXF.sh.

-

Modify the ffmpeg script as needed to perform different transcodes :)

+

Modify the script as needed to perform different transcodes, or to use with ffprobe. :)

The basic pattern will look similar to this:
for item in *.ext; do ffmpeg -i $item (ffmpeg options here) "${item%.ext}_suffix.ext"

e.g., if an input file is bestmovie002.avi, its output will be bestmovie002_suffix.avi.