mac-vth264: Add Apple H264 encoder

Adds a VideoToolbox based H264 encoder for OSX, which most notably
allows the use of hardware encoding (Quicksync).

NOTES:
- Hardware encoding is handled by Apple itself internally.  The plugin
  itself has little control over many details due to the way that Apple
  designed the VideoToolbox interface.  Generally however, quicksync is
  used if available on the CPU, and quicksync is almost always available
  due to the fact that macs are exclusively Intel.

- The VideoToolbox does not seem to implement CBR, so it won't be
  available.  These encoders are generally not recommended for
  streaming.
master
kc5nra 2015-07-16 20:55:50 -05:00 committed by jp9000
parent afa2985f64
commit 595f451eb7
4 changed files with 1057 additions and 0 deletions

View File

@ -13,6 +13,7 @@ elseif(APPLE)
add_subdirectory(coreaudio-encoder)
add_subdirectory(mac-avcapture)
add_subdirectory(mac-capture)
add_subdirectory(mac-vth264)
add_subdirectory(mac-syphon)
add_subdirectory(decklink/mac)
elseif("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")

View File

@ -0,0 +1,32 @@
project(mac-vth264)
find_library(AVFOUNDATION AVFoundation)
find_library(COCOA Cocoa)
find_library(COREFOUNDATION CoreFoundation)
find_library(COREVIDEO CoreVideo)
find_library(VIDEOTOOLBOX VideoToolbox)
find_library(COREMEDIA CoreMedia)
include_directories(${AVFOUNDATION}
${COCOA}
${COREFOUNDATION}
${COREVIDEO}
${VIDEOTOOLBOX}
${COREMEDIA})
set(mac-vth264_SOURCES
encoder.c)
add_library(mac-vth264 MODULE
${mac-vth264_SOURCES})
target_link_libraries(mac-vth264
libobs
${AVFOUNDATION}
${COCOA}
${COREFOUNDATION}
${COREVIDEO}
${VIDEOTOOLBOX}
${COREMEDIA})
install_obs_plugin_with_data(mac-vth264 data)

View File

@ -0,0 +1,13 @@
VTH264EncHW="Apple VT H264 Hardware Encoder"
VTH264EncSW="Apple VT H264 Software Encoder"
VTEncoder="VideoToolbox Encoder"
Bitrate="Bitrate"
UseMaxBitrate="Limit bitrate"
MaxBitrate="Maximum bitrate"
MaxBitrateWindow="Maximum bitrate window (seconds)"
KeyframeIntervalSec="Keyframe Interval (seconds, 0=auto)"
Profile="Profile"
None="(None)"
DefaultEncoder="(Default Encoder)"
UseBFrames="Use B-Frames"

1011
plugins/mac-vth264/encoder.c Normal file

File diff suppressed because it is too large Load Diff