How to start gst-launch with startx command

I am using angstrom-qt5-x11-image, I want to launch gstreamer with startx command with rtsp stream, something like this,

startx gst-play-1.0 rtsp://username:password@ --

How to achieve this at startup.
I tried above command without success.
The rtsp stream is okay. But the above command results in black screen. The top command shows x-server and gst-play are running.
Any help would be appreciated.
Thank you.

hi @akshay

Could you provide the software version for your module?
Additionally could you share also the dmesg log in a file? Thanks.

Hi jaski.tx,
The git branch is V2.8 (LinuxImageV2.8),
toradex-bsp-platform is Apalis-TK1_LXDE-Image_2.8b2.97-20180331,

gstreamer version

 gst-play-1.0 --version
    gst-play-1.0 version 1.12.2
    GStreamer 1.12.2

dmesg attachment


Thanks for the Information.

For starting Application at Startup using X11, you need to follow the steps described in the following article.

Dear jaski, Thanks for this information about startup, but when I manually try to run gst-play-1.0 with rtsp stream the output is black screen. What could be the reason behind it ? Am I missing some plugins/libraries ?

You mean even manually trying to play your stream does not work? Or only when started automatically?

BTW: Did you now attempt the “Script Started by Systemd” or “Using nodm, xinit, and a Custom Script” variant?

Yes even manually trying to play this stream does not work, I also tried using ~/.xinitrc in home directory, gst-play-1.0 does starts as it is shown by top command but it does not show the rtsp video, we can only see a black screen and mouse pointer in x shape.

OK, so “gst-launch with startx” has absolutely nothing to do with what you are in effect asking for. You are in general unable to play an RTSP stream, correct? How do you know that whatever stream you are trying to play is even correct? Did you have a look at the following article on our developer website already? OK, admittedly that one is about RTP and not RTSP. I guess if RTSP support is really missing in our regular demo images you may easily add it to your custom image. Looks like gst-rtsp may be part of the meta-multimedia layer. Alternatively, you may try running JetPack which comes with RTSP support.

BTW: That plays an RTSP stream when using JetPack after having activated multiverse:

sudo apt-get install gstreamer1.0-plugins-bad
gst-launch-1.0 -ve rtspsrc location=rtsp:// ! rtph264depay ! h264parse ! omxh264dec ! nvhdmioverlaysink

Thank you @marcel.tx, @jaski.tx, got it working,
I installed

opkg install gstreamer1.0-plugins-bad
opkg install gst-plugins-good-rtsp
opkg install libgstrtsp-0.10-0
opkg install libgstrtsp-1.0-0 

without x-server command line

gst-launch-1.0 -ve rtspsrc location=rtsp://system:system@ latency=0 ! rtph264depay ! h264parse ! omxh264dec ! nvhdmioverlaysink

with startx as argument

startx /usr/bin/gst-launch-1.0 -ve rtspsrc location=rtsp://system:system@ latency=0 ! rtph264depay ! h264parse ! omxh264dec ! nvhdmioverlaysink --

autostart using ~/.xinitrc in home directory,
insert this line in ~/.xinitrc

exec /usr/bin/gst-launch-1.0 -ve rtspsrc location=rtsp://system:system@ latency=0 ! rtph264depay ! h264parse ! omxh264dec ! nvhdmioverlaysink

You are very welcome.