Skip to content

Instantly share code, notes, and snippets.

@willvincent
Last active April 20, 2020 21:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willvincent/11ed9f06fd766a975fd6 to your computer and use it in GitHub Desktop.
Save willvincent/11ed9f06fd766a975fd6 to your computer and use it in GitHub Desktop.
Batch transcode a directory of video files to another directory, with your desired codecs and whatnot
#!/bin/bash
# These paths should either be relative to the current directory
# or full system paths.
SOURCE_PATH="Camera_Original"
DEST_PATH="Prores"
# wildcard for files to process
FILES="*.MXF"
# Prores 'flavor'
# 0 = 422 Proxy
# 1 = 422 LT
# 2 = 422 Normal
# 3 = 422 HQ
FLAVOR=1
# FFmpeg arguments/options
FFMPEG_OPT="-vcodec prores -profile:v ${FLAVOR} -acodec pcm_s16le"
# Container wrapper format (file extension, mov, avi, etc)
WRAPPER="mov"
# Verbosity level: quiet, panic, fatal, error, warning, info, verbose
VERBOSITY="warning"
######################################################################
## DO NOT CHANGE BELOW THIS LINE
######################################################################
clear
for FILE in $SOURCE_PATH/$FILES
do
FILENAME=$(basename "$FILE")
CURRENT="${FILENAME%%.*}"
echo "Processing $CURRENT..."
ffmpeg -i $FILE $FFMPEG_OPT -v $VERBOSITY $DEST_PATH/$CURRENT.$WRAPPER
done
Copy link

ghost commented Jul 14, 2014

Nice

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment