fzwoch / obs-gstreamer

GStreamer OBS Studio plugin
GNU General Public License v2.0
358 stars 34 forks source link

add QSV (msdk) and nvenc/h265 codecs #86

Closed marvin0815 closed 2 years ago

marvin0815 commented 2 years ago
fzwoch commented 2 years ago

Do you have access to these encoders and did you test them? Just wondering whether gop-size is really being used on both since they usually don't share the same names for their options.

marvin0815 commented 2 years ago

At least gop-size is mentioned by gst-inspect-1.0 as an element property for msdk. It could be there for compatibility reasons though.

$ gst-inspect-1.0 msdkh264enc
libva info: VA-API version 1.14.0
libva info: Trying to open /usr/lib64/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva info: va_openDriver() returns 0
Factory Details:
  Rank                     none (0)
  Long-name                Intel MSDK H264 encoder
  Klass                    Codec/Encoder/Video/Hardware
  Description              H264 video encoder based on Intel Media SDK
  Author                   Josep Torra <jtorra@oblong.com>

Plugin Details:
  Name                     msdk
  Description              Intel Media SDK based elements
  Filename                 /usr/lib64/gstreamer-1.0/libgstmsdk.so
  Version                  1.18.4
  License                  LGPL
  Source module            gst-plugins-bad
  Source release date      2021-03-15
  Binary package           GStreamer Bad Plug-ins source release
  Origin URL               Unknown package origin

GObject
 +----GInitiallyUnowned
       +----GstObject
             +----GstElement
                   +----GstVideoEncoder
                         +----GstMsdkEnc
                               +----GstMsdkH264Enc

Implementierte Schnittstellen:
  GstPreset

Pad Templates:
  SINK template: 'sink'
    Availability: Always
    Capabilities:
      video/x-raw
                 format: { (string)NV12, (string)I420, (string)YV12, (string)YUY2, (string)UYVY, (string)BGRA }
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]
         interlace-mode: progressive
      video/x-raw(memory:DMABuf)
                 format: NV12
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]
         interlace-mode: progressive

  SRC template: 'src'
    Availability: Always
    Capabilities:
      video/x-h264
              framerate: [ 0/1, 2147483647/1 ]
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
          stream-format: byte-stream
              alignment: au
                profile: { (string)high, (string)main, (string)baseline, (string)constrained-baseline }

Element has no clocking capabilities.
Element has no URI handling capabilities.

Pads:
  SINK: 'sink'
    Pad Template: 'sink'
  SRC: 'src'
    Pad Template: 'src'

