Hi Gimp, based on your experiences, which do you think performs best in terms of shake reduction quality? I know you mentioned your top 2 but I's still want to know.

I only tried ffmpeg and premiere pro's but they still look wavy. Do you think those techniques you mentioned perform better considering how advanced they are.
 
Last edited:
Hi. No, not really. They are all different ways to arrive at the same destination.

Well the shortest answer is, stick with ffmpeg. ImageJ requires a pretty steep learning curve if you don't already know it, and Mathworks is a proprietary licensed product; easy enough to pirate since every math or engineering student at every university has a copy, but we will not discuss such things here.

vidstab in ffmpeg is quite useful, but remember, this is cheating - re-aligning the frames in post to emulate a stabilized rig... the only way to guarantee perfect video is to shoot it perfectly.

BTW, you know you can tweak vidstab parameters, yes?

1st pass:
ffmpeg -i xiaomiyi.mp4 -vf vidstabdetect=stepsize=6:shakiness=8:accuracy=9:result=vector_data.dat -f null NUL

2nd pass:
ffmpeg -i xiaomiyi.mp4 -vf vidstabtransform=input=vector_data.dat:zoom=1:smoothing=30,unsharp=4:4:1.0:3:3:0.4 -vcodec libx264 -preset slower -tune film -crf 18 -acodec copy output.mp4

If you want more info on the parameters you can manipulate with vidstab, see his github: https://github.com/georgmartius/vid.stab

You also have to consider your footage. If you have a panning shot in the same clip as a forward travel shot, those might require two separate attempts. If you split the clip, the video segments might be better processed individually. There is no magic, only really cool code. That's why I posted those links, so you can understand what is going on.

(You can also just google 'ffmpeg stabilized video still shaky' - or something like that - and find answers from lots of people who had the same issues earlier.)

"how advanced"?! They are ALL very advanced! The algorithms involved make math geeks drool. Note that video stabilizing is a side effect of what the mathematicians where initially after; computing optical flow. As it figures out the trajectory of the tracked objects, it will interpolate, with some fancy motion estimation code, to attempt to keep things still. They're not putting all this effort into coding things like this so us kids can make cool dashcam or drone videos, they're doing it for creepy stuff like http://www.smartmeup.org/ ... you can imagine development of some of it is funded by governments, too, have you seen the facial recognition cameras in Grand Central Station and NYC area airports? It's cool, but it's also very creepy\scary, Minority Report-ish.

There's a reason people will pay $$$$ for a fancy stabilized gimbal. You can't do everything in post with software... yet.
 
I can't get this to work, when i type the ffmpeg -i input_video.mp4 -vf vidstabdetect=shakiness=5:show=1 analyzed_video.mp4 i get this error
C:\ffmpeg\bin>ffmpeg -i input_video.mp4 -vf vidstabdetect=shakiness=5:show=1 analyzed_video.mp4
'ffmpeg' is not recognized as an internal or external command, operable program or batch file.

Also there is no bin folder inside ffmpeg when i extracted it so i created a bin folder, is that right?

Edit: My mistake. I downloaded the wrong version ffmpeg-3.0.2.tar.bz2. I thought it was for windows lol. I now downloaded the right version for windows and everything's ok now. Thanks.

I have same problem I downloaded file from first post it is ffmpeg 3.1.2, where am I wrong? Also I cannot find bin folder inside ffmpeg, should I make one?
 
I am trying to do the same for encoding the x264 videos to x265.
will this work?

for %%a in ("*.mp4") do ffmpeg.exe -i "%%a" -c:v libx265 -preset medium -crf 22 -c:a aac -b:a 128k -vf "eq=contrast=1.02:saturation=1.3:gamma=1.4:brightness=-0.1, unsharp" -y "%%~na-x265.mp4"
 
Back
Top