How to auto start viewing an RTSP stream upon power-on?

Can someone please give me an idea how to make my Raspberry Pi-B /OSMC automatically launch whatever is the best viewer for watching an RTSP stream?.

It would be nice also to have something in place such that if the stream drops for more than maybe 5 seconds, it will re-launch the viewer with the same parameters, without user intervention.

If not the second… Please at least advise on how to autostart and begin watching a known IP address for streamed audio/video.

Thank you Thank You.

(Yeah, I’m a noob to Pi and OSMC. Sorry for such elementary questions.)

-Andrew

CONTEXT SINCE A MODERATOR WAS SUSPICIOUS OF MY POST…
i have an rtsp streaming device Cerevo USA LiveShell PRO HD Wireless Video Streaming B&H # CECDPLS02A MFR # CDP-LS02A. i need to be able to quickly get it’s stream viewable on a monitor in a different room with little to no interaction. nothing nefarious here.

unlisted this for now too see your intentions with “streaming” im gonna remind you of our rules here on the forum

https://discourse.osmc.tv/faq#stealing

so please state your intentions

You could probably do this with ‘autoexec.py’

Sam

Re-listed this post.

ok thanks, but what do i launch to be able so show a live stream… i just need the initial app and mechanism to connect to my rtsp://<local.ip.address>/live.bla.bla.bla

It will be a constant address/URL. It will never change.

Have a look at the xbmc Python API on the Kodi wiki.

You would do

import xbmc

Then it’s probably something like xbmc.play()

Sam

Couldn’t you put the URL into an .m3u and have kodi play it at startup? There’s an option to do just that somewhere in the Settings. (I have a little startup sound play when kodi loads.)

That sounds good. Is there a tool within Kodi to create an .m3u? Or do I need to download a tool?

Or do I need to create one on a mac and then find a way to upload it to my kodi install.

Thanks!

-A

https://www.google.com/search?q=kodi+create+m3u&oq=kodi+create+m3u&ie=UTF-8

An .m3u is very easy to make by hand.

ie. nano playlist.m3u

#EXTM3U
#EXTINF:-1 
rtsp://url.you.want.to.use

Do this while ssh’d into your osmc install and there’s no hassle about how to transfer a file there.