RTSP streaming to a web application (using VLC 2.0)

I am working on a web application that should display streaming video on a remote desktop. We have already implemented this using ffmpeg / ffserver and flowplayer, transcoding RTSP to .flv format, but it is very fragile, and my research led me to use the VLC command-line version.

My question is: Is there a way to transcode the transcoded RTSP (like OGG, RTP or another format) to the browser, while avoiding relying on the flash?

I know that the tag has not supported streaming video for some time, but it is difficult for me to find consistent documentation. Some say that you can directly connect RTP, some say that you can never pass a tag.

In addition, I am currently testing all of this on a local Apache server.

I assume that transcoding will look something like this:

  • vlc -vvv rtsp: //xx.xx.xx.xx: 554 / vga.sdp --no-sout-audio --sout '#standard {access = http, mux = ogg, dst = http: // localhost / test_ogg.php}

OR

  • vlc -vvv rtsp: //xx.xx.xx.xx: 554 / vga.sdp --no-sout-audio --sout '#transcode {vcodec = mp4v, acodec = mpga, vb = 400}: duplicate {DST = display, DST = {MUX RTP = c, DST = xxx.xxx.xx.xx, port = XXXX}} '

Thanks - Mason

+4
source share
1 answer

So, the solution I was looking for appeared in the form of CVLC 2.0.1 [VLC console only], but also used the capabilities of muxing ffmpeg.

This one-line code transcodes the RTSP stream to FLV and pushes it to my localhost server on the specified port.

cvlc rtsp://xxx.xxx.xxx.xxx:554/vga.sdp :sout='#transcode{vcodec=FLV1,vb=2048,fps=25,scale=1,acodec=none,deinterlace}:http{mime=video/x-flv,mux=ffmpeg{mux=flv},dst=127.0.0.1:8090/device_1.flv}' :no-sout-standard-sap :ttl=5 :sout-keep :no-audio --video --no-sout-audio 

Advantages of this include the lack of the need to edit the ffserver.conf file every time a stream changes resolution, baud rate, frame rate, etc. - Only to restart this single line so that it can re-capture the stream. In addition, if the stream has the appropriate specifications, you do not need the vb= and fps= properties; I would use them only if I needed to throttle the stream for the sake of a web page.

--network-caching was another feature that I considered, although very useful in some situations, unnecessary in my case.

Flowplayer code looks something like this:

 <div style="width:1280px;height:720px;margin:10px" id="player_1"></div><script language="javascript"> flowplayer("player_1", {src: "/js/flowplayer-3.2.7.swf", wmode:"transparent"},{ clip: { url: 'http://127.0.0.1:8090/device_1.flv', autoPlay: true, autoBuffering: true, live: true, bufferLength:0 }, plugins: { controls: { all: false, scrubber: true, play: true, fullscreen: true, time: false, width: '100%', opacity: 0.8, tooltips: { buttons: true, fullscreen: 'Enter fullscreen mode' } } } }); 

We hope that this will help any viewer to face similar problems!

Mason

+5
source

All Articles