Customise Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorised as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyse the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customised advertisements based on the pages you visited previously and to analyse the effectiveness of the ad campaigns.

No cookies to display.

FFmpeg: Timelapse from Video, Speed Up vs Every n-th Frame

I go over two techniques in FFmpeg to turn a long video into a “timelapse”. One is to speed up the video. The second is to take every n-th frame of video. The second method simulates a traditional timelapse where you record a series of photos. I go over the pros and cons of each technique.

FFmpeg playlist: https://www.youtube.com/playlist?list=PLErU2HjQZ_ZOPDZ71Khzt5PX4X4j6flkg

Speed Up Video 500x
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
ffmpeg -i sky.mp4 -vf "setpts=0.002*PTS,crop=in_w:in_w*9/16,scale=1920:1080" -vcodec libx264 -b:v 10000k -r 60 -pix_fmt yuv420p sky_speedier.mp4
ffmpeg -i sky.mp4 -vf "setpts=0.002*PTS,crop=in_w:in_w*9/16,scale=1920:1080" -vcodec libx264 -b:v 10000k -r 60 -pix_fmt yuv420p sky_speedier.mp4
ffmpeg -i sky.mp4 -vf "setpts=0.002*PTS,crop=in_w:in_w*9/16,scale=1920:1080" -vcodec libx264 -b:v 10000k -r 60 -pix_fmt yuv420p sky_speedier.mp4
Time to Execute (using hardware acceleration on Mac)
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
real 19m49.420s
user 52m21.576s
sys 0m14.403s
real 19m49.420s user 52m21.576s sys 0m14.403s
real	19m49.420s
user	52m21.576s
sys	0m14.403s
External Link: Speed up video

https://trac.ffmpeg.org/wiki/How%20to%20speed%20up%20/%20slow%20down%20a%20video

Use every 500th Frame
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
ffmpeg -i sky.mp4 -vf "select='not(mod(n,500))',setpts=N/FRAME_RATE/TB,crop=in_w:in_w*9/16,scale=1920:1080" -vcodec libx264 -b:v 10000k -r 60 -pix_fmt yuv420p sky_virtual_timelapse.mp4
ffmpeg -i sky.mp4 -vf "select='not(mod(n,500))',setpts=N/FRAME_RATE/TB,crop=in_w:in_w*9/16,scale=1920:1080" -vcodec libx264 -b:v 10000k -r 60 -pix_fmt yuv420p sky_virtual_timelapse.mp4
ffmpeg -i sky.mp4 -vf "select='not(mod(n,500))',setpts=N/FRAME_RATE/TB,crop=in_w:in_w*9/16,scale=1920:1080" -vcodec libx264 -b:v 10000k -r 60 -pix_fmt yuv420p sky_virtual_timelapse.mp4
Time to Execute (using hardware acceleration on Mac)
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
real 11m21.001s
user 42m2.315s
sys 0m21.926s
real 11m21.001s user 42m2.315s sys 0m21.926s
real	11m21.001s
user	42m2.315s
sys	0m21.926s
External Link: Create timelapse from video

https://stackoverflow.com/questions/41902160/create-time-lapse-video-from-other-video

Use Hardware Encoding on Mac
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
Change libx264 to h264_videotoolbox
Change libx264 to h264_videotoolbox
Change libx264 to h264_videotoolbox
Use Hardware Encoding on Windows (Intel processor, QuickSync)
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
Change libx264 to h264_qsv
Change libx264 to h264_qsv
Change libx264 to h264_qsv

Leave a comment

Your email address will not be published. Required fields are marked *