프로그램 사용/gstreamer

gstreamer videomixer ... 2?

구차니 2023. 3. 27. 12:05

chatGPT 님께 물어보니 tee나 queue 대신 videomixer를 알려주시는데

videomixer의 경우 특이하게(?) sink_%u 라고 여러개의 sink를 받을 수 있는 엘리먼트이다.

Pad Templates
sink_%u
video/x-raw:
         format: { AYUV, BGRA, ARGB, RGBA, ABGR, Y444, Y42B, YUY2, UYVY, YVYU, I420, YV12, NV12, NV21, Y41B, RGB, BGR, xRGB, xBGR, RGBx, BGRx }
          width: [ 1, 2147483647 ]
         height: [ 1, 2147483647 ]
      framerate: [ 0/1, 2147483647/1 ]
Presence – request

Direction – sink

Object type – GstPad

src
video/x-raw:
         format: { AYUV, BGRA, ARGB, RGBA, ABGR, Y444, Y42B, YUY2, UYVY, YVYU, I420, YV12, NV12, NV21, Y41B, RGB, BGR, xRGB, xBGR, RGBx, BGRx }
          width: [ 1, 2147483647 ]
         height: [ 1, 2147483647 ]
      framerate: [ 0/1, 2147483647/1 ]
Presence – always

Direction – src

Object type – GstPad

[링크 : https://gstreamer.freedesktop.org/documentation/videomixer/index.html?gi-language=c]

 

그럴싸 하게 주는데 막상 실행하면 에러 -_-

$ gst-launch-1.0 \
v4l2src device=/dev/video0 ! video/x-raw,width=640,height=480 ! videorate ! videoconvert ! videocrop top=0 left=0 right=640 bottom=480 ! \
videomixer name=mix \
sink_0::xpos=0 sink_0::ypos=0 sink_0::alpha=0 \
v4l2src device=/dev/video1 ! video/x-raw,width=640,height=480 ! videorate ! videoconvert ! videocrop top=0 left=0 right=640 bottom=480 ! \
sink_1::xpos=640 sink_1::ypos=0 sink_1::alpha=0 \
! videoconvert ! autovideosink

(gst-launch-1.0:11399): GStreamer-CRITICAL **: 12:04:11.113: gst_element_link_pads_filtered: assertion 'GST_IS_BIN (parent)' failed
WARNING: erroneous pipeline: syntax error