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. |
22nd February 2012, 20:57 | #1 | Link |
Registered User
Join Date: Dec 2007
Location: Germany
Posts: 632
|
Overlay and YV24
Hey guys,
I'm having a problem with Overlay when using YV24 color space. Instead of a clean overlay without any transparency I get a half-opaque overlay and weird colors. This behaviour only arises if the base clip is YV24, if it is in any other color space it works as expected, even with YV24 overlay clips. I'm using 2.6, build Sep 13 2011 and SEt's MT. Here's a script to recreate the problem: Code:
Colorbars(pixel_type="YUY2").ConverttoYV24() b=Colorbars(pixel_type="YUY2", width=320, height=240).ConverttoYV24() Overlay(last, b, x=160, y=32, opacity=1) ConverttoRGB() #for viewing Last edited by TheSkiller; 22nd February 2012 at 21:00. |
22nd February 2012, 23:05 | #2 | Link |
Avisynth Developer
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
|
Oops, Overlay does not ensure the input frame is writeable. Colorbars uses a single static frame, which of course is always in use, so the "frame->GetWritePtr(PLANAR_Y)" will return NULL.
Code:
... 196 PVideoFrame __stdcall Overlay::GetFrame(int n, IScriptEnvironment *env) { 197 198 FetchConditionals(env); 199 200 // Fetch current frame and convert it. 201 PVideoFrame frame = child->GetFrame(n, env); 202 if (vi.IsYV24() && inputCS == vi.pixel_type) { // Fast path 203 // This will be used to avoid two unneeded blits if input and output is yv24 204 // Note however, that this will break, if for some reason AviSynth in the future 205 // will choose different alignment on YV24 planes. 206 if (img) 207 delete img; 208 img = new Image444(frame->GetWritePtr(PLANAR_Y), frame->GetWritePtr(PLANAR_U), frame->GetWritePtr(PLANAR_U), 209 frame->GetRowSize(PLANAR_Y), frame->GetHeight(PLANAR_Y), frame->GetPitch(PLANAR_Y)); 210 } else { ... |
Tags |
overlay yv24 |
|
|