cisco / openh264

Open Source H.264 Codec
BSD 2-Clause "Simplified" License
5.49k stars 1.78k forks source link

MacBook Pro (2013-2019) - Encoder resolution 1680x1050 (UV) planes not rendering correctly. #3178

Open austinkottke opened 4 years ago

austinkottke commented 4 years ago

It appears that 1680x1050 resolution does not encode properly with openh264 on older macbook pros (2013) and the 2019 edition. The YUV420 conversion fails to fill out the chroma colors correctly. Luma (Y) appears to render correctly.

Can anyone verify this?

Recent macbook pros now use 1680x1050 as their default. Probably why no one ever reported this.

Capture Source: VideoToolBox kCVPixelFormatType_420YpCbCr8Planar Encoder: OpenH264 1.8.0 Decoder: VideoToolBox

All other resolutions appear to encode properly. No errors are shown in the encoder process.

Screen Shot 2019-10-11 at 1 31 12 PM

sijchen commented 4 years ago

looks like some mismatch in sizing, could you check the decoder outcome's size? it MAY be actually 1680x1056.

austinkottke commented 4 years ago

The VideoToolBox frame decoder sees it at 1680 x 1050 - as well as the output decoded frame which is also at 1680 x 1050.

austinkottke commented 4 years ago

The decompression session w/h is set as so using videotoolbox.

CFDictionarySetValue(attr, kCVPixelBufferWidthKey,  (__bridge CFNumberRef)@(_frame_width));
CFDictionarySetValue(attr, kCVPixelBufferHeightKey, (__bridge CFNumberRef)@(_frame_height));
austinkottke commented 4 years ago

Using VideoToolBox only:

Capture Source: VideoToolBox kCVPixelFormatType_420YpCbCr8Planar Encoder: VideoToolBox Decoder: VideoToolBox Res: 1680 x 1050

The frame renders correctly. It is only when swapped with OpenH264 encoding that the chroma (UV) colors do not render correctly.

austinkottke commented 4 years ago

Still need info?