View Full Version : cropping interlaced video
o770
26th July 2006, 20:02
The source video is interlaced. Could I still crop the source if it won't be resized nor de-interlaced?
I'm encoding to DivX from interlaced NTSC non anamorphic (4:3) video (DVD) and adding appropriate DAR signal afterwards. The video stream shows some noise at the bottom and thin black margins on the sides that I wanted removed. Cropping could change the AR a little bit.
If the source video could be cropped, could I pls get some advice on how I should crop it? I'm hoping I could just cut the noise and margins out once the DAR signal (4:3) will be added later.
Thanks a lot!
P.s.: this (http://forum.doom9.org/showthread.php?t=92658&highlight=golden+rule+interlac%2A) topic is a reference, the post stating against resize in special.
manono
27th July 2006, 06:47
Hi-
If the source is DVD, and the colorspace is YV12, then you have to be real careful how you crop, if you plan on keeping it interlaced:
In YV12:
width mod-2
height mod-2 if video is progressive
height mod-4 if video is interlaced
http://www.avisynth.org/Crop
You can crop the top and bottom both only in multiples of 4.
o770
27th July 2006, 20:47
Thanks manono!
o770
31st July 2006, 18:36
manono,
I thought I would try setting resolution to any of 4:3AR then crop the video (as you told me to) until the aspect error is minimal. I realized then that the error varies depending upon the resolution I choose, even though AR has been set to 4:3. I also realized that I'd have much to crop if I intended to reach the 4:3 AR - video resolution is 780x420. After doing that, I expected just to remove the resizer from the AVS.
Sorry for letting u read all of this. I've verified that I can trust my standalone player after all (pioneer 588). It can correctly detect the AR signal passed through Mpeg4modifier.
If I crop the width by 2 pixels and run the .avs preview, mplayer says width must be divisible by 4. Should I obey that too?
Thanks again!
manono
1st August 2006, 01:36
Yeah, I was wondering about that when I quoted the crop page. I've seen that message before also. So you got the small picture with the red writing? I think though, (try it to be sure) that the Width crops themselves can be Mod2, but the resulting width has to be Mod4. So it's not as strict as is cropping the heights. Cropping 2 on the left and 4 on the right is no good. But cropping 6 on the left and 6 on the right should be good. I think.
o770
3rd August 2006, 02:21
manono,
could you pls explain in regard to the quote below what isn't optimal if dimensions of the video are only divisible by 4 (not 16), like the result I've got from cropping: 696x420?
The 'official DivX 5.2 guide' says: "the dimensions of the video after both cropping and resizing have been performed must be divisible by 4. For optimal performance the dimensions should be divisible by 16".
P.S.: has that anything to do with macroblocks?
manono
3rd August 2006, 03:32
Hi-
P.S.: has that anything to do with macroblocks?
Hehe, yes, it has everything to do with macroblocks. I'll let TheWEF explain it for you:
divx is encoded in macroblocks of 16 x 16 pixels.
e.g.:
640 x 272 = 174080 pixels = 680 macroblocks.
640 x 274 = 175360 pixels (0.7% more) = 720 macroblocks (5.9% more).
more macroblocks - more compression overhead.
for compressibility reasons i highly recommend to at least use w-mod and h-mod of 16 pixels.
w-mod 32 is recommended for playback compatibility on older gfx-cards.
http://forum.doom9.org/showthread.php?t=42708
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.