Webcam streaming over png file with Gstreamer

Hello, I am trying to watch USB webcam with gstreamer-1.0 over our background png file. I have used below pipelines,

gst-launch-1.0 videomixer name=mix ! videoconvert ! fbdevsink multifilesrc location="/home/root/bg1.png" caps="image/png,framerate=1/1" ! pngdec ! imagefreeze ! mix. v4l2src device=/dev/video2 ! 'video/x-raw,width=640,height=480,framerate=30/1' ! videoconvert ! mix.

But it says,

Setting pipeline to PAUSED ...                                                  
Pipeline is live and does not need PREROLL ...                                  
Setting pipeline to PLAYING ...                                                 
New clock: GstSystemClock                                                       
WARNING: from element /GstPipeline:pipeline0/GstFBDEVSink:fbdevsink0: A lot of .
Additional debug info:                                                          
../../../../gstreamer-1.12.2/libs/gst/base/gstbasesink.c(2901): gst_base_sink_i:
There may be a timestamping problem, or this computer is too slow.              
WARNING: from element /GstPipeline:pipeline0/GstFBDEVSink:fbdevsink0: A lot of .
Additional debug info:                                                          
../../../../gstreamer-1.12.2/libs/gst/base/gstbasesink.c(2901): gst_base_sink_i:
There may be a timestamping problem, or this computer is too slow.              
WARNING: from element /GstPipeline:pipeline0/GstFBDEVSink:fbdevsink0: A lot of .
Additional debug info:                                                          
../../../../gstreamer-1.12.2/libs/gst/base/gstbasesink.c(2901): gst_base_sink_i:
There may be a timestamping problem, or this computer is too slow.   

As it mentioned, the webcam streaming is too slow. Can anyone tell me how to mix png and gstreamer in this purpose?

Thank you in advance.

Hi @hkhunkim

Hello, I am trying to watch USB webcam with gstreamer-1.0 over our background png file.

What exactly are you trying to do? What is your application?

As it mentioned, the webcam streaming is too slow. Can anyone tell me how to mix png and gstreamer in this purpose?

What are you expecting?

Could you update Bsp 2.8b6 since 2.8b5 is not supported anymore?. I would suggest you to use the LXDE Image if you want to have a background image during you are streaming a video.

Best regards,
Jaski

Hello,

We are trying to make backup camera in our demo car. That’s why I want to stream webcam video over our background image.

Unfortunately, I cannot use LXDE image. Our UI program (Storyboard) cannot be run in LXDE image. it can be only operated without X11 graphical back-end.

And lastly, of course, I expected 30 framerate streaming, but it only shows too slow video.

Hi @hkhunkim,

Thanks for your Input. I am looking into this and will come back tomorrow to you.

Hi @hkhunkim

I could reproduce your issue on Bsp 2.8b6 Lxde Image.

First of all, you need to use the iMX gstreamer plugins for your pipeline which can be found here.
In Linux, you can check for the installed GST elements by the following command:

gst-inspect-1.0 | grep -i imx

After some tries, I found one gstreamer command which makes the video with the background run smoothly.

gst-launch-1.0 imxcompositor_g2d name=mix ! imxvideoconvert_g2d ! imxeglvivsink multifilesrc location="/home/root/bg1.png" caps="image/png,framerate=1/1" ! pngdec ! imagefreeze ! mix. imxv4l2src device=/dev/video3 ! 'video/x-raw,width=640,height=480,framerate=30/1' ! imxvideoconvert_g2d ! mix. &

However this was tested on LXDE image. Since you are running an Image without X1, you need to configure you image correctly to use the iMX gstreamer plugins directly for Framebuffer. Please have a look here.

Another thing, you should also consider is to write the background image directly in the framebuffer fb0 and then stream the webcam video using gstreamer in the fb1 . These two links (Framebuffer, Overlay) may be helpful for you.

Best regards,
Jaski

Thank you for your answer.

I already used direct framebuffer OS setting as shown in your URL (https://www.toradex.com/community/questions/4483/apalis-imx6-linux-image-and-vivante-gpu-fb-support.html)

And your gstreamer command cannot be executed, it says

WARNING: erroneous pipeline: no element "imxcompositor_g2d"

And when I try to install its gst plugins, it says

Solver encountered 2 problem(s):
 * Problem 1/2:
 *   - package gstreamer1.0-plugins-bad-opengl-1.12.2-r0.0.armv7at2hf-neon requires libgles2-mesa >= 17.1.7, but none of the providers can be installed
 * 
 * Solution 1:
 *   - allow deinstallation of eglinfo-fb-1.0.0-r0.armv7at2hf-neon-mx6qdl

 * Solution 2:
 *   - do not ask to install a package providing gstreamer1.0-plugins-bad-opengl

 *   - do not ask to install a package providing gstreamer1.0-plugins-bad-meta

 *   - do not ask to install a package providing gstreamer1.0-plugins-bad-staticdev

 * Problem 2/2:
 *   - package gstreamer1.0-plugins-bad-dev-1.12.2-r0.0.armv7at2hf-neon requires libgstgl-1.0-0, but none of the providers can be installed
 * 
 * Solution 1:
 *   - allow deinstallation of eglinfo-fb-dev-1.0.0-r0.armv7at2hf-neon-mx6qdl

 * Solution 2:
 *   - do not ask to install a package providing gstreamer1.0-plugins-bad-dev

 *   - do not ask to install a package providing gstreamer1.0-plugins-bad-meta

 *   - do not ask to install a package providing gstreamer1.0-plugins-bad-staticdev

Maybe there is conflict configuration between eglinfo-fb and imxcompositor_g2d. I think it’s only possible to be applied in lxde image with X11. And I will keep update my findings and works based on your comments of direct usage on fb0(Video Webcam) and fb1(Background image) separately.

Thank you!

Hi @hkhunkim

Thanks for your Input.

What is the output of the following command in your console image:

gst-inspect-1.0 | grep -i imx

Maybe there is conflict configuration between eglinfo-fb and imxcompositor_g2d. I think it’s only possible to be applied in lxde image with X11.

This is strange. As NXP writes , this plugins should work with better without X11 or wayland.

And I will keep update my findings and works based on your comments of direct usage on fb0(Video Webcam) and fb1(Background image) separately.

Sure, we will wait for your feedback. You may consult also this page.

Best regards,
Jaski