Skip to content

Instantly share code, notes, and snippets.

@lextra2
Last active May 16, 2019 00:36
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 lextra2/4722bde44949990ae98af192ccd7799d to your computer and use it in GitHub Desktop.
Save lextra2/4722bde44949990ae98af192ccd7799d to your computer and use it in GitHub Desktop.
FFMPEG.BAT - Encodes the first video/audio stream of all mkv files in this .bat location into h264 two-pass/flac, than moves them to the ENCODED folder. Requires all files to be in the same location.
mkdir ENCODED
for %%a in (*.mkv) do (
ffmpeg -i "%%a" -map_metadata -1 -map_chapters -1 -c:v libx264 -b:v 5M -preset medium -tune animation -pass 1 -vf format=yuv420p10le -color_range 1 -color_primaries 1 -color_trc 1 -colorspace 1 -an "ENCODED\%%~na.mkv"
ffmpeg -y -i "%%a" -c:v libx264 -b:v 5M -preset medium -tune animation -pass 2 -vf format=yuv420p10le -color_range 1 -color_primaries 1 -color_trc 1 -colorspace 1 -c:a flac "ENCODED\%%~na.mkv"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment