Log in

View Full Version : Problem with x264 and colorspaces


max-holz
8th November 2005, 13:27
I'am understress ;)

I have this AVS file:

LoadPlugin("C:\Programmi\x264\DGDecode.dll")
LoadPlugin("C:\Programmi\x264\plugins\Undot.dll")
LoadPlugin("C:\Programmi\x264\plugins\convolution3d.dll")
LoadPlugin("C:\Programmi\x264\plugins\FluxSmooth.dll")
LoadPlugin("C:\Programmi\x264\plugins\Deen.dll")
LoadPlugin("C:\Programmi\x264\plugins\VagueDenoiser.dll")
LoadPlugin("C:\Programmi\x264\plugins\DctFilter.dll")
LoadPlugin("C:\Programmi\x264\plugins\ColorMatrix.dll")
Import("C:\Programmi\x264\QMF_bistecc.avs")


mpeg2source("C:\Scambio\Elaborazione Video\Nulla\Nulla_Prova.d2v")

crop(0,86,-2,-88)

function Filter_Motion_Nil(clip c)
{
c = Undot(c)
c = ConvertToYUY2(c)
c = Convolution3D (c, 0, 3, 4, 3, 4, 2.8, 0)
c = ConvertToYUY2(c)
c = LanczosResize(c,640,336)
c = ConvertToYUY2(c)
c = FluxSmoothT(c,temporal_threshold = 2)
c = ConvertToYUY2(c)
return c
}

function Filter_Motion_Min(clip c)
{
c = Undot(c)
c = ConvertToYUY2(c)
c = Convolution3D (c, 0, 3, 4, 3, 4, 2.8, 0)
c = ConvertToYUY2(c)
c = BicubicResize(c,640,336,0,0.7)
c = ConvertToYUY2(c)
c = FluxSmoothT(c,temporal_threshold = 2)
c = ConvertToYUY2(c)
return c
}

function Filter_Motion_Mid(clip c)
{
c = Undot(c)
c = ConvertToYUY2(c)
c = Convolution3D (c, 0, 3, 4, 3, 4, 2.8, 0)
c = ConvertToYUY2(c)
c = BicubicResize(c,640,336,0,0.6)
c = ConvertToYUY2(c)
c = FluxSmoothST(c,temporal_threshold= 2 ,spatial_threshold= 2)
c = ConvertToYUY2(c)
return c
}

function Filter_Motion_High(clip c)
{
c = Undot(c)
c = ConvertToYUY2(c)
c = Convolution3D (c, 0, 3, 4, 3, 4, 2.8, 0)
c = ConvertToYUY2(c)
c = BicubicResize(c,640,336,0,0.4)
#c = VagueDenoiser(c,threshold=0.8, method=1, nsteps=6, chromaT=0.8)
#c = ConvertToYUY2(c)
c = ConvertToYV12(c)
c = Deen(c,"a3d",1,4,5,3)
c = ConvertToYUY2(c)
c = DCTFilter(c,1,1,1,1,1,1,0.5,0)
return c
}

function Filter_Motion_Very_High(clip c)
{
c = Undot(c)
c = ConvertToYUY2(c)
c = Convolution3D (c, 0, 3, 4, 3, 4, 2.8, 0)
c = ConvertToYUY2(c)
c = BicubicResize(c,640,336,0.333,0.333)
#c = VagueDenoiser(c,threshold=0.8, method=1, nsteps=6, chromaT=0.8)
#c = ConvertToYUY2(c)
c = ConvertToYV12(c)
c = Deen(c,"a3d",1,4,5,3)
c = ConvertToYUY2(c)
c = DCTFilter(c,1,1,1,1,1,1,0.5,0)
return c
}

a = QMF(2,5,7,12,7,debug=false).ColorMatrix()

a.ConvertToRGB()
return a

and I receive this error from MeGUI:

Next job job1-1 is a video job. encoder commandline:
"C:\Programmi\x264\x264.exe" --pass 1 --bitrate 1471 --stats "C:\Scambio\Elaborazione Video\Nulla\Nulla.stats" --ref 8 --mixed-refs --bframes 3 --subme 6 --weightb --trellis 2 --analyse all --8x8dct --me umh --threads 2 --cqmfile "C:\Programmi\x264\eqm_avc_hr.cfg" --progress --no-psnr --output NUL "C:\Scambio\Elaborazione Video\Nulla\Nulla.avs"
successfully set up video encoder and callbacks for job job1-1
----------------------------------------------------------------------------------------------------------

Log for job job1-1

avis [error]: unsupported input format (YUY2)
could not open input file 'C:\Scambio\Elaborazione Video\Nulla\Nulla.avs'

What could I do for resolve colorspace's problem? I don't understand, I'am sure that the avs output is RGB "a.ConvertToRGB() return a" but this doesn't function.

Ciao

MeteorRain
8th November 2005, 13:36
a.ConvertToRGB()
return a
Let's see what happened.

a.ConvertToRGB() convert clip "a" into rgb, and put it in the variable clip "last".
return a return the clip "a", which is still in YUY2.

a simpler way is to just write a.ConvertToRGB(), and everything will go well :p

and more, using YV12 colorspace is also a choice.

max-holz
8th November 2005, 13:46
Let's see what happened.

a.ConvertToRGB() convert clip "a" into rgb, and put it in the variable clip "last".
return a return the clip "a", which is still in YUY2.

a simpler way is to just write a.ConvertToRGB(), and everything will go well :p

and more, using YV12 colorspace is also a choice.

Thanks, a silly error :D

foxyshadis
8th November 2005, 13:54
Actually x264 only supports yv12, so if you are going to use this, you have to make sure you have a "return a.converttoyv12()" rather than rgb at the end.

Manao
8th November 2005, 15:31
On a side note, there're now scripts that are better tuned than QMF, which only works on a per frame basis. And why do you need so much colorspace conversion ?

Finally, I'd advise you to have a look at HybridFuPP.

max-holz
8th November 2005, 15:56
On a side note, there're now scripts that are better tuned than QMF, which only works on a per frame basis. And why do you need so much colorspace conversion ?

Finally, I'd advise you to have a look at HybridFuPP.

It's the first time that I test this kind of script. Could you tell me where can I fouund scrpits better than QMF with a littel explanation?