Element Properties:
  accuracy            : The AVBR Accuracy in the unit of tenth of percent
                        flags: lesbar, schreibbar
                        Unsigned Integer. Range: 0 - 65535 Default: 0 
  async-depth         : Depth of asynchronous pipeline
                        flags: lesbar, schreibbar
                        Unsigned Integer. Range: 1 - 20 Default: 4 
  b-adapt             : Adaptive B-Frame Insertion control
                        flags: lesbar, schreibbar
                        Enum "GstMsdkEncAdaptiveB" Default: 32, "off"
                           (0): auto             - SDK desides what to do
                           (32): off              - Disable Adaptive B-Frame insertion 
                           (16): on               - Enable Aaptive B-Frame insertion 
  b-frames            : Number of B frames between I and P frames
                        flags: lesbar, schreibbar
                        Unsigned Integer. Range: 0 - 2147483647 Default: 0 
  b-pyramid           : Enable B-Pyramid Reference structure
                        flags: lesbar, schreibbar
                        Boolean. Default: false
  bitrate             : Bitrate in kbit/sec
                        flags: lesbar, schreibbar, änderbar in den Status NULL, BEREIT, PAUSIERT oder ABSPIELEN
                        Unsigned Integer. Range: 1 - 2048000 Default: 2048 
  cabac               : Enable CABAC entropy coding
                        flags: lesbar, schreibbar
                        Boolean. Default: true
  convergence         : The AVBR Convergence in the unit of 100 frames
                        flags: lesbar, schreibbar
                        Unsigned Integer. Range: 0 - 65535 Default: 0 
  frame-packing       : Set frame packing mode for Stereoscopic content
                        flags: lesbar, schreibbar
                        Enum "GstMsdkH264EncFramePacking" Default: -1, "none"
                           (-1): none             - None (default)
                           (3): side-by-side     - Side by Side
                           (7): top-bottom       - Top Bottom
  gop-size            : GOP Size
                        flags: lesbar, schreibbar
                        Unsigned Integer. Range: 0 - 2147483647 Default: 256 
  hardware            : Enable hardware encoders
                        flags: lesbar, schreibbar
                        Boolean. Default: true
  i-adapt             : Adaptive I-Frame Insertion control
                        flags: lesbar, schreibbar
                        Enum "GstMsdkEncAdaptiveI" Default: 32, "off"
                           (0): auto             - SDK desides what to do
                           (32): off              - Disable Adaptive I frame insertion 
                           (16): on               - Enable Aaptive I frame insertion 
  i-frames            : Number of I frames between IDR frames
                        flags: lesbar, schreibbar
                        Unsigned Integer. Range: 0 - 2147483647 Default: 0 
  low-power           : Enable low power mode (DEPRECATED, use tune instead)
                        flags: lesbar, schreibbar, veraltet
                        Boolean. Default: false
  max-frame-size      : Maximum possible size (in kb) of any compressed frames (0: auto-calculate)
                        flags: lesbar, schreibbar
                        Unsigned Integer. Range: 0 - 65535 Default: 0 
  max-slice-size      : Maximum slice size in bytes (if enabled MSDK will ignore the control over num-slices)
                        flags: lesbar, schreibbar
                        Unsigned Integer. Range: 0 - 4294967295 Default: 0 
  max-vbv-bitrate     : Maximum bitrate(kbit/sec) at which data enters Video Buffering Verifier (0: auto-calculate)
                        flags: lesbar, schreibbar
                        Unsigned Integer. Range: 0 - 2048000 Default: 0 
  mbbrc               : Macroblock level bitrate control
                        flags: lesbar, schreibbar
                        Enum "GstMsdkEncMbBitrateControl" Default: 32, "off"
                           (0): auto             - SDK desides what to do
                           (32): off              - Disable Macroblock level bit rate control
                           (16): on               - Enable Macroblock level bit rate control 
  min-force-key-unit-interval: Minimum interval between force-keyunit requests in nanoseconds
                        flags: lesbar, schreibbar
                        Unsigned Integer64. Range: 0 - 18446744073709551615 Default: 0 
  name                : The name of the object
                        flags: lesbar, schreibbar, 0x2000
                        String. Default: "msdkh264enc0"
  num-slices          : Number of slices per frame, Zero tells the encoder to choose any slice partitioning allowed by the codec standard
                        flags: lesbar, schreibbar
                        Unsigned Integer. Range: 0 - 2147483647 Default: 0 
  parent              : The parent of the object
                        flags: lesbar, schreibbar, 0x2000
                        Object of type "GstObject"
  qos                 : Handle Quality-of-Service events from downstream
                        flags: lesbar, schreibbar
                        Boolean. Default: false
  qpb                 : Constant quantizer for B frames (0 unlimited)
                        flags: lesbar, schreibbar
                        Unsigned Integer. Range: 0 - 51 Default: 0 
  qpi                 : Constant quantizer for I frames (0 unlimited). Also used as ICQQuality or QVBRQuality for different RateControl methods
                        flags: lesbar, schreibbar
                        Unsigned Integer. Range: 0 - 51 Default: 0 
  qpp                 : Constant quantizer for P frames (0 unlimited)
                        flags: lesbar, schreibbar
                        Unsigned Integer. Range: 0 - 51 Default: 0 
  rate-control        : Rate control method
                        flags: lesbar, schreibbar
                        Enum "GstMsdkEncRateControl" Default: 1, "cbr"
                           (1): cbr              - Constant Bitrate
                           (2): vbr              - Variable Bitrate
                           (3): cqp              - Constant Quantizer
                           (4): avbr             - Average Bitrate
                           (8): la_vbr           - VBR with look ahead (Non HRD compliant)
                           (9): icq              - Intelligent CQP
                           (10): vcm              - Video Conferencing Mode (Non HRD compliant)
                           (11): la_icq           - Intelligent CQP with LA (Non HRD compliant)
                           (13): la_hrd           - HRD compliant LA
                           (14): qvbr             - VBR with CQP
  rc-lookahead        : Number of frames to look ahead for Rate control
                        flags: lesbar, schreibbar
                        Unsigned Integer. Range: 10 - 100 Default: 10 
  rc-lookahead-ds     : Down sampling mode in look ahead bitrate control
                        flags: lesbar, schreibbar
                        Enum "GstMsdkEncRCLookAheadDownsampling" Default: 0, "default"
                           (0): default          - SDK desides what to do
                           (1): off              - No downsampling
                           (2): 2x               - Down sample 2-times before estimation
                           (3): 4x               - Down sample 4-times before estimation
  ref-frames          : Number of reference frames
                        flags: lesbar, schreibbar
                        Unsigned Integer. Range: 0 - 2147483647 Default: 1 
  target-usage        : 1: Best quality, 4: Balanced, 7: Best speed
                        flags: lesbar, schreibbar
                        Unsigned Integer. Range: 1 - 7 Default: 4 
  trellis             : Enable Trellis Quantization
                        flags: lesbar, schreibbar
                        Flags "GstMsdkEncTrellisQuantization" Default: 0x00000000, "None"
                           (0x00000000): None             - Disable for all frames
                           (0x00000002): i                - Enable for I frames
                           (0x00000004): p                - Enable for P frames
                           (0x00000008): b                - Enable for B frames
  tune                : Encoder tuning option
                        flags: lesbar, schreibbar
                        Enum "GstMsdkEncTuneMode" Default: 0, "auto"
                           (0): auto             - Auto 
                           (32): none             - None 
                           (16): low-power        - Low power mode
fzwoch commented 2 years ago

Thanks, looks good to me.