Skip to content

Instantly share code, notes, and snippets.

@esnho
Last active January 28, 2021 08:06
Show Gist options
  • Save esnho/17170c288d190fd4cad24a961c755266 to your computer and use it in GitHub Desktop.
Save esnho/17170c288d190fd4cad24a961c755266 to your computer and use it in GitHub Desktop.
# ffmpeg interpolation from
## https://www.hellocatfood.com/misusing-ffmpegs-motion-interpolation-options/
ffmpeg -i lnm_faces_original.mp4 -filter:v "setpts=40*PTS,minterpolate='fps=24:scd=none:me_mode=bidir:vsbmc=1:search_param=400'" -y output.mp4
mv output.mp4 deer.head-5fps-to-25fps-30pts-search_param-400.mp4
ffmpeg -i deer.head-5fps.mp4 -filter:v "setpts=1*PTS,minterpolate='fps=24:scd=none:me_mode=bidir:vsbmc=1:search_param=400'" -y deer.head-24fps-1pts.mp4
ffmpeg -i deer.head-5fps.mp4 -filter:v "setpts=1*PTS,minterpolate='fps=24:scd=none:me_mode=bidir:vsbmc=1:search_param=4000'" -y deer.head-24fps-1pts.mp4
# convert to 5fps
ffmpeg -i deer.head.mp4 -filter:v fps=5 deer.head-5fps.mp4
ffmpeg -i deer.head.mp4 -filter:v fps=1 deer.head-1fps.mp4
ffmpeg -i deer.head-1fps.mp4 -filter:v "setpts=1*PTS,minterpolate='fps=24:scd=none:me_mode=bidir:vsbmc=1:search_param=400'" -y deer.head-1fps-to-24fps-1pts.mp4
ffmpeg -i deer.head-1fps.mp4 -filter:v "setpts=1*PTS,minterpolate='fps=24:scd=none:me_mode=bidir:vsbmc=1:search_param=8'" -y deer.head-1fps-to-24fps-1pts-search_param-8.mp4
ffmpeg -i deer.head-5fps.mp4 -filter:v "setpts=1*PTS,minterpolate='fps=24:scd=none:me_mode=bidir:vsbmc=1:search_param=8'" -y deer.head-5fps-to-24fps-1pts-search_param-8.mp4
ffmpeg -i deer.head.mp4 -filter:v fps=3 deer.head-3fps.mp4
ffmpeg -i deer.head-3fps.mp4 -filter:v "setpts=1*PTS,minterpolate='fps=24:scd=none:me_mode=bidir:vsbmc=1:search_param=8'" -y deer.head-3fps-to-24fps-1pts-search_param-8.mp4
ffmpeg -i deer.head-3fps.mp4 -filter:v "setpts=3*PTS,minterpolate='fps=24:scd=none:me_mode=bidir:vsbmc=1:search_param=400'" -y deer.head-3fps-to-24fps-3pts-search_param-400.mp4
ffmpeg -i deer.head-3fps.mp4 -filter:v "setpts=10*PTS,minterpolate='fps=24:scd=none:me_mode=bidir:vsbmc=1:search_param=400'" -y deer.head-3fps-to-24fps-10pts-search_param-400.mp4
# interpolate an image sequence cropping to 4:3 aspect ratio
ffmpeg -r 24 -i "deer.head-low/f%05d.png" -c:v libx264 -q:v 0 -g 1 -vf fps=24 -filter:v "crop=960:in_h,setpts=10*PTS,minterpolate='fps=24:scd=none:me_mode=bidir:vsbmc=1:search_param=400'" -pix_fmt yuv420p deer.head-low-3fps-to-24fps-10pts-search_param-400.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment