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. |
6th June 2019, 21:35 | #1 | Link |
Registered User
Join Date: Nov 2004
Posts: 251
|
Video stabilization (deshake)
Hi
I tried to stabilize my video, however I could not get what I expected. Video source is 3840×2160@29.970, mp4. First I try to use deshaker (v3.1) plugin in virtualdub. Altered setting from default in 1st pass, scale:Full Altered setting from default in 2nd pass, edge compensation:None Because the final video going to be cropped any zoom is not needed. I was not happy with outcome. Second try to use DePanStabilize. Code:
LoadPlugin("C:\My Program Files\MeGui\tools\lsmash\LSMASHSource.dll") LSMASHVideoSource("D:\Camera\deshake-test\VID_20190606_123345.mp4") i = ConvertToYV12() mdata = DePanEstimate(i) DePanStabilize(i, data=mdata) crop(142, 80, -142, -80) LanczosResize(1920,1080) Code:
i = ConvertToYV12() mdata = DePanEstimate(i, range=2, trust=0, dxmax=5, dymax=5, zoommax=1, log="F:\depanlog.log") DePanStabilize(i, data=mdata, dxmax=30, dymax=15, zoommax=1, rotmax=0, inputlog="F:\depanlog.log") crop(142, 80, -142, -80) LanczosResize(1920,1080) Last I did try also came from google search. Code:
i = ConvertToYV12() vectors=MSuper().MAnalyse(isb=false,blksize=8, overlap=0,search=5) globalmotion=MDepan(vectors,pixaspect=1,thSCD1=500) DepanStabilize(data=globalmotion,cutoff=0.5,mirror=15,prev=0,next=0,blur=50,pixaspect=1,subpixel=2,method=1) crop(142, 80, -142, -80) LanczosResize(1920,1080) I created a stack video about each try including one video which only cropped and resized: The original video is available here: VID_20190606_123345 I would like to ask help what should I do to get a correct result? Regards Szabi |
6th June 2019, 22:10 | #2 | Link |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,795
|
Need more info. Which avs version 32/64bit? Latest dll versions?
No problems here with 32bit avs+. But ran into memory issues with prefetch in avs 32bit. (with last script)
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database Last edited by ChaosKing; 6th June 2019 at 22:18. |
6th June 2019, 22:58 | #3 | Link |
Formerly davidh*****
Join Date: Jan 2004
Posts: 2,496
|
Being a wide angle video and having what I think is some moderate-to-strong rolling shutter are probably what's stopping you get a better result. Have you tried enabling the Rolling Shutter setting on Deshaker?
It's either that or there's some other weird processing going on with that video, because there are times when it looks like the clouds are out of sync with the ground. |
7th June 2019, 01:58 | #4 | Link |
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,695
|
I tried with Deshaker 3.0 but couldn't get it to work. I then stabilized it using an old version of Mercalli that is built into Vegas. I didn't play around with the settings much, so I assume that some of the funkiness in the clouds and around the edges of the video could be improved. Also, my Mercalli is almost a decade old and their newer versions are far better. It is expensive, but is probably the best stabilizer out there. You can download the trial and see if it is worth the (considerable) expense to purchase.
Here's a link to the result (which I down res'd to HD just to make it easier to deal with). Stabilized Video |
7th June 2019, 03:51 | #5 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,370
|
As John mentioned by John- newer versions of mercalli are improved. Most notably - they have rolling shutter correction modes.
Here is the result using the default setting for rolling shutter - vibrations/wobble (also downscaled to 1080p). You can play with the settings and probably get slightly better results. Or adjust more smoothness (but more zoom) Free , open source software is still lacking in terms of RS correction . Deshaker has partial RS correction, but not generally not as good in those scenarios as mercalli or warp stabilizer https://www.mediafire.com/file/o3ick...obble.mp4/file |
7th June 2019, 08:21 | #7 | Link | ||||
Registered User
Join Date: Nov 2004
Posts: 251
|
Quote:
In this case it did not worked neighter with ffms nor with lsmash (index was done my megui). Installed AviSynth+. Now ffms still crash however lsmash worked expect the last one. Presently 9 different Avisynth exist? Really? For me it is really confusing and it even worse by complicating x86 or 64bit. Quote:
I did try rolling shutter set on deshaker, it gives a slightly better result. Quote:
Quote:
I stacked it to the new comparison video: As conclusion there is no free software wich could provide better result what I achieved by Deshaker and DePanStabilize until now and there is no better settings for DePanStabilize neighter. Thanks for your help. Regards Szabi |
||||
7th June 2019, 08:31 | #8 | Link |
Registered User
Join Date: Nov 2004
Posts: 251
|
Modifiy it to the following also has crash result:
Code:
ConvertToYV12() vectors=MSuper().MAnalyse(isb=false,blksize=8, overlap=0,search=5) globalmotion=MDepan(vectors,pixaspect=1,thSCD1=500) DepanStabilize(data=globalmotion,cutoff=0.5,mirror=15,prev=0,next=0,blur=50,pixaspect=1,subpixel=2,method=1) crop(142, 80, -142, -80) LanczosResize(1920,1080) It would be nice to try 64bit ffms or lsmash indexing but there is no tool to do so. |
7th June 2019, 08:50 | #9 | Link | |
Registered User
Join Date: Dec 2005
Location: Germany
Posts: 1,795
|
Quote:
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth VapourSynth Portable FATPACK || VapourSynth Database |
|
7th June 2019, 09:30 | #10 | Link | |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
From Here:- https://forum.doom9.org/showthread.p...57#post1876357
Quote:
Guess I forgot to remove from directory before zipping up. Zip size 31MB, unzip about 113MB(ffms dll's are quite big. The included script will try AVIsource if AVI file, then LSMash ISO source if ISO file, then FFMS if still not opened ok, then lastly LSMash non ISO source filter. Requires RT_Stats which is included in zip. EDIT: Think all source dlls are 10 bit capable. EDIT: Here script. Can extract function only to eg GetSeq.avsi in plugins and then just use GetSeq(FileName) to load clip. As it stands, does not use any fancy LSmash or Ffms2 args. GetSeq.avsi Code:
Function GetSeq(String vFn,String "aFn") { Function IsISOFileName(String s) {s=RT_GetFileExtension(s) Return(s==".mov"||s==".mp4"||s==".m4v"||s==".3gp"||s==".3g2"||s==".mj2"||s==".dvb"||s==".dcf"||s==".m21")} Function IsRiffFileName(String s) {s=RT_GetFileExtension(s) Return(s==".avi"||s==".wav")} myName="GetSeq: " aFn = Default(aFn,"") aFn = (aFn=="") ? vFn : aFn Assert(vFn!="",RT_String("%sVFn Cannot be ''",myName)) vFn = vFn.RT_GetFullPathName IsRiffV = vFn.IsRiffFileName IsIsoV = vFn.IsISOFileName Assert(aFn!="",RT_String("%saFn Cannot be ''",myName)) aFn = aFn.RT_GetFullPathName IsRiffA = aFn.IsRiffFileName IsIsoA = aFn.IsISOFileName c=0 a=0 Try { # 1st Try specialized AVI c = (IsRiffV) ? vFn.AviSource : NOP (c.IsClip) ? RT_DebugF("AviSource opened Video\n '%s'",vFn,name=myName) : NOP } catch (msg) { RT_DebugF("Catch: %s",msg,name=myName) } Try { a = (c.IsClip && c.HasAudio && aFn==vFn) ? c : (IsRiffA) ? aFn.WavSource : NOP (a.IsClip && a.HasAudio) ? RT_DebugF("%s opened Audio\n '%s'",(c.IsClip && c.HasAudio && aFn==vFn)?"AviSource":"WavSource",aFn,name=myName) : NOP } catch (msg) { RT_DebugF("Catch: %s",msg,name=myName) } # Next try specialized ISO LSMash Try { IsOpenV=(c.IsClip && c.HasVideo) c = (IsIsoV) ? LSMASHVideoSource(vFn) : c (IsIsoV) ? RT_DebugF("LSMASHVideoSource opened Video\n '%s'",vFn,name=myName) : NOP } catch (msg) { RT_DebugF("Catch: %s",msg,name=myName) } Try { IsOpenA=(a.IsClip && a.HasAudio) a = (IsIsoA) ? LSMASHAudioSource(aFn) : a (IsIsoA) ? RT_DebugF("LSMASHAudioSource opened Audio\n '%s'",aFn,name=myName) : NOP } catch (msg) { RT_DebugF("Catch: %s",msg,name=myName) } # Next try FFMS2 Try { IsOpenV=(c.IsClip && c.HasVideo) (!IsOpenV) ? FFIndex(vFn) : NOP c=(!IsOpenV) ? FFVideoSource(vFn) : c (!IsOpenV) ? RT_DebugF("FFVideoSource opened Video\n '%s'",vFn,name=myName) : NOP } catch (msg) { RT_DebugF("Catch: %s",msg,name=myName) } Try { IsOpenA=(a.IsClip && a.HasAudio) a=(!IsOpenA) ? FFAudioSource(aFn) : a (!IsOpenA) ? RT_DebugF("FFAudioSource opened Audio\n '%s'",aFn,name=myName) : NOP } catch (msg) { RT_DebugF("Catch: %s",msg,name=myName) } # Next try LSmash non ISO Video Try { IsOpenV=(c.IsClip && c.HasVideo) c = (!IsOpenV && !IsIsoV) ? LWLibavVideoSource(vFn) : c (!IsOpenV && !IsIsoV) ? RT_DebugF("LWLibavVideoSource opened Video\n '%s'",vFn,name=myName) : NOP } catch (msg) { RT_DebugF("Catch: %s",msg,name=myName) } Try { IsOpenA=(a.IsClip && a.HasAudio) a = (!IsOpenA && !IsIsoA) ? LWLibavAudioSource(aFn) : a (!IsOpenA && !IsIsoA) ? RT_DebugF("LWLibavAudioSource opened Audio\n '%s'",aFn,name=myName) : NOP } catch (msg) { RT_DebugF("Catch: %s",msg,name=myName) } Assert(c.IsClip, RT_String("%s failed open on\n '%s'",myName,vFn)) (!c.HasAudio && a.IsClip && a.HasAudio) ? AudioDubEx(c,a) : c (!HasAudio) ? RT_DebugF("Audio failed Open on\n '%s",aFn,name=myName) : NOP return Last } Code:
FN=".\heima_720p_500.mp4" #FN="10Bit_Standard8_Scan_16FPS.avi" GetSeq(FN) Info Return last
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 7th June 2019 at 09:50. |
|
7th June 2019, 14:14 | #11 | Link | |
Registered User
Join Date: Nov 2004
Posts: 251
|
Quote:
When analyzing the 2nd step (Correct CMOS distortions) always crash. Failure message : "Analyzing or creating the shadow-video has failed" Nothing comes easy. EDIT: Exporting the video by Lagarith Lossless Codec with resizing to 1920x1080 helped to feed it with Mercalli. Seems 4k/mp4 video not welcomed or my PC has not enough power. Last edited by szabi; 7th June 2019 at 14:29. |
|
7th June 2019, 17:50 | #12 | Link | |
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,695
|
Quote:
One trick you could use would be to create a temporary video that is identical to the original, but down-res'd to 1920x1080, or even lower. Run that through the Deshaker first pass. Then, open the original file, load the LOG file created in the first pass, and see if Deshaker will process the original file using the motion vectors created on the lower-res version in the first pass. |
|
9th June 2019, 06:33 | #13 | Link |
Registered User
Join Date: Nov 2004
Posts: 251
|
Hi
I cropped the video by virtualdub to 3556x2000 and saved to avi through Lagarith Lossless Codec and did cut 1 minutes segments. After the Mercalli did eat them. It was so long time ago when I could not use script rather than working lossless. Thanks for help. Regards szabi Last edited by szabi; 9th June 2019 at 06:43. |
Tags |
avisynth, depanstabilize, deshake, stabilize, virtualdub |
Thread Tools | Search this Thread |
Display Modes | |
|
|