Last active
June 19, 2019 15:02
-
-
Save pmarreck/4d7decd61a5259e1985048d71409532f to your computer and use it in GitHub Desktop.
FFmpeg command to convert a png to a single-frame mp4 (with pretty stellar compression, especially compared to jpeg) BONUS: Full browser support!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# On OS X, with an ffmpeg installed via Homebrew, the following command works and results in a single-frame movie file that is compatible with Chrome, QuickTime and the latest iDevices: | |
ffmpeg -i FILENAME.png -an -vcodec libx264 -coder 1 -flags +loop -cmp +chroma -subq 10 -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -profile:v high -level 4.2 -pix_fmt yuv420p -vf “scale=trunc(iw/2)*2:trunc(ih/2)*2” -trellis 2 -partitions +parti8x8+parti4x4 -crf 24 -threads 0 -r 25 -g 25 -y FILENAME.mp4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The double quotes are the wrong characters here's the line fixed:
It should be noted too that it's not a good solution for image compression because a browser will have performances issues if all the images of a page are mp4 and it will increase cpu usage.