Tegra K1 OpenMax capabilities

I’m considering purchasing a Jetson TK1 development board for a video project. It is my understanding that access to the OpenMax encoding api is through a customized gst-omx library (omxh264enc). I’m particularly interested in the OpenMax encoding parameter OMX_VIDEO_INTRAREFRESHTYPE so I can encode P-frame only with intra-refresh. After many hours of searching, I have been unable to find any documentation on what encoding options are available.

Does the Tegra K1 support this encoding mode, and is it exposed in Nvidia’s gst-omx library implementation? If someone with a Jetson TK1 would be kind enough and run gst-inspect on omxh264enc (gstreamer 1.0) and/or nv_omx_h264enc (gstreamer 0.10) and post the output, that would also help tremendously. Thanks!

OpenMAX is not officially supported, only GStreamer. Currently Gst uses the OMX API internally though.

GST sources are available, so you should be able to check some things from there too.

The below commands are run with 19r3 libraries.

ubuntu@tegra-ubuntu:~$ gst-inspect-1.0 omxh264enc
Factory Details:
  Rank                     primary + 10 (266)
  Long-name                OpenMAX H.264 Video Encoder
  Klass                    Codec/Encoder/Video
  Description              Encode H.264 video streams
  Author                   Sebastian Dröge <sebastian.droege@collabora.co.uk>

Plugin Details:
  Name                     omx
  Description              GStreamer OpenMAX Plug-ins
  Filename                 /usr/lib/arm-linux-gnueabihf/gstreamer-1.0/libgstomx.so
  Version                  1.2.3
  License                  LGPL
  Source module            gstreamer
  Source release date      2014-02-08
  Binary package           GStreamer source release
  Origin URL               Unknown package origin

GObject
 +----GInitiallyUnowned
       +----GstObject
             +----GstElement
                   +----GstVideoEncoder
                         +----GstOMXVideoEnc
                               +----GstOMXH264Enc
                                     +----GstOMXH264Enc-omxh264enc

Implemented Interfaces:
  GstPreset

Pad Templates:
  SRC template: 'src'
    Availability: Always
    Capabilities:
      video/x-h264
                  width: [ 16, 4096 ]
                 height: [ 16, 4096 ]
          stream-format: { byte-stream, avc }
              alignment: au

  SINK template: 'sink'
    Availability: Always
    Capabilities:
      video/x-raw
                 format: { I420, NV12 }
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]

Element Flags:
  no flags set

Element Implementation:
  Has change_state() function: gst_omx_video_enc_change_state

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

Pads:
  SINK: 'sink'
    Implementation:
      Has chainfunc(): gst_video_encoder_chain
      Has custom eventfunc(): gst_video_encoder_sink_event
      Has custom queryfunc(): gst_video_encoder_sink_query
      Has custom iterintlinkfunc(): gst_pad_iterate_internal_links_default
    Pad Template: 'sink'
  SRC: 'src'
    Implementation:
      Has custom eventfunc(): gst_video_encoder_src_event
      Has custom queryfunc(): gst_video_encoder_src_query
      Has custom iterintlinkfunc(): gst_pad_iterate_internal_links_default
    Pad Template: 'src'

Element Properties:
  name                : The name of the object
                        flags: readable, writable
                        String. Default: "omxh264enc-omxh264enc0"
  parent              : The parent of the object
                        flags: readable, writable
                        Object of type "GstObject"
  control-rate        : Bitrate control method
                        flags: readable, writable, changeable only in NULL or READY state
                        Enum "GstOMXVideoEncControlRate" Default: -1, "default"
                           (0): disable          - Disable
                           (1): variable         - Variable
                           (2): constant         - Constant
                           (3): variable-skip-frames - Variable Skip Frames
                           (4): constant-skip-frames - Constant Skip Frames
                           (-1): default          - Component Default
  target-bitrate      : Target bitrate (0xffffffff=component default)
                        flags: readable, writable, changeable in NULL, READY, PAUSED or PLAYING state
                        Unsigned Integer. Range: 0 - 4294967295 Default: 4294967295 
  quant-i-frames      : Quantization parameter for I-frames (0xffffffff=component default)
                        flags: readable, writable, changeable only in NULL or READY state
                        Unsigned Integer. Range: 0 - 4294967295 Default: 4294967295 
  quant-p-frames      : Quantization parameter for P-frames (0xffffffff=component default)
                        flags: readable, writable, changeable only in NULL or READY state
                        Unsigned Integer. Range: 0 - 4294967295 Default: 4294967295 
  quant-b-frames      : Quantization parameter for B-frames (0xffffffff=component default)
                        flags: readable, writable, changeable only in NULL or READY state
                        Unsigned Integer. Range: 0 - 4294967295 Default: 4294967295
ubuntu@tegra-ubuntu:~$ gst-inspect-0.10 nv_omx_h264enc
Factory Details:
  Long name:    OpenMAX IL H.264/AVC video encoder
  Class:        Codec/Encoder/Video
  Description:  Encodes video in H.264/AVC format with OpenMAX IL
  Author(s):    Felipe Contreras
  Rank:         primary + 10 (266)

Plugin Details:
  Name:                 omx
  Description:          OpenMAX IL
  Filename:             /usr/lib/arm-linux-gnueabihf/gstreamer-0.10/libgstomx.so
  Version:              0.10.1
  License:              LGPL
  Source module:        gst-openmax
  Binary package:       gst-openmax source release
  Origin URL:           Unknown package origin

GObject
 +----GstObject
       +----GstElement
             +----GstOmxBaseFilter
                   +----GstOmxBaseVideoEnc
                         +----GstOmxH264Enc

Implemented Interfaces:
  GstImplementsInterface
  GstOmx

Pad Templates:
  SINK template: 'sink'
    Availability: Always
    Capabilities:
      video/x-raw-yuv
                  width: [ 16, 4096 ]
                 height: [ 16, 4096 ]
              framerate: [ 0/1, 2147483647/1 ]
                 format: { I420, NV12 }
      video/x-nv-yuv
                  width: [ 16, 4096 ]
                 height: [ 16, 4096 ]
              framerate: [ 0/1, 2147483647/1 ]
                 format: { I420, NV12 }
      video/x-nvrm-yuv
                  width: [ 16, 4096 ]
                 height: [ 16, 4096 ]
              framerate: [ 0/1, 2147483647/1 ]
                 format: { I420, NV12 }

  SRC template: 'src'
    Availability: Always
    Capabilities:
      video/x-h264
              framerate: [ 0/1, 2147483647/1 ]
                  width: [ 176, 2147483647 ]
                 height: [ 144, 2147483647 ]
          stream-format: { byte-stream, avc }
              alignment: { au }

Element Flags:
  no flags set

Element Implementation:
  Has change_state() function: 0xb6066694
  Has custom save_thyself() function: gst_element_save_thyself
  Has custom restore_thyself() function: gst_element_restore_thyself

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

Pads:
  SRC: 'src'
    Implementation:
      Has custom eventfunc(): gst_pad_event_default
      Has custom queryfunc(): gst_pad_query_default
      Has custom iterintlinkfunc(): gst_pad_iterate_internal_links_default
      Has getcapsfunc(): gst_pad_get_fixed_caps_func
      Has acceptcapsfunc(): gst_pad_acceptcaps_default
    Pad Template: 'src'
  SINK: 'sink'
    Implementation:
      Has chainfunc(): 0xb606697c
      Has custom eventfunc(): 0xb6065d50
      Has custom queryfunc(): gst_pad_query_default
      Has custom iterintlinkfunc(): gst_pad_iterate_internal_links_default
      Has setcapsfunc(): 0xb608ed24
      Has acceptcapsfunc(): gst_pad_acceptcaps_default
    Pad Template: 'sink'

Element Properties:
  name                : The name of the object
                        flags: readable, writable
                        String. Default: "omxh264enc0"
  component-name      : Name of the OpenMAX IL component to use
                        flags: readable
                        String. Default: "OMX.Nvidia.h264.encoder"
  component-role      : Role of the OpenMAX IL component
                        flags: readable
                        String. Default: null
  library-name        : Name of the OpenMAX IL implementation library to use
                        flags: readable
                        String. Default: "libnvomx.so"
  use-timestamps      : Whether or not to use timestamps
                        flags: readable, writable
                        Boolean. Default: true
  input-buffers       : The number of OMX input buffers
                        flags: readable, writable
                        Unsigned Integer. Range: 1 - 10 Default: 6 
  output-buffers      : The number of OMX output buffers
                        flags: readable, writable
                        Unsigned Integer. Range: 1 - 10 Default: 6 
  full-frame          : Whether or not the data is full framed
                        flags: readable, writable
                        Boolean. Default: true
  bitrate             : Encoding bit-rate
                        flags: readable, writable
                        Unsigned Integer. Range: 0 - 4294967295 Default: 4000000 
  quality-level       : Encoding quality-level
                        flags: readable, writable
                        Unsigned Integer. Range: 0 - 2 Default: 2 
  rc-mode             : Encoding rate control mode
                        flags: readable, writable
                        Enum "GstOmxVideoEncRCModeType" Default: 2, "vbr2"
                           (0): cbr              - GST_OMX_VIDENC_RCMODE_TYPE_CONSTANT
                           (1): vbr              - GST_OMX_VIDENC_RCMODE_TYPE_VARIABLE
                           (2): vbr2             - GST_OMX_VIDENC_RCMODE_TYPE_VARIABLE2
  iframeinterval      : Encoding Intra Frame occurance frequency
                        flags: readable, writable
                        Unsigned Integer. Range: 0 - 4294967295 Default: 60 
  qp-range            : Qunatization range for P and I frame
                        flags: readable, writable
                        String. Default: null
  temporal-tradeoff   : Temporal Tradeoff value for encoder
                        flags: readable, writable
                        Enum "GstOmxVideoEncTemporalTradeoffType" Default: 0, "30fps"
                           (0): 30fps            - GST_OMX_VIDENC_FORCE_FRAMERATE_AS_FAST_AS_POSSIBLE
                           (1): 24fps            - GST_OMX_VIDENC_FORCE_FRAMERATE_24
                           (2): 20fps            - GST_OMX_VIDENC_FORCE_FRAMERATE_20
                           (3): 15fps            - GST_OMX_VIDENC_FORCE_FRAMERATE_15
                           (4): 10fps            - GST_OMX_VIDENC_FORCE_FRAMERATE_10
  bit-packetization   : Whether or not Packet size is based upon Number Of bits
                        flags: readable, writable
                        Boolean. Default: false
  insert-spsppsatidr  : Whether or not insert SPS & PPS at every IDR
                        flags: readable, writable
                        Boolean. Default: true
  framerate           : Frames per second
                        flags: readable, writable
                        Integer. Range: 0 - 60 Default: 30 
  slice-header-spacing: Slice Header Spacing number of macroblocks/bits in one packet
                        flags: readable, writable
                        Unsigned Long. Range: 0 - 4294967295 Default: 0 

Element Actions:
  "force-IDR" :  void user_function (GstElement* object);

I’m happy to run some gst-launch commands, if you want more testing to be done.

The gst-inspect output provides enough, no launch commands necessary. Thanks for your help, that resolved several questions of mine.