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.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 22nd February 2012, 20:57   #1  |  Link
TheSkiller
Registered User
 
Join Date: Dec 2007
Location: Germany
Posts: 634
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
Also, as a side note, generating the color bars in YV24 via pixel_type crashes on me without an error message.

Last edited by TheSkiller; 22nd February 2012 at 21:00.
TheSkiller is offline   Reply With Quote
Old 22nd February 2012, 23:05   #2  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,173
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 { 
...
Fix scheduled.
IanB is offline   Reply With Quote
Reply

Tags
overlay yv24

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 16:55.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.