Log in

View Full Version : Cropping YV12


hello_hello
2nd January 2013, 11:51
I guess this is kind of a newbie question so for lack of a better place to ask.....

I take a YV12 video and open it using MeGUI and crop it's width and height to mod2 dimensions. It displays fine using MeGUI's preview and encodes as expected.

I open the MeGUI AVS script using MPC-HC or VirtualDub(mod) and I get an AVISynth error "YV12 images for output must have a width divisible by 4".

If I crop the width to mod 4 but leave the height mod2, everything still displays fine and encodes as it should using MeGUI. The same script displays correctly using VirtualDub, but opening it with MPC-HC or VirtualDubMod it displays as though the colors have been shifted (for want of a better description). After encoding with MeGUI though, MPC-HC and VirtualDubMod display the encoded video fine, although if I try to encode it using VirtualDubMod the encode will still have the same shifted colors.

So I guess I'm trying to understand the inconsistency. ie why MeGUI can display and encode a mod2 script using AVISynth but the same script produces an error when opening it with MPC-HC or VirtualDub(mod). And why the mod2 height produces shifted colors when opening the script with one program but not another.

Thanks.

J_Darnley
2nd January 2013, 19:37
It is a limitation of the VfW interface to avisynth that forces that mod4 requirement. If you use things which use the avisynth API then you can use mod2 just fine. As for the shifting colours, I would put the blame on something, usually a YUV->RGB conversion, that gets used on playback.

hello_hello
2nd January 2013, 21:53
Thanks for the info. At least now I know why.