2016-10-07 55 views
0

我有4個usb framegrabbers我想從中捕獲視頻並在4個屏幕(它們混合在一個窗口中)顯示它。侏儒流光掩模混合器

運行命令給出什麼是採集卡支持:

gst-launch-1.0 --gst-debug=v4l2src:5 v4l2src device=/dev/video0 ! fakesink 2>&1 | sed -une '/caps of src/ s/[:;] /\n/gp' 

結果:

0:00:00.015135255 4333  0x1e01630 DEBUG    v4l2src gstv4l2src.c:300:gst_v4l2src_negotiate:<v4l2src0> caps of src 
video/x-raw, format=(string)YUY2, framerate=(fraction)30000/1001, width=(int)720, height=(int)480, interlace-mode=(string)interleaved, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)bt601 
video/x-raw, format=(string)I420, framerate=(fraction)30000/1001, width=(int)720, height=(int)480, interlace-mode=(string)interleaved, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)bt601 
video/x-raw, format=(string)YV12, framerate=(fraction)30000/1001, width=(int)720, height=(int)480, interlace-mode=(string)interleaved, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)bt601 
video/x-raw, format=(string)BGR, framerate=(fraction)30000/1001, width=(int)720, height=(int)480, interlace-mode=(string)interleaved, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)1:1:5:4 
video/x-raw, format=(string)RGB, framerate=(fraction)30000/1001, width=(int)720, height=(int)480, interlace-mode=(string)interleaved, pixel-aspect-ratio=(fraction)1/1, colorimetry=(string)1:1:5:4 

當我運行:

#!/bin/bash 
gst-launch-1.0 -e videomixer name=mix ! videoconvert ! autovideosink \ 
     videotestsrc pattern=13 ! video/x-raw, format=YUY2, framerate=30000/1001, width=720, height=480 ! videobox border-alpha=0 top=-480 left=-720 ! mix. \ 
     videotestsrc pattern=1 ! video/x-raw, format=YUY2, framerate=30000/1001, width=720, height=480 ! videobox border-alpha=0 top=-480 left=0 ! mix. \ 
     videotestsrc pattern=15 ! video/x-raw, format=YUY2, framerate=30000/1001, width=720, height=480 ! videobox border-alpha=0 top=0 left=-720 ! mix. \ 
     videotestsrc pattern=0 ! video/x-raw, format=YUY2, framerate=30000/1001, width=720, height=480 ! videobox border-alpha=0 top=0 left=0 ! mix. 

它works.Four測試窗口顯示出來。

現在我想顯示/ dev/video0,但它不起作用。

Reports "Internal data flow error": 
#!/bin/bash 
gst-launch-1.0 -e videomixer name=mix ! videoconvert ! autovideosink \ 
     v4l2src device=/dev/video0 ! video/x-raw, format=YUY2, framerate=30000/1001, width=720, height=480 ! videobox border-alpha=0 top=-480 left=-720 ! mix. \ 
     v4l2src device=/dev/video1 ! video/x-raw, format=YUY2, framerate=30000/1001, width=720, height=480 ! videobox border-alpha=0 top=-480 left=0 ! mix. \ 
     v4l2src device=/dev/video2 ! video/x-raw, format=YUY2, framerate=30000/1001, width=720, height=480 ! videobox border-alpha=0 top=0 left=-720 ! mix. \ 
     v4l2src device=/dev/video3 ! videoconvert ! video/x-raw, format=YUY2, framerate=30000/1001, width=720, height=480 ! videobox border-alpha=0 top=0 left=0 ! mix. 

運行提示錯誤:

Setting pipeline to PAUSED ... 
Pipeline is live and does not need PREROLL ... 
Setting pipeline to PLAYING ... 
New clock: GstSystemClock 
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data flow error. 
Additional debug info: 
gstbasesrc.c(2948): gst_base_src_loop(): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: 
streaming task paused, reason not-negotiated (-4) 
EOS on shutdown enabled -- waiting for EOS after Error 
Waiting for EOS... 
ERROR: from element /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstXvImageSink:autovideosink0-actual-sink-xvimage: Output window was closed 
Additional debug info: 
xvimagesink.c(555): gst_xv_image_sink_handle_xevents(): /GstPipeline:pipeline0/GstAutoVideoSink:autovideosink0/GstXvImageSink:autovideosink0-actual-sink-xvimage 

可能有人請幫忙。

回答

0

我沒有足夠的積分把它作爲評論。

我有完全相同的問題,除了我的視頻源是MJPEG流。

我已經設法通過向管道添加視頻比例來創建窗口。

這將是相當於給你:

gst-launch-1.0 -e videomixer name=mix ! videoconvert ! autovideosink \ 
     v4l2src device=/dev/video0 ! videoscale ! video/x-raw, format=YUY2, framerate=30000/1001, width=720, height=480 ! videobox border-alpha=0 top=-480 left=-720 ! mix. \ 
     v4l2src device=/dev/video1 ! videoscale ! video/x-raw, format=YUY2, framerate=30000/1001, width=720, height=480 ! videobox border-alpha=0 top=-480 left=0 ! mix. \ 
     v4l2src device=/dev/video2 ! videoscale ! video/x-raw, format=YUY2, framerate=30000/1001, width=720, height=480 ! videobox border-alpha=0 top=0 left=-720 ! mix. \ 
     v4l2src device=/dev/video3 ! videoscale ! videoconvert ! video/x-raw, format=YUY2, framerate=30000/1001, width=720, height=480 ! videobox border-alpha=0 top=0 left=0 ! mix. 

不幸的是我得到的是一個空的窗口,但至少這是一種進步。