Gstreamer OMXエンコーダはパラメータを受け入れませんか?

Gstreamer OMXエンコーダはパラメータを受け入れませんか?

私はGstreamer 1.0を使用してRTMP経由でUSBウェブカメラフィードを送信しようとしています。 Raspberry PiでOMX h264エンコーダを使用する次の作業パイプラインがあります。

gst-launch-1.0 v4l2src device=/dev/video0 ! image/jpeg, width=1280, height=720, framerate=30/1 ! jpegdec ! videoconvert  ! queue   ! omxh264enc ! h264parse ! flvmux  !  rtmpsink location='<rtmp URL>'

私が経験している問題は、目標ビットレート、制御速度などのパラメータをエンコーダに追加すると、次のエラーが発生することです。

ERROR: from element /GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0: Could not initialise supporting library.
Additional debug info:
gstvideoencoder.c(1627): gst_video_encoder_change_state (): /GstPipeline:pipeline0/GstOMXH264Enc-omxh264enc:omxh264enc-omxh264enc0:
Failed to open encoder

どんなアイデアがありますか?

編集:構文に問題がある場合に備えて、パラメータを含むパイプの外観は次のとおりです。

gst-launch-1.0 v4l2src device=/dev/video0 ! image/jpeg, width=1280, height=720, framerate=30/1 ! jpegdec ! videoconvert  ! queue   ! omxh264enc target-bitrate=10000 ! h264parse ! flvmux  ! rtmpsink location='<rtmp URL>

ベストアンサー1

私に役立つ解決策はを指定することでしたcontrol-rate

... ! omxh264enc target-bitrate=500000 control-rate=1 ! ...
$ gst-inspect-1.0 omxh264enc
Factory Details:
  Rank                     primary + 1 (257)
  Long-name                OpenMAX H.264 Video Encoder
  Klass                    Codec/Encoder/Video
  Description              Encode H.264 video streams
  Author                   Sebastian Dröge <[email protected]>

Plugin Details:
  Name                     omx
  Description              GStreamer OpenMAX Plug-ins
  Filename                 /usr/lib/arm-linux-gnueabihf/gstreamer-1.0/libgstomx.so
  Version                  1.0.0.1
  License                  LGPL
  Source module            gst-omx
  Source release date      2015-11-11 17:35 (UTC)
  Binary package           GStreamer OpenMAX Plug-ins git
  Origin URL               Unknown package origin

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

Implemented Interfaces:
  GstPreset

Pad Templates:
  SINK template: 'sink'
    Availability: Always
    Capabilities:
      video/x-raw
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 0/1, 2147483647/1 ]

  SRC template: 'src'
    Availability: Always
    Capabilities:
      video/x-h264
                  width: [ 16, 4096 ]
                 height: [ 16, 4096 ]


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 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

おすすめ記事