Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
FFMPEG Transcoder Script
#!/bin/sh
# Copyright 2014 Typomedia Foundation. All rights reserved.
# Released under GPL version 3.
#
# FFMPEG Transcoder Script v1.2
EXEC=/usr/bin/ffmpeg
INPUT=/mnt/media/Movies
FTYPE=*.rip.mkv
SUFFIX=.h264.mkv
# check if script is not running
if ! ps x | grep '[/]ffmpeg.h264.sh' > /dev/null
cd $INPUT
# Transcode all files with the specified FTYPE
for FILE in $FTYPE
# transcode video stream and copy all audio streams and all subtitles
do $EXEC -i "$FILE" -map 0 -c:v libx264 -preset slow -tune film -crf 20 -c:a copy -c:s copy "$FILE${SUFFIX}"
done
fi
@typomedia
Copy link
Author

typomedia commented Dec 20, 2013

More options for encoding you will find here: https://trac.ffmpeg.org/wiki/x264EncodingGuide

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