Skip to content

Instantly share code, notes, and snippets.

@theDrGray
Created February 10, 2016 02:48
Show Gist options
  • Save theDrGray/f248fbf7275fbbc26b9d to your computer and use it in GitHub Desktop.
Save theDrGray/f248fbf7275fbbc26b9d to your computer and use it in GitHub Desktop.
#!/bin/bash
# Variables
INPUT_VIDEO="./input.mov"
OVERLAY_VIDEO="./overlay.mov"
OUTPUT_VIDEO_FILENAME="output.mov"
OVERLAY_START="0"
# Delete existing output file if it exists
if [ -f $OUTPUT_VIDEO_FILENAME ]; then
rm $OUTPUT_VIDEO_FILENAME
fi
# Command
ffmpeg -i $INPUT_VIDEO -i $OVERLAY_VIDEO \
-filter_complex "[1:v]setpts=PTS+$OVERLAY_START/TB[a]; \
[0:v][a]overlay=w:h" \
-c:v libx264 -crf 18 -pix_fmt yuv420p \
$OUTPUT_VIDEO_FILENAME
# Open new video
open $OUTPUT_VIDEO_FILENAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment