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 22nd September 2011, 00:28   #1  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,691
Undo interlaced resizing mess

Here is a five-second clip of news footage from 1971 that was shot originally shot on 16mm film:

News Footage

Problem: As you will see, the film has three good frames followed by two bad frames. My assumption is that the film was telecined to 29.97 interlaced, and then this interlaced version was resized, but resized as if it were progressive.

Merely doing an IVTC on this, or doing a separatefields() and then trying to do something with the individual fields won't work, I don't think.

I know that Didée, one of the ultimate gurus on this subject, has said in other postings on similar subjects that there isn't much that can be done for something like this, but I thought I'd ask, just in case someone has some ideas. I potentially have to deal with several hours of this footage, and I may not be able to get hold of the original source.

Thanks!

Last edited by johnmeyer; 22nd September 2011 at 01:54. Reason: Added: "resized as if it were progressive"
johnmeyer is offline   Reply With Quote
Old 22nd September 2011, 04:25   #2  |  Link
Didée
Registered User
 
Join Date: Apr 2002
Location: Germany
Posts: 5,389
60i video can't. But 3/2 pulldown can
Code:
blur(0,1).FixBlendIVTC().TDecimate()
# #
__________________
- We´re at the beginning of the end of mankind´s childhood -

My little flickr gallery. (Yes indeed, I do have hobbies other than digital video!)
Didée is offline   Reply With Quote
Old 22nd September 2011, 15:59   #3  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,691
Quote:
Originally Posted by Didée View Post
60i video can't. But 3/2 pulldown can
Code:
blur(0,1).FixBlendIVTC().TDecimate()
# #
Thank you, Didée!

Once again, I didn't accurately identify the problem, although even if I had, I didn't know about the FixBlendIVTC function.

Many thanks also to MOmonster for creating the FixBlendIVTC function. I'm totally amazed at how well it fixes the problem. I've been looking, field-by-field, at the results of what Didée posted above, and I have a very difficult time distinguishing the original "good" fields from those that were blend-deinterlaced.

I now have clean 23.976 progressive video, and can proceed. Wonderful!
johnmeyer is offline   Reply With Quote
Old 22nd September 2011, 18:29   #4  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
ExBlend() was not intended for this source but I thought I would give it a try with
Didée's Blur and TDecimate. The script below produces less blending with ExBlend
but does produce noisier fixed frames, you might want to give it a whirl.
I did not play with args to FixBlendIVTC nor TDecimate.

Code:
Import("D:\avs\FixBlendIVTC_v091a.avs")
Avisource("D:\avs\problem video.avi")
A=blur(0,1).FixBlendIVTC().TDecimate()
B=blur(0,1).Exblend(PAL=0,show=0).Tdecimate()      # EDIT: Added PAL=0
StackVertical(A,B)
ConvertToRGB32()	# VDUBMOD dont like 636 Width Planar
EDIT: ExBlend() does no postprocessing on recovered frames, the intended source usually does not need any.

EDIT: The below script just shows a 4 window clip, original unblurred frame Top left,
Blurred only frame Bot left, FixBlendIVTC top right, and ExBlend Bottom Right, its
probably not exactly frame for frame (TDecimate) but it is good to see all four clips at once.
In the Exblend() clip, the dog has a more consistent number of legs.
All clips have had TDecimate() applied.
Code:
Import("D:\avs\FixBlendIVTC_v091a.avs")
Avisource("D:\avs\problem video.avi")
A=blur(0,1).FixBlendIVTC().TDecimate()
B=blur(0,1).Exblend(PAL=0,show=0).Tdecimate()      # EDIT: Added PAL=0
Z=TDecimate()
X=Z.Blur(0,1)
L=StackVertical(Z,X)
R=StackVertical(A,B)
StackHorizontal(L,R)
ConvertToRGB32()	# VDUBMOD dont like 636 Width Planar
__________________
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; 22nd September 2011 at 22:43.
StainlessS is offline   Reply With Quote
Old 22nd September 2011, 20:11   #5  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,691
Stainless,

Thanks for the script using your Exblend plugin. I did my own comparison between Exblend and FixBlendIVTC. Your plugin runs faster than the FixBlend function and is more stable (I had occasional crashes with the FixBlendIVTC function on the dozen films I've done this morning since I read Didée's post). However, using the Exblend defaults, I end up with slightly noiser frames than I do with FixBlendIVTC.



The difference is subtle (look at the noise around the dog's legs), and if I had more time I could probably make the two approaches close to equivalent for these sources by doing a little more post-processing (as you pointed out in your post).

I've added Exblend to my library of AVS code snippets and will definitely use it in the future. Thanks!

If I really get into this, I suppose I should look into various filters for the "mosquito" noise resulting from the relatively low-bandwidth encoding. I usually deal with better sources, so I don't have to deal with this problem.
johnmeyer is offline   Reply With Quote
Old 22nd September 2011, 22:52   #6  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Hi john,

I've added 'PAL=0' to the Exblend() args above, (should really have done this before, long since I've used it).
I've just spent a little time seeing if I could do a little simplistic denoising within ExBlend, no luck yet,
but I'll give it a go again (perhaps I can get a temporary one-off test version working).
Can you perhaps give the script you are currently using with FixblendIVTC (args) so I can see
what you have, also posting an additional longer clip might help, say about 10-20MB.
Might not be able to do anything tomorrow, but will come back to it the day after, I think.
Cheers.

PS, are you using the same version FixBlendIVTC_v091a.avs as me ?

PPS, I ask the above because I see dogs with 8 legs (ie not that much unblending done
in the FixBlendIVTC clip) whereas the ExBlend clip has the more accustomed number.
(EDIT: perhaps FixBlendIVTC need a longer clip to get into sync, and I dont have one).
__________________
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; 22nd September 2011 at 23:27.
StainlessS is offline   Reply With Quote
Old 22nd September 2011, 23:17   #7  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,691
Quote:
Originally Posted by StainlessS View Post
I've added 'PAL=0' to the Exblend() args above, (should really have done this before, long since I've used it).
I've just spent a little time seeing if I could do a little simplistic denoising within ExBlend, no luck yet,
but I'll give it a go again (perhaps I can get a temporary one-off test version working).
Can you perhaps give the script you are currently using with FixblendIVTC (args) so I can see
what you have, also posting an additional longer clip might help, say about 10-20MB.
Might not be able to do anything tomorrow, but will come back to it the day after, I think.
Cheers.
Thanks for all the help!

I used FixBlendIVTC exactly as Didée posted, i.e., with no arguments.

Please don't spend any more time on this because I am almost finished with this project. If I have to do any more of this work, I will almost certainly use ExBlend because it is about 10x faster than the FixBlend function call, and seems to be more stable. The slight difference in denoising can easily be remedied in many ways, and is not a big deal for this project because the video is rather pathetic to begin with.

Finally, just to answer your question, here is a sample of one of the scripts. I always tune each script to the source, but they are all roughly the same as this one.
Code:
Import("C:\Program Files\AviSynth 2.5\plugins\FixBlendIVTC.avs")
LoadPlugin("C:\Program Files\MeGUI\tools\ffms\ffms2.dll")
VId=FFVideoSource("E:\Stanford Historical Video\fla42.flv").AssumeFPS(30000,1001).crop( 4, 24, 0, -24)
Aud=FFAudioSource("E:\Stanford Historical Video\fla42.flv", 0)
AudioDub(Vid, Aud)
blur(0,1).FixBlendIVTC().TDecimate()
FWIW, the film I'm transferring was taken at a series of campus college protests in 1970 and 1971. I was briefly the photographer for the campus newspaper and have still photos in my collection that I took at these exact same events.
johnmeyer is offline   Reply With Quote
Old 22nd September 2011, 23:35   #8  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Not a problem, I would like to add the denoising anyway, if it can help in other sources, and this
clip just got me interested. I had intended going back to it at some future point.
Have a nice one.
__________________
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 ???
StainlessS is offline   Reply With Quote
Old 23rd September 2011, 01:12   #9  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
@Anyone reading this:-

DO NOT use "FixBlendIVTC_v091a.avs", The FixBlendIVTC I tried did not work properley and also
put up some kind of metric by default. I located and downloaded "FixBlendIVTC_v09b.avs"
from the Wiki and it works just fine.

The FixBlendIVTC_v091a.avs I tried came from the RPack and as the metric shows by default, I guess
that someone was in the process of editing/testing it and forgot to take it out of test mode.

No wonder I never actually managed to get FixBlendIVTC to do anything very productive in the
past.

The R_Pack in question with the dodgy FixBlendIVTC can be found here (18/11/2009):-

http://forum.doom9.org/showthread.ph...ghlight=r_pack

And the Good working version here:-

http://avisynth.org/mediawiki/FixBlendIVTC


Perhaps v0.91a works good but not as it is directly available.

EDIT: The "FixBlendIVTC_v091a.avs" mentioned above has additional functionality to the older version on the wiki
but is not in usable state, the below link tells how to fix the problem by editing two lines.

http://forum.doom9.org/showthread.ph...24#post1528124
__________________
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 October 2011 at 18:45.
StainlessS is offline   Reply With Quote
Old 23rd September 2011, 01:22   #10  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,691
I just checked, and I have been using (since Didée's post yesterday) version v0.9b - 20.12.2006.
johnmeyer is offline   Reply With Quote
Old 23rd September 2011, 04:07   #11  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Haha, I thought you were an animal lover, you seemed sooo easily pleased with 8 legged dogs.

EDIT: My sister used to have a three legged Boxer bitch (literally), she worked for the RSPCA
as a dog placement officer (part time volunteer). Three legged canines would normally get
the chop, as not too many people visit the shelters looking for a dog with fewer attachments
than the norm, so she took it (had 7 altogether).
Myself, I kinda like the four legged variety, best.
__________________
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; 14th October 2011 at 21:25.
StainlessS is offline   Reply With Quote
Old 7th October 2011, 19:14   #12  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Hi JohnMeyer

Sorry to wake you up again, but, might I ask your permission to use the supplied clip to demo an
updated feature of Exblend().

The update will now use a Dclip (detection clip) eg the blurred version for the above problem clip,
but will use the good frames from the original unblurred clip. The unblending would be done (by
default) using the Dclip as source (just for the 2 blended frames) as, if the Dclip were necessary,
then it would likely produce worse quality if using the source clip to re-construct the unblended frames.
In addition, ExBlend() will now write a file giving frame numbers of the 1st frame in the blended pair,
in format "1 n" where '1' is optional and is the default for use in eg ClipClop() range/frame replacement plugin.
You could do BOTH passes (modes == 1 & 2) of ExBlend(), and then apply some kind of de-noising on the
resultant ExBlend() clips to create a denoised clip, and then using ClipClop() together with the
frames.txt file, replace the denoised frames into the ExBlend() output. Decimation would then be done
on that [with my preference being MultiDecimate()].
A rather long winded approach, 2 passes for ExBlend(), 1 pass for ClipClop(), and 2 for Multidecimate(),
but the results are quite good, I used MCDegrain script filter by Didee for the denosing, but any could
be used:-

MCDegrain: http://forum.doom9.org/showthread.php?t=161594

EDIT: the above MCDegrain would best be modifed for use on ExBlend output as I forgot the duplicated frame in
the 2nd blend position, best would be to use 3 frames prior to Blends, the 1st recovered frame, skip the 2nd
duplicated recovered frame, and use the 3 frames following that.

EDIT:- Currently trying to incorporate decimation into 2nd pass of ExBlend() to remove the necessity to use
Multidecimate, dont know how successful I shall be.
__________________
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; 12th October 2011 at 07:59.
StainlessS is offline   Reply With Quote
Old 7th October 2011, 19:29   #13  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,691
Sure, go ahead and use the clip.
johnmeyer is offline   Reply With Quote
Old 14th October 2011, 20:15   #14  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980


Hi John, wadya think.

Have now got Exblend() doing it's own decimation and producing
a text file of unblended frames for use in eg ClipClop frame
replacement plugin (as noted in previous post).
Not quite complete (have memory access violations when
using MediaPlayer) but am getting there.
The recovered frame repair used the previously mentioned
MCDegrain() by Didee, he da man.
(And of course MVTools authors, Manao, Fizick, Tsp, TSchniede,
dem da man two)
__________________
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; 14th December 2018 at 15:01.
StainlessS is offline   Reply With Quote
Old 15th October 2011, 00:12   #15  |  Link
johnmeyer
Registered User
 
Join Date: Feb 2002
Location: California
Posts: 2,691
That looks very good.

I've decided I might be able to use this for my film transfer system, but I don't know if it will work better than the software I already use which is based on TFM and TDecimate.

I was going to post here, but instead I think I'll start a new thread and see if others might have some ideas. Here's a link to that new thread:

Recover image from shutterless 16mm projector capture
johnmeyer is offline   Reply With Quote
Old 15th October 2011, 01:49   #16  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
It will undoubtably not work as good as the software you already use, Exblend is intended for
recovery from old conversions to VCD, this last little foray, gives it a little more functionality, but it remains
firmly in the realm of VCD recovery, I just found it a little sad that a most capable plugin, has been
completely ignored, alas, not that many people are interested in recovery from VCD in this time
of HD content.
If it can on a one-off problem help, then that also would be a good thing, Didee's blur caught my interest,
and I had to explore it.
__________________
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 ???
StainlessS is offline   Reply With Quote
Reply

Tags
artifacts, interlace, resize, telecine

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 22:14.


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