Log in

View Full Version : How do I get out interlaced that is flagged as interlaced?


Emulgator
10th January 2010, 19:45
I'd like to process noisy and interlaced PAL-DV footage through MC_Spuds and keep it interlaced while editing and encoding.
Source is 720x576x25i, MC_Spuds can operate only on progressive video.
So I do SeparateFields before MC_spuds and after MC_spuds I thought to use Weave.
In any case I am presented with a progressive (and unfortunately combed) 720x576x25p outcome.
A field order check using VirtualDub with AssumeBFF and SeparateFields lead me to think all would come out as desired,
I got to see two 720x288 fields that do advance properly.
But while checking that intermediate before editing and encoding I see that the usual deinterlacers like in MediaPlayerClaassic do not deinterlace anymore.
They see the intermediate as progressive.
I would rather like to see something like the good old fields of 720x288 that are to be presented in 20ms sequence
instead of the combed frames of 720x576 that are to be presented in 40ms sequence.
Any combination of AssumeFieldBased or AssumeBFF afterwards did not help.
Even if I just make an almost empty script, like only AviSource("<Path>.avi pointing to any interlaced source
and process this through VirtualDub, lets say into Huffyuff,
I get .avi that is seen as progressive by GSpot,MediaInfo and the like.
I am a bit puzzled here, Avisynth documentation tells me there is no such flag, but how do I achieve the "impossible"?

Currently (v2.5x and older versions), AviSynth has no interlaced flag which can be used for interlaced video. There is a field-based flag, but contrary to what you might expect, this flag is not related to interlaced video. In fact, all video (progressive or interlaced) is frame-based, unless you use AviSynth filters to change that. There are two filter who turn frame-based video into field-based video: SeparateFields and AssumeFieldBased.

#---------------------------------Standard-Plugin-Lade-Aufrufe-------------------------------------
LoadPlugin("C:\Programme\AviSynth 2.5\plugins\DGDecode.dll")
Load_Stdcall_plugin("C:\Programme\AviSynth 2.5\plugins\yadif.dll")
#---------------------------------Standard-Quellfilter-Aufrufe-------------------------------------
AviSource("N:\Wedel.avi")
#OpenDMLSource(".avi")
#DirectShowSource(".avi")
#MPEG2Source(".d2v")
#ImageSource("D:\Bilder\%d.bmp", 0, 1000, 23.976, RGB)
#------------------------Eingangs-Konverter/Trimmer/Definitionen---------------------------------
Trim(33900,34100)
#.............
#--------------Achtung ! MC_spuds kann nur Progressive !!! Direkt nach TGMC ist MC ok..---------
#-------Bei Interlaced entweder a) vorher SeparateFields, dann MC_spuds, danach Weave--------
#--oder b) vorher bobben mit TGMC, dann MC_spuds, danach Half-Height-Resize, danach Weave--
AssumeBFF()
SeparateFields
MC_spuds(frames=2,strength=3,blocksize=8,overlap=4,sharpp=1,ss_x=1.25,ss_y=1.25,lsfstr=80,colorbleed=true)
Weave
#DoubleWeave
AssumeFieldBased
#...........
#-------------------------------Kontrollabteilung 1: Field-Order korrekt ?--------------------------
#AssumeBFF()
#SeparateFields
#----------------------Bildhöhenverdopplungs-Resizer nach SeparateFields-------------------------
#----------------(nur 1 Resizer einkommentieren, dient zur Kontrollerleichterung)-----------------
#PointResize(720,576)#(...häßlich, aber positionsecht,zeigt die ehrliche Wahrheit durch Pixelverdopplung)
#Lanczos4Resize(720,576)
#Spline36Resize(720,576)#(...positionsecht...)
#eedi2(field=2)#(eedi2 kontrolliert wohl am schärfsten und besten, aber nicht positionsecht!...)
#nnedi2_rpow2(rfactor=2,cshift="Spline36resize", fwidth=width*1)#(nnedi2 ist zu gut im Erraten..)
#----------------------------------------Ende Field-Order-Test--------------------------------------

2Bdecided
11th January 2010, 13:36
IME it's better to bob than separate fields in this case - though either will work OK.

DV-AVI isn't like normal AVI. DV-AVI includes extra information, including aspect ratio. Players normally assume that DV-AVI is interlaced.

Plain (e.g. lossless, HuufYUV) AVI doesn't have aspect ratio or interlacing information. You have to tell the player what to do manually.

When you output something like MPEG-2, e.g. for DVD, most (not all) players will assume it's interlaced, and show it accordingly.

For quick checking on PC, I usually comment out the re-interlace part, and just watch the progressive frames.

You shouldn't use assumefieldbased - that's not what it's for.

You set interlaced or not in the encoder, not in AVIsynth.

Cheers,
David.

Emulgator
11th January 2010, 20:07
Thank you.
Some of my NLE's (Vegas, Premiere, Edius, EditStudio) just seem to guess at it and it seems to come out right.
If I input unflagged Huffyuv.avi into NLE and select DV-AVI as output
I get interlaced flagged DV-AVI from these NLE's that can be deinterlaced on playback.
Only if I output Huffyuv from NLE again, (I wanted to avoid DV-AVI), then there is room for misinterpretation.
I felt unsure, because after encoding I sometimes got progressive combed frames.
So my only chance in any MPEG-2 / MPEG-4 encoder is to set flags, (sometimes 2 specifications),
run short trials and check encode output.
Confirmation is better.

2Bdecided
12th January 2010, 11:20
In an NLE, you set the input clip's properties, and set the output's properties, separately. They're not necessarily related. The NLE should hopefully understand what you set, and make an appropriate (though not always optimal!) conversion is necessary. But that's not your problem! You're problem is just that you expect the interlaced-or-not nature of the footage to be flagged on the output, when it isn't.

I doubt your DV-AVI is "flagged as interlaced" in any way that the player cares about - if it's deinterlacing DV-AVI, it'll also deinterlace progressive DV-AVI.


What is your intended output format? How do you intend to watch it? Decide that, and then you can decide how to handle interlacing.

Cheers,
David.

Emulgator
12th January 2010, 19:48
Thanks, I guess all is clear now.
After 6 years of successful authoring, encoding straight from the NLE without any fieldorder issues
I had some artifacts now after beginning to apply avisynth-based filtering.

If may well be that because I was using Yadif before MC_spuds on that certain buggy PAL speedup pulldown 2-2 footage
(where I tried to fix fieldblending with separating fields and discarding the very first field)
that some motion parts showed up where I expected sane progresive frames.
It did not come out as desired, and so I started to research for my faults.
Next time when I wanted to keep everything interlaced I got "progressive" intermediates.
In the first place I was puzzled about MPC, PowerDVD not being able to deinterlace my intermediate.
Now that I got confirmation I can understand that MPC won't see any flag because there is none, and therefore sees nothing to deinterlace, ok.

Now I should only notice my fieldorder from the capture device, be very careful about restoration not to move this,
think of fieldorder as kept throughout editing, and only on encoding tell encoder the same fieldorder.

It was only this first time that I was moving fields, lines, anything, to fix this source and in the end...well, was not too sure.