我正在開發一個項目,我需要根據顏色顯示一個基於顏色的感興趣區域的「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