nuked
10th August 2003, 19:40
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.
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.