Combine multiple image files using videomixer [GStreamer]

怎甘沉沦 提交于 2019-12-08 05:02:29

问题


I want to combine multiple image files from the internet with Gstreamer 0.10 using a videomixer. I wrote the command line below :

gst-launch videomixer name=mixer ! xvimagesink \
    uridecodebin uri=http://www.geocyclab.fr/wp-content/uploads/2011/10/linux_crystalized_tux.jpg ! \
                videoscale ! video/x-raw-yuv,width=200,height=200 ! \
                ffmpegcolorspace ! \
                imagefreeze ! \
                videobox border-alpha=0 top=0 left=0 ! mixer. \
    uridecodebin uri=http://www.thetechherald.com/media/images/201148/Security-vendors-warn-against-leaked-Windows-7-downloads-windowslogo_1.jpg ! \
                videoscale ! video/x-raw-yuv,width=200,height=200 ! \
                ffmpegcolorspace ! \
                imagefreeze ! \
                videobox border-alpha=0 top=-200 left=0 ! mixer. \
    uridecodebin uri=http://www.colins-it.co.uk/images/Apple-App-Store_21.jpg ! \
                videoscale ! video/x-raw-yuv,width=200,height=200 ! \
                ffmpegcolorspace ! \
                imagefreeze ! \
                videobox border-alpha=0 top=0 left=-200 ! mixer.

I have 2 problems with this command line :

  1. When I want to combine 2 image files, this command line works great, but when I add the third one, a black screen appears instead of the first picture. If I add more pictures, these pictures will appear as I would expect, but at some point (I don't remember when exactly, maybe at the 7th or 8th picture), all pictures except one will be hiden behind black screens.

  2. I can use PNG files only if I delete the 'video/x-raw-yuv' command, but I want to resize the picture... I tried souphttpsrc + pngdec instead of uridecodebin, but I didn't succeed in having the good result.

Can anyone help me ? Thank you.

Edit : If I add the videoboxes in the opposite order (from bottom-right corner to upper-left corner), there are no more black screen on most of my pictures, but I still have one on the first picture (top=0 and left=0).


回答1:


Ok try this and tell me if it works:

gst-launch videomixer2 sink_0::ypos=200 sink_2::xpos=200  name=mixer ! ffmpegcolorspace ! xvimagesink uridecodebin uri=http://www.geocyclab.fr/wp-content/uploads/2011/10/linux_crystalized_tux.jpg ! videoscale ! ffmpegcolorspace ! imagefreeze !  "video/x-raw-yuv, format=(fourcc)AYUV, width=200, height=200" ! mixer. uridecodebin uri=http://www.thetechherald.com/media/images/201148/Security-vendors-warn-against-leaked-Windows-7-downloads-windowslogo_1.jpg ! videoscale ! ffmpegcolorspace ! imagefreeze ! "video/x-raw-yuv, format=(fourcc)AYUV, width=200, height=200" ! mixer. uridecodebin uri=http://www.colins-it.co.uk/images/Apple-App-Store_21.jpg ! videoscale ! ffmpegcolorspace ! imagefreeze ! "video/x-raw-yuv, format=(fourcc)AYUV, width=200, height=200" ! mixer.

With this pipeline you should replace the jpg file by a png if you want. But for position now you should change on videomixer2 like in this pipeline.



来源:https://stackoverflow.com/questions/19678956/combine-multiple-image-files-using-videomixer-gstreamer

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!