6

I cannot create a pipeline with gstreamer and I don't know how I can debug it further.

gst-launch-1.0 --gst-debug=GST_CAPS:4 -v -e customsrc num-buffers=1000 ! video/x-h264,width=600,height=600,framerate=1/12,stream-format=byte-stream ! mpegtsmux ! udpsink host=10.92.7.2 port=5000
WARNING: erroneous pipeline: could not link customsrc0 to mpegtsmux0

The capabilities of customsrc and mpegtsmux are matching. But obviously something is missing.

customsrc

Pad Templates:
  SRC template: 'src'
    Availability: Always
    Capabilities:
      video/x-h264
                  width: [ 1, 2147483647 ]
                 height: [ 1, 2147483647 ]
              framerate: [ 1/2147483647, 2147483647/1 ]
          stream-format: avc
              alignment: au

mpegtsmux

Pad Templates:
  SINK template: 'sink_%d'
    Availability: On request
      Has request_new_pad() function: 0x76beca8c
    Capabilities:
      video/x-h264
          stream-format: byte-stream
              alignment: { au, nal }

What else can I do to figure out the mismatch?

Umut
  • 2,317
  • 1
  • 17
  • 19
  • They have different stream formats (avc != byte-stream). Maybe use an h264parse element between them? – mpr Jul 30 '15 at 17:46
  • Isn't `video/x-h264,width=600,height=600,framerate=1/12,stream-format=byte-stream` filter enough to convert the format to byte-stream? – Umut Jul 30 '15 at 18:31

1 Answers1

4

Caps are for filtering and defining how the pipeline runs--they don't cause any transformation by themselves. For example, if you have two elements with these caps on their source and sink pads:

  video/x-h264
      stream-format: byte-stream
          alignment: { au, nal }

  video/x-h264
      stream-format: byte-stream
          alignment: { au, nal }

And you place this caps filter between them:

video/x-h264,alignment=nal

You'll cause the pipeline to use nal alignment there. If your elements have these caps on their pads:

  video/x-h264
      stream-format: avc
          alignment: { au, nal }

  video/x-h264
      stream-format: byte-stream
          alignment: { au, nal }

You need to add an element that will convert video/x-h264,stream-format=avc into video/x-h264,stream-format=byte-stream. h264parse will do this because it takes any video/x-h264 content on its sink pad, and outputs whatever stream-format and alignments are needed for its downstream source:

  SRC template: 'src'
    Availability: Always
    Capabilities:
      video/x-h264
                 parsed: true
          stream-format: { avc, avc3, byte-stream }
              alignment: { au, nal }

  SINK template: 'sink'
    Availability: Always
    Capabilities:
      video/x-h264
mpr
  • 3,250
  • 26
  • 44