Skip to content

Instantly share code, notes, and snippets.

@typomedia
Forked from typomedia/ffmpeg.h264.sh
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save typomedia/8953145 to your computer and use it in GitHub Desktop.
Save typomedia/8953145 to your computer and use it in GitHub Desktop.
Libav Transcoder Script
#!/bin/sh
# Copyright 2013 Typomedia Foundation. All rights reserved.
# Released under GPL version 3.
#
# Libav Transcoder Script v1.0beta
EXEC=/usr/bin/avconv
INPUT=/mnt/media/Movies
FTYPE=*.rip.mkv
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 -crf 20 -c:a copy -c:s copy "${FILE%%.*}.mkv"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment