View Full Version : Undoing blended deinterlaced video?
Darkvater
21st October 2007, 16:55
Which what I've been trying to do for the past week orso.
I have tried CDeBlend, but it doesn't do much I think, or doesn't do what I expect it to do. The blended frames are still present, just some are duplicated so the movie seems jumpy.
I would've loved to try FixBlendIVTC() but Avisynth/Virtualdub crashes during operation.
Virtualdub says: 'Avisynth read error: <garbage>', virtualdub just crashes when I try to export the movie. Using FixBlendIVTC v0.9, Avisynth 2.5.8 Alpha2 and Virtualdub 1.7.6.
I've also tried custom deinterlacing in photoshop but somehow cannot get it to work.
The frames in the movie have the following pattern:
1 A
2 B
3 B+C
4 C+D
5 D
6 E
7 E+F
...
So every 2 frames I have another frame blended in with two full frames. I thought solving the problem would be easy. Just subtract frame 2 from frame 3 (B+C - B) and subtract 5 from 4 (C+D - D) and interlace the result together to get the perfect result. But sadly this doesn't want to work out, or I am doing something wrong.
Please see attached 4 frames I am talking about. I'll try to put a small sample online hopefully
http://darkvater.openttd.org/interlaced.jpg
MOmonster
22nd October 2007, 12:54
Cdblend is not created for such sources with doubleblends. FixBlendIVTC should work if the blendweight is 50:50. But it doesnīt look so.
Donīt know why FixBlendIVTC doesnīt work. I use Average_21Oct05, mt_masktools and avisynth 2.57 and all runs fine.
Maybe you can upload a small sample.
Darkvater
22nd October 2007, 23:03
Cdblend is not created for such sources with doubleblends. FixBlendIVTC should work if the blendweight is 50:50. But it doesnīt look so.
Donīt know why FixBlendIVTC doesnīt work. I use Average_21Oct05, mt_masktools and avisynth 2.57 and all runs fine.
Maybe you can upload a small sample.
The sample is here: http://darkvater.openttd.org/moscow.avi. 200 frames. The pattern is as above, however every 15 frames there is only 1 blended frame instead of two in the list.
The original source was an MPEG2 file encoded from a VHS capture, and loaded in avisynth with dgdecode. I then encoded this with ffdshow at 90% quality for the sample. Unfortunately I didn't do the capturing, otherwise there wouldn't be any blending to speak off. Damn amateurs, can't even properly capture 8mm tapes :(
To be complete 'Average' is Average_21Oct05.dll and Masktools is 1.5.1.0, Virtualdub (sometimes) even crashes with
An out-of-bounds memory access (access violation) occurred in module 'VirtualDub'...
...reading address 0484FBA0.
MOmonster
23rd October 2007, 10:26
The original source was an MPEG2 file encoded from a VHS capture, and loaded in avisynth with dgdecode. I then encoded this with ffdshow at 90% quality for the sample. Unfortunately I didn't do the capturing, otherwise there wouldn't be any blending to speak off. Damn amateurs, can't even properly capture 8mm tapes :(
To be complete 'Average' is Average_21Oct05.dll and Masktools is 1.5.1.0, Virtualdub (sometimes) even crashes with
You need mt_masktools (masktools v2) for FixBlendIVTC.
Also if you get it running you would be disappointed. The blendweights are not constant and FixBlendIVTC will fail.
I allready thought about v1.0 with a blendweight detection, but with your noisy and bad quality source this methode would also fail.
The only particular solution for such sources would be a constant pattern function, but the pattern in your source is the opposite of constant.
If the source is very important for you and really short, you can do the restoring manually. There is nothing else you can do.
Darkvater
24th October 2007, 10:18
You need mt_masktools (masktools v2) for FixBlendIVTC.
If the source is very important for you and really short, you can do the restoring manually. There is nothing else you can do.
Thank you very much for the reply. I tried some manual restore with taking image differences and adding/subtracting them in Photoshop but I think the amount of noise is killing it and it would need heavy manual correction (I'll post an image of the best automatic result I got, there of course could be a better way but I am sadly not an expert).
The source is very important though (childhood movies :) ), but I don't have the manpower to clean up 90 minutes of it. I'll think I'll try to live with it for now. Thanks again MOmonster for looking into this for me.
MOmonster
24th October 2007, 14:30
Some math to help you:
You have this pattern: a b cd de e ...
The blends in your source can have different blendweight, for example cd70 and de65 (cd70=c*0.7+d*0.3, de60=d*0.65+e*0.35).
You want to restore the clear d Frame. Therefore the blend with the bigger d-part should be choosen, here de65.
The calculation is easy, we get d out of de and e with: d = de65*1/0.65 - e*0.35/0.65. The Average Plugin can do this.
The math is easy but the automatic restoring is very complicated. The blenddetection itself is not so easy, but getting the right blendweight is just more difficult. Thatīs why FixBlendIVTC works only with cd50 and de50 (default case), it restore the d from both blends and merge them together to reduce artefacts. But this wonīt work in your case.
Also if the detection works fine the restored Frame have the blocking and noise of both Frames de and e, so the output still wonīt satisfy you.
Keep it like it is or get a better captured source.
Darkvater
22nd November 2007, 17:25
I'm back :)
Thank you very much for your help MoMonster but you were pretty right. I've played with the video for a few days but could not get any satisfactory results from it, so eventually I just gave up.
Then to my delight it turns out one of the kids sent in the tape to some telecine company and I/we got back a very nice DV video. Its format is 29.970i, so I had a go with it to convert it back to 18p.
After some fiddling I came up with a 2:3:5 IVTC which (almost) perfectly restores the original framerate. The only issue I have is that some parts are perfect, but then in others, interlacing can be seen. It could have happened when the company changed the spools (I had four of them), at least I hope so.
Anyways, just wanted to thank you for your help :)
MOmonster
22nd November 2007, 20:35
I think I couldnīt help you so much, at least I couldnīt solve your problem.
But, yes, no problem. Helping each other is the reason for such forums;).
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.