Log in

View Full Version : Making accurate and smooth hyperlapse


BernHard
4th April 2018, 19:10
Hello amazing forum.
I’ve got few gigabytes of FullHD H264 avi video at 30 fps which is essentially dashboard camera footage from long 1000 miles road trip in a car.
I want to do make a hyperlapse out of this video – by dropping most of the frames in regular intervals, let's say leaving in the footage only 1 frame out of 10, and then removing gaps and speeding up remaining image sequence to 60 fps or so.
Virtualdub does very dirty job (not smooth and choppy, seems not dropping frames evenly), so I am trying to explore avisynth to see if it can be done nicely on Windows PC.
Asking for help with following:

1. Can this be done with avisynth, in principle?
2. Could someone please guide me with script creation for such video decimation and acceleration?

Video stabilization can be done in virtualdub (deshaker plugin) very easily, so it is not part of the question.

Thank you!

poisondeathray
4th April 2018, 19:26
Hello amazing forum.
I’ve got few gigabytes of FullHD H264 avi video at 30 fps which is essentially dashboard camera footage from long 1000 miles road trip in a car.
I want to do make a hyperlapse out of this video – by dropping most of the frames in regular intervals, let's say leaving leaving in footage only 1 frame our of 10, and then removing gaps and speeding up remaining image sequence to 60 fps or so.
Virtualdub does very dirty job (not smooth and choppy, seems not dropping frames evenly), so I am trying to explore avisynth to see if it can be done nicely on Windows PC.
Asking for help with following:

1. Can this be done with avisynth, in principle?
2. Could someone please guide me with script creation for such video decimation and acceleration?




In principle, yes . It would be something like this


SelectEvery(10)
AssumeFPS(60)



But a "smooth hyperlapse" , what something like microsoft's hyperlapse produces, does other things like stabilization, motion blur

There are various ways you can attempt to do this too in avisynth - depanstabilize, mflowblur, or qtgmc shutter blur, or temporalsoften

BernHard
4th April 2018, 20:17
SelectEvery(10)
AssumeFPS(60)



wow! that worked as a charm.
Thank you, Poisondeathray!

Yanak
5th April 2018, 13:50
This can help too i think : http://forum.doom9.org/showthread.php?t=175017&highlight=sickjumps

Allows to have an acceleration at the start and deceleration at the end and in between the video accelerated by the value you want, ( might be useful to keep the start and end of your footage more visible while in an acceleration and deceleration parts) , and with audio synchronized too if you use avisynth to manage the audio part ( i'm not sure if your dashcam footage have this tho :p )

then at the end assumeFPS(60) or ChangeFPS(60) to have you footage at 60 fps ( if the original is already 60 fps then there is no need for this part)

LoadPlugin("H:\plugins\ffms2.dll")
LoadPlugin("H:\plugins\SickJumps.dll")

video = FFVideoSource("H:\BigBuckBunny_DivX_HD720p_ASP.divx", colorspace = "YUV420P8")

audio = FFAudioSource("H:\BigBuckBunny_DivX_HD720p_ASP.divx")

AudioDub(video, audio)

SickJumps(500, 14000, 1, 20, 5, 2, end_multiplier=1)

ChangeFPS(60)

Here the video accelerated part will be x20 speed of the original video, acceleration will start at the frame 500 and end at the frame 14000, the acceleration time will be 5 seconds ( during 5 seconds after reaching the frame 500 it will speed up progressively for 5 seconds until reaching speed x20 ) and the deceleration time is 2 seconds, ( 2 seconds before reaching frame 14000 it will slow down progressively until reaching speed x1 at frame 14000 )

the first "1" value is the speed before the acceleration process, and same thing for "end_multiplier=1", before and after the accelerated effect part the video will be at normal speed here.

Using the video found here : http://www.divx.com/en/devices/profiles/video

this is the result of the script : https://streamable.com/8lvhi

PS: smoothing all this can maybe be done with some other things like poisondeathray explained, might even be possible with the option " script_variable" inside Sickjumps plugin itself but i never tested this part much, this said i really don't like the blurry effects those hyper-lapse videos i saw end up, feels like playing games with motion blur which is something i really hate and one of the first options i disable in any video game i touch :p

johnmeyer
5th April 2018, 14:38
You can also do it in an NLE. I did this one in Vegas. It too is dashcam video. Easy.

Carmel Valley Road at 250 mph (https://www.youtube.com/watch?v=CZ4UNlQPXKQ)

If you really want to do this right, you should add some motion blur so that the sped up video "looks natural." I didn't add that blur. You can google "timelapse motion blur (https://www.google.com/search?q=timelapse+motion+blur&ie=utf-8&oe=utf-8)" and find out more about how to do really professional timeplapse.