Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 10th August 2003, 18:40   #1  |  Link
nuked
Registered User
 
nuked's Avatar
 
Join Date: Jan 2003
Posts: 139
encoding AS interlaced: questions, tests and some results

Well I hope this isn't too basic or the wrong thread forum, but I figured folks here would know the most about it(feel fre to move to anohter forum if you think best) and there's SO much info that's it's very hard to find what one wants in the searches.

Basically I want to encode an interlaced avi in divx or xvid for playback at 60hz. The source is a mix of interlaced and telecined material at 30fps but I just want to treat it as interlaced and keep it interlaced but without doubling my file size.

Idealy I would do a SeparateFields() and then just enocde it and let the playback filters double the vertical res and then shift every other frame one line. I'd like to be able to do interlaced playback on tv and have the choice to use 60 or 30 fps deinterlacing methods on the computer. I imagine for tv it's enough to simply double the vertical res without interpolating, keep it at 60fps and not even bother with the line shift cause the tv effectively should do the line shift itself(but I'm not sure how the tv-out function will handle this in practice), but for the computer I'd need a line shift every other frame after the resize. So first question is does such a playback filter exist?

Now the only reason I figure it's better to SeparteFields() is because I guessed(and you'll see tests below) that divx would compress better that way, but it's not obvious.. one way produces spatial jitter, the other temporal jitter, both possibly hard to compress if the codec isn't aware of the situation. But if I can just leave it as interlaced frames and get a codec to encode and decode in a more or less field separated manner that's fine too. I read on some random web page of unknown date that xvid "hanldes" interalecing and divx5 doesn't. I've only played with divx5 so far.

What I've tried:

1)I've tried leaving the source as interlaced frame ie nothing but crop in my avs file, and just encoding with divx 5. Playing back with ffdshow's bob or ffmpeg deinterlacer produced some persistent color striping with this method, not just transient motion effects, but like the sky would stripe sometimes... of course this is likely to be some color space issue anywhere along the processing chain and may be fixable. Aside from the stiping the result is fairly pleasing/stable.
The "encode as interlaced" option in divx5 does nothing good for me. Same visual quality, same striping and actually one or 2 percent larger file size!

2)I've tried separatefields with not resizing just to see what happens. Amazingly the ***FILE SIZE IS LESS THAN HALF than method 1!*** that's a bonus that can't be overlooked of course. Of course when I playback and double the verticle res it bobs a bit, but will probably look good on a tv.

