GStreamer in Docker for Windows.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

GStreamer in Docker for Windows.

Andrés Meseguer Valenzuela
Dear all,
I am trying to create a Linux image to execute containers with  
gstreamer pipelines in Docker Desktop (for Windows).
For example, using the following dockerfile:

FROM ubuntu:20.10

RUN apt-get update && \
       apt-get -y install sudo

RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser  
docker sudo

CMD /bin/bash

RUN sudo -s apt-get update
RUN apt-get install libgstreamer1.0-0 gstreamer1.0-plugins-base  
gstreamer1.0-plugins-good gstreamer1.0-plugins-bad  
gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools  
gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3  
gstreamer1.0-qt5 gstreamer1.0-pulseaudio -y

ENTRYPOINT gst-launch-1.0 v4l2src device=/dev/video0 !  
'video/x-raw,width=640,height=480,framerate=30/1' ! videoconvert !  
ximagesink

USER docker

I try to display my webcam but the problem is that despite this image  
builds, when I run it, the prompt returns this:

> docker run -it --net=host -e --privileged  -v  
> /dev/video0:/dev/video0 fivecomm/webcam  
> >$HOME/.Xauthority:/root/.Xauthority                                  
>                                                                    
> Setting pipeline to PAUSED ...                                        
>                                                    ERROR: from  
> element /GstPipeline:pipeline0/GstXImageSink:ximagesink0: Could not  
> initialise X output                     Additional debug info:        
>                                                                      
>                       ../sys/ximage/ximagesink.c(867):  
> gst_x_image_sink_xcontext_get ():  
> /GstPipeline:pipeline0/GstXImageSink:ximagesink0:    Could not open  
> display                                                              
>                                     ERROR: pipeline doesn't want to  
> preroll.                                                              
>                    Failed to set pipeline to PAUSED.                  
>                                                                      
>  Setting pipeline to NULL ...                                        
>                                                     Freeing pipeline  
> ...

Hence, I would like to know how to display in Windows.
Thanks for your time.

Regards,
Andrés.


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: GStreamer in Docker for Windows.

Nicolas Dufresne-5
Le lundi 07 décembre 2020 à 11:57 +0100, Andrés Meseguer Valenzuela a écrit :

> Dear all,
> I am trying to create a Linux image to execute containers with 
> gstreamer pipelines in Docker Desktop (for Windows).
> For example, using the following dockerfile:
>
> FROM ubuntu:20.10
>
> RUN apt-get update && \
>        apt-get -y install sudo
>
> RUN useradd -m docker && echo "docker:docker" | chpasswd && adduser 
> docker sudo
>
> CMD /bin/bash
>
> RUN sudo -s apt-get update
> RUN apt-get install libgstreamer1.0-0 gstreamer1.0-plugins-base 
> gstreamer1.0-plugins-good gstreamer1.0-plugins-bad 
> gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools 
> gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 
> gstreamer1.0-qt5 gstreamer1.0-pulseaudio -y
>
> ENTRYPOINT gst-launch-1.0 v4l2src device=/dev/video0 ! 
> 'video/x-raw,width=640,height=480,framerate=30/1' ! videoconvert ! 
> ximagesink
>
> USER docker
>
> I try to display my webcam but the problem is that despite this image 
> builds, when I run it, the prompt returns this:
>
> > docker run -it --net=host -e --privileged  -v 
> > /dev/video0:/dev/video0 fivecomm/webcam  
> > > $HOME/.Xauthority:/root/.Xauthority                                 
> >                                                                   
> > Setting pipeline to PAUSED ...                                       
> >                                                    ERROR: from 
> > element /GstPipeline:pipeline0/GstXImageSink:ximagesink0: Could not 
> > initialise X output                     Additional debug info:       
> >                                                                      
> >                       ../sys/ximage/ximagesink.c(867): 
> > gst_x_image_sink_xcontext_get (): 
> > /GstPipeline:pipeline0/GstXImageSink:ximagesink0:    Could not open 
> > display                                                              
> >                                     ERROR: pipeline doesn't want to 
> > preroll.                                                             
> >                    Failed to set pipeline to PAUSED.                 
> >                                                                      
> >  Setting pipeline to NULL ...                                        
> >                                                     Freeing pipeline 
> > ...

Assuming you have X running on the host, make sure to set DISPLAY environement
accordingly, and ensure that correct permissions are set. The X server may
requires you to expose a socket into your docker.

>
> Hence, I would like to know how to display in Windows.
> Thanks for your time.
>
> Regards,
> Andrés.
>
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel