Search code examples
videogstreamervideo-processingwaylandgoogle-coral

Do not use display gstreamer aarch 64 linux


I am using gstreamer on google coral dev board and performing video analytics on it. The platform details are :

Linux bored-horse 4.9.51-imx #1 SMP PREEMPT Tue May 14 20:34:37 UTC 2019 aarch64 GNU/Linux

I have a pipeline of the form :

GST_DEBUG=*gl*:5 gst-launch-1.0 videotestsrc  ! video/x-raw,width=640,height=480,framerate=15/1 ! queue max-size-buffers=1 leaky=downstream  ! glupload ! queue max-size-buffers=1 leaky=downstream ! glfilterbin filter=glcolorscale  ! video/x-raw,format=RGBA,width=320,height=180 ! videoconvert ! video/x-raw,format=RGB,width=320,height=180 ! appsink name=appsink sync=false emit-signals=true max-buffers=1 drop=true

It works fine when run from a terminal. However when i execute the pipeline as a background service , it fails because background service do not have access to display. Anyways I dont want to display the window , i just want to connect the data to the appsink , so that i can perform video analytics on it.

So anyone has any idea about , how to force it to not use display and just forward the data to appsink . Please help


Solution

  • I believe you have contact us for the same query and I've responded, but here is the service file so other can reference:

    [Unit]
    Description=Back service
    After=weston.target
    
    [Service]
    ExecStart=/home/mendel/service_script.sh
    Environment=XDG_RUNTIME_DIR=/run/user/1000
    
    [Install]
    WantedBy=multi-user.target
    

    The problem, I believe was that you needed to set the XDG_RUNTIME_DIR env variable.

    This is working for me:

    mendel@bored-quill:~$ sudo systemctl status back
    ● back.service - Back service
       Loaded: loaded (/lib/systemd/system/back.service; disabled; vendor preset: enabled)
       Active: active (running) since Thu 2020-03-05 14:48:57 UTC; 6h ago
     Main PID: 13522 (service_script.)
        Tasks: 10 (limit: 797)
       Memory: 19.2M
       CGroup: /system.slice/back.service
               ├─13522 /bin/bash /home/mendel/service_script.sh
               └─13523 gst-launch-1.0 videotestsrc ! video/x-raw,width=640,height=480,framerate=15/1 ! queue max-size-buffers=1 leaky=downstream ! glupload ! queue max-size-buffers=1 leaky=downstream ! glfilterbin f
    
    Mar 05 21:43:02 bored-quill service_script.sh[13522]: 6:54:05.284750061 13523 0xaaaad4400a30 DEBUG             gleglimage gsteglimage.c:431:_drm_direct_fourcc_from_info: Getting DRM fourcc for RGBA
    Mar 05 21:43:02 bored-quill service_script.sh[13522]: 6:54:05.284849062 13523 0xaaaad4400a30 DEBUG             gleglimage gsteglimage.c:661:gst_egl_image_from_dmabuf_singleplaner: fourcc AB24 (875708993) n_plane
    Mar 05 21:43:02 bored-quill service_script.sh[13522]: 6:54:05.285265825 13523 0xffff900040f0 DEBUG           glbasememory gstglbasememory.c:178:gst_gl_base_memory_init: new GL buffer memory:0xffff8035dcc0 size:1
    Mar 05 21:43:02 bored-quill service_script.sh[13522]: 6:54:05.285372385 13523 0xffff900040f0 DEBUG          glbasetexture gstglmemory.c:340:gst_gl_memory_init: new GL texture context:<glcontextegl0> memory:0xfff
    Mar 05 21:43:02 bored-quill service_script.sh[13522]: 6:54:05.285269905 13523 0xaaaad442b630 DEBUG      gldownloadelement gstgldownloadelement.c:419:gst_gl_download_element_prepare_output_buffer:<gldownloadeleme
    Mar 05 21:43:02 bored-quill service_script.sh[13522]: 6:54:05.286813716 13523 0xffff900040f0 DEBUG                gldebug gstgldebug.c:320:_gst_gl_debug_callback:<glcontextegl0> low: GL debug marker from third p
    Mar 05 21:43:02 bored-quill service_script.sh[13522]: 6:54:05.286898196 13523 0xffff900040f0 DEBUG               glfilter gstglfilter.c:981:gst_gl_filter_filter_texture: calling filter_texture with textures in:2
    Mar 05 21:43:02 bored-quill service_script.sh[13522]: 6:54:05.287709642 13523 0xaaaad4400a30 DEBUG             gleglimage gsteglimage.c:431:_drm_direct_fourcc_from_info: Getting DRM fourcc for RGBA
    Mar 05 21:43:02 bored-quill service_script.sh[13522]: 6:54:05.287806243 13523 0xaaaad4400a30 DEBUG             gleglimage gsteglimage.c:661:gst_egl_image_from_dmabuf_singleplaner: fourcc AB24 (875708993) n_plane
    Mar 05 21:43:02 bored-quill service_script.sh[13522]: 6:54:05.288226006 13523 0xffff900040f0 DEBUG           glbasememory gstglbasememory.c:178:gst_gl_base_memory_init: new GL buffer memory:0xffff8035dcc0 size:1