Skip to content

Instantly share code, notes, and snippets.

@SuperShinyEyes
Last active June 27, 2019 06:52
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 SuperShinyEyes/ec167bb67fdc0df7a563b88090148ebf to your computer and use it in GitHub Desktop.
Save SuperShinyEyes/ec167bb67fdc0df7a563b88090148ebf to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
VIDEO_PATH=$1
SRC_X="256"
SRC_Y="256"
TARGET_SIZE="512x256"
ffmpeg \
-i $VIDEO_PATH/$2 -i $VIDEO_PATH/$3 \
-filter_complex "
nullsrc=size=$TARGET_SIZE [base];
[0:v] setpts=PTS-STARTPTS, scale=$SRC_X\x$SRC_Y [left];
[1:v] setpts=PTS-STARTPTS, scale=$SRC_X\x$SRC_Y [right];
[base][left] overlay=shortest=1 [tmp1];
[tmp1][right] overlay=shortest=1:x=$SRC_X:y=0
" \
-c:v libx264 $VIDEO_PATH/$4".mp4"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment