Last active
April 17, 2016 20:36
-
-
Save ocdude/2f142e5012cffadb355521a62caee21d to your computer and use it in GitHub Desktop.
This file contains hidden or 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/bash | |
# This script is for encoding videos in 1080p60 for YouTube using YouTube's recommendations | |
# Optionally allows for usage of nvenc instead of libx264 | |
# Usage: yt-1080p60.sh INFILE OUTFILE [nvenc] | |
INFILE="$1" | |
OUTFILE="$2" | |
ENCODER="$3" | |
if [ "$ENCODER" = "nvenc" ]; then | |
ENC="nvenc_h264" | |
else | |
ENC="libx264" | |
fi | |
# encoding for YouTube 1080p60 | |
ffmpeg -hide_banner -i "$INFILE" \ | |
-c:v "$ENC" \ | |
-crf 12 \ | |
-r 60 \ | |
-g 30 \ | |
-bf 2 \ | |
-b:v 12M \ | |
-profile:v high \ | |
-preset slow \ | |
-pix_fmt yuv420p \ | |
-movflags +faststart \ | |
-c:a aac \ | |
-b:a 384k \ | |
-ar 48000 \ | |
"$OUTFILE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment