我正试图将一个绿色屏幕应用程序与我的罗技C910 WebCam放在Fedora 21上。我使用以下命令从摄像头中获得了1080p30 h264视频,并使用gstreamer显示:
gst-launch-1.0 v4l2src device=/dev/video0 ! queue ! \
video/x-h264,width=1920,height=1080,framerate=30/1 ! \
h264parse ! avdec_h264 ! xvimagesink sync=false这是很好的工作与低延迟。我想做的下一件事是,在添加摄像头图片后的图像/视频之前,先对图片进行色度键,使某些颜色透明。根据我所读到的,我需要使用alpha过滤器来实现这一点。从gst检查中,我可以看到它接受了视频/x-raw,输出了视频/x-raw。avdec_h264元素输出视频/x-raw,因此看起来我应该能够:
gst-launch-1.0 v4l2src device=/dev/video0 ! queue ! \
video/x-h264,width=1920,height=1080,framerate=30/1 ! \
h264parse ! avdec_h264 ! alpha method=green ! \
xvimagesink sync=false然而,每当我运行该命令时,我都会得到以下输出:
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Redistribute latency...
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2933): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming task paused, reason not-negotiated (-4)
Execution ended after 0:00:00.437613774
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...有人能告诉我我错过了什么吗?为什么这不能正常工作?
谢谢你的帮忙,
肯辛顿夫人
发布于 2015-05-14 10:52:44
您应该通过视频转换元素将alpha与xvimagesink连接起来:
gst-launch-1.0 v4l2src device=/dev/video0 ! queue ! \
video/x-h264,width=1920,height=1080,framerate=30/1 ! \
h264parse ! avdec_h264 ! alpha method=green ! videoconvert ! \
xvimagesink sync=falsehttps://stackoverflow.com/questions/30005021
复制相似问题