Skip to content

Instantly share code, notes, and snippets.

@Altreus
Created April 17, 2016 10:06
Show Gist options
  • Select an option

  • Save Altreus/62f85ef2f355e65bcb39918e702c363d to your computer and use it in GitHub Desktop.

Select an option

Save Altreus/62f85ef2f355e65bcb39918e702c363d to your computer and use it in GitHub Desktop.
ffmpeg script
#!/bin/bash
OUT=`basename "$PWD"`.avi
BITRATE=10000000
RATIO=1920:1080
# x264 main profile, veryfast cpu, lossless, level is kinda like version
# -preset veryfast -qp 0
# 60fps, keyframe every 2s
ffmpeg -i "$3" -i "$4" \
-map 0:v -map 1:a \
-vb "$BITRATE" -minrate "$BITRATE" -maxrate "$BITRATE" -bufsize "$BITRATE" \
-aspect "$RATIO" -s "$RATIO" \
-c:v libx264 -profile:v main -level 3.1 \
-r 60 -g 120 -keyint_min 120 -x264opts "keyint=120:min-keyint=120:no-scenecut" \
-c:a libfdk_aac -ab 48000 -ac 2 -f avi \
-ss "$1" -to "$2" "$OUT"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment