Log in

View Full Version : Quick x264vfw questions


HulkHoganRules
1st September 2013, 18:02
Hello. I want to use x264vfw in lossless mode. My capture card uses the YUY2 colorspace. I have some questions:

1. Will selecting "Keep/Accept Only YUV 4:2:2" in the settings actually give me 4:2:2 sampling or is it still going to be 4:2:0?

2. Will selecting "Keep input colorspace" keep YUY2 with 4:2:2 sampling?

3. If 1 and 2 are yes, is there a difference as to what I select?

The reason I ask is because with 1 and 2, MediaInfo reports the chroma sub sampling as 4:2:0 which confuses me.

raffriff42
1st September 2013, 18:50
>MediaInfo reports the chroma sub sampling as 4:2:0
Have you selected Profile="High 4:2:2" ?

HulkHoganRules
1st September 2013, 20:43
>MediaInfo reports the chroma sub sampling as 4:2:0
Have you selected Profile="High 4:2:2" ?

Thanks for that. Still unsure as to 1 and 2 though.

LoRd_MuldeR
1st September 2013, 23:05
1. Will selecting "Keep/Accept Only YUV 4:2:2" in the settings actually give me 4:2:2 sampling or is it still going to be 4:2:0?

With this option, the Codec will only accept YUV 4:2:2 as input and keep it that way. If input is not YUV 4:2:2, then encoding will fail.

In other words: You will either get YUV 4:2:2 or nothing at all.

2. Will selecting "Keep input colorspace" keep YUY2 with 4:2:2 sampling?

If the input indeed is YUV 4:2:2 (e.g. YUY2), then yes. But if it happens to be something else, then not.

Note that here it matters what the encoding application passes to the Codec, which is not necessarily the same what your input file contains!

For example: In VirtualDub the pixel format that will be passed to the Codec is selected under Video -> Color Depth (on the right side).


(BTW: YUY2 is only one specific way of storing YUV 4:2:2 data in memory. It's the exactly same information as, for example, UYVY (aka Y422/UYNV/HDYC) or YV16. They just differ in the memory layout.)

HulkHoganRules
2nd September 2013, 13:56
So I'm guessing either option will produce the same video?

LoRd_MuldeR
2nd September 2013, 14:22
So I'm guessing either option will produce the same video?

As I said before, not necessarily. The first option always produces YUV 4:2:2 and it refuses everything but YUV 4:2:2 as input.

The second option accepts any supported input format and keeps what ever that is - which might be YUV 4:2:2, but might be something else just as well.

And remember: For the second option it does not matter what your original input video file contains. It does matter what the application passes to the Codec.

(For example, VirtualDub converts the input video to whatever you have selected under "Video" -> "Color Depth" before sending it to the Codec)

HulkHoganRules
2nd September 2013, 14:44
I did some PSNR and SSIM calculations and fortunately they are identical which is a good thing. The Convert to 420 option gave about 99.8% similarity.