Selur's Little Message Board
Error on h264 2.35:1 ratio encoding? - Printable Version

+- Selur's Little Message Board (https://forum.selur.net)
+-- Forum: Hybrid - Support (https://forum.selur.net/forum-1.html)
+--- Forum: Problems & Questions (https://forum.selur.net/forum-3.html)
+--- Thread: Error on h264 2.35:1 ratio encoding? (/thread-354.html)



Error on h264 2.35:1 ratio encoding? - gabster - 04.04.2018

Hi All -

So trying to encode a 2.35:1 (1920 x 817) clips I am getting an:

"Problem with output D:\renders\test.mov
Width and Height need both to be dividable through 2 without rest.
Reason: Yv12-colorspace"

Not sure what do do, any tips will help.
thanks a lot!
gabi


RE: Error on h264 2.35:1 ratio encoding? - Selur - 04.04.2018

Okay the problems is you are trying to encode a video with odd width/height values into a color space (YV12 <> 4:2:0) that doesn't support such resolutions. Smile
Which is why Hybrid reported:
Quote:Width and Height need both to be dividable through 2 without rest.
Reason: Yv12-colorspace
in the hope that the user would know about color sampling and it's associated limitations.

Ways to solve this are:
a. resize to archive even width and height values
b. crop to archive even width and height values
c. encode to a color space which support such resolutions (4:4:4 color sampling is needed), assuming your target format support such color sampling.

Cu Selur


RE: Error on h264 2.35:1 ratio encoding? - gabster - 05.04.2018

(04.04.2018, 18:41)Selur Wrote: Okay the problems is you are trying to encode a video with odd width/height values into a color space (YV12 <> 4:2:0) that doesn't support such resolutions. Smile
Which is why Hybrid reported:
Quote:Width and Height need both to be dividable through 2 without rest.
Reason: Yv12-colorspace
in the hope that the user would know about color sampling and it's associated limitations.

Ways to solve this are:
a. resize to archive even width and height values
b. crop to archive even width and height values
c. encode to a color space which support such resolutions (4:4:4 color sampling is needed), assuming your target format support such color sampling.

Cu Selur

Thanks Selur!

Since I need to stick with the 2.35:1 (anamorphic) sizing, I could only choose answer "c" encoding to a different color space.
But that means I cannot use h264, right? The only option for Output Color Space there is i420.

thanks!
g


RE: Error on h264 2.35:1 ratio encoding? - Selur - 05.04.2018

No. H.264 supports 4:2:0, 4:2:2 and 4:4:4 assuming you chose a profile which supports it, like "High4:4:4" (which at least x264 supports). (see: https://en.wikipedia.org/wiki/H.264/MPEG-4_AVC#Profiles for a list of the profiles H.264 supports in general)
Downsides of 4:4:4 are that there is more data to save, which requires more data rate and cpu power for en- and decoding.
Also most hardware decoders won't support High 4:4:4.

Out of curiosity is your content really anamorphic (<> PAR != 1:1) if it is what PAR (pixel aspect ratio) is it that you end up with an actual resolution of 1920x817, or isn't is anamorphic and simple square pixels (<> PAR 1:1) with a DAR (display aspect ratio) of 2.35:1?

Cu Selur


RE: Error on h264 2.35:1 ratio encoding? - gabster - 05.04.2018

(05.04.2018, 19:19)Selur Wrote: No. H.264 supports 4:2:0, 4:2:2 and 4:4:4 assuming you chose a profile which supports it, like "High4:4:4" (which at least x264 supports). (see: https://en.wikipedia.org/wiki/H.264/MPEG-4_AVC#Profiles for a list of the profiles H.264 supports in general)
Downsides of 4:4:4 are that there is more data to save, which requires more data rate and cpu power for en- and decoding.
Also most hardware decoders won't support High 4:4:4.

Out of curiosity is your content really anamorphic (<> PAR != 1:1) if it is what PAR (pixel aspect ratio) is it that you end up with an actual resolution of 1920x817, or isn't is anamorphic and simple square pixels (<> PAR 1:1) with a DAR (display aspect ratio) of 2.35:1?

Cu Selur

It's pseudo anamorphic (in other words just cropped the top and bottom from a true 1920x1080 timeline to simulate that ratio. 
thanks!


RE: Error on h264 2.35:1 ratio encoding? - Selur - 05.04.2018

Okay. It's cropped square pixel content, so it's not anamorphic at all, since the PAR is still 1:1. Smile

Cu Selur


RE: Error on h264 2.35:1 ratio encoding? - gabster - 06.04.2018

(05.04.2018, 20:04)Selur Wrote: Okay. It's cropped square pixel content, so it's not anamorphic at all, since the PAR is still 1:1. Smile

Cu Selur

Right - but how do I get around this issue?
Any advice welcomed.

thanks!
g


RE: Error on h264 2.35:1 ratio encoding? - Selur - 06.04.2018

I don't the issue. (I was just confused since you mentioned anamorphic in a way that is seemed wrong to me.)

Anamorphic encoding was introduced since people had a fixed number of pixels, in for example on DVD (720x480 for NTSC, 720x576 for PAL), and wanted to save for example 1024x576 content with a minimum of black borders around it. So anamorphic signaling was introduced which meant, that the one of the dimensions (usually the width) was saved in a compressed/stretched way and the decoder had to stretch/compress the content on decoding.
Thus having 1024x576 pixels were compressed to 720x576 encoded and signaled with a PAR of 1.25 (=1024/576) which told the decoder that on playback the content needed to be stretched to 1024x576 again. (iirc. http://www.widescreen.org has a decent introduction to the history of anamorphic encoding)

Cu Selur