3)My personal little idea... I did bob (or dgbob, which seems could be better) then ReduceBy2 then encoded. This basically encodes a bottom field as a frame and then a second bottom field as another frame but where the second bottom field is an interpolation of the original top field. So I've done a bob but without doubling my data rate(still 2x frame rate but half vert res). Then enocode, and double the vertical res on playback. I'm rather proud of myself for this little trick. It produces not so bad results. There is no true bob effect on playback, but of course since every other frame is made of interpolated lines and then reinterpolated to double the res it shimmers significantly. Although a neat idea, not quite good enough. I have a another thought to do a quarter line interpolation on both fields instead of a half line interpolation on one. This should help the shimmer some I think, but will still reduce image sharpness(but maybe it's a good noise reducer ), so it's not my favorite aproach, and I still have to figure out how to do it.

So with the file size problem of 1 and the shimmer of 3... it seems that 2 is my only option but I need a playback filter that can treat every other frame diferently... Unless ther is a codec pair that is desinged to handle this... xvid?. Please any thoughts/help? Thanks alot for reading this far.

*correctoin... I previously said that I separated fileds first in method 3... I corrected this error above... I did not.. only bob and reduceby2 since bob does the frame doubling itself... just a mistype in the first version.

Last edited by nuked; 10th August 2003 at 19:26.
nuked is offline   Reply With Quote
Old 10th August 2003, 21:12   #2  |  Link
nuked
Registered User
 
nuked's Avatar
 
Join Date: Jan 2003
Posts: 139
OOps, okay the file size savings on the separatefields approach was wrong.. seemed to good to be true. I had the wrong field assumpiton and was making duplicate frames the time which dvix5 handled quite nicely with essentially no bits. After doing this right, method gives a file size 10% larger than method 1 for telicened segments..

That means method 1 and 2 are both still in the running, 2 having slightly larger file size and 1 giving me striping problems. I'm working on seeing if avisynth can handle the playback massaging I want for method 2 at high enough speed.
nuked is offline   Reply With Quote
Old 11th August 2003, 16:57   #3  |  Link
nuked
Registered User
 
nuked's Avatar
 
Join Date: Jan 2003
Posts: 139
Well nobody seems to care, but I'm gonna update my progress anyway. Seems like there is a sever lack of attention to this issue in general. Like lots of arguing here and there, but no guides or general consensus. SO basically I've decide I'm probably gonna give up and run decomb's telecide and decimate 5 and live with the jerkiness in the interlaced parts even if there are alot.

I've tried encoding in xvid now with interlace checked. Been awhile since i've done anything with xvid, but I think I have the settings mostly under control. Seems to generally do an excellent job of compressing the interlaced material and high quality and low file size, but every couple of seconds it produces alot of blockiness ( I don't just mean contrast on the edge of the blocks I mean COMPLETELY diferent colordd blocks) on verticle edges that are moving. This is not directly an interlacing affect because if I do separtefields on playback so I can watch the fields independantly the effect is still there. This is probably just some little xvid glitch that I could get addressed in some other forum, but for now it's strike 3 on interlaced material for me.

Seems like it would be very nice if there was something like an mpeg4/avi format where we could just copy directly the Top_Field_First and Repeat_First_Field flags straight off the source and into the avi, have no duplicates or telecining or deinterlacing and be done with it... seems MUCH simpler than all the current headache, but then I don't know much. yes I know sometimes, usually, it's preferable to reconstruct progressive frames, but then those those times where it's just a famously big headache and it doesn't need to be.
nuked is offline   Reply With Quote
Old 11th August 2003, 20:13   #4  |  Link
Wilbert
Moderator
 
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
I don't know anything about hybrid material. The decomb-docs suggest the following (decomb 5):

"Processing Hybrid Material If you have a clip that contains both 3:2 pulldown (film) and pure video, you can do a good job with it like this:

LoadPlugin("decomb.dll")
AVISource("hybrid.avi")
Telecide(order=1,guide=1)
Decimate(mode=3,threshold=2.0)

Refer to APPENDIX B for further details on handling hybrid material."

I won't quote appendix B here, but I'm sure you can find it ... If it's not sufficient, I suggest you post in the following forum:

http://neuron2.net/ipw-web/bulletin/bb/index.php
Wilbert is offline   Reply With Quote
Old 11th August 2003, 21:01   #5  |  Link
nuked
Registered User
 
nuked's Avatar
 
Join Date: Jan 2003
Posts: 139
actually I'm having trouble finding docs on the more recentl decomb version with this mode=3 optioon, but I'll keep looking. From what I have found it doesn't seem like a magic bullet, but that's not surprising. It doesn't actualyl decimate anything, just selects which one it would have decimated and falgs it so it can be modified somehow from what I understand.. maybe so an interpolated frame can be used instead of a repeated one, I'm not sure.

From what I can tell this method stays at 30fps, deinterlaces interlaced stuff(telecide deinterlaces by default if combing is found) using a default blend behaviour, recontstructs progressive stuff from telecined stuff, and leaves repeated frames mixed in to the now progressive stuff which can presumably be dealt with by interpolating them or something.. but then the best way to interpolate is to leave it telecined in the first place. So now you have the worst of all possible worlds in terms of image quality and size and all you've solved is possibly smoothness. You have extra progressive frames to encode which if interpolated cannot be compressed away in the codec no matter how smart the codec is, and although you're at 30fps you've lost the whole advantage of 30fps which was to be able not screw up the interlaced parts. You've just screwed them up in a diferent way now.. now you have imperfect deinterlacing instead of motion jitter of 24fps and you get to pay for the whole mess with a larger file size... If I'm gonna go to 30fps I'm not gonna go and screw up all the fields first. Thanks for trying but I'll pass. Seriously, I don't mean to sound harsh at all, I apreciate suggestions on the issue as this is really not something well resolved at the moment.

If you want to interpolate frames anyway then run telelicide and deciamte down to 24 then when you detect your in an interlaced segemnt take the 2 frames on either side of the decimated one and interpolate them in time slightly towards each ohter. This would indeed be a neat filter but I don't think it exists, still not a solution I like, but at least it doesn't waste file size.

well I guess aside from some help on the playback filter front.. and I'm learning some there, I'm discovering real solutions are in better codecs and I guess that can't be solved in this forum. Thanks again though.

ps.. see my thread in development forum for the correct solution to the problem.

oh yeah.. for any who don't know, for a description of TFF and RFF goto the doom9.org page under "basics"(yeah right) ... "telecine explained"
adn just for fun learn about the little 0 1 2 3 and 2 2 2 2 patterns in your .d2v file.

Last edited by nuked; 11th August 2003 at 22:16.
nuked is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 22:01.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.