Skip to content

Instantly share code, notes, and snippets.

@ichub
Created August 11, 2018 00:51
Show Gist options
  • Save ichub/700aa0f5e018e5e30104a3b97cde3bc7 to your computer and use it in GitHub Desktop.
Save ichub/700aa0f5e018e5e30104a3b97cde3bc7 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
convert -coalesce $1 frames%04d.png
rm list.txt
ffmpeg -r 10 -i frames%04d.png -vcodec mjpeg -y concatenated.mp4
for i in {1..10}; do printf "file '%s'\n" concatenated.mp4 >> list.txt; done
ffmpeg -y -f concat -i list.txt -c copy bad_format.mp4
ffmpeg -y -i bad_format.mp4 -vcodec h264 -acodec aac -strict -2 -pix_fmt yuv420p -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" $1.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment