Skip to content

Instantly share code, notes, and snippets.

@DASPRiD
Created April 5, 2014 23:28
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 DASPRiD/b702749fda0858569613 to your computer and use it in GitHub Desktop.
Save DASPRiD/b702749fda0858569613 to your computer and use it in GitHub Desktop.
# First we will create the splash video part in a lossless format
SPLASH_TEMP=$(mktemp --suffix=.mp4)
$FFMPEG -loop 1 -i "$INPUT_SPLASH" -t $SPLASH_LENGTH -c:v libx264 -pix_fmt yuv420p -preset ultrafast -qp 0 -y "$SPLASH_TEMP"
# Then create the final timelapse
$FFMPEG \
-i "$SPLASH_TEMP" \
-i "$INPUT_VIDEO" \
-i "$INPUT_AUDIO" \
-filter_complex "[1:v]setpts=$PTS*PTS [tl]; [0:v] [tl] concat=n=2:v=1:a=0 [v]" \
-map '[v]' -map 2:0 \
-codec:v libx264 -pix_fmt yuv420p -profile:v high -preset slow -b:v 4m -maxrate 4m -bufsize 8m -threads 0 \
-codec:a libvo_aacenc -b:a 192k -ac 2 -ar 48000 \
-shortest \
-y \
"$OUTPUT_FILE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment