Log in

View Full Version : Need advise for RGB32 to YV12 conversion


Chabb
5th June 2008, 12:38
In some cases I have to convert video
from YV12 to RGB32 and back to YV12 in my scripts
(to use VirtualDub filters).
Processed video often has TV color range (and it's too dark),
so I'm using

levels(16,1.5,235,0,255,coring=false)

When RGB is not involved the result has pure black and white
after using converttoyv12(matrix="pc.709")
But when RGB conversion present,
converting back to YV12 gives odd results:
after converttoyv12(matrix="pc.709")
pure black and most noticeably white (almost white)
are looking like clipped again
and after converttoyv12()
result has TV color range

What I'm doing wrong?
Is there a bug in filters, or in their order
... or in my DNA :)

thetoof
12th June 2008, 06:34
Why do you need vdub filters? The avs ones are quite powerful... and I'd be surprised to see something that'd be done by vdub and not avs.

2Bdecided
12th June 2008, 11:24
I can think of some. Deshaker is the obvious one.

To avoid banding and clipping, try simply...

converttorgb(matrix="PC.709")

on the way out of AVIsynth to VirtualDub, and just...

converttoyv12(matrix="PC.709")

...on the way back. That's it. No need to use levels. Note that the RGB in the middle won't "look right" on a PC monitor, but it's fine for processing, and you'll get back the correct (original) YV12 levels at the end.

Cheers,
David.