Skip to content

Instantly share code, notes, and snippets.

@supahfunk
Last active April 11, 2022 07:34
Show Gist options
  • Save supahfunk/29fa07e7b86617954faa02fd76befffd to your computer and use it in GitHub Desktop.
Save supahfunk/29fa07e7b86617954faa02fd76befffd to your computer and use it in GitHub Desktop.
Extract first frame from video and convert mp4 optimized for web with FFMPEG
/*------------------------------
Extract first frame from video
------------------------------*/
ffmpeg -i input.mov -vf "select=eq(n\,0)" -q:v 3 output.jpg
/*------------------------------
Convert video optimized for web
------------------------------*/
ffmpeg -i input.mov -c:v libx264 -preset veryslow -pix_fmt yuv420p output.mp4
/*------------------------------
Convert video optimized for web
No Audio
------------------------------*/
ffmpeg -i input.mov -c:v libx264 -preset veryslow -pix_fmt yuv420p -an output.mp4
/*------------------------------
Resize Video
------------------------------*/
-vf scale=480:-1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment