PDA

View Full Version : How to get field order from an interlaced AVI?


new_age
7th August 2002, 19:10
Hello!

I'm capturing with asus 6800 deluxe in WinME with PicVideo MJPEG.
The field order to set to get a correct SVCD when using CCE is always other. I can only test the svcd with my dvd player.

So how can I detect the correct field order without testing with my dvd player?

NA

avih
8th August 2002, 04:53
i've only checked for pal, but in avisynth iirc:

if clip.separatefields produces a 'clean' video then it's 'bottom first'

if it produces a jumpy clip, but clip.complementparity.separatefields produces a smooth clip, then it's top first.

new_age
8th August 2002, 12:17
What do you mean about 'jumpy'?

NA

avih
8th August 2002, 19:46
make the script (avs file) and play it with and vdub or wmp or zoomplayer or powerdivx etc.

just try with and without 'separatefields' you'll understand what 'jumpy' is.

the technical explanation is that if it's the wrong order, the fields won't play at the order in which they were recorded.

just try it and see.

new_age
9th August 2002, 00:25
Hello!

Lot of thanks for the info. I've tried you've said. Now I know what 'jumpy' means. It looks like the same when I play svcd with my dvd player and the svcd has a wrong field order.
----
That's ok now I can see what field order should I use. BUT! How can I detect it from a program. As you can see I'm a software developer (author of WinSubMux btw) and I want to write a program that opens the avi file and tells you in what field order must you encode the svcd/vcd.

So is there any info inside the avi file or it depends on the source? (I'm capturing from analogue source)

NA

avih
9th August 2002, 04:25
i see your point.

however, from my experience, if you use the same capture card and the same driver, on the same pc, it's NOT going to change. it would either be always bottom first, or always top first. so you only have to test that once.

detecting this automatically could be hard, but you can show the user 2 clips (avs) and let him choose the smoother one.

new_age
9th August 2002, 10:28
Hello!

I use the hw mentioned above in the first msg and the field order is always other when I capture.

NA

new_age
9th August 2002, 13:20
Now that's really weird!!! :confused: :confused:

I've captured 11 samples (asus 6800, nvidia wdm 1.08, PAL interlaced, picvideo mjpeg). The method you've mentioned above I've detected that the field order for samples are these:
00 - bottom
01 - top
02 - top
03 - bottom
04 - bottom
05 - top
06 - bottom
07 - top
08 - bottom
09 - bottom
10 - top

(01, 02, 05, 07, 10 were 'jumpy' when I used separatefields and complementparity fixed it)

So I created SVCD-s with this script for all files:
---------------------------------
SegmentedAVISource("capture.avi")
SeparateFields()
BilinearResize(480, 288)
Weave()
---------------------------------

I've used CCE 2.64 for creating mpeg2 and on the video tab I've only checked Add seq end code and Upper field first. (4pass VBR)

I've used tmpgenc for multiplexing mpv and mp2 files.

After encoding all samples I've used MPEG Aspect Ratio Easy Changer to set bottom field first for 00, 03, 04, 06, 08, 09 files. (on the MPG files)

I've used VCDEasy (vcdxbuild) for creating svcd bin/cue.

The result was suprising. All the samples that I've set to bottom field first were good and the TOP field first samples were jumpy with my dvd player.

2nd part I've set all samples to bottom field first (MPEG Aspect Ratio Easy Changer) and the same way watch with my dvd player. And all were ok! :confused:

So what happened???

NA

theReal
9th August 2002, 22:03
with my Hauppage WinTV PCI (BT878) the field order also changes randomly from capture to capture (I've done some 50fps clips and sometimes I had to use complementparity(), sometimes not)

new_age
10th August 2002, 00:09
Hello!

Finally. A solution that works for me since I can not detect correct field order from the avi file. (However there is an option in DVD2SVCD at CCE encoder page for automatic field order, so somehow it is possible to detect it!!!)

So the solution:

1) I encode the AVI file with CCE (it always use top field first no matter what I select)
2) Create a D2V file from the encoded MPG file
3) Create an AVS script:
------------------------------
LoadLibrary("MPEG2DEC.DLL")
MPEG2Source("ENCODED_MPG.D2V")
SeparateFields()
------------------------------
4) Open the AVS file and if the video is 'jumpy' than I have to change the field order

NA

theReal
10th August 2002, 00:29
why not just:

avisource("file.avi")
seperatefields()


???
Do I miss something or why do you encode to mpeg with cce before?
This way you'd know the field order before any encoding is done, wouldn't that be better?

new_age
10th August 2002, 00:47
Hello!

(1) CCE still (2.64) has the bug that no matter what field order you select it always encode "top field first"
(2) As I've mentioned above "Now that really weird..." it doesn't work for me.

NA

theReal
10th August 2002, 01:20
ah ok, now I see... I should've read more closely before :rolleyes:

Triggerle
12th August 2002, 19:38
If I am not mistaken, you can also use tmpgenc to check:

1. Select your capture as the source.
2. Go to filters and double-click deinterlace.
3. Now you can change the field order at the top.
4. Press and hold the little arrow at the bottom right to preview the clip. You'll notice "jumping" if the field order is not correct.
5. Change field order and repeat to verify.

Triggerle

Si
12th August 2002, 23:46
Originally posted by new_age
[B]Now that's really weird!!! :confused: :confused:

I've captured 11 samples (asus 6800, nvidia wdm 1.08, PAL interlaced, picvideo mjpeg). The method you've mentioned above I've detected that the field order for samples are these:
00 - bottom
01 - top
02 - top
03 - bottom
04 - bottom
05 - top
06 - bottom
07 - top
08 - bottom
09 - bottom
10 - top



I've been looking into field order problems for a while and although I'm not familiar with your encoding chain (I just use VirtualDub framserving to TMPGEnc myself) I know a few things about field order probems (and think I know a few more)

I capture PAL 25fps using WinTV in Win98. I believe that my capture setup is stable and does not contribute to field order changes.

I strongly suggest capturing from a true video source (e.g. camcorder) and testing your capture system whilst viewing scenes with motion.

On my system, I end up capturing top field first - the top line of my captured video contains a field that is earlier in time than then second line (tested as above)

If I encode to MPEG-2/SVCD, then the MPEG-2 stream must have the Top Field First(TFF) flag set in order for my DVD player to playback correctly to my TV.

IF the TFF flag is not set, then the video will "stutter".

The above ONLY applies to true video (e.g from a camcorder).

If I capture 100% film progressive material perfectly transferred to video then it doesn't matter whether the TFF flag is set or not as both fields come from the same point in time and the DVD player just puts out one after the other.

However it is a fact that lots of original film material from USA sources transferred to PAL can be created with a top field from one original frame and the bottom from another. Worse still, this can change dynamically during the video (usually at scene changes but not always of course :-).

BUT the actual "field order" of the video itself, top before bottom (or vice versa) doesn't change. If it did, then the picture would be unwatchable on normal TV!

So "field order" is something to work out once on a particular capture setup and then set in stone. BTW, it is said by DV users that DV is always Bottom Field First.

If you have material that you think contridicts what I've said I would VERY interested to see it :-)

I suggest using DVD2AVI to check whether your MPEG-2 coder is correctly setting the TFF flag (TMPGEnc V2.57 has a bug and isn't if you use non-interlaced :-(

Sorry for long post!

regards
Simon
Try using my ViewFields filters/plugins to help sort out your systems.