Log in

View Full Version : ImageSource + ConvertToYUY2 + ConvertToYv12 problem


Selur
23rd February 2007, 18:22
#http://www.heise.de/ct/ftp/testbilder/kameras_0621/canon_eos-400d_iso100.jpg
ImageSource("canon_eos-400d_iso100.jpg", end=249)
GaussResize(640,480)

ConverttoYv12()

Returns as expected as Yv12 colorSpace.

#http://www.heise.de/ct/ftp/testbilder/kameras_0621/canon_eos-400d_iso100.jpg
ImageSource("canon_eos-400d_iso100.jpg", end=249)
GaussResize(640,480)
ConverttoYUY2()
ConverttoYv12()

Returns as YUY2 colorSpace. -> Why?

for completeness:
Stumpled over this problem when I wanted to convert the following script with MeGui to x264 and Megui kept complaining about the colorspace not being Yv12.
#http://www.heise.de/ct/ftp/testbilder/kameras_0621/canon_eos-400d_iso100.jpg
big = ImageSource("canon_eos-400d_iso100.jpg", end=249).ConverttoYv12().ConvertToYUY2()


b1 = big.BilinearResize(640,480).meInfo(" - 1 - ")
b4 = big.BicubicResize(640,480,0.333,0.333).meInfo(" - 2 - ")
b8 = big.GaussResize(640,480).meInfo(" - 3 - ")
b3 = big.BicubicResize(640,480,0.0,0.5).meInfo(" - 4 - ")
b2 = big.BicubicResize(640,480,0.0,0.75).meInfo(" - 5 - ")
b10 = big.Spline16Resize(640,480).meInfo(" - 6 - ")
b5 = big.LanczosResize(640,480).meInfo(" - 7 - ")
b12 = big.GaussResize(640,480,p=75).meInfo(" - 8 - ")
b6 = big.Lanczos4Resize(640,480).meInfo(" - 9 - ")
b11 = big.Spline16Resize(640,480).meInfo(" - 10 - ")
b7 = big.SimpleResize(640,480).meInfo(" - 11 - ")
b9 = big.PointResize(640,480).meInfo(" - 12 - ")

return b1+b4+b8+b3+b2+b10+b5+b12+b6+b11+b7+b9

function meInfo(clip a, string b){
return a.AddBorders(8,8,8,8,color=$FFFFFF).Subtitle(b,align=8,font="kroeger 08_53",size=30,text_color=$000000,halo_color=$FFFFFF)
}
ConvertToYv12()


version() -> AviSynth 2.56, build: Oct 28 2005

Cu Selur

foxyshadis
23rd February 2007, 18:47
Are you sure it returns YUY2, and not DIB? Avisynth error messages always return in DIB, a good way to tell that you're missing one. On mine it's "there is no function SimpleResize" since I don't keep it in the autoload folder, maybe it's something similar for you? It works fine here once I load the plugin. btw, you don't need the first YV12, you can convert directly from RGB to YUY2. (In fact RGB->YV12 has a YUY2 intermediate step.)

Selur
23rd February 2007, 19:03
btw, you don't need the first YV12, you can convert directly from RGB to YUY2. (In fact RGB->YV12 has a YUY2 intermediate step.)
Sorry, for the first Yv12 thats just some rest from finding the problem. ;)

Are you sure it returns YUY2, and not DIB?
That's what ffdshow reports. ;)

On mine it's "there is no function SimpleResize" since I don't keep it in the autoload folder, maybe it's something similar for you? Comes with MeGui, but is also availabe here:
http://www3.impacthosting.com/trbarry/SimpleResize.zip

It works fine here once I load the plugin.
You can convert the file with MeGui to mp4(x264)? If so, did you use another SimpelResize than the one I linked to?

You do get Yv12 colorspace output? If so, how did you check? (for me ffdshow shows YUY2 via OSD and MeGui complains that it is not Yv12 when trying to add a x264 job to the queue)

Cu Selur

squid_80
25th February 2007, 05:55
#http://www.heise.de/ct/ftp/testbilder/kameras_0621/canon_eos-400d_iso100.jpg
ImageSource("canon_eos-400d_iso100.jpg", end=249)
GaussResize(640,480)
ConverttoYUY2()
ConverttoYv12()Returns as YUY2 colorSpace. -> Why?

Are you absolutely sure you've tried exactly that script? Because it returns yv12 here. And it has a subtle difference to your full script...
#http://www.heise.de/ct/ftp/testbilde...00d_iso100.jpg
big = ImageSource("canon_eos-400d_iso100.jpg", end=249).ConverttoYv12().ConvertToYUY2()


b1 = big.BilinearResize(640,480).meInfo(" - 1 - ")
b4 = big.BicubicResize(640,480,0.333,0.333).meInfo(" - 2 - ")
b8 = big.GaussResize(640,480).meInfo(" - 3 - ")
b3 = big.BicubicResize(640,480,0.0,0.5).meInfo(" - 4 - ")
b2 = big.BicubicResize(640,480,0.0,0.75).meInfo(" - 5 - ")
b10 = big.Spline16Resize(640,480).meInfo(" - 6 - ")
b5 = big.LanczosResize(640,480).meInfo(" - 7 - ")
b12 = big.GaussResize(640,480,p=75).meInfo(" - 8 - ")
b6 = big.Lanczos4Resize(640,480).meInfo(" - 9 - ")
b11 = big.Spline16Resize(640,480).meInfo(" - 10 - ")
b7 = big.SimpleResize(640,480).meInfo(" - 11 - ")
b9 = big.PointResize(640,480).meInfo(" - 12 - ")

return b1+b4+b8+b3+b2+b10+b5+b12+b6+b11+b7+b9

function meInfo(clip a, string b){
return a.AddBorders(8,8,8,8,color=$FFFFFF).Subtitle(b,align=8,font="kroeger 08_53",size=30,text_color=$000000,halo_color=$FFFFFF)
}
ConvertToYv12()
That script returns a clip before the converttoyv12 call is reached.

Selur
25th February 2007, 08:42
I thought I used exactly that script, but testing again now it really does work.

So, sorry for the missreport. :(

Cu Selur

Ps.: Don't know how I totally missed this. :(

krieger2005
26th February 2007, 01:07
This is the reason why people should not mix main script with functions inbetween. However... everybody has his own preferences. Good Luck!