obs-studio icon indicating copy to clipboard operation
obs-studio copied to clipboard

mac-videotoolbox: Add HEVC encoders (hw+sw)

Open yuriy-chumak opened this issue 1 year ago • 1 comments

Description

Add support for HEVC (in addition to the existing AVC) for mac-videotoolbox.

Motivation and Context

MacOS videotoolbox plugin should allow HEVC encoding. image

How Has This Been Tested?

Cmake variable ENABLE_HEVC should be enabled (-DENABLE_HEVC=ON)

  1. HDR video was recorded using "Apple VT HEVC Hardware" encoder. Video parameters were tested using the ffprobe tool. The recorded video was played using mpv.
  2. HDR Video was streamed to YouTube using "Apple VT HEVC Hardware" encoder. Video parameters were tested using the Stats for nerds YouTube feature. The streamed video was viewed using chrome web browser.

Mac mini (M1) / 11.6 Big Sur, MacBook Pro (i7) / 12.5 Monterey

Types of changes

  • New feature (non-breaking change which adds functionality)
    • H.264(AVC) related code moved to the mac-videotoolbox/encoder-h264.c.
    • Contents of mac-videotoolbox/encoder.c made H.264/H.265 universal.
    • H.265(HEVC) staff placed in the mac-videotoolbox/encoder-h265.c.

Checklist:

  • [x] My code has been run through clang-format.
  • [x] I have read the contributing document.
  • [x] My code is not on the master branch.
  • [x] The code has been tested.
  • [x] All commit messages are properly formatted and commits squashed where appropriate.
  • [ ] I have included updates to all appropriate documentation.

yuriy-chumak avatar Aug 09 '22 10:08 yuriy-chumak

Please split your commits and explain your changes in detail if possible. There appear to be changes not directly related to HEVC.

Done. Non related HEVC code removed.

yuriy-chumak avatar Aug 10 '22 09:08 yuriy-chumak

I'll update PR soon - will merge changes into one source file to simplify review and merging with others changes.

yuriy-chumak avatar Aug 11 '22 12:08 yuriy-chumak

The code has been combined into one file to make it easier to review.

yuriy-chumak avatar Aug 16 '22 08:08 yuriy-chumak

I looked through the diffs, and this PR has been superset by other commits. It should be fine to close.

jpark37 avatar Nov 25 '22 21:11 jpark37