Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Gro-Tsen/09c4dac747dab2c4e93d255c7eea9c6a to your computer and use it in GitHub Desktop.
Save Gro-Tsen/09c4dac747dab2c4e93d255c7eea9c6a to your computer and use it in GitHub Desktop.
## Initial attempt:
ffmpeg -loop 1 -i /tmp/schumann-piano-concerto-III-97-to-104.png -i /tmp/schumann-piano-concerto-III-97-to-104.ogg -c:v libx264 -tune stillimage -c:a aac -b:a 192k -shortest /tmp/out.mp4
## Phone doesn't like YUV444 format, so let's try this:
ffmpeg -loop 1 -i /tmp/schumann-piano-concerto-III-97-to-104.png -i /tmp/schumann-piano-concerto-III-97-to-104.ogg -c:v libx264 -tune stillimage -c:a aac -b:a 192k -pix_fmt yuv420p -shortest /tmp/out.mp4
## Still not happy. Change framerate, audio bitrate and scale, perhaps?
ffmpeg -r 25 -loop 1 -i /tmp/schumann-piano-concerto-III-97-to-104.png -i /tmp/schumann-piano-concerto-III-97-to-104.ogg -c:v libx264 -tune stillimage -ar 48000 -c:a aac -b:a 96k -vf scale=1280:260 -pix_fmt yuv420p -shortest /tmp/schumann-piano-concerto-III-97-to-104.mp4
## Apparently, Twitter also worries about the aspect ratio:
ffmpeg -r 25 -loop 1 -i /tmp/schumann-piano-concerto-III-97-to-104.png -i /tmp/schumann-piano-concerto-III-97-to-104.ogg -c:v libx264 -tune stillimage -ar 48000 -c:a aac -b:a 96k -vf scale=1280:260,pad=width=1280:height=720:x=0:y=230:color=white -pix_fmt yuv420p -shortest /tmp/schumann-piano-concerto-III-97-to-104.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment