Log in

View Full Version : Interlaced Playback throught TV-out


vmesquita
14th April 2003, 23:43
Hi everyone,

I am trying to get correct output of interlaced content. So far I had some success, but still some issues.
I am capturing stuff with my BT878 card and encoding to Divx5 interlaced mode. I playback using the TV-Out of my GEForce MX-200 with TV-Tool to maintain the overscan, at 640x480 (I live in a NTSC country). I encode my stuff at 640x480 or 320x480, never resizing vertically.
Initially everything seemed to work, but the images were a bit blurry. Then I found out that the TVTool AntiFlicker Filter was doing it, and set it to 0.
I started to see some field order problems when playing back my encodes throught TV-out. (I know it's field order problem, because it's the same stuff that used to happen to some SVCDs when playing using a stand alone DVD player and I solved changing the field order from Top Filed First to Bottom Field First).
I found that it is possible to get perfect playback using Reclock, but not always at the first try. Like that: I play the video, if the issue happens I pause and try again (50% chance of getting field order right). When I get the field order right, the video plays smoothlly until I pause or it ends. I can't enable post-processing because any slow down causes the issue again.

Anyone got a better solution? With Reclock I can't use the dual head capabilites of my card. Also the try and error method is annoying... And finally, I don't know how to use it with DVDs, since WinDVD doesn't load reclock... Any player suggestions? The original DivX decoding filters don't seem to work with this method, only FFDShow (No idea why).

Vmesquita

henriQ
16th April 2003, 09:32
Greetings,

Ffdshow 'takes over' decoding tasks.

As for experimental reproducing, one suggestion: try ViPlayer_205
(Urusoft). It allows direct assessment to decoding (and other)
Filters.

HN

vmesquita
16th April 2003, 14:16
Ok, I'll give it I try. Only yesterday I found out how to use overlay with my NVidia GeForce2MX (It's really great to be able to use a DVDMax Matrox or Theater Mode Radeon on my GeForce). I haven't tried playing interlaced material throught overlay yet.

vmesquita

^^-+I4004+-^^
16th April 2003, 14:47
i have the same trouble on tnt2/bt869 and tvtool on sharpest
setting (not on "dvd-normal" but in that mode tvtool is deinterlacing too...so it's not a merit) but i have always cared less for interlaced (seems like few developers felt that way too..heh),but if it'll make you feel better,you're not alone with such problems....very few people try to have interlaced on tv-out anyhow..but as i hear TFF works nice on matrox (BFF not at all,so divxg400 must be used to "shift image by one row"......divxg400 didn'0t helped me,as my field order problem is completely randomly occurring )

vmesquita
16th April 2003, 16:19
Have you tried using ReClock with Vsynch Monitor enabled? That worked for me, but I have the following annoyances:

* I have to pause and play until I get the field order right (usually 0~3 times). When I do, the video will play smooth till another pause or the end.
* I can't use TwinView, because ReClock doesn't work with it. Today I am going to test how overlay behaves (now that I found out how to use), without ReClock of couse since it doesn't work on secondary head. So that mean I can't play a video to TV while I browse the web.

Before Reclock, I had the same problem you suggest (field order randonly changing). But I live in a PAL-M country (that means NTSC with different color codification, should have been called NTSC-M
:-) )

I created a interesting way to test if interlacing: I created a file with alternate black lines in Paint, and outputed it to TV. I know that the fields are not being blured when I can see then perfectly distinct.

I am also going to test the player Vi_Player and post the results as soon as I do.
<edit> I forgot to mention, my TV chipset is Chornell 7008</edit>

Vmesquita

chaumurky
23rd April 2003, 13:17
"I created a interesting way to test if interlacing: I created a file with alternate black lines in Paint, and outputed it to TV. I know that the fields are not being blured when I can see then perfectly distinct."

Exactly what I did. Pretty much at the same stage as you. TVTool, Re-Clock - just getting field timing correct is all that's left. Maybe the author of reclock will be the one able to help here - what with sync detection already in the code. Just a thought...

BTW where can I check out this Vi_Player?

vmesquita
23rd April 2003, 23:39
Try this:

http://www.viplay.cjb.net/

Didn't help me, anyway...
I mailed the reclock author but still no reply...

vmesquita

vmesquita
24th April 2003, 17:44
Just some updates:

I still can't get overlay mode to work correct (Vsynch problems, I guess), but now I can use TwinView. I only have to configure Reclock to use the seconday head. But it is only possible to do this if the the TV is active as a secondary display. Then you have to select the second NVidia that appears on device selection in the Reclock configuration dialog. I am using the 43.45 drivers, not sure if works with older drivers or with other cards. Finally I can play interlaced content on TV (after getting the field order right, of course), while browse the Web!
I also managed to play DVDs correctly on tv. Using ZoomPlayer, I select the WinDVD filters with Reclock, and set the deinterlacing options to "force weave".
So I guess two things are left to be done: the field order guessing and the overlay. Maybe reclock could address this issues... Well itīs open source, and I'll take a look at it as soom as I have time to.

<edit>Maybe the overlay not working has to do with the directX81. I'll upgrade to DX9 and post the results. (I recentlly reinstalled my system)</edit>

[]īs
Vmesquita

avih
24th April 2003, 21:38
to date, i've found out that the most bullet proof method for me for playing interlaced content with correct field order through tv-out would be by using an avisynth script that deinterlace and doubles the frame rate, either in the form of 'clip.bob' or 'clip.complementparity.bob', depending on the original field order (it will usually be only one of those for a specific capture card)

you'll need a fairly fast pc (prob 1G+) to do that (playback) in real time, depending on your capture resolution, of course. if your pc is slower, you could use the bob function to resize vertically (vertical resize is 'free' with bob). just replace the bob function in the above scriptlet ( ;) ) with 'bob(0.3,0.3,clip.height/2)'.

now, play the avs file with your favourite media player. it should also work through tv-out.

cheers
avih

^^-+I4004+-^^
24th April 2003, 22:44
Originally posted by avih
to date, i've found out that the most bullet proof method for me for playing interlaced content with correct field order through tv-out would be by using an avisynth script that deinterlace and doubles the frame rate, either in the form of 'clip.bob' or 'clip.complementparity.bob', depending on the original field order (it will usually be only one of those for a specific capture card)

avih

heh,talking about the cheating!
deinterlace->doubleframerate=jerky motion (just because you deinterlaced!)

this whole discussion is about PURE interlaced output to tv-out (so smooth motion is preserved).....

btw. mentioned method is the same in "smoothdeinterlacer" way to convert standards......
first get progressive stream,then interlace it again............
i would rather use the "3 times" method of reclock,because the only advantage of interlaced is smooth motion........

avih
24th April 2003, 23:33
@^^-+I4004+-^^:
1st try it, then trash it. the method i mentioned works perfectly for me. and trust me, i do care about 50fps smooth playback. this method doesn't rely on dodgy timing or perfect screen resolution. it only needs a decent cpu. i'm using it on duron 800, and it's working great.

you won't be able to tell whether it's the avisynth script or a 'PURE' interlaced output, as long as your cpu is up for the task. and if it's too slow, the avisynth method will look smoother since the percise timing needed for pure interlaced output would not be kept.

bob is the 'purest' method of deinterlacing, as it just separates the fields, doubles the framerate and shift the image one line up/down. it doesn't involve algorithms which might introduce artifacts. and in any case, the tv's vertical resolution is exactly the resolution you'd get from bob, since the double vertical resolution if used for 2 consecutive fields on the tv, and each of them is 'half' from the full vert res.

vmesquita
25th April 2003, 00:54
Avih,

I could not make your method to do real-time (320x480) , even with no Post-processing. I tried Avisynth 2.08 and 2.51, and FFDShow and the original DivX decoding filters with no success... I own a Duron 950, but even with a P4 - 1.6 I wasn't able to get real-time output. Any tips?
Also I would like to note that this methods is a kind of deinterlacing, because it interpolates the missing ,lines. From the AVISynth Documentation:

"Bob takes a clip and bob-deinterlaces it. This means that it enlarges each field into its own frame by interpolating between the lines. The top fields are nudged up a little bit compared with the bottom fields, so the picture will not actually appear to bob up and down. However, it will appear to "shimmer" in stationary scenes because the interpolation doesn't really reconstruct the other field very accurately."

But I'll be happy if it ends the field guessing session. (Keeping the same quality, of course!) :)

[]'s
vmesquita

avih
25th April 2003, 01:03
@vmesquita:

i haven't done this for a while now. give me some time, i'll edit this post with specific instructions, codecs used, apps and versions etc.

regarding bob:
you may want to check exactly what bob-deinterlace does.
1. it separates the fields, and hence, doubles the framerate of the clip.
2. it doubles the vert res of each NEW frame (originally a field) by interpolating between lines OF THE SAME FIELD, therefore there are no artifacts. the interpolation doesn't involve 2 fields, and is done as a merely technical solution to bring each field to a frame vert resolution.
3. it shifts every NEW frame one pixel up/down, depending whether it's an even or odd frame, since ORIGINALLY, the 2 fields contained in an interlaced frame have slightly vertically shifted spatial location.

the result is a clip with the same resolution as the original clip, and doubled framerate. each frame in the new clip corresponds to one of the fields in the original clip, interpolated(=stretched) to full height resolution with slight vert offset to match the original spatial information.

therefore, bob IS the purest (not neccessarily the best though) deinterlace method. it just displays the fields one after another just as the TV displays an interlaced signal. it also adapts the vertical offset of each field to the original offset in which the interlaced signal was created. it does NOT loose overall temporal nor spatial resolution. nor does it increase the overall resolution (except for the technical interpolation, but no REAL new data is presented as in more advanced deinterlacing techniques).

when a bob-deinterlaced clip is displayed on a progressive display, it just.. bobs ;). but when such a clip is played through a TV, it seems as a normal interlaced signal, since the tv-out chip/software combines each 2 consecutive images from the pc into a single interlaced frame ready for the tv to display. this process, although through quite a long pipeline, results in exactly the same signal as the one from directly displaying the interlaced clip to the tv, as long as you keep the timing correct with the latter.

the reason we need tools such as re-clock, divxG400 and others is that even a slightly incorrect timing during playback of pure interlaced clip will result in an incorrect signal fed to the tv and will result in a mess. the avisynth method eliminates this dependancy on exact timing (AND exact resolution) by feeding the tv-out chip with separated consecutive images, which are then composed correctly into an interlaced signal by that chip. if we have incorrect timing during playback, the worst artifact will be a pause of frame or 2, but never shifted fields (either of the 2 forms of it).

^^-+I4004+-^^
25th April 2003, 02:19
>but when such a clip is played through a TV, it seems as a normal interlaced signal.

because only even or odd scanlines of that frame (ex field)
are sent to tv-out(as tv/tv-out works with fields only-50FPS of PC will be converted to 50FIPS(fieldspersecond)on tv-out...each field is half the full frame)....(?)
yes.well this might work........but 50fps needs cpu power....

in fact,you were right this keeps the temporal/spatial info............
even if tv-out projected "wrong" lines of frame (interpolated ones) it shouldn't make a difference,as they are derived from the same field.....but interpolation should be perfect;if you were to project only the interpolated lines with lower precison (less info than real line) of each line,it should look slightly worse.....(this obviously depends on how the playback starts and what parts/lines of frame are sent to tv-out first...)

avih
25th April 2003, 03:24
@^^-+I4004+-^^:
1. well, this might work... it DOES work ;)

2. yes, strong cpu is needed if you playback a hi-res clip, as i have noted in ALL of my previous posts on this thread. you'll have to check out the limitations of your system.

3. if you were to project only the interpolated lines with lower precison (less info than real line) of each line,it should look slightly worse.....(this obviously depends on how the playback starts and what parts/lines of frame are sent to tv-out first...) theoretically, you're correct, but in practice, you probably won't be able to tell the difference if it was 'original' scanline or an interpolated one.

@vmesquita:
here are my settings along with the relevant additional info for you to try (take into account that this is on a PAL system):

-------------------------------------------------------------------
tv-out playback of interlaced clips using avisynth:
Duron 800, 256M SDRAM, Win XP-Pro, Pal tv signal.

capture (not necessary for this demonstration which concerns with PLAYBACK), but anyway:
---------
- the clip was captured directly to xvid, with pcm audio.
virtualdub: 1.4.9
capture resolution: 320x576 (pal), 25fps.
xvid: several months old. CBR, 5000Kbps, Motion search: 1- very low. the rest is defaults.
audio: pcm 16bit, mono
cpu usage: 50% - 100% (depends on the complexity of the scene)

avisynth script:
----------------
clip=avifilesource("D:\test000.avi")
clip.complementparity.bob(0.3,0.3,clip.height/2)

playback:
---------
zoom player v2.90: aspect ratio-> 4:3
avisynth: v2.06 2002-sep-27
xvid decoder: ffdshow 2003-jan-03. no resize, no postprocessing etc.
cpu usage: 80% - 100% (depends on the complexity of the scene)



the above avisynth script was generated automatically from a batch file in the 'send to' directory.
the file: "<relevant windows or profile dir>\send to\deinterlace.bat":
------
echo off
echo #automatic deinterlace avs file > tmp_deint.avs
echo clip=avifilesource("%1%") >> tmp_deint.avs
echo clip.complementparity.bob(0.3,0.3,clip.height/2) >> tmp_deint.avs

start tmp_deint.avs
------

this way you can display any interlaced clip directly in your favorite media player (as long as the file associations of 'avs' are set correctly) being bob-deinterlaced in real time by right clicking on it -> send to -> deinterlace.bat
if tv-out is enabled, it will play correctly and smoothly on your tv.

notes:
------
1. the 'complementparity' part may or may not be needed with your system. you should examine both options.
2. if your cpu is much stronger, you can replace 'bob(0.3,0.3,clip.height/2)' with just 'bob'. this will cause the clip to stay in full vertical resolution.
3. note that the resulting clip won't necessarily keep the original/preferred aspect ratio. if your player supports it, select 4:3 ratio. if it doesn't you can configure ffdshow to change the aspect ratio.

hope you find this method usefull.