Skip to content

Instantly share code, notes, and snippets.

@ilyakava
Last active January 30, 2018 10:29
Show Gist options
  • Save ilyakava/692e30249a27ebc7ec3d to your computer and use it in GitHub Desktop.
Save ilyakava/692e30249a27ebc7ec3d to your computer and use it in GitHub Desktop.
# to cut first 3 seconds and length 8 seconds (custom step done for each file)
ffmpeg -ss 3 -t 8 -i VID00080.MP4 -vcodec copy -acodec copy white.MP4
# to burn in the timecode (r=framerate) (use in loop like below)
# ffmpeg -i $MOVIE -vf "drawtext=fontfile=/Users/artsyinc/Library/Fonts/PxPlus_VGA_SquarePx.ttf: fontsize=128: timecode='00\:00\:00\:00': r=30: x=(w-tw)/2: y=h-(2*lh): fontcolor=white: box=1: boxcolor=0x00000000@1" timecode/$MOVIE
# to speed up
for MOVIE in $(ls | grep MP4);
do LENGTH=$(ffprobe -i $MOVIE -show_format -loglevel quiet | egrep -oE 'duration=(\d+)' | awk -F= '{print $2}');
RATIO=$(echo 7.0/$LENGTH | bc -l);
ffmpeg -i $MOVIE -t 7 -filter:v setpts=$RATIO*PTS fast/$MOVIE
done
# to concatenate videos listed in cat.txt
ffmpeg -f concat -i cat.txt -c copy output.MP4
# to remove the audio
ffmpeg -i combo.MP4 -c copy -an combo1.MP4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment