Skip to content

Instantly share code, notes, and snippets.

@nathansearles
Last active August 19, 2021 00:43
Show Gist options
  • Save nathansearles/a893f729b100d55362ea1552e3e0d3ad to your computer and use it in GitHub Desktop.
Save nathansearles/a893f729b100d55362ea1552e3e0d3ad to your computer and use it in GitHub Desktop.
FFmpeg output mp4 video for web
# Output video
ffmpeg -an -i source.mp4 -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -level 3 output.mp4
# Output video and change width (-vf scale=720:-1)
ffmpeg -an -i source.mp4 -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -level 3 -vf scale=720:-1 output.mp4
#Output first frame as PNG for poster image
ffmpeg -i source.mp4 -ss 00:00:00 -vframes 1 output.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment