Skip to content

Instantly share code, notes, and snippets.

@christianselig
Last active September 2, 2022 17:35
Show Gist options
  • Save christianselig/b871f93d4d7bf449cdf57c5eb0501cdc to your computer and use it in GitHub Desktop.
Save christianselig/b871f93d4d7bf449cdf57c5eb0501cdc 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