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 21st April 2018, 16:41   #1  |  Link
tppytel
Registered User
 
Join Date: Feb 2017
Posts: 31
Any way to IVTC this?

I've got an odd film trailer here, from Criterion's edition of Picnic at Hanging Rock. It's encoded as HD MBAFF AVC @30fps but doesn't follow a typical 3:2 telecine pattern. Since this is an older Australian film, I'm guessing Criterion's source was far removed from the original and had suffered at least a couple of film/PAL/NTSC conversions. The result is a badly combed mess, even when played back from the physical disc to a TV. Running it through SeparateFields() shows combing even in individual fields.

Is there any way to get something more watchable back out of this? Any pointers are appreciated.

Dropbox link to 10 sec sample
tppytel is offline   Reply With Quote
Old 21st April 2018, 23:07   #2  |  Link
Frank62
Registered User
 
Join Date: Mar 2017
Location: Germany
Posts: 234
Most of the mess is caused by resizing to HD while interlaced...
The best algorithm I found was resizing back to SD 720*480 with "precise bilinear" in Virtualdub after cropping first 240 px on both sides. This avoids most of the inteferences. (There are also some "Debilinear"-Scripts somewhere here, but the results they gave me when I tested it a long time ago were not that good, might be by accident).

After this an SRestore to 25fps is not really nice but gives a watchable result.

Especially for Picnic: The reddish tinge reminds me of the Australian VHS release, by the way the most complete source out there.

By the way this is my first post in this forum after having read for some years passively. Thanks to all cracks here for a lot of invaluable tricks I learned!
Frank62 is offline   Reply With Quote
Old 21st April 2018, 23:58   #3  |  Link
FranceBB
Broadcast Encoder
 
FranceBB's Avatar
 
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,903
Frank62 is right. tdeint didn't recognize the fields on 1920x1080.
That's basically because the fields displayed were not the ones of a 1080i, but were the ones from the 480i.
In other words, the original SD source was interlaced and has been upscaled while it was interlaced and that screwed everything up.
Once you reverse upscale it and deinterlace it, you still get blending as it was 25->29.970. You can try a few deblending filters, but blending doesn't actually look bad, to be fair.
I'm at work right now and I can only encode in XDCAM50-422 PAL and I spent like 5 minutes looking at it.
I didn't have time to tweak parameters, but I also suggest you to use Despot, Descratch, deraimbow and deshaking filters.
This is what I have done in 5 minutes at work:

Encoded Sample: https://we.tl/ZhRm5d8Pf4

#Indexing
FFMpegSource2("sample.mkv", atrack=-1)

#Reverse upscale
DebilinearResizeMT(720, 480)

#Deinterlace
tdeint(mode=2, order=-1, field=-1, mthreshL=6, mthreshC=6, map=0, type=2, debug=false, mtnmode=1, sharp=true, cthresh=6, blockx=16, blocky=16, chroma=true, MI=64, tryWeave=true, link=1, denoise=true, slow=2, opt=4)

#Deblend
SRestore(Frate=25)

#Deraimbowning
ChubbyRain2(th=10, radius=10, show=false, sft=10, interlaced=false)
Cnr2("xxx",4,5,255)

#Despot
DeSpot(mthres=16, mwidth=7, mheight=5, merode=30, interlaced=false, show=0, show_chroma=false, fitluma=true, color=true, motpn=true, p1percent=12)

#Luma and chroma in tv range
Limiter(min_luma=16, max_luma=235, min_chroma=16, max_chroma=240)

#Resize
Spline64ResizeMT(1920, 1080)

#Color conversion
Converttoyv16(interlaced=false)
FranceBB is offline   Reply With Quote
Old 22nd April 2018, 06:17   #4  |  Link
tppytel
Registered User
 
Join Date: Feb 2017
Posts: 31
Thanks for the quick replies. I'm always amazed at the expertise here. Some questions, because I'd like to understand what I'm doing...

1) How did both of you identify that the problem was resizing an interlaced source? I understand in a general way why you can't naively resize interlaced sources - you'd be running your resize algorithm across lines that belong to different (effective) 60fps frames. And that creates all kinds of distortions. Correct? So how did you know that was what was happening here?

2) With DebilinearResizeMT, should I be running that against the full HD input, or a cropped 1440x1080 input? Frank's comment suggests that I should use the cropped input. But both are possible depending on the SAR the SD version was encoded with, right? Is there some way to tell what's correct?

3) I understand what SRestore does, but I'm unclear on why the clip was produced in a way that requires it. The ultimate source of the trailer is surely film-rate, right? So a PAL version of it would have just sped up the source by 1 fps. If someone wanted an NTSC version of the trailer, why not just take that 25fps source, slow it back down, and telecine it to 30fps instead of field-blending it? I'm assuming there are practical/technological considerations I don't understand here.

3b) Following the above, couldn't I just use AssumeFPS() to slow the video down to 24fps (after the deinterlacing and deblending) and slow down and pitch correct the audio to match? That should be the closest match to the presumed original source, right?

For the moment, I've just de-resized and deinterlaced to 30fps. That's already a vast improvement on the original encoding, and it's not like I'm going to watch the trailer over and over. But any further comments on the above questions are much appreciated.
tppytel is offline   Reply With Quote
Old 22nd April 2018, 06:55   #5  |  Link
real.finder
Registered User
 
Join Date: Jan 2012
Location: Mesopotamia
Posts: 2,587
for reverse upscaled interlace video you can check this https://forum.doom9.org/showthread.php?p=1823545 read until the last post
__________________
See My Avisynth Stuff
real.finder is offline   Reply With Quote
Old 22nd April 2018, 11:42   #6  |  Link
Frank62
Registered User
 
Join Date: Mar 2017
Location: Germany
Posts: 234
1) If you have seen this kind of distortion once and had to clean it up you never forget...

2) Concerning distortions it won't make a difference, only cropping first and then do the rest should be faster.

3) In the past these kinds of conversions were common. A PAL speedup (or in opposite direction speeddown) is very much cleaner but a speedup. In the days of CRT-tvs the negative aspects were much smaller, so they used different compromises.
SRestore I used here because I couldn't restore the original interlace structure 100% with the downsizing, which caused blending - so you have to de-blend somehow.

3b) Yes, of course.


If you want the cleanest picture of all, you might also re-cut everything from a good film source of PICNIC.
Frank62 is offline   Reply With Quote
Reply

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 09:01.


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