Incomplete removal of borders when using Magix stabilization module

abolibibelot wrote on 12/26/2018, 2:12 PM

I'm using Magix Video Deluxe 2016 Premium (I believe it's also known as Movie Edit Pro).

When I apply the Magix stabilization effect, and check the “eliminate black borders” box, the result seems fine in preview (even at 100%), but when exporting the stabilized footage I can see remnants of black borders “dancing” around the picture; they're tiny – 1 pixel in width – but flicker constantly, so it's definitely disturbing. I have tried many combinations of parameters, to no avail. I have also tried, as a workaround, to unckeck the “eliminate borders” box, and then manually zoom in with the “Extract” effect (not sure of the name in english, it's called “Extrait” in french), but the stupid thing applies the zoom *before* the stabilization, which of course is completely useless...

I have also tried the Mercalli v2 plugin several times, but could never get a satisfying result. Apparently Mercalli v4 should be included with this version, but it's nowhere to be found.

 

Comments

johnebaker wrote on 12/26/2018, 3:55 PM

@abolibibelot

Hi

Assuming you are doing the analysis and zoom adjustment in Mercalli then I suspect you are doing these out of order, if you are using the Size & Position, Zoom effect then this is not necessary.

The correct way to adjust the zoom is a shown below:

HTH

John EB

 

VPX 16, Movie Studio 2025, and earlier versions 2015 and 2016, Music Maker Premium 2024.

PC - running Windows 11 23H2 Professional on Intel i7-8700K 3.2 GHz, 16GB RAM, RTX 2060 6GB 192-bit GDDR6, 1 x 1Tb Sabrent NVME SSD (OS and programs), 2 x 4TB (Data) internal HDD + 1TB internal SSD (Work disc), + 6 ext backup HDDs.

Laptop - Lenovo Legion 5i Phantom - running Windows 11 24H2 on Intel Core i7-10750H, 16GB DDR4-SDRAM, 512GB SSD, 43.9 cm screen Full HD 1920 x 1080, Intel UHD 630 iGPU and NVIDIA GeForce RTX 2060 (6GB GDDR6)

Sony FDR-AX53e Video camera, DJI Osmo Action 3 and Sony HDR-AS30V Sports cams.

abolibibelot2 wrote on 12/26/2018, 6:18 PM

Again, I had to create another account, can no longer access the first one, password refused...

Thanks for this quick reply, but please pay attention to what I wrote. In the first part, I said “Magix stabilization effect”, not “Mercalli”; then I briefly mentioned Mercalli, to say that I never achieved a satisfying result with this third-party module. The Magix stabilizer performs usually well, but I get these thin flickering borders. I tried various values for the maximum shift, from 1 to 10, still I get the same effect.

Also I don't quite understand how it's calculated. Normally, for a 1280x720 frame, a value of 2% should magnify to 1306x734, then cut to 1280x720, yet with this value, if I check what's displayed in the “Position/size” menu, I get a magnification of 1332x750 – actually, it fluctuates between 1332 and 1333 for the width and between 749 and 750 for the heigth, which may be part of the explanation for the flickering 1 pixel border. And it won't accept decimal values : I wanted to use 2.5, which should result in an integer calculation, magnifying to 1312x738, but it's not accepted, it's truncated to 2.

johnebaker wrote on 12/26/2018, 7:28 PM

@abolibibelot2

Hi

. . . . The Magix stabilizer performs usually well, but I get these thin flickering borders. I tried various values for the maximum shift, from 1 to 10, still I get the same effect. . . . .

Does the source video suffer from rotational instability? If so then the Magix stabilizer will not correct for this, it only fixes X and Y axis motion

The Mercalli stabilisers, both v2 and v4 perform much better - they fix rotational motion as well as being much more adjustable.

IIRC Mercalli v4 was an add on for Movie Edit Pro 2016 that had to be purchased.

John EB

VPX 16, Movie Studio 2025, and earlier versions 2015 and 2016, Music Maker Premium 2024.

PC - running Windows 11 23H2 Professional on Intel i7-8700K 3.2 GHz, 16GB RAM, RTX 2060 6GB 192-bit GDDR6, 1 x 1Tb Sabrent NVME SSD (OS and programs), 2 x 4TB (Data) internal HDD + 1TB internal SSD (Work disc), + 6 ext backup HDDs.

Laptop - Lenovo Legion 5i Phantom - running Windows 11 24H2 on Intel Core i7-10750H, 16GB DDR4-SDRAM, 512GB SSD, 43.9 cm screen Full HD 1920 x 1080, Intel UHD 630 iGPU and NVIDIA GeForce RTX 2060 (6GB GDDR6)

Sony FDR-AX53e Video camera, DJI Osmo Action 3 and Sony HDR-AS30V Sports cams.

abolibibelot2 wrote on 12/26/2018, 8:16 PM

I had to change my password because the first one apparently got refused twice with two different e-mail adresses... the only explanation is that it contained the character “€”, yet it was specifically required to use a damn “special character”, and both times it was validated during registration ! Another thing to pi$$ me off today...

Back to the subject : I do not want to correct the small rotational instability, and it is not the issue here. Those are entire rows of one pixel width, on either side of the frame, which should be removed when using the “eliminate black borders” option, and which are not. For some videos I don't have that effect but I couldn't identify a pattern so far. I've had many issues with Lagarith files, perhaps this could be the cause, I'd have to do a gazillion more tests to be sure, but I really want to get it over with, this video was intended as a Christmas gift, obviously it's too late for that, but with the amount of totally unexpected issues I get at every single step I'm not even sure it will be completed for Christmas next year.

And in my experience, Mercalli v2 sucks. I can not obtain what I want, which is to correct a high frequency jerkiness caused by a malfunction of the camera's optical stabilizer, and smooth the regular camera movements just a tad, not make it unnaturally steady. By default Mercalli adds way too much zoom, tries to correct the rotation which is highly detrimental to the quality of the picture, and once I remove everything that's unwanted it leaves me with no stabilization at all. The alternative would be to use Deshaker, a highly regarded free stabilization plugin for VirtualDub, but that means exporting yet another bunch of huge lossless intermediates, when I'm already short in storage space...

abolibibelot2 wrote on 12/27/2018, 7:16 PM

Scenestealer (from the other thread)

I think we should continue the discussion about stabilisation in your other post. My apologies for mentioning it in this one but it was meant to be a passing comment possibly relevant,in relation to my mention of the unpatched version you are running.

Alright ! :^p I'm a big believer in the “if it's not broken don't fix it” motto... But when something is indeed broken, how am I supposed to know that there's a patch out there which could (or not) fix the issue ? Where can I find those patches ?

If the videos you are working with are not confidential, can you upload a section of the original video (about 20 - 30 secs long), that has the jerkiness problem, for us test.

Please upload to a file sharing site such Dropbox - not  Youtube/Vimeo etc or the forum as they will convert the video.

Lagarith files are very large, I have a rather slow DSL upload speed, so I had to cut a very small segment, only 5sec. long (cut with VirtualDub2 in “fast recompress” mode, so no processing at all).

https://uptobox.com/k086sjqgsfie

Here is a longer segment of the movie once exported from Magix Video Deluxe, as Lagarith as well, then compressed with ffmpeg / x264, showing the issue with those thin flickering borders :

https://uptobox.com/cs4hv60u3ite

And here are two other test exports, showing other kinds of random issues with Lagarith source files :

https://uptobox.com/zes5lrn6th7t

https://uptobox.com/50l4mfj1hjdm

 

johnebaker wrote on 12/28/2018, 4:02 AM

@abolibibelot2

Hi

. . . . in my experience, Mercalli v2 sucks. I can not obtain what I want, which is to correct a high frequency jerkiness . . .

Thanks for the video clips - I installed the Lagarith codec and tested the stabilisation with Mercalli v2 - I had to use MEP 2019 as my 2016 installation only has Mercalli v4 - and this is the before and after result of a default settings analysis, as seen in MEP.

Demo video removed at abolibibelot's request

AFAICS the exports as AVI Lagarith, AVI standard and MP4 h.264 using MEP 2019 were all rock steady and no black borders.

I also tested Mercalli v4 stabilisation in MEP 2016 and again the exports did not show any issues with black borders.

I should have asked earlier is what is requiring you to work with Lagarith/uncompressed video / Virtual Dub etc?

You still have not told us what the video format is ex camera?

Where did you get the Lagarith codec from - was it in an all in one codec pack eg K-Lite etc?

HTH

John EB

 

Last changed by johnebaker on 12/28/2018, 7:04 AM, changed a total of 3 times.

VPX 16, Movie Studio 2025, and earlier versions 2015 and 2016, Music Maker Premium 2024.

PC - running Windows 11 23H2 Professional on Intel i7-8700K 3.2 GHz, 16GB RAM, RTX 2060 6GB 192-bit GDDR6, 1 x 1Tb Sabrent NVME SSD (OS and programs), 2 x 4TB (Data) internal HDD + 1TB internal SSD (Work disc), + 6 ext backup HDDs.

Laptop - Lenovo Legion 5i Phantom - running Windows 11 24H2 on Intel Core i7-10750H, 16GB DDR4-SDRAM, 512GB SSD, 43.9 cm screen Full HD 1920 x 1080, Intel UHD 630 iGPU and NVIDIA GeForce RTX 2060 (6GB GDDR6)

Sony FDR-AX53e Video camera, DJI Osmo Action 3 and Sony HDR-AS30V Sports cams.

abolibibelot2 wrote on 12/28/2018, 5:04 AM

Thanks for the video clips - I installed the Lagarith codec and tested the stabilisation with Mercalli v2 - I had to use MEP 2019 as my 2016 installation only has Mercalli v4 - and this is the before and after result of a default settings analysis, as seen in MEP.

I was pissed and therefore a bit excessive – Mercalli v2 usually works well, but I don't like how it operates as a “black box”, with for instance no possibility of defining the area of analysis (which changes the result a great deal in Magix stabilizer), and no possibility of adjusting parameters afterwards. When it fails (for instance there's a sequence I tested it with, where it added two lateral bumps which weren't even there in the original footage), nothing can be done, re-applying it will produce the same outcome, at least with the Magix stabilizer there's some margin for adjustment / fine-tuning. In my tests, Magix stabilizer generally fared better, at the same level of zoom-in. (In Magix stabilizer I set the max shift value to 2% only, that should be enough to correct what needs to be corrected; by default Mercalli zooms in way too much for my taste, if the sequence analyzed contains normal camera panning, the sample I provided is not representative – by the way, I would prefer that you remove the demonstration video, not that it's ultra confidential – just my brother putting on a suit jacket over his pyjamas – but I wouldn't want this to be there 5 years from now...)

I do not have those thin black borders with Mercalli, only with Magix stabilizer.

I should have asked earlier is what is requiring you to work with Lagarith/uncompressed video / Virtual Dub etc?

Not that it's relevant to the question but here we go again... (I already explained this in the other thread.) The camera had a malfunction affecting the optical stabilizer, which provoked a frequent spontaneous vertical jerkiness (mostly vertical, there are some instances of horizontal bumps too in the worst parts), meaning, a steady up-and-down shaking of the frame, while I was holding the camera normally (I don't have Parkinson's disease). For the footage shot indoor (= low shutter speed), it caused many frames to be blurred because of the shaking, even after stabilizing it looked awful. So I had to pre-process the affected sequences, about half an hour, with Avisynth interpolation filters, namely FrameSurgeon and Morph, manually parsing about 50.000 frames to salvage the precious footage, and generate more than 4000 frame interpolation commands (with the help of a tool named Sawbones, from the author of FrameSurgeon). And to avoid losing any quality after this harrowing work, I exported the processed files in a lossless format, Lagarith being among the most efficient in terms of compression ratio. I also tried MagicYUV, UtVideo, HuffYUV, to no avail : with each one of those formats I had weird issues.

You still have not told us what the video format is ex camera?

That's also irrelevant, because I don't have issues with the few remaining files which do not need any pre-processing, but they were originally in M2TS / AVCHD, from a Panasonic ZS7 camera.

Where did you get the Lagarith codec from - was it in an all in one codec pack eg K-Lite etc?

I installed Lagarith with the Lagarith installer. I also have CCCP, which is a package based on LAV filters. I did many tests, enabling or disabling Lagarith in LAV video settings, enabling or disabling AVI in LAV splitter, changing the “Hardware acceleration” option... Inside Magix Video Deluxe I tried changing the video mode, disabling some import modules like “AVI import module”, “Internal AVI import”, “Internal DirectShow AVI import”... Some of these things seemed to fix part of the issue, but then it came back, it's totally unpredictable.

As I said in the other thread, my system is based on :

Intel i6700K CPU, Asus Maximus Hero VIII, 16GB RAM, no dedicated graphic card

 

Scenestealer wrote on 12/28/2018, 5:26 AM

@abolibibelot2

But when something is indeed broken, how am I supposed to know that there's a patch out there which could (or not) fix the issue ? Where can I find those patches ?

The program should show you a prompt to update if there is one available, when you open the program. If not go to the top menu>Help>Update on line.

And in my experience, Mercalli v2 sucks. I can not obtain what I want, which is to correct a high frequency jerkiness caused by a malfunction of the camera's optical stabilizer, and smooth the regular camera movements just a tad, not make it unnaturally steady.

If it is too steady after analysis has run, just move the zoom slider to the left and this will reduce the zoom and subsequent correction amount.

By default Mercalli adds way too much zoom, tries to correct the rotation...

As above, and if you don't want the rotation corrected just uncheck tilt option or move the z axis slider to the left. Actually the Glide camera Stabi cam option default retains a little motion to make walking shots look more natural.

V4 works better in terms of keeping zoom and degradation to a minimum with a slider that controls the zoom amount dynamically, so it "on the fly" zooms by an amount needed by the worst frames and reduces the zoom on sections that do not need as much stabilising.

V4 did come with MEP2016 premium and installed with it's own serial that should have come with your purchase (from Magix?).

Peter

 

 

System Specs: Intel 6th Gen i7 6700K 4Ghz O.C.4.6GHz, Asus Z170 Pro Gaming MoBo, 16GB DDR4 2133Mhz RAM, Samsung 850 EVO 512GB SSD system disc WD Black 4TB HDD Video Storage, Nvidia GTX1060 OC 6GB, Win10 Pro 2004, MEP2016, 2022 (V21.0.1.92) Premium and prior, VPX7, VPX12 (V18.0.1.85). Microsoft Surface Pro3 i5 4300U 1.9GHz Max 2.6Ghz, HDGraphics 4400, 4GB Ram 128GB SSD + 64GB Strontium Micro SD card, Win 10Pro 2004, MEP2015 Premium.

johnebaker wrote on 12/28/2018, 7:05 AM

@abolibibelot2

Hi

. . . I would prefer that you remove the demonstration video, . . .

No problem - done.

John EB

VPX 16, Movie Studio 2025, and earlier versions 2015 and 2016, Music Maker Premium 2024.

PC - running Windows 11 23H2 Professional on Intel i7-8700K 3.2 GHz, 16GB RAM, RTX 2060 6GB 192-bit GDDR6, 1 x 1Tb Sabrent NVME SSD (OS and programs), 2 x 4TB (Data) internal HDD + 1TB internal SSD (Work disc), + 6 ext backup HDDs.

Laptop - Lenovo Legion 5i Phantom - running Windows 11 24H2 on Intel Core i7-10750H, 16GB DDR4-SDRAM, 512GB SSD, 43.9 cm screen Full HD 1920 x 1080, Intel UHD 630 iGPU and NVIDIA GeForce RTX 2060 (6GB GDDR6)

Sony FDR-AX53e Video camera, DJI Osmo Action 3 and Sony HDR-AS30V Sports cams.

abolibibelot2 wrote on 12/28/2018, 4:22 PM

If it is too steady after analysis has run, just move the zoom slider to the left and this will reduce the zoom and subsequent correction amount.

I did try that, but then, at the same zoom level as Magix stabilizer, the latter performed better and with more consistency; when it fails, I can usually understand why, and try something else to improve the result, or, if there's only a small glitch affecting a few frames, correct it manually by editing the curves, or remove one of the curves entirely (for instance the horizontal stabilization curve if the shakiness is mostly vertical and objects are moving horizontally). Bottom line is, I did quite a few tests with Mercalli v2, and the results were not to my liking. I'll try Mercalli v4 if I can grab it (I got MVD second-hand and there was no specific serial number for Mercalli that I recall, could have been lost by the former owner), but I was hoping that I could finish this movie for Christmas, it was belated because of that and several other issues (that one for instance), now it seems like I won't even be able to finish it this year. (It's been almost three years since I've started it ! I made a first version in May, but it was quite rough, I used the original footage in the editor, exported as lossless AVI, then tried to repair the bad frames on the rendered movie, so each time there was some text or a cross-fade the interpolation was ugly; that's why I wanted to do a better and hopefully final version by re-doing the editing with the already processed footage to get a cleaner result.)

V4 works better in terms of keeping zoom and degradation to a minimum with a slider that controls the zoom amount dynamically, so it "on the fly" zooms by an amount needed by the worst frames and reduces the zoom on sections that do not need as much stabilising.

VirtualDub's Deshaker has such an option, it's very weird and quite unsettling [*], I prefer a fixed zoom. Deshaker also has an option to keep the original image without zooming, and fill the borders with either a mixture of previous and next frames, or an interpolation from the edges of the picture, but it's very slow and generally not that good.

[*]

 

I did some other tests :

– In a new project, I imported just a MagicYUV file (now I can no longer get Lagarith files to be read normally, I get a “frame salad” as someone described it on the german Magix forum – where he got no useful feedback unfortunately), applied Magix stabilizer with the same parameters as before, a fade-in and a fade-out, then exported as Lagarith : no thin black borders.

– Then I copied that movie object into the current project, put it where it should be, to be displayed briefly over a longer sequence from an untouched M2TS file, and exported a few seconds, starting just before the fade-in and ending just after the fade-out : the thin flickering black borders are there.

– Then I copied all the relevant objects from the current project to yet another new project, and exported approximately the same sequence : the thin flickering black borders are there but only at the fade-in and fade-out, the rest is fine.

Weird, weird, weird... ‘O_O