在我的管道中,我想使用 2 个不同的 v4l2 源。但是当我将代码 1 与 double v4l2src 一起使用时,我会收到一些错误,例如“ 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);
我也可以直接使用 gstreamer 多摄像头运行代码,我可以从 2 个不同的摄像头录制视频。
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
但是我无法直接为我的 WebRTC 项目修复我的管道,我必须再添加一个 v4l2src ,你能帮我解决一下吗?