digitalFAQ.com Forums [Archives]

digitalFAQ.com Forums [Archives] (http://www.digitalfaq.com/archives/)
-   Avisynth Scripting (http://www.digitalfaq.com/archives/avisynth/)
-   -   Avisynth: Converttoyuy2() (http://www.digitalfaq.com/archives/avisynth/8580-avisynth-converttoyuy2.html)

jorel 03-12-2004 06:44 AM

converttoyuy2()
 
hy friends! :)

script load in vdubmod from dvd2avi project:

mpeg2source("D:\dvd teste\a1.D2V")
converttoyuy2() #more contrast and vivid colors

give more contrat and vivid colors than:

mpeg2source("D:\dvd teste\a1.D2V")
#converttoyuy2() #using the "#"in this line, the image seems washed

ok,it's slow but the image is better if use any filter or MA script!

any comments?
thanks.
:wink:

Dialhot 03-12-2004 06:55 AM

Re: converttoyuy2()
 
Quote:

Originally Posted by jorel
any comments?

The image LOOKS better, but it is not better.

Let me compare with audio as you seem to know that better : a lot of cheap audio receivers have tons of DSP that can transform the sound and let it seems better to a newbie hear. But.. a "purist" will never use these DSP as they completly tranforms the original sound.

You know what I mean ?

Ok. So "ConvertToYUY2" has the same effect on your eyes : perhaps it looks better, but the original colorspace of the DVD is YV12.
And for me it is really important, especially for THX labelised sources, to not screw the work of the editor by doing such stupid convertion.

Note: okay, all this is just theory because everything screw up the colors, including TMPGENC (we saw that in comparing CCE/ffvfw and TMPGENC some time ago). I'm using currently the new Deen insteed of Convolution3D and the colors aren't the same at all :-(

jorel 03-12-2004 07:11 AM

" ...DVD is YV12."
oh yes,i knew!

why vmesquita use this line in the end of the script in his guide if it :
"... screw the work of the editor by doing such...etc,etc,etc!
:roll:
:lol:

Phil,
i'm reading your edition in the last post while i'm writing this!
:wink:

new Deen?
...found:
http://ziquash.chez.tiscali.fr/
http://www.avisynth.org/warpenterprises/

Dialhot 03-12-2004 07:23 AM

Quote:

Originally Posted by jorel
why vmesquita use this line in the end of the script in his guide if it :

BEcause old (2.50) version of CCE couldn't work in other thing than YUY2. But it is not the case anymore with 2.66 or 2.67.
I do not have such line in my script and I don't have any problem.

Quote:

new Deen?
Yes. A new one that has near 1 year old but never had time for it before :-). See there :

http://www.kvcd.net/forum/viewtopic.php?t=9532

These are both the old one.
New is there :
http://atlas2.tgv.net/~media-video/f...pic.php?t=2808
(see the french word "Telecharger" and click on it).

jorel 03-12-2004 07:36 AM

the link from Télécharger,give a new version from 13/08/03 and
the warplink and the marc homepage give the version from 19/01/03.

thanks!
:D

"...is not the case anymore with 2.66 or 2.67."

right, now i see cos i have 250 and 266 and 266 really don't need!
:wink:

did you read that cce 266/267 is better for p4 but
cce250 is better for athlon and give more quality
:?:

incredible 03-12-2004 07:44 AM

Jorel, according to colorspaces this here is a very useful site:
http://www.mir.com/DMG/chroma.html

Now to the "more contrast" in case of YUY2 output via Avisynth:

Different colorspaces at the end of an avs script sometimes will be treated by different system decoders! And that depends on how you configured your system, maybe XVID-Codec for YV12 and MS-YUY2-Codec for YUY2, ... or even FFdshow.
And heres the point, where on YUY2 output there could be done a postprocessing --- maybe activated in your case?

Do a test and open an avs script leaved at YV12 in Vdub and watch under File Information ... you will see which decompressor will be used - in my case the XVID codec.
Now apply a ConverttoYUY2() at the end of your script and open it again using Vdub ... you will see which decompressor will be used in this case.

There are so many options in decompressor engines like deblocking, Filmlook, etc. et. etc not mention the postprocessing capabilities if ffdshow as decompressor is used.

And here is the question (espec. to Phil).
IF you get into newer CCE using YV12 this would mean directshow is used to convert that YV12 to YUY2 so CCE can handle it internally?? Would be interesting as I only trust in Avisynths colorconversations ... so maybe a converttorgb24() in case of TmpgEnc or a ConverttoYUY2() in case of CCE could be a better way??

Or even if directshow is not used to pre-convert internally, how do we know TmpgEnc or CCE do end up with their type of internal colorconversation compared to avisynth colorconversation routines.

jorel 03-12-2004 07:58 AM

right incredible!

using converttoyuy2() in vdubmod file information:
YUV 4:2:2 (YUY2) ---> really better!

and without the line show:
ATI YUV12 format codec (16) --->washed!


.....i have an old ati all in wonder,
should i reinstall xvid to turn it better?

thanks for the link too!
:wink:

incredible 03-12-2004 09:25 AM

As I "could" remember, phil reported some issues according to that ATI YV12codec. Well in my case everything ends up very well by using XVID for decompressing YV12.

http://roeder.goe.net/~koepi/xvid.shtml

Be shure you don't have already an older version deeply installed on your system if yes, deinstall it first as Koepi uses a new installer from now on.
And for shure, ... ged rid of that ATI YV12 codec ;-) ..... IF not needed by other things and that I don't know in your case of existing ATI hardware .


:idea: :!: PS: What do you mean by saying "washed colors"??
Do you mean that cause of resulted artifacts out of an real! interlaced d2v input?
http://www.kvcd.net/forum/viewtopic.php?t=9380
Watch there the YV12 "interlaced" Chroma issue.

BobNET 03-12-2004 09:42 AM

Quote:

Originally Posted by jorel
using converttoyuy2() in vdubmod file information:
YUV 4:2:2 (YUY2) ---> really better!

and without the line show:
ATI YUV12 format codec (16) --->washed!


.....i have an old ati all in wonder,
should i reinstall xvid to turn it better?

I noticed this too (I'm also using an All-In-Wonder with the ATI YV12 codec). I put ConvertToYUY2() at the bottom of all my scripts since I figured that one conversion from YV12 to YUY2 wouldn't be as bad as several RGB<->YUYV-type conversions...

Actually, I would have thought a conversion from YV12 to YUY2 would be lossless, since you should only have to encode the chroma values twice (instead of once). Does anyone have the algorithm for YV12<->YUY2 conversion? I've been reading the code from AviSynth for a half-hour or so, but my assembly language skills aren't what they used to be... :mrgreen:

incredible 03-12-2004 10:02 AM

I think the solution is not "how aviynth upsamples the color frequency" an issue is already given by an added colorspace conversion which could be avoided. Every Colorspace conversion means a loss in chroma uspampling even YV12 to YUY2 as it can be read in the link I posted above.
Maybe your avs results good by previewing it in Vdub but in worsed case it will be even resampled 2! times more (like if using TmpgEnc where first rgb24 and finally YV12 mpeg).

So find out IF that ATI codec is really needed (I don't know as I do not have ATI hardware onboard), if not, trash it and use another one as it seems that this codec is responsable for wrong data processing.

Dialhot 03-12-2004 10:10 AM

Quote:

Originally Posted by incredible
As I "could" remember, phil reported some issues according to that ATI YV12codec.

You remember very well ! With ATI I had to use a "level" command in my script to lower the gamma to 0.8 :!:

For your other question, I wonder also if it will not be better to convert manually at the end just to be sure to control everything from a to z in the convert chain. It would avoid problems like thie ATI YV12 codec.

:arrow: that is something to test

Quote:

Do you mean that cause of resulted artifacts out of an real! interlaced d2v input?
http://www.kvcd.net/forum/viewtopic.php?t=9380
Watch there the YV12 "interlaced" Chroma issue.
WIth ATI YV12 installed, "Washed" means ... use the level feature of ffdshow, boost the gamma to 1.4 or 1.6... you will see what washed means !

jorel 03-12-2004 03:01 PM

incredible,
"washed" means.....washed!
:lol: just kidd.
means that the image have less color and contrast..like old photos(not so old)!

now i'm waiting the verdict (write this way?) from you all.
what codec i have to use?
the vobs after the authoring have better color and image(luma)
and 30% less size(with cce-Q10) :arrow: than the original vob in powerdvd.
i got the same with tmpgenc, few differences in images.
i don't did tests in the tvs, only in pc (monitor 15)!

:wink:

Dialhot 03-12-2004 03:09 PM

Quote:

Originally Posted by jorel
what codec i have to use?

Xvid !

jorel 03-12-2004 03:14 PM

Quote:

Originally Posted by Dialhot
Quote:

Originally Posted by jorel
what codec i have to use?

Xvid !

8)

thanks Phil!

jorel 03-12-2004 05:30 PM

i'm back with mine results:

scripts:

1-
mpeg2source("D:\dvd teste\a1.D2V")
#converttoyuy2()
in vdub
with
Koepi's xvid 290204
or
TI YUV12 format codec (16)
:arrow: nothing is different between this 2, still "washed" !

2-
mpeg2source("D:\dvd teste\a1.D2V")
converttoyuy2()
in vdub
with
Koepi's xvid 290204
or
YUV 4:2:2 (YUY2)
nothing is different between this 2,
:arrow: still really better with converttoyuy2() :!:
i see real details !
:o

:idea:
please,can someone test with and without converttoyuy2() in the end of the script?
thanks!

:wink:

Dialhot 03-12-2004 05:58 PM

Quote:

Originally Posted by jorel
please,can someone test with and without converttoyuy2() in the end of the script?

I did a lot ! And your problem is to find why your colors are washed in YV12, not why YUY2 is better ! In a normal situation colors in YV12 should be the same than in YUY2 !

Did you at least remove the ATI YV12 ? Did you check that this time this is Xvid that is used ?

kwag 03-12-2004 06:25 PM

I tried it. I have XviD CODEC installed.
Can't see any difference with or without ConvertToYUY2() at the end of the script.

-kwag

jorel 03-12-2004 06:28 PM

Quote:

Originally Posted by kwag
I tried it. I have XviD CODEC installed.
Can't see any difference with or without ConvertToYUY2() at the end of the script.

-kwag

ok Kwag.....now choose:
me or my pc is mad?
maybe both!
:?

jorel 03-12-2004 06:32 PM

more:
my friend Edson is here with me and see the pictures.
he see that with converttoyuy2() is really better easily!
:o

:?

edited>
if someone want to see,i can send the pictures with 1mb size each by mail!

kwag 03-12-2004 06:39 PM

Hi jorel,

It must be a CODEC issue :!:
That's why you see it better with the line inserted :)

-kwag

Dialhot 03-12-2004 06:41 PM

Quote:

Originally Posted by jorel
more:
my friend Edson is here with me and see the pictures.
he see that with converttoyuy2() is really better easily!

Jorel ?
:arrow: did you verify that this is the XVID codec taht is used now as YV12 decompressor, YES OR NOT :?:

If it is still ATI YV12 that does the job it's normal to have the picture like you have.

jorel 03-12-2004 06:44 PM

Quote:

Originally Posted by kwag
Hi jorel,

It must be a CODEC issue :!:
That's why you see it better with the line inserted :)

-kwag

ok Kwag,ok Phil(i saw your last post Phil)!

now how can i trash the codec that i don't want to use?
(ati in this case)
i want test with xvid alone and do pictures to compare!
:)

Dialhot 03-12-2004 06:48 PM

Quote:

Originally Posted by jorel
now how can i trash the codec that i don't want to use?
(ati in this case)

Do you have DXMan from AnalogX ? Use it : you can select a codec and remove it.

http://www.analogx.com/welcome.htm

BobNET 03-12-2004 08:11 PM

Quote:

Originally Posted by incredible
I think the solution is not "how aviynth upsamples the color frequency" an issue is already given by an added colorspace conversion which could be avoided. Every Colorspace conversion means a loss in chroma uspampling even YV12 to YUY2 as it can be read in the link I posted above.

Ah, so it interpolates the chroma values? That can't be good...

Quote:

Maybe your avs results good by previewing it in Vdub but in worsed case it will be even resampled 2! times more (like if using TmpgEnc where first rgb24 and finally YV12 mpeg).
Actually, I first noticed this in TMPGEnc, then verified it using VDub... either way, using ConvertToYUY2() gives results as they're supposed to look (or at least as the original looks, I suppose that could be wrong too). The ATI YV12 codec seems to clamp output values, I'm guessing to [16,235]. I haven't done any analysis other than using the histogram in VDub for a quick check.

Will TMPGEnc always convert the input video to RGB24? The documentation for the colourspace-conversion functions in AviSynth seem to indicate this: "There are no known advantages of using RGB24 (except that TMPGEnc requires RGB24 input)." If so, then it might be better to use ConvertToRGB24() instead of ConvertToYUY2(), avoiding unnecessary colourspace conversions...

jorel 03-12-2004 08:19 PM

Quote:

Originally Posted by Dialhot
Quote:

Originally Posted by jorel
now how can i trash the codec that i don't want to use?
(ati in this case)

Do you have DXMan from AnalogX ? Use it : you can select a codec and remove it.

http://www.analogx.com/welcome.htm

8O :screwy:
:lol: :lol: :rotf:

Phil,
i download DXMan, he find thousands but can't see the ati codecs!
:lol:

Dialhot 03-12-2004 08:35 PM

Quote:

Originally Posted by BobNET
Will TMPGEnc always convert the input video to RGB24?

yes it is.
So if you really want to add a convert at the end of the script, it should be better to had a ConvertoToRGB24.

@Jorel
You don't know how the codec came on your PC ? You should be abble to remove it if you know who put it on the disc.

jorel 03-12-2004 08:40 PM

Quote:

Originally Posted by Dialhot
@Jorel
You don't know how the codec came on your PC ? You should be abble to remove it if you know who put it on the disc.

yes,i know the name.....and was me that put it on the disk!
:lol:

wait a little, i will "kill" it now!

:wink:

jorel 03-12-2004 09:14 PM

ok!
the system call for reboot after i remove the ati codecs.
done!

now i have "XviD MPEG-4 Codec" loading the script:
mpeg2source("D:\dvd teste\a1.D2V")
#converttoyuy2()

nothing is different with or without converttoyuy2(), the quality is the same but
:arrow: better than using ati codecs, the image isn't "washed".

correct me if i'm wrong:
means that using only the xvid codec(without converttoyuy2()) the quality will be better than ati codecs
:arrow: and will encode faster too!
i read somewhere that converttoyuy2() is slow, right?
:wink:

Dialhot 03-12-2004 09:22 PM

Quote:

Originally Posted by jorel
correct me if i'm wrong:

No need to correct you ;-)

jorel 03-12-2004 09:57 PM

Quote:

Originally Posted by Dialhot
Quote:

Originally Posted by jorel
correct me if i'm wrong:

No need to correct you ;-)

thanks Phil, Kwag, incredible and BobNET :!:

in only one day i got tons with your help.
amazing team-work!

:D

BobNET 03-13-2004 01:13 AM

Quote:

Originally Posted by jorel
ok!
the system call for reboot after i remove the ati codecs.
done!

How did you remove the ATI codecs? Just click "Remove" from the Control Panel?

And have you had any problems since removing them?

jorel 03-13-2004 04:13 AM

Quote:

Originally Posted by BobNET
Quote:

Originally Posted by jorel
ok!
the system call for reboot after i remove the ati codecs.
done!

How did you remove the ATI codecs? Just click "Remove" from the Control Panel?

And have you had any problems since removing them?

very good questions BobNET and i have surprises:
yeah, ati codecs was removed from control panel!

after remove the ati codecs and removing the converttoyuy2() from the script,
cce show a big advertence:
:arrow: " :!: Couldn't find appopriate video codec for 'YV12'. "
8O :?:

i "back" the converttoyuy2() line in the script....
now another surprise:
-->the image is cool (the same as ati codec) and

:arrow: cce needed ~12% more time to encode with xvid + converttoyuy2()
than using ati codec + converttoyuy2()

:grenade: :crashed:

i loose the ati codecs in ati player-capture mode (obvious)!
:arrow: and can't open anything that need "video codec for 'YV12'. "

:douh:

:?
and now?!?!?!

edited>
"cce needed ~12% more time to encode with xvid + converttoyuy2() "
is the correct % value!

BobNET 03-13-2004 11:29 AM

Quote:

Originally Posted by jorel
Quote:

Originally Posted by BobNET
How did you remove the ATI codecs? Just click "Remove" from the Control Panel?

And have you had any problems since removing them?

very good questions BobNET and i have surprises:
yeah, ati codecs was removed from control panel!

i loose the ati codecs in ati player-capture mode (obvious)!
:arrow: and can't open anything that need "video codec for 'YV12'. "

So not really an improvement, then?

:douh:

Did you reinstall XviD after removing the ATI codecs? Maybe the registry entries (or whatever else) that are needed for XviD to decode YV12 don't get added if there's already a YV12 codec on the system...

I'd try it myself right now, but I don't want to hose my system for video captures in the middle of a TV season... :expert:

jorel 03-13-2004 11:44 AM

improvement ?

no BobNET, it's ~12% slow than with avi codecs...the performance is worse!

and yes,i uninstall xvid codecs(reboot)
run "regvac" and "evidence eliminator" to clean traces,
after this i re install xvid again (reboot),
then i did the tests and got the results posted!

like i ask before,or i or my system is mad?!?!
now, without converttoyuy2() in the script, CCE don't work :!:
and i'm using 266 that don't need yuy2 convertion like Phil posted!

some more comments please!
i'm lost and :? :? :?

BobNET 03-13-2004 11:58 AM

Quote:

Originally Posted by jorel
improvement ?

no BobNET, it's ~12% slow than with avi codecs...the performance is worse!

D'oh! Looks like my next project will use ConvertToRGB24() at the bottom to avoid both muddy colours (due to ATI's borked YV12 codec) and also needless colourspace conversions in TMPGEnc (since it's going to convert to that anyway)...

I'll play with my settings sometime next week, when I'll have time to fix things in case they break horribly... :crashed:

jorel 03-13-2004 12:03 PM

ConvertToRGB24() :?:
8O

don't do that,it's worse of all,really slow...i had tryed ConvertToRGB32() too!
horribles performances!

:lol:

BobNET 03-13-2004 02:09 PM

Quote:

Originally Posted by jorel
ConvertToRGB24() :?:
8O

don't do that,it's worse of all,really slow...i had tryed ConvertToRGB32() too!
horribles performances!

For TMPGEnc I think it's probably the best choice (at least in the case where you're using YV12 with the ATI codecs, like us)... it always converts to RGB before encoding for some reason, so if you use ConvertToYUY2() then:

YV12 -> YUY2 -> RGB (in TMPGEnc) -> (encode to MPG) YV12

but with ConvertToRGB24():

YV12 -> RGB (in AviSynth) -> (encode to MPG) YV12

so you do one less colourspace conversion. Plus you get to control the conversion in your script instead of worrying about what TMPG will do...

But this is all theoretical since I haven't done any tests yet :-D

I don't know if CCE expects RGB input or not. I'd guess no but I'm not sure (I should get the trial and test it, too)...

jorel 03-13-2004 02:42 PM

well, i will restart everything...
:screwy:

:ideasmiley:
reinstall the originals ati codecs that came with ati all in wonder cd
and do some tests for performance and quality.

after this i uninstall ati codecs again and install xvid to do another group of tests.
if i got the same the results, :eeks:
i will stay using the ati codecs that came with the drive !

can't think in better way to remove this doubts but all ideas are welcome!

:)

edited>
maybe i wasn't clear BobNET:
converttorgb24() or converttorgb32() are slow than converttoyuy2()
in CCE with or without xvid codec :!:

incredible 03-13-2004 05:21 PM

Quote:

Originally Posted by jorel
converttorgb24() or converttorgb32() are slow than converttoyuy2() in CCE with or without xvid codec :!:

Shure Jorel cause CCE expects YUY2! :wink:
And if your avs finally results in YUY2 NO MORE Xvid/ATI codec, means YV12 codec is needed (see the File Information in Vdub)

So lets resume:

- CCE expects YUY2

- TmpgEnc expects RGB24 (thats also a reason why TmpgEnc is slower than CCE ;-) )

- Mencoder expects YUY2 (as the log says it )

jorel 03-13-2004 09:10 PM

incredible,
i think that you found the "key" of it all!
8) :D

nothing is wrong with my system and happen just like i posted.
i will install and uninstall all codecs again to remove all doubts,
and to test the quality and performance!

and one more detail that i'm thinking after read your post:
(remember: xvid is instaled,ati codecs was uninstaled)
doing it now (writing after each result) :

loading the script WITH converttoyuy2()
in vdub information i got:
Decompressor: YUV 4:2:2 (YUY2)... :arrow: work in CCE
:arrow: is the same that i posted in the first page
of this thread after your first post incredible!
was using the ati codec with converttoyuy2() in the script
the image is better!!!

loading the script WITHOUT converttoyuy2()
in vdub information i got:
Decompressor: XviD MPEG-4 Codec... :arrow: don't work in CCE

for this reason works in CCE using XviD or ati codec WITH converttoyuy2() in the script:
:arrow: Decompressor: YUV 4:2:2 (YUY2)
just like you wrote:
" CCE expects YUY2 "
right?
please, more comments!
:wink:
very cool!


All times are GMT -5. The time now is 08:15 PM  —  vBulletin © Jelsoft Enterprises Ltd

Site design, images and content © 2002-2026 The Digital FAQ, www.digitalFAQ.com
Forum Software by vBulletin · Copyright © 2026 Jelsoft Enterprises Ltd.