Log in

View Full Version : Tmpgenc natively accepting YUY2 input, apparently?


Katie Boundary
22nd November 2016, 08:32
On some computers that I have access to, TMPGEnc accepts AVS scripts with no colorspace conversions whatsoever.

On others, I have to add converttorgb() because TMPGEnc doesn't officially support YUY2 input.

I have no idea why this is happening. Any hints?

StainlessS
22nd November 2016, 20:42
Not sure, think maybe remember something about having to install XVid (or some other tool which installs YUV <---> RGB conversion filter).
Perhaps, such is installed on one machine, and not on the other.
(think maybe Helix YUV codecs may have been later recommended for same purpose, was a long long time ago).
https://www.google.com/?gfe_rd=cr&ei=tAFqVuTzKdLS8AfknKK4BQ&gws_rd=ssl,cr&fg=1#q=helix+YV12

Oh, afterthought, think HuffYUV should also cope with the YUV->RGB conversion, try install that first (v2.2.1, not 2.2.2 which has bugs).

EDIT: here HuffYUV 2.2.1:- http://www.mediafire.com/file/i569818i28afu6g/HuffYUV+2-1-1.7z

manolito
22nd November 2016, 21:26
Some things I remember from the old DVD2SVCD and CCE days:

DVD2SVCD supports the TMPGEnc encoder right out of the box. As the default it uses the line "ConvertToRGB24()", and this makes me assume that TMPEnc might really only support RGB input.

But it should be easy to test this:
In your AVS script alternatively append the lines:
ConvertToRGB24()
ConvertToYUY2()
ConvertToYV12()

and see what TMPEnc does with each of these commands.

The thing with the installed YUV codecs like Helix, XviD or DivX is a little different IIRC. This was extensively discussed for the CCE encoder which only supports YUY2 input. The last line in the AVS script should be
"ConvertToYUY2(interlaced=true|false)"

And the general consensus was that it was preferable to explicitly do the color conversion in AviSynth instead of just using an installed YUV codec, because all these codecs would blindly assume progressive content while AviSynth lets you specify progressive or interlaced.


Cheers
manolito

StainlessS
22nd November 2016, 23:35
And the general consensus was that it was preferable to explicitly do the color conversion in AviSynth instead of just using an installed YUV codec, because all these codecs would blindly assume progressive content while AviSynth lets you specify progressive or interlaced.

+1 on that.

hello_hello
28th November 2016, 17:11
I don't quite understand how the conversion to RGB process works when the output from Avisynth is YUY2, however there's some info below confirming what's already been said.

http://www.avisynth.org.ru/docs/english/corefilters/convert.htm

In most cases, the ConvertToRGB filter should not be necessary. If Avisynth's output is in YUY2 format and an application expects RGB, the system will use the installed YUY2 codec to make the conversion. However, if there's no installed YUY2 codec, or if (as is the case with ATI's and some other YUY2 codec) the codec converts from YUY2 to RGB incorrectly, you can use AviSynth's built-in filter to convert instead.

Huffyuv will act as the system YUY2 codec if there's no other codec installed, so if you install Huffyuv and uninstall all other YUY2 codecs, then you'll never need ConvertToRGB.

ConvertToRGB24 and ConvertToRGB32 can be used to force AviSynth to use a specific store method for RGB data. RGB24 data is often much slower to process than RGB32 data, so if your source is RGB24, you may get a speed gain by converting to RGB32. There are no known advantages of using RGB24 except that TMPGEnc and VFApi requires RGB24 input.

Katie Boundary
11th January 2017, 12:31
Not sure, think maybe remember something about having to install XVid (or some other tool which installs YUV <---> RGB conversion filter).
Perhaps, such is installed on one machine, and not on the other.
(think maybe Helix YUV codecs may have been later recommended for same purpose, was a long long time ago).
https://www.google.com/?gfe_rd=cr&ei=tAFqVuTzKdLS8AfknKK4BQ&gws_rd=ssl,cr&fg=1#q=helix+YV12

Oh, afterthought, think HuffYUV should also cope with the YUV->RGB conversion, try install that first (v2.2.1, not 2.2.2 which has bugs).

EDIT: here HuffYUV 2.2.1:- http://www.mediafire.com/file/i569818i28afu6g/HuffYUV+2-1-1.7z

People still use Huffy? I thought Lagarith had replaced it eons ago.

Izuchi
11th January 2017, 16:54
Ehem...

Lagarith relies on floating point math in the arithmetic coder, which nearly guarantees that errors like this will occur eventually, depending on the phase of the moon and so forth. The format should generally be avoided if possible.

Katie Boundary
12th January 2017, 10:11
Ehem...

Okay then :eek: Thanks for the heads-up.