Last active
June 3, 2019 05:11
-
-
Save mpharrigan/5f10a8ea4dcb74b9c767 to your computer and use it in GitHub Desktop.
Make a quality movie using ffmpeg
This file contains 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
ffmpeg -i molecule.%5d.ppm -c:v libx264 -preset slow -crf 18 molecule.mkv | |
# -i input filenames | |
# -c:v codec (libx264 --> H.264) | |
# -preset duh | |
# -crf quality factor, lower = better, 18 = practically lossless | |
# output filename | |
# For colors, make sure you're using yuv444 which should be the default in newer ffmpeg | |
# Note: you can use either the vmd ppm or tga image files |
This file contains 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
ffmpeg \ | |
-framerate 90 -i vmd/final.molecule.%05d.tga \ | |
-framerate 90 -i plot/frame%05d.png \ | |
-c:v libx264 \ | |
-preset slow \ | |
-crf 18 \ | |
-filter_complex "\ | |
[1:v] scale=in_w*0.8:in_h*0.8 [sclvrl] ;\ | |
[0:v][sclvrl] overlay=eval='init':x=W-w-5:y=5 [overout] ;\ | |
[overout] scale=trunc(in_w/2)*2:trunc(in_h/2)*2" \ | |
movie.overlay.mkv | |
# syntax for ffmpeg "filters" is | |
# [in_stream_name] command=parameter1=value1:parameter2=value2 [out_stream_name] ; | |
# | |
# The above takes video stream 1 [1:v] and scales it by 0.8 | |
# It then overlays the output of that [sclvr1] onto the vmd movie [0:v] | |
# The final line rounds the whole video to have a width and height divisible | |
# by 2, which is something needed by h264 (??). I think the default width for | |
# vmd is an odd number. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For macs, esp so that imovie can open it, use the following