Skip to content

Instantly share code, notes, and snippets.

@tomchentw
Last active December 26, 2022 05:58
Show Gist options
  • Save tomchentw/5106bb7e873bc88641654096a9aeee60 to your computer and use it in GitHub Desktop.
Save tomchentw/5106bb7e873bc88641654096a9aeee60 to your computer and use it in GitHub Desktop.
ffmpeg + magic
# Save poster at 1s to out.heic
ffmpeg -ss 00:00:01 -i input.mp4 -frames:v 1 -q:v 5 -f image2pipe - | magick - out.heic
# to h265
ffmpeg -i input.mp4 -c:v libx265 out.mov
# to h264
ffmpeg -i input.mp4 -c:v libx264 out.mov
# Save to h265 with poster
ffmpeg -i input.mp4 -i poster.jpg -map 0 -map 1:0 -c:v:0 libx265 -c:v:1 copy -disposition:v:1 attached_pic output.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment