Log in

View Full Version : How change field parity


yup
4th August 2010, 07:40
Hi all!
Mainly I deal with with analog capture from VHS tape. When I make this I get AVI (lossless codec huffyuv or Ut) with bottom field first.
Before I clean video using script with AssumeTFF() line after AVISource() and when encoding to MPEG2 I also set TFF and do not have problem.
Now I want try vreveal software for video enhancing and if this program will be get wrong parity from AVI will be wrong work.
I try reencode my AVI with simple script
AVISource("add.avi")
ASSUmeFieldBased()
AssumeTFF()
LetterBox(16,12,16,12)
But after encoding if i use info() command I see again bottom field first.
Please advice way for correcting.

With kind regards yup.

Alex_ander
4th August 2010, 08:38
after encoding if i use info() command I see again bottom field first.


Avisynth will show default BFF for any opened avi, it doesn't mean actual field order. In your case the original video is most likely TFF, otherwise you'd have problems from AssumeTFF. If you want to change the actual (not just assumed) field order, use this:

DoubleWeave().SelectOdd()

yup
4th August 2010, 10:12
Alex_ander thanks for reply.
I am worry about that other software can also wrong determine field parity.
When I give my friend files for converting to MPEG2 in Adobe CS, we have problem because Adobe CS see like BFF and my friend need change to TFF using advanced setting. Now I use vreveal software and at this program not exist setting for parity.
May be exist programm which can change parity?
yup.

AVIL
4th August 2010, 11:07
Hi,

There is a filter called ReverseFieldDominance which not only changes parity indicator, it reorder internally the fields as well, too. See the info at Simon Walters (SI) site:

http://www.geocities.com/siwalters_uk/fnews.html

good luck

yup
4th August 2010, 11:13
AVIL!

I need use
ReverseFieldDominance(shiftup=false))
Only for change flag?

yup.

yup
4th August 2010, 11:19
I try simple script
LoadPlugin("ReverseFieldDominance.dll")
AVISource("test.avi")
ReverseFieldDominance(shiftup=false)
and after
AVISource("reenc.avi")
info()
I see always BFF.
yup.

yup
4th August 2010, 11:48
It is sample video
http://www.sendspace.com/file/ff8com
Captured using Studio MovieBoard Plus 700-PCI .
This card made for DV capture and because give BFF?
yup.

manolito
4th August 2010, 11:54
There is no foolproof automatic way to determine the field order of an interlaced clip, you have to do that visually. Here is neuron's explanation (taken from the Decomb manual):
It is essential to set the field order properly for correct rendering. The field order is obtained from Avisynth and can be set using the AssumeTFF() or AssumeBFF() functions in your script before invoking Telecide(). Set AssumeTFF() for top field first; use AssumeBFF() for bottom field first. Because setting it correctly is so important, you are strongly encouraged not to make assumptions about the field order of a clip, but rather to verify the field order using the following procedure.

To determine the field order, make an Avisynth script that serves the raw clip without any processing. If it were an AVI, then just AviSource() would be used. For our examples, we'll use AviSource(). Add a script line to separate the fields using top field first, as follows:

AviSource("your_clip.avi")
AssumeTFF().SeparateFields()

Now serve the script into VirtualDub and find an area with motion. Single step forward through the motion. Note whether the motion progresses always forward as it should, or whether it jumps back and forth as it proceeds. For example, if the field order is wrong, an object moving steadily from left to right would move right, then jump back left a little, then move right again, etc. If the field order is correct, it moves steadily to the right.

If the motion is correct with AssumeTFF().SeparateFields(), then your field order is top field first and you must use AssumeTFF(). If the motion is incorrect, then your field order is bottom field first and you must use AssumeBFF(). If you want to double check things, you can use AssumeBFF.SeparateFields() to check correct operation for bottom field first.

Let's assume we have a top field first clip in the following steps. You would of course use the correct field order for your clip. So far, then, our script is as follows:

AviSource("your_clip.avi")
AssumeTFF()
Telecide()

To reverse field dominance there is also another function by StickBoy which achieves its goal using a different method:
# JDL_ReverseFieldDominance
#
# Reverses the field-dominance in an interlaced clip.
#
# Unlike Simon Walters' Reverse Field Dominance plug-in,
# JDL_ReverseFieldDominance recombines fields instead of shifting
# scanlines. See:
#
# <http://neuron2.net/reverse/reverse.html>
#
# for descriptions of the two methods. Although this function uses the
# field recombination method, it does not lose the first field of video
# nor should it introduce audio/video desynchronization.
#
# PARAMETERS:
# "bobFirstLast" : Pass true to bob-deinterlace the first and last frames
# of the output clip.
# (Default: true)
#
# REQUIRES:
# jdl-util.avsi (SetParity, Trim2)
You can find StickBoy's tools at www.avisynth.org/stickboy


Cheers
Manolito

Didée
4th August 2010, 11:57
Snow is white, sky is blue, and AVI does not signal field order.

manolito
4th August 2010, 12:01
And your sample clip is definitely TFF.

Cheers
manolito

yup
4th August 2010, 12:27
manolito!
Yes I know that this sample is TFF, but Avisynth show BFF, also if I try load simple script (without AssumeTFF() line) to HCEncgui I see also BFF, but many file from DGIndex and DGAVCIndex HCEncgui see like TFF. The same situation with Procoder 3.
I try vreveal and see bad result for deinterlacing for my AVI capturing and good result for HD video. Problem that Vreveal see wrong parity.
Didée!
Problem do not have solution?
yup.

Alex_ander
4th August 2010, 12:31
This card made for DV capture and because give BFF?

That's not necessarily. By DV Camera standards both PAL and NTSC are BFF, but that's different from ITU601, where for PAL different capture line range is defined (it comes from analog broadcast standards). By ITU, NTSC capture appears to be BFF, PAL - TFF. DV used by a TV capture card is just a method of encoding, neutral to field order. So no wonder you have TFF, as I supposed.
As I can understand, vreveal doesn't accept scripts and you encode intermediate avi's. If that encoder is something like Lagarith (which doesn't use settings for changing field order input to output), previously change TFF to BFF in script:

AssumeTFF()
DoubleWeave()
SelectOdd()#BFF

P.S. (I'm assuming your target program always considers avi's BFF and doesn't offer to specify field order for imported videos)

yup
4th August 2010, 12:38
Alex_ander!
Problem that I have TFF AVI with BFF flag. Any attempt do not have success. I try reencode to huffyuv, lagarith and Ut.
Vreveal see only AVI not avs scripts it is true.
I have a lot of captured material and want try Vreveal. Next time I try capture in DV codec may be this solve problem.
yup.

2Bdecided
4th August 2010, 12:45
Alex_ander!
Problem that I have TFF AVI with BFF flag.AVI does not have a field order flag!!!!

You have to tell you software the field order using something else (drop down menu, etc) - it can't "know" from the file because the file doesn't say.

(Some video formats that you can pick inside an AVI file can signal field order, but that's in the format itself, not the AVI file.)

Cheers,
David.

manolito
4th August 2010, 12:46
OK, slowly now...

Your clip is TFF, but AviSynth reports BFF. This is normal, AviSynth always shows BFF by default. This is because AVI files do not have any embedded information about field order.

So all you need is AssumeTFF() at the top of your script. This just tells AviSynth the real field order of your clip. If you do not need to change the field order to BFF (I see no reason why you would want to do this) then you do NOT need to reverse the field dominance.

So if you process a captured AVI file, the first thing you do is determine the REAL field order by using the method explained by neuron2. (If you always use the same capture device and capture software, then the field order of your captured clips will always be the same, no need to check after every new capture).

If like in your case you determine that the clip is TFF, then you put the AssumeTFF() line at the top of your script. If your clip is BFF then you change the line to AssumeBFF(). (Or you skip this line altogether because AviSynth assumes BFF by default).

I hope this makes it a little clearer for you...:)

Cheers
manolito

yup
4th August 2010, 12:51
:thanks: to all!
I try Alex_ander advice for reencode lossless codec it is work.
yup.

2Bdecided
4th August 2010, 12:55
There is no foolproof automatic way to determine the field order of an interlaced clip, you have to do that visually.If the content itself really is interlaced, and if it's in a format that can flag the field order (like MPEG), and if the field order is flagged, then you can almost always trust this flag to be correctly set.

An interlaced MPEG containing interlaced content with the field order flagged incorrectly would be considered broken - certainly any hardware player (and almost any software player) would play it back with the most terrible jittery forwards/backwards movement you can imagine.

Obviously interlaced content flagged/encoded as progressive, and progressive content flagged/encoded as interlaced, are both found (the latter being very common), and the field order flags (if any) can't be trusted (or aren't relevant).

There's also field-shifted progressive encoded as interlaced, but the field order flags are usually "correct" in this case too, for the same reason as with true interlaced content (see above).

Cheers,
David.