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. |
2nd July 2016, 14:08 | #1 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
Deshaker Comparison
I've been doing some comparison between Deshaker and Mercalli ProDad v4. I wanted to share my results.
First, Deshaker is a VirtualDub plugin and is hard to use. I'm trying to program it within my own software to automate the process but am encountering a few challenges. Mercalli ProDad is a commercial software. It used to integrate within Adobe Premiere but v3 and v4 are stand-alone software. So here are the results, for those interested. Deshaker Pros: - Cleaner image - Better efforts at reconstructing borders and not zooming unecessarily Cons: - Difficult to configure and use - Slow - Some wobble or jello effects Mercalli ProDad Pros: - Much easier to use - Much faster - Wobble and jello effects are still there but weaker Cons: - Image is blurrier - It zooms a lot more - Requires a lossy re-encoding of the file -- not ideal in a video processing chain I am aware that some of the settings can be tweaked in both software to improve the results. Here I have gone mostly with default settings with just minor customization. I would have expected Mercalli ProDad to do a much better job because it analyzes the movements in 3D and is a lot more sophisticated. Overall, Deshaker wins. It will be worth spending more time to program its easy integration within an AviSynth script. However, whenever I use "fill borders with previous or future frames", it fails to render the video. First the video processes, then the output jams on a frame, and after being jammed on the same frame for a while, it aborts the encoding. Will have to investigate. There was a bug in AviSynth+ where it crashed in the destructor and I fixed it. You need this updated VDubFilter.dll. I'll have to keep testing whether the issues I'm seeing are related to AviSynth+ or I'm doing something wrong.
__________________
FrameRateConverter | AvisynthShader | AvsFilterNet | Natural Grounding Player with Yin Media Encoder, 432hz Player, Powerliminals Player and Audio Video Muxer Last edited by MysteryX; 2nd July 2016 at 14:17. |
2nd July 2016, 14:52 | #2 | Link |
Registered User
Join Date: Mar 2015
Posts: 775
|
Interesting subject. When it comes to testing codecs everyone have test patterns and psnr graphs, but all I can find for deshaking is "looks good".
What kind of shakiness are you trying to repair? Supposedly strong part of Mercalli4 is 3d and cmos repair, but it is very slow and actually when I run single test it did not repair anything and created artifacts.
__________________
VirtualDub2 |
2nd July 2016, 16:21 | #3 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
You can't really test a deshaker with test patterns and graphs; unless you take a video of a sheet of paper having those patterns.
I have a 1080p video testimonial recorded from a compact camera. The video is quite noisy and slightly shaky (hand-held); with a part where I'm moving the camera around so it's then very shaky. For the part that is fixed, I find it works best with Deshaker when I only detect rotation and disable "detect zoom" and "detect scene change", but then when I start moving around it causes the image to skip quite a lot so "detect zoom" must be enabled. I just gave Mercalli another try. This time I disabled Smooth Camera Path and reduced "avoid borders" from 40 to 22, and reduced "pan shot smoothing" from 40 to 29. Most importantly, I used the preset "Vibrations/Wobble". Compared to Deshaker, the first pass took quite a bit longer, while the second pass was still fast. Result? The over-zoom was gone. I reduced the settings too much and it is still a bit shaky, but even there, Deshaker's video that is zoomed in more has a clearer picture. - Mercalli loses details - Most of the wobbles are now gone; but there are a few left that are even bigger (or they just stand out more?) - *there is a slight yellow decoloration* The workflow that is working best so far is 1. Convert video from PC colors to TV colors and run Deshaker's first pass from the source 2. Run SMDegrain(prefilter=4) on the source, then convert from PC to TV colors, then run Deshaker's second pass. OR 1. Run SMDegrain(prefilter=4), convert from PC colors to TV colors, and save to AVI 2. Import into Mercalli, re-encode as H264 with highest quality. I tried importing an AVS file into Mercalli. That didn't work. Based on my source video, my goal is to have a video that fixes the slight shaking of the first part without degrading the quality, and that handles the camera movements of the second part nicely without too much wobbles. I think that's a good test video.
__________________
FrameRateConverter | AvisynthShader | AvsFilterNet | Natural Grounding Player with Yin Media Encoder, 432hz Player, Powerliminals Player and Audio Video Muxer Last edited by MysteryX; 2nd July 2016 at 16:30. |
2nd July 2016, 17:10 | #4 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
For Deshaker, I had an idea. To deal with Wobbles, you can go through the clip (without SMDegrain it renders quite fast), see what specific frames have wobbles, and delete those frames from the Log file. In my software I might add an option to enter the list of frames to discard. But then, if the video is zoomed, will it "break the zoom" and completely break the video sequence?
Now I'm testing this script. Second argument is "Pass". You must first run with 2nd argument set to 1 which generates a log file, then run again with it set to 2. Only run SMDegrain on the 2nd pass. Here I'm setting "Fill borders with previous and future frames" and it's working. It's just that when playing in MPC-HC, the first 30 frames are black, but I'm not getting the crash. Code:
LoadVirtualDubPlugin("deshaker.vdf", "deshaker", preroll=0) Trim(0, 500) SMDegrain(prefilter=4, tv_range=false) ConvertToRGB32(matrix="PC709") deshaker("19|2|30|4|1|0|1|0|640|640|1|2|1000|1000|1000|1000|4|1|3|2|8|30|300|4|F:\Job_Deshaker.log|0|0|0|0|0|0|0|0|0|0|0|0|0|1|15|15|5|15|1|1|30|30|0|0|0|0|1|0|0|10|1000|1|88|1|1|20|5000|100|20|1|0")
__________________
FrameRateConverter | AvisynthShader | AvsFilterNet | Natural Grounding Player with Yin Media Encoder, 432hz Player, Powerliminals Player and Audio Video Muxer Last edited by MysteryX; 2nd July 2016 at 17:12. |
2nd July 2016, 17:13 | #5 | Link |
Registered User
Join Date: Feb 2002
Location: California
Posts: 2,695
|
As you may know, I wrote an extensive guide to Deshaker, over ten years ago. I then wrote a series of Vegas and Virtualdub scripts which completely automate the stabilization process so you can batch stabilize individual scripts with Deshaker. Batch stabilization is something you still cannot easily do with Mercalli.
Having established my "creds," let me say that in most cases, Mercalli produces vastly better stabilization. There are exceptions, and I still use Deshaker on some footage, but not often. The one thing that puzzles me is your report that Mercalli is creating footage that is less sharp. That has not been my experience. It makes me think that there is something wrong in your Mercalli workflow. I do not have the latest version, and I use the plugin for Vegas, so I may not be able to duplicate what you are doing. The usual reasons for blurred footage is zooming. Even the smallest amount of zoom can end up softening detail. It sounds like you are using the Deshaker modes that use border fixing and don't zoom. This preserves detail and sharpness. It is important to make sure that every last vestige of zooming is turned off in Mercalli or you will indeed get a softer image. Since Mercalli's border fixing didn't used to be as good as Deshaker, it was often undesireable to completely eliminate zooming because the edges ended up looking too weird. I have heard that V4 has better edge correction. I have been meaning to purchase the SAL version, but haven't gotten around to it yet. So, make sure that you really do have all zooming turned off in Mercalli. Last edited by johnmeyer; 2nd July 2016 at 17:14. Reason: Modified last sentence |
2nd July 2016, 18:04 | #6 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
For Deshaker, I can improve on memory limitations with something like this; but it does bring quite a few limitations that will be a hassle to program around for automatic script generation. But this script works. However, I can't use MT and CPU usage is only 50-60%.
Code:
P="Encoder\" AddAutoloadDir(P, true) MP_Pipeline(""" P="Encoder\" LoadPlugin(P+"LSMASHSource.dll") LoadPlugin(P+"MVTools2.dll") Import(P+"SMDegrain.avsi") LoadPlugin(P+"KNLMeansCL.dll") LoadPlugin(P+"Dither.dll") Import(P+"Dither.avsi") file="F:\NaturalGrounding\Convert\TestimonialAndreas.MOV" LWLibavVideoSource(file, cache=True) Trim(0, 500) SMDegrain(prefilter=4, tv_range=false, lsb=true) ### prefetch: 5, 5 ### ### """) LoadVirtualDubPlugin(P+"deshaker.vdf", "deshaker", preroll=0) ConvertToRGB32(matrix="PC709") deshaker("19|2|30|4|1|0|1|0|640|640|1|2|1000|1000|1000|1000|4|1|3|2|8|30|300|4|F:\Job_Deshaker.log|0|0|0|0|0|0|0|0|0|0|0|0|0|1|15|15|5|15|1|1|30|30|0|0|0|0|1|0|0|10|1000|1|88|1|1|20|5000|100|20|1|0") Original AVI after SMDegrain (which served as the source for Mercalli) Mercalli - no zoom, "Vibrations/Wobble" mode Deshaker In the Mercalli screenshot, the wood loses the sharpness of its grain and there is a yellow decoloration. I have run SMDegrain(prefetch=4) on both. In the case of Mercalli, the first script was exported as AVI.
__________________
FrameRateConverter | AvisynthShader | AvsFilterNet | Natural Grounding Player with Yin Media Encoder, 432hz Player, Powerliminals Player and Audio Video Muxer Last edited by MysteryX; 2nd July 2016 at 18:10. |
2nd July 2016, 18:35 | #7 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,374
|
RE: color discoloration
1) What kind of "AVI" did you export for import into Mercalli ? 2) What export settings are you using ? 3) How are you taking screenshots ? YV12 Colorbars in UT Video 709 imported and exported come out the same in terms of color. So I'm thinking there are some issues with your workflow for mercalli |
2nd July 2016, 18:44 | #8 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
Source video is PC709. I degrain, convert color range PC->TV, and export as Rec709 UT Video AVI using FFMPEG.
From Mercalli, I export with H264(mp4) High Quality. To take screenshots, I open in MPC-HC and "Save Image as PNG" I rendered 2 videos with Mercalli. The first one with Standard preset doesn't have the same decoloration... or perhaps just very lightly. The second one with "Vibrations/Wobble" preset has much stronger decoloration (or coloration?) |
2nd July 2016, 19:27 | #9 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,374
|
Mercalli uses something close to Rec601 when converting RGB<=>YUV , similar to vdub deshaker, when you don't control the conversion. But there is still a slight discoloration when corrected for , so it's not exactly Rec601. You can use prores if you want higher quality . It's unfortunate that they don't allow you to use lossless codecs
|
3rd July 2016, 01:44 | #11 | Link | |||
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
Quote:
But then, Deshaker also definitely has its drawbacks. Is there a way to fix Mercalli's decoloration and loss of quality? The decoloration can easily be fixed afterwards; but the loss of quality I guess it's just the way Mercalli works. Quote:
Features and limitations Quote:
__________________
FrameRateConverter | AvisynthShader | AvsFilterNet | Natural Grounding Player with Yin Media Encoder, 432hz Player, Powerliminals Player and Audio Video Muxer Last edited by MysteryX; 3rd July 2016 at 01:48. |
|||
3rd July 2016, 01:48 | #12 | Link |
Registered User
Join Date: Mar 2012
Location: Texas
Posts: 1,665
|
There's also Deshaker3D.
|
3rd July 2016, 02:08 | #13 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
One of the drawbacks of Deshaker is the need to manually configure the Rolling Shutter value to "God Knows What"; or perhaps this gives a quality advantage over Mercalli doing it automatically?
It appears there has been several other attempts at creating better deshakers: Deshaker3D and Lens Transform Tool. Neither of which support Rolling Shutter Correction. Both of which also use Deshaker's first pass. To process the video in 3D, wouldn't it have to better analyze the movement axis in the first pass instead of only changing the 2nd pass? Deshaker3D also misses many of the features of Deshaker. Has anyone seen good improvements with it still? It seems these are mostly "work in progress" that saw no further development. Mercalli ProDad definitely wins on this aspect. |
3rd July 2016, 02:46 | #14 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
On the same vein of comparing commercial products with free products, here's a comparison of Adobe Premiere CC 2015.1's new Optical Flow with SVP.
SVP Adobe Premiere Optical Flow The clip isn't exactly the same; the SVP clip is zoomed in a little bit more, but it's good enough for a comparison. Optical Flow creates UGLY artifacts. SVP team wins! I'll steal the words of McAfee when he ridiculed the FBI computer engineers: "Some people are born geniuses and these people can't be 'made'. Get a few of my people together and they'll do what hundreds of well-trained computer engineers can't ever do." (he didn't use these exact words but that was the general idea) I'm all for developing products in a sustainable way and creating businesses, and this gives me faith in the Open Source path.
__________________
FrameRateConverter | AvisynthShader | AvsFilterNet | Natural Grounding Player with Yin Media Encoder, 432hz Player, Powerliminals Player and Audio Video Muxer Last edited by MysteryX; 3rd July 2016 at 02:48. |
3rd July 2016, 03:01 | #15 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
When encoding with Deshaker and "Fill borders with previous and future frames", I get this error
Code:
Could not allocate video frame. Out of memory. memory_max = 1073741824, memory_used = 900757717 Request=6220831 In defense of Mercalli, the AviSynth Virtual File System may allow piping directly from AviSynth into Mercalli without first re-encoding.
__________________
FrameRateConverter | AvisynthShader | AvsFilterNet | Natural Grounding Player with Yin Media Encoder, 432hz Player, Powerliminals Player and Audio Video Muxer Last edited by MysteryX; 3rd July 2016 at 03:29. |
3rd July 2016, 03:26 | #16 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,374
|
For the memory issue, is that with avs script and filters, or did you "bake" it to an intermediate? Splitting it out would reduce memory issues
For mercalli (and all stablizers), they can all soften to picture to an extent, even without zoom. x,y subpixel translation or rotations can also soften the picture, dewarping /cmos correction (if the program has it) can also soften the picture. Some of what you're seeing is going to be compression related issues if you're using h264. It's too bad that version doesn't allow lossless export. You can indirectly use avs with anything, using avfs . I've never come across a Windows program that won't accept the "fake" AVI. But some receiving programs require RGB24 or 32 (ie. add ConvertToRGB24 or 32 to the end) , but many will accept as is Other popular options for generic stabilization : ffmpeg has libvidstab, and there is also warp stabilizer in Adobe . There are also other categories of stabilizers, but they are meant for tracking and compositing VFX work, not generic use hand held shots. They usually require more manual input Last edited by poisondeathray; 3rd July 2016 at 03:35. |
3rd July 2016, 03:31 | #17 | Link |
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
I get best results by running in that order
1. SMDegrain 2. Deshake 3. InterFrame (SVP) Perhaps MP_Pipeline is the best option then... with the hassles that will go with it. Or without it, it works fine without "use previous and future frames" on 1080p content. |
3rd July 2016, 08:32 | #18 | Link |
Registered User
Join Date: Mar 2015
Posts: 775
|
Lens Transform Tool is work in very slow progress (too difficult to do part time) and not in generally usable state now.
I worked on improving analysis pass. Deshaker and libvidstab search for 2d motion and therefore they find no solution with any amount of perspective. What I was doing is to instead solve for 3d rotation, and it kindof works.
__________________
VirtualDub2 |
3rd July 2016, 09:58 | #20 | Link | ||
Soul Architect
Join Date: Apr 2014
Posts: 2,559
|
Quote:
Quote:
|
||
Thread Tools | Search this Thread |
Display Modes | |
|
|