[Solved] Autostart when RTSP-stream arrives?

*nix specific usage questions
velola
New Cone
New Cone
Posts: 4
Joined: 27 Jul 2012 16:41

[Solved] Autostart when RTSP-stream arrives?

Postby velola » 27 Jul 2012 17:15

Hello there!

In short: Is there a way to start a (--sout) playlist item automatically if a stream is available?

To elaborate on this: I'm currently setting up a streaming environment where users publish their h.264 RTSP-stream via Quicktime Broadcaster to a Darwin Streaming Server instance (running on Ubuntu 10.04). So far, so little VLC involved...

In order to embed the video on a flashplayer webpage, I transcode the incoming RTSP with VLC (VLC media player 1.0.6 Goldeneye) like this:

Code: Select all

cvlc -vv rtsp://myserver.net:5678/streamname.sdp --no-sout-transcode-hurry-up --sout-mux-caching=4000 --rtsp-caching=4000 --sout="#transcode{threads=auto,deinterlace,aenc=ffmpeg{aac-profile=low},ab=192,samplerate=44100,channels=2,acodec=mp4a,audio-sync,vcodec=h264,width=640,height=480,fps=24,scale=1,vb=224,venc=x264{keyint=250,preset=veryfast,level=-1,profile=baseline,nocabac,slices=8,qcomp=0.4,vbv-maxrate=2000,vbv-bufsize=2000}}:std{access=http,mux=ffmpeg{mux=flv},mime="video/x-flv",dst=:5677/streamname.mp4}"
Despite lacking complete understanding of all the options involved, above code is running okay for me.

However, the current setup needs manual starting _and_ stopping of the VLC instance (which is not desired). Any insights on how to 'daemonize' the transcoding?

Currently I could think of the following:
  • Make VLC trying to reconnect whenever the RTSP stream stops (this one is especially needed if the transcoding crashes). OR
  • Create a daemon process that checks for the RTSP and starts VLC if the transcoded stream doesn't exist. OR
  • ??? Am I just doing it wrong?
Hopefully somebody here can enlighten me ;)
Regards,
Konrad
Last edited by velola on 27 Jul 2012 17:30, edited 1 time in total.

velola
New Cone
New Cone
Posts: 4
Joined: 27 Jul 2012 16:41

Re: Autostart when RTSP-stream arrives?

Postby velola » 27 Jul 2012 17:30

Oh dear!

I figured it out (writing just helps finding the right query it seems :roll: ).

Searching for 'autostart' I stumbled upon this: viewtopic.php?f=14&t=86796&p=287362&hil ... rt#p287362.

Altering the code from above I ended up with this:

Code: Select all

cvlc -vv --loop rtsp://myserver.net:5678/streamname.sdp --no-sout-transcode-hurry-up --sout-mux-caching=4000 --rtsp-caching=4000 --sout="#transcode{threads=auto,deinterlace,aenc=ffmpeg{aac-profile=low},ab=192,samplerate=44100,channels=2,acodec=mp4a,audio-sync,vcodec=h264,width=640,height=480,fps=12,scale=1,vb=224,venc=x264{keyint=250,preset=veryfast,level=-1,profile=baseline,nocabac,slices=8,qcomp=0.4,vbv-maxrate=2000,vbv-bufsize=2000}}:std{access=http,mux=ffmpeg{mux=flv},mime="video/mp4",dst=:5677/streamname.mp4}" vlc://pause:5
So basically adding the

Code: Select all

--loop
option and adding a

Code: Select all

vlc://pause:5
to the playlist. Works like a charm!

Maybe this helps somebody sometimes?

Cheers,
Konrad


Return to “VLC media player for Linux and friends Troubleshooting”

Who is online

Users browsing this forum: No registered users and 9 guests