我正在开发一个项目,我需要根据颜色显示一个基于颜色的感兴趣区域的“alpha keying”视频,然后在图像上运行它通过视频可以看到感兴趣区域下的图像。通过图像覆盖(或播放)视频作为背景 - 使用gstreamer
$ gst-launch-0.10 -e \
videomixer name=mix\
! ffmpegcolorspace \
! xvimagesink \
videotestsrc pattern=0 \
! video/x-raw-yuv, framerate=1/1, width=350, height=250 \
! textoverlay font-desc="Sans 24" text="CAM1" valign=top halign=left shaded-background=true \
! videobox border-alpha=0 top=-200 left=-50 \
! mix.
multifilesrc location="drawing_total_mask_1.jpg" caps="image/jpeg,framerate=1/1"
! jpegdec \
! textoverlay font-desc="Sans 26" text="Live from Pl" halign=left shaded-background=true auto-resize=false \
! ffmpegcolorspace \
! video/x-raw-yuv,format=\(fourcc\)AYUV \
! mix.
搜索它,我发现这样的事情,让我显示在图像上测试视频(videotestsrc
),但是当我给一个备用视频源,它不会做。
我用来给我自己的源代码和错误所遵循的代码。
$ gst-launch-0.10 -e videomixer name=mix ! ffmpegcolorspace ! xvimagesink filesrc location = "asd.mp4" ! video/x-raw-yuv, framerate=1/1, width=350, height=250 ! textoverlay font-desc="Sans 24" text="CAM1" valign=top halign=left shaded-background=true ! videobox border-alpha=0 top=-200 left=-50 ! mix. multifilesrc location=drawing_total_mask_1.jpg" caps="image/jpeg,framerate=1/1" ! jpegdec ! textoverlay font-desc="Sans 26" text="Live from Pl" halign=left shaded-background=true auto-resize=false ! ffmpegcolorspace ! video/x-raw-yuv,format=\(fourcc\)AYUV ! mix.
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
WARNING: from element /GstPipeline:pipeline0/GstTextOverlay:textoverlay0: Could not multiplex stream.
Additional debug info:
gsttextoverlay.c(1848): gst_text_overlay_video_event(): /GstPipeline:pipeline0/GstTextOverlay:textoverlay0:
received non-TIME newsegment event on video input
WARNING: from element /GstPipeline:pipeline0/GstTextOverlay:textoverlay1: Could not multiplex stream.
Additional debug info:
gsttextoverlay.c(1848): gst_text_overlay_video_event(): /GstPipeline:pipeline0/GstTextOverlay:textoverlay1:
received non-TIME newsegment event on video input
ERROR: from element /GstPipeline:pipeline0/GstCapsFilter:capsfilter1: Filter caps do not completely specify the output format
Additional debug info:
gstcapsfilter.c(393): gst_capsfilter_prepare_buf(): /GstPipeline:pipeline0/GstCapsFilter:capsfilter1:
Output caps are unfixed: video/x-raw-yuv, framerate=(fraction)1/1, width=(int)350, height=(int)250, format=(fourcc){ AYUV, YUY2, Y444, UYVY, Y42B, YV12, I420, Y41B }
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
我无法找到正确的东西我没有做到这一点。
所以总结
我想要一个由我制作的视频,带有一个透明的alpha区域,当它在图像上运行时,会在视频中的alpha区域显示图像。 任何帮助,将不胜感激。
在此先感谢。
能否请你通过把你说的帮我,在任何管道中作为例子或使用上面的一个。谢谢 – 2015-02-23 12:15:58