Skip to content

Instantly share code, notes, and snippets.

@ggrell
Forked from christianselig/ffmpeg-ios.txt
Created September 2, 2022 17:35
Show Gist options
  • Save ggrell/67d0979b28395ebf75c2002134ba7c23 to your computer and use it in GitHub Desktop.
Save ggrell/67d0979b28395ebf75c2002134ba7c23 to your computer and use it in GitHub Desktop.
# Convert from H264 to H265
ffmpeg -i in.mov -c:v libx265 -an -x265-params crf=20 output.mp4
# Tag as HVC instead of HEV1 so iOS can play it
ffmpeg -i output.mp4 -vcodec copy -acodec copy -tag:v hvc1 output2.mp4
# Bonus: it can take a second to play (no more than H264) so here's how to generate
# a thumbnail of the first frame to embed in your view as a placeholder.
ffmpeg -i output2.mp4 -vf "select=eq(n\,34)" -vframes 1 thumbnail.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment