View Single Post
Old 6th October 2019, 22:30   #10  |  Link
Goggen240
Registered User
 
Join Date: Sep 2019
Posts: 14
Quote:
Originally Posted by StainlessS View Post
Goggen240, you do know that Vdub2 has an excellent avs script editor[tools menu], yeh ?, just
press F5 key for instant refresh of script to display, easy peasy.

EDIT: or some people use avsPmod, cant be much different to using vdub.
I didn't know that, or at least I never thought to look. Could be helpful.
Those times I've used AviSynth I've just used Notepad or even command line; I grew up with DOS so it's almost nostalgic.
The problem I have with AviSynth is that I'm not a coder, can't write code, and can barely read AviSynth scripts. So it can get pretty impenetrable pretty quick. I know it's great at what it does (and probably what I'm trying to do), but the analogy is that it's better to use a hammer you know how to use than a nail gun you don't.
And I've gotten pretty good at using VirtualDub for nail gun jobs...

Quote:
Originally Posted by StainlessS View Post
EDIT: Here an avs thread on your prob,
Undo interlaced resizing mess :- https://forum.doom9.org/showthread.p...ght=legged+dog

JohnMeyer was kinda lucky that ExBlend() worked in that particular case, it was not intended for such problems, but kinda accidentally worked ok.
There was a thread and script posted in Avisynth Usage forum, within last 12 months I think, particularly for this problem, dont know where it is though,
maybe someone else remembers. Post in Avs Usage, maybe.
Just noticed the 576i thing, so maybe ExBlend a total bum steer (is for NTSC),(...)
From the description that's improper telecine/IVTC, so you're right that it's not quite the same. Here there's too much field information, so the problem is to get rid of the right (well, wrong) stuff. I don't quite understand the scripts they come up with, but I'm seeing a lot of Decimate and Blend, and for 24FPS trapped in 59,94Hz that's probably appropriate.
I suppose the principle would also apply for other similar issues (5:6 pulldown), but for straight PAL or NTSC rescaled improperly it doesn't quite fit. I did find some other ones though.

I've been googling this once in a while for years so I've been through a lot of this kind of thread, heh.
One big problem now is that all the example pictures and video are long dead, unfortunately. So it's a bit difficult to find out exactly what they were trying to fix.
I didn't find the new one either, but at least I'm having fun trying to work out the problem for myself.
Learning is fun.

But anyway:

Sequel thread:
https://forum.doom9.org/showthread.p...61#post1531961
More detail on how they ended up with the messed up telecine.
One point that comes up is that the field issues happen irregularly due to timing issues, so there was an issue of how to identify "broken" frames from the rest.
That pretty much never applies to "normal" messed up interlaced videos, which would be perfectly regular. Usually. There are a lot of ways to mess up video...

Another old thread that's on to something.
Sounds like my second examples, where it switches TFF/BFF, blend, BFF/TFF, blend, and so on.
https://forum.doom9.org/showthread.p...96#post1492396
Their suggestion: QTGMC Deinterlace/FrameDouble-->Resize-->Reinterlace
Kinda what I'm going for, but this sorta blurs the heck out of the video until the problem is gone. Also I don't know why the resize is *before* the reinterlace? Wouldn't that be bad?
I've had more luck just blending the fields, but I've been fiddling with using a similar technique to theirs:
Deinterlace 2x Top-Field-First -> Deinterlace 2x Bottom-Field-First -> Blend 'em together
(Blurry, and you lose half the motion information, but simple)
As far as I can tell, a simple blend is less... Stable? It's trying to blend odd and even lines always, but when the field order swaps it goes off a little. The extra blur from blending 2x filters seems to cancel that out. I think.
I'm probably wrong and blending is just better.

Followup to that first thread, this time for a video with completely separated fields every 18/18 lines (seems to be nearest-neighbor rescaled before deinterlacing).
https://forum.doom9.org/showthread.php?t=170813
They seemed to arrive at a solution of motion-interpolating the missing 9 lines and masking it all together. And then blending the two fields, because that's how it was done.
I'm trying to do that (except 2x), but in one file for 2x2 and not for 18/18 lines (which is a horrible nightmare). Although some files with messed up interlacing actually have messed up deinterlacing, like the wavy edges example I made. Those could be kinda repaired with that sort of approach with the right kind of mask, so I've been thinking about that. (I've seen that thread before.)

Pretty new thread:
https://forum.doom9.org/showthread.php?t=174507
A more general approach, but this also ends up blending the fields, rather than separating them and recovering (some) motion information. My suggestion before, "just blend 'em", should work much the same.

A new and suprisingly hostile one:
http://www.digitalfaq.com/forum/vide...ded-video.html
They settle on giving up. Pretty much.
They do hypothesize a lot of the solutions I'm trying to put into practice.

Quote:
Originally Posted by StainlessS View Post
(...)but I still think there was a script posted not so long ago
for pure interlaced downscale fix (but was maybe specifically for reversing Bilinear downsize only).
EDIT: There seems to be a script (DeBilinear) for reversing interlaced upsizing, but of course you want the reverse.
EDIT: Found it, this seems to be a AVISynth script package that includes DeBilinear and a bunch of others (BiCubic, Lanczos, etc.). I don't know how to use it.
https://github.com/jpsdr/ResampleMT
Also found some kind of... Thing... I think... That analyzes frames/pictures to find the original resolution. It's in Python. I really don't know how to use it.
https://github.com/Infiziert90/getnative
Like I mentioned before, since I'm not a programmer, documentation written by programmers for programmers is pretty much impenetrable to me.
I've been messing around with ResampleMT and the example script included, and in a couple hours I've gotten it from access violation on line 1 to access violation on line 6. So that's progress.

Oh, this looks real interesting!
Pretty much all analog video is 704x480 or 716x576, so recovering data from an upscale is really cool.
In fact, the example I posted has both:
The script (apparently) used to compress and post the videos downscales to a bunch of different resolutions; 180p, 270p, 360p, and 540p. But the videos also get upscaled to 720p!
So I'll play around with that script once I have time and figure out how.

Yeah, recovering 576i from 720p is a lot more promising...
My original plan was to blend 720x540 and 960x720 together, where they would have to be upscaled to the same resolution. The resolutions actually line up at UHD 2880x2160, which is a really dumb size for a 1967 broadcast in 576i...

One still unsolved problem that I might fumble my way towards is 544p; in the early days of digitization, they had one job: Scale 720x576 up to 768x576, and 720x480 down to 640x480. To get square pixels.
...Or what they often ended up doing, which was scaling down to 720x544 and call it a day, since it ended up 4:3!
(Actually 1.32:1, but at least they got close...)
So lots of interlacing issues at that exact resolution. And a bunch of other resolutions too of course. (512x384 was real popular too.)

Lastly, the part where I'm being difficult is that I'm trying to recover motion information as well, like with YADIF/QTGMC 2x deinterlacing, and not just blend the fields.
Naturally I collect files with messed up interlacing issues just for the fun of trying to fix 'em. Who wouldn't?
(And if they aren't available in other forms. Usually that one.)

Back in them good old days the goal of deinterlacing was always to blend the fields, or discard the other field as "nicely" as possible. 25/30 frames per second was the goal.
But I'm all for deinterlacing 2x. You can leave the fields/lines you have untouched, interpolate what you don't have, and get 50/60 FPS instead of 25/30. For now at least it's as close to original you can get, and since it doesn't really touch the original lines, it should be fairly future proof as well.

Doesn't mean it looks better though, heh.

Last edited by Goggen240; 7th October 2019 at 12:26.
Goggen240 is offline   Reply With Quote