Skip to content

Instantly share code, notes, and snippets.

@heisters
Created August 16, 2012 00:12
Show Gist options
  • Save heisters/3364936 to your computer and use it in GitHub Desktop.
Save heisters/3364936 to your computer and use it in GitHub Desktop.
Using FFMPEG to splice a bumper onto an excerpt of a movie
#!/bin/bash
in="$1"
bumper_img="$2"
seek="$3" # "hh:mm:ss" or # of seconds
length="$4" # "hh:mm:ss" or # of seconds
ffmpeg \
-f image2pipe -vcodec ppm -i <(
ffmpeg \
-v 0 \
-loop 1 -f image2 -i "${bumper_img}" \
-f image2pipe -vcodec ppm \
-r 29.97 -t 5 -an \
-y /dev/stdout;
ffmpeg \
-v 0 \
-ss "${seek}" -t "${length}" \
-i "${in}" \
-f image2pipe -vcodec ppm \
-r 29.97 -an \
-y /dev/stdout
) \
-f mov -vcodec libx264 \
-r 29.97 -an \
-y /tmp/concated.mov
exit $?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment