Skip to content

Instantly share code, notes, and snippets.

@robgaunt
Last active January 7, 2025 12:13
Show Gist options
  • Save robgaunt/bd8674153d3e583ce9a2 to your computer and use it in GitHub Desktop.
Save robgaunt/bd8674153d3e583ce9a2 to your computer and use it in GitHub Desktop.
ffmpeg a/v sync test video
# Rate in frames per second.
RATE=30
# Duration in seconds.
DURATION=300
# Video size options: https://www.ffmpeg.org/ffmpeg-utils.html#Video-size
SIZE=hd1080
OUTFILE=avsync_${SIZE}_${RATE}fps_${DURATION}s.webm
~/bin/ffmpeg -f lavfi -i "sine=frequency=1:beep_factor=800:duration=${DURATION}" \
-f lavfi -i "testsrc=duration=${DURATION}:size=${SIZE}:rate=${RATE}" \
-vf "drawtext=fontfile=/usr/share/fonts/truetype/droid/DroidSansMono.ttf: \
timecode='00\:00\:00\:00': r=${RATE}: x=0: y=0: fontcolor=white: \
fontsize=256: box=1: boxcolor=0x00000099" \
-c:v libvpx -b:v 8M -c:a libvorbis $OUTFILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment