Last active
December 21, 2015 10:29
-
-
Save typomedia/6292423 to your computer and use it in GitHub Desktop.
FFMPEG Transcoder Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
More options for encoding you will find here: https://trac.ffmpeg.org/wiki/x264EncodingGuide