Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 19th March 2012, 13:01   #1  |  Link
dar1us
Registered User
 
dar1us's Avatar
 
Join Date: Apr 2002
Location: Europe/Oceana
Posts: 332
Deshaking aircraft cockpit videos

Long time, no post... So excuse me if this isn't an appropriate forum for this.

I am a professional pilot and I am going through some videos from my training that were filmed in cockpit with digital video cameras lacking optical image stabilization. The problem with small piston aircraft (not jet) is they vibrate A LOT when the engine is running, and also from turbulence, ground roll (especially on grass) and the inevitable 'positive landings'.

I am trying to clean up some of my training videos. They are not unwatchable without any deshaking, but it would make them seem much smarter if the vibration was dealt with.

Does anyone have any suggestions, I was using Gunnar Thalins 'Deshaker 1.8' for VirtualDub and I am aware there is a Avisynth version. It does a fairly good job, not perfect but it helps a lot. My biggest problem with it is the zooming in and out it does. It settles down when I am flying as the motion is fairly steady and I am staying in one place in the cockpit but if there are any large movements (like pre-flight checks even with the engine off) the filter zooms in and out annoyingly. There doesn't seem to be anyway to disable the zoom function in the VirtualDub plugin, can this be done in the Avisynth version or does anyone have any suggestions for alternatives - Avisynth or not - that may help to clean up my video?

Last edited by dar1us; 19th March 2012 at 13:15.
dar1us is offline   Reply With Quote
Old 19th March 2012, 13:35   #2  |  Link
yup
Registered User
 
Join Date: Feb 2003
Location: Russia, Moscow
Posts: 854
Hi dar1us!

Recently i try deshake video shooting from moving car.
My roadmap QTGMC for deinterlacing and Mercalli pro dad for deshaking.
First I try deshake (interlaced video) and after deinterlace and result will be shake (I try also Gunar Deshaker at this step).
Mercalli not free, but have a lot of setting.
yup.
yup is offline   Reply With Quote
Old 19th March 2012, 14:16   #3  |  Link
pbristow
Registered User
 
pbristow's Avatar
 
Join Date: Jun 2009
Location: UK
Posts: 262
Quote:
Originally Posted by dar1us View Post
Does anyone have any suggestions, I was using Gunnar Thalins 'Deshaker 1.8' for VirtualDub and I am aware there is a Avisynth version. It does a fairly good job, not perfect but it helps a lot. My biggest problem with it is the zooming in and out it does.
That's a very old version of Deshaker! I've got version 3.0, and it has a setting where you can limit the range of zoom, or turn it off completely (set it to zero). This is on the "Pass 2" panel (right hand side), under "Max correction limits".


Downloadable from here: http://www.guthspot.se/video/deshaker.htm

Useful comparison video:
pbristow is offline   Reply With Quote
Old 19th March 2012, 17:45   #4  |  Link
2Bdecided
Registered User
 
Join Date: Dec 2002
Location: Yorkshire, UK
Posts: 1,673
VirtualDub Deshaker performed miracles on a video I shot on a roller coaster with a point-and-shoot camera (no image stabilisation).

As pbristow said, download the latest version, and read the guide...
http://www.guthspot.se/video/deshaker.htm
...and read the guide again. Did I mention that you should read the guide?

Cheers,
David.
2Bdecided is offline   Reply With Quote
Old 19th March 2012, 17:53   #5  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,038
If you Google my name ("John Meyer") and "Deshaker" you'll see that I've written a lot about how to get good results with this particular utility (I also wrote some extensive scripts for Vegas and VirtualDub to automate using Deshaker inside of Vegas).

I've used many of the commercial programs as well.

I've stabilized a lot of footage taken from small airplanes (my old man was a pilot, and I took a lot of video from his 310). I've also stabilized a lot of modern video that others have taken from various aerial platforms (including helicopters).

So, I have a little experience, and based on that experience, you have several issues to deal with.

