Skip to content

Instantly share code, notes, and snippets.

@eser
Created April 5, 2026 13:25
Show Gist options
  • Select an option

  • Save eser/c6d35f8cb41ad504c88029b2eecbcc19 to your computer and use it in GitHub Desktop.

Select an option

Save eser/c6d35f8cb41ad504c88029b2eecbcc19 to your computer and use it in GitHub Desktop.
Video Conversion Script for YouTube (ffmpeg, afconvert)
VIDEOFILE="intro.mov"
VIDEOFILE_BASE="${VIDEOFILE%.*}"
afconvert "${VIDEOFILE}" -o "${VIDEOFILE_BASE}_audio.wav" -d LEI24 -f WAVE -c 2
ffmpeg -i "${VIDEOFILE}" -i "${VIDEOFILE_BASE}_audio.wav" \
-map 0:v -map 1:a \
-c:v libx265 -preset slow -crf 15 \
-pix_fmt yuv420p10le \
-color_primaries bt709 -color_trc bt709 -colorspace bt709 \
-tag:v hvc1 \
-c:a aac -b:a 384k \
-movflags +faststart \
"${VIDEOFILE_BASE}.mp4"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment