Skip to content

Instantly share code, notes, and snippets.

@salamanders

salamanders/speedup.sh

Last active Jun 15, 2020
Embed
What would you like to do?
Speed up video 64x with frame blending/averaging using ffmpeg
# Force input to 60fps. blend 16, and pick 1 of each 16. (do we do extra work for the other 15?) Set PTS to 1/16th of "original". Encode very high quality.
ffmpeg -r 60 -i molt.mp4 \
-vf "crop=in_h:in_h,tmix=frames=16:weights='1',select='not(mod(n\,16))',setpts=0.0625*PTS" \
-c:v libx265 -crf 18 -an molt16.mp4
# ffmpeg -i FryingPan_deG4NxkouGM.mp4 -vf "tblend=average,framestep=2,tblend=average,framestep=2,tblend=average,framestep=2,tblend=average,framestep=2,tblend=average,framestep=2,tblend=average,framestep=2,setpts=0.015625*PTS" -r 30 -c:v mpeg4 -q:v 1 -an output_64.mp4
# to crop: ffmpeg -i joined.mov -vf "crop=in_w-800:in_h-200:400:0,tblend=average,framestep=2,tblend=average,framestep=2,tblend=average,framestep=2,setpts=0.125*PTS" -r 30 -c:v mpeg4 -q:v 1 -an output_8.mp4
# Change goal FPS from 15 (in) to a bit of blur and 60 out: ffmpeg -ss 00:12:03 -i emerge01.mp4 -vf "crop=in_w-400:in_h:400:0,tblend=average,framestep=2,tblend=average,framestep=2,setpts=0.0625*PTS" -r 60 -c:v mpeg4 -q:v 1 -an output_60b.mp4
@salamanders

This comment has been minimized.

Copy link
Owner Author

@salamanders salamanders commented Jun 15, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.