1 year ago

#237915

test-img

cagdas demirel

Multi-Camera in WebRTC application with Gstreamer C++

In my pipeline I would like to use 2 different v4l2 source. But When I used like code 1 with double v4l2src , I can get some error like "ERROR GST_PIPELINE grammar.y:740:gst_parse_perform_link: could not link h264parse1 to payloader"

pipe1 =
            gst_parse_launch ("webrtcbin name=sendrecv stun-server=stun://" STUN_SERVER " "
                              "v4l2src  device=/dev/video0 "
                              "! videorate "
                              "! video/x-raw,width=640,height=360,framerate=15/1 "
                              "! videoconvert "
                              "! queue max-size-buffers=1 "
                              "! x264enc bitrate=600 speed-preset=ultrafast tune=zerolatency key-int-max=15 "
                              "! video/x-h264,profile=constrained-baseline "
                              "! queue max-size-time=100000000 ! h264parse "
                              "! rtph264pay config-interval=-1 name=payloader "
                              "! sendrecv. ", &error);

I can also use directly gstreamer multi camera run codes, And I can recorded videos from 2 different camera.

gst-launch-1.0 -e v4l2src device=/dev/video0 ! videoconvert! videoscale ! 'video/x-raw, width=(int)640, height=(int)480' ! tee name=c c. ! queue ! omxvp8enc bitrate=1500000 ! rtpvp8pay ! udpsink bind-port=8574 host=192.168.1.110 port=8574 loop=false c. ! queue ! omxh264enc bitrate=1500000 ! mp4mux ! queue ! filesink location=test-RightFacingCamera.mp4 v4l2src device=/dev/video1 ! videoconvert! videoscale ! 'video/x-raw, width=(int)640, height=(int)480' ! tee name=b b. ! queue ! omxvp8enc bitrate=1500000 ! rtpvp8pay ! udpsink bind-port=8564 host=192.168.1.110 port=8564 loop=false b. ! queue ! omxh264enc bitrate=1500000 ! mp4mux ! queue ! filesink location=test-LeftFacingCamera.mp4

But I couldn't fix my pipeline directly for my WebRTC project, I have to add one more v4l2src , Can you help me about it?

c++

webrtc

gstreamer

pipeline

gst-launch

0 Answers

Your Answer

Accepted video resources