First, if this is older video (taken with analog or early generation CCD digital camera), then your biggest problem will be the blur caused by camera movement. Unless you used a high shutter speed (at least 1/125, but preferably 1/500 or faster) you will find that the stabilized footage will seem to "pop" in and out of focus. This is due to the movement of the camera as the plane hits an air pocket. You don't notice this when the camera moves because your brain expects fast-moving video to be blurred. However, once the motion is removed, you are left with a frame that is blurred, whereas the adjacent frames are not. The blurring is due to the fact that normal shutter speeds are 1/60 for NTSC and 1/50 for PAL and this is too slow to prevent blur due to camera motion.

There is absolutely nothing you can do about this. You simply have to decide whether the blur is less objectionable than the motion. If you haven't yet shot the video, then you should always use a high shutter speed when doing aerial video.

If the video is taken with a fairly modern video camera that uses a CMOS shutter, you may also have to grapple with the horrors of CMOS "rolling shutter" artifacts. Here is an example of what can happen from the vibration from a vehicle powered by a gasoline engine. In this case it is a motorcycle engine, but the same thing may happen with video taken using a CMOS camera in a piston aircraft:

CMOS Vs CCD Rolling Shutter Effect + Jello Effect Kawasaki ZX-11

In addition to the "jello" artifacts shown here, you can also get skew (where buildings appear to tilt sideways as the camera pans horizontally). The extent of these artifacts differs widely between different camera models.

Some of this awful stuff can be reduced by using the "rolling shutter" reduction available in some motion stabilization software. In my experience, the Deshaker rolling shutter compensation is only marginally effective. By contrast, the Mercalli 2.0 rolling shutter reduction works much better. I highly recommend that you download and try out Mercalli if you have rolling shutter issues.

Finally, since this is an AVISynth forum, you certainly should try Depan. I use this all the time to provide small corrections to my 8mm/16mm film captures. It works extremely well for removing gate weave and minor camera movements, but is not well suited for larger corrections. To my knowledge (and I may be wrong about this), I don't think it provides any facility for correcting rolling shutter artifacts.

Last edited by johnmeyer; 19th March 2012 at 17:55. Reason: Added "always use a high shutter speed ..."
johnmeyer is online now   Reply With Quote
Old 2nd August 2012, 08:03   #6  |  Link
fvisagie
Registered User
 
Join Date: Aug 2008
Location: Isle of Man
Posts: 586
Quote:
Originally Posted by johnmeyer View Post
...the horrors of CMOS "rolling shutter" artifacts. Here is an example ...:

CMOS Vs CCD Rolling Shutter Effect + Jello Effect Kawasaki ZX-11
Hi John,

I suspect this is what some of my car cam videos suffer from, but YouTube marks this video as private, even when I log in. If not too much to ask, could you change that, please?

Thanks,
Francois
fvisagie is offline   Reply With Quote
Old 2nd August 2012, 16:39   #7  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,038
Quote:
Originally Posted by fvisagie View Post
I suspect this is what some of my car cam videos suffer from, but YouTube marks this video as private, even when I log in. If not too much to ask, could you change that, please?
I wish I could, but it is not my video. Whoever owns the video made it private.
johnmeyer is online now   Reply With Quote
Old 3rd August 2012, 07:35   #8  |  Link
fvisagie
Registered User
 
Join Date: Aug 2008
Location: Isle of Man
Posts: 586
Thanks for confirming.
fvisagie is offline   Reply With Quote
Old 30th September 2012, 10:36   #9  |  Link
martin53
Registered User
 
Join Date: Mar 2007
Posts: 405
John,

Quote:
Originally Posted by johnmeyer View Post
... your biggest problem will be the blur caused by camera movement ... There is absolutely nothing you can do about this.
Over the last three months, I put together a runtime filter FSubstitute() that measures how blurred each frame is, and can substitute it by a previous/future frame with 2 MVTools filters (MInterpolate & MCompensate), or a quadrilateral-transformed copy (called Freeze in my words).

It was intended against exacly the issue you describe, although I did not need an aircraft to produce it taking a shot while walking was sufficient.

My intention is to publish that script in the wiki, but I am shy if its actual state is good enough for the public. Are you interested in testing it? Be warned. It is slow (approx. 1 fps with 640x480 on my core i5) and needs some ingredients like GRunt, GScript, MaskTools, RT_Stats, quad (thanks to the authors).

I could say a lot more about how to deal with buildings (Freeze is better - less jello risk) vs. people or animals (MCompensate is better, can substitute moving persons/arms/legs). Freeze by more than two frames is risky because it can invert the original monotonic frame order, and make the clip look stuttering.

EDIT: updated filter script
Attached Files
File Type: zip Comparison-187.zip (100.2 KB, 36 views)
File Type: txt FSubstitute_121002.txt (24.2 KB, 20 views)

Last edited by martin53; 2nd October 2012 at 18:31. Reason: Filter script updated
martin53 is offline   Reply With Quote
Old 30th September 2012, 10:44   #10  |  Link
martin53
Registered User
 
Join Date: Mar 2007
Posts: 405
Dar1us,

Quote:
Originally Posted by dar1us View Post
I was using Gunnar Thalins 'Deshaker 1.8' for VirtualDub
you might want to test the Deshaker helper functions, especially the motion estimation improvement. See these posts.
I never allow zoom, it always looked awful.
martin53 is offline   Reply With Quote
Old 30th September 2012, 12:23   #11  |  Link
smok3
brontosaurusrex
 
smok3's Avatar
 
Join Date: Oct 2001
Posts: 2,390
Quote:
Over the last three months, I put together a runtime filter FSubstitute() that measures how blurred each frame is, and can substitute it by a previous/future frame with 2 MVTools filters (MInterpolate & MCompensate), or a quadrilateral-transformed copy (called Freeze in my words).
sounds very cool, its about time to install windows somewhere...
__________________
certain other member
smok3 is offline   Reply With Quote
Old 30th September 2012, 16:55   #12  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,038
Of all the things you have done (and from your posts in several threads, it is clear that you have been busy), the automatic detection of the blurred frames is the most interesting. I'll be interested to see how that is accomplished.

As for testing, I have some old, low-res footage (i.e., VHS video) that I took from a plane flying at a few hundred feet in a circle around a target on a mountain ridge, and it is full of bumps from the thermals. The bad frames are definitely quite blurred.

Finally, FWIW, here is what I was able to do with a similar program where I transferred motion picture film that was taken with a defective camera. This camera had a defective gear and did not advance the film all the way, but only sometimes, resulting in a "jump" every several frames. I couldn't figure out an accurately detection algorithm, so I manually marked each frame, and then used a script that took those marks and replaced the bad frames with a motion-estimated version, using the adjacent frames:

http://www.youtube.com/watch?v=uzMFo...ECA2CB&index=2

And yes, I'd be interested in testing whatever you have developed.

Last edited by johnmeyer; 30th September 2012 at 16:56. Reason: spelling error I didn't catch
johnmeyer is online now   Reply With Quote
Old 2nd October 2012, 18:41   #13  |  Link
martin53
Registered User
 
Join Date: Mar 2007
Posts: 405
John,
I downloaded your movie and tested with this script:

Code:
<your source filter here, I converted flv->avi with XMediaRecode>
crop(20,0,-326,0)
FSubstitute(5,quad=false)
where mode 5 is in today's updated filter. It allows only freeze, no compensate or interpolate - since there is no motion in the clip, and a difference of '300' between original and substituted frame.
FSubstitute found all bad frames and exchanged them. Because the bad frames also 'jump' downwards, FSubstitute also replaces them below their original position. Maybe a setting that prevents Y correction would make sense, because this is a typical damage.
martin53 is offline   Reply With Quote
Old 9th October 2012, 01:20   #14  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,038
I look forward to trying your filter when you release it.
johnmeyer is online now   Reply With Quote
Old 11th November 2012, 17:38   #15  |  Link
martin53
Registered User
 
Join Date: Mar 2007
Posts: 405
Though I still did not finish everything for a full release, I posted it in the forum in a new thread. I think it is worth being tested now.

EDIT 11/22/2012
John,
your example above is now decently repaired with frame freeze or interpolation by your choice with the script. See mentioned thread.

Last edited by martin53; 23rd November 2012 at 22:41.
martin53 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 00:49.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.