Opened 3 years ago

Closed 3 years ago

#7704 closed defect (fixed)

8-bit pixel format is used when decoding 10-bit video using VideoToolbox

Reported by: fumoboy007 Owned by: Aman
Priority: normal Component: avcodec
Version: git-master Keywords: videotoolbox
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


Summary of the bug:
kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange is always used regardless of the bit depth of the video.

Attachments (2)

VideoToolbox_10bit.patch (4.5 KB ) - added by fumoboy007 3 years ago.
0001-Support-10-bit-color-when-using-VideoToolbox-to-deco.patch (4.9 KB ) - added by fumoboy007 3 years ago.

Download all attachments as: .zip

Change History (9)

comment:1 by fumoboy007, 3 years ago

Keywords: hwaccel added

comment:2 by Carl Eugen Hoyos, 3 years ago

Keywords: 10bit hdr hwaccel removed

comment:3 by fumoboy007, 3 years ago

Here is an unfinished patch. It is unfinished because we should probably check at runtime for macOS 10.13+ before using the 10-bit pixel format since that is when it was introduced. I don’t have time in the immediate future to figure out how to check the macOS version at runtime.

by fumoboy007, 3 years ago

Attachment: VideoToolbox_10bit.patch added

comment:4 by Aman, 3 years ago

Cc: added
Owner: set to Aman
Status: newopen

Could you please submit git-format-patch version of the patch including Author info so we can commit it? There are some patterns used to define missing symbols on older versions of macOS which I can add to make this patch complete.

comment:5 by fumoboy007, 3 years ago

Thanks for picking this up! I’ve attached the patch. Let me know if there is anything else you need.

comment:6 by Aman, 3 years ago

Thanks. I forgot to specify that ffmpeg-devel is the preferred place for patches, so they can be more widely reviewed.

As far as macOS compatibility, you can refer to how I added compatibility checks for kCMVideoCodecType_HEVC here:

If you feel so inclined, take a stab at adding compatibility using the approach above and send the new patch to the ffmpeg-devel list. If not, I will plan to pick this up in a few weeks and do the same. Thanks for your contribution!

comment:7 by Carl Eugen Hoyos, 3 years ago

Resolution: fixed
Status: openclosed
Note: See TracTickets for help on using tickets.