Embed RTSP Stream into Browser - html

I have an IP Camera that only has an address locally: XXX.XXX.X.XX.
This camera has an rtsp stream and I want to integrate that stream into HTML5's video tag. Unfortunately, it only accepts mp4, ogg and web. What should I do now?
Note that I do not want to use a plugin!

Related

Can aframe be used to play rtsp video

I am trying to stream a rtsp video from my html website. I am using RTSPtoWeb (https://github.com/deepch/RTSPtoWeb) to convert the rtsp stream into a link that ends with ".m3u8". Is it possible to then use aframe with the link so I can embed my 360 video on the website and if so, how can I do so?
If it's not possible, how can I embed 360 video stream to my html website?

HTML5 RTP Audio Stream

I currently have a setup where VLC player is playing live audio via an RTP stream coming from my server. Is it at all possible that HTML5 <audio> tag can play this stream instead?

Convert Icecast .ogg stream to mp3

I haven been trying to figure this out for more than a week now but still not successful. I am able to do a live audio stream in .ogg format using virtual DJ as the client and Icecast as streaming server. .ogg stream plays successfully in Firefox and Chrome but doesn't play in IE. How can i play the same stream in both the formats .ogg and .mp3 so that it is supported in all modern browsers although i can only produce one kind of stream i.e .ogg using my client virtual DJ.
I want my users to listen to my same stream irrespective of the browsers they use.
Please help. I really need to get this going.
VirtualDJ can only broadcast in one format at the time, either as Ogg or MP3.
To get both formats you would have to go through a middle server which trans-code one format into the other and broadcast on a different port:
You may be able to use something like VideoLAN (VLC) to do this which can output as Icecast:
vlc.exe --sout "#transcode{[TRANSCODE_OPTIONS]}:std{[OUTPUT_OPTIONS]}" INPUT
For example converting input to a mp3 stream (ibid.):
vlc --sout "#transcode{acodec=mp3,ab=128,channels=2,samplerate=44100}:std{access=file,mux=raw,dst=OUTPUT}" INPUT
You can also set up trans-coding via the GUI. See more details in the provided link.
When the two streams are setup you can define them as audio sources:
<audio>
<source src="//host:8000/mount1" type="audio/ogg" />
<source src="//host:8001/mount2" type="audio/mpeg" />
<audio>

Custom audio encoder for flash player

It seems like the only option for recording h264/aac videos with flash is to use Wowza and use the aac transcoder. What options are there for encoding aac audio right inside flash player before sending through the Netstream? Would be possible to extract raw audio from a Microphone by listening to the SampleDataEvent, encoding that audio how you want, then sending it through the Netstream with the send method? Would you have to manually rejoin the audio with the video then?
Not sure it will do exactly what you want, but you could check out FlashyWrappers which allows you to encode video in Flash.

Read red5 live stream with HTML5

How can I read a Red5 (RTMFP) stream using HTML5?
Red5 supports different kinds of streaming*, so I don't know which kind of streaming you mean:
Streaming Video (FLV, F4V, MP4)
Streaming Audio (MP3, F4A, M4A)
Recording Client Streams (FLV only)
*source: Red5 on Google Code.
You probably want to use the HTML5 Video Tag and/or the HTML5 Audio Tag to 'play' the stream. Therefor you will need to do some conversion.
Audio streaming
New technique, lot's of browsers and no universal codec support yet.
See browsers + codec's it supports*:
FireFox 3.6+
Ogg Vorbis
Wav
Safari 5+
MP3
WAV
Chrome 6
Ogg Vorbis
MP3
Opera 10.5+
Ogg Vorbis
WAV
Internet Explorer 9 (beta)
MP3
WAV
*source: Native Audio in the browser.
Video streaming
Currently there's a discussion going on about the HTML5 Video Codec, between Ogg Theora and H.264. So make a conversion to one of those formats. I would recommend H.264 because it looks like Red5 will implement H.264 support in the future.
As with audio as with video.. New technique, lot's of browsers and no universal codec support yet. See for list: HTML5 Video on Wikipedia.
After conversion
The easiest way to check for support of the video and audio tags is to dynamically create one or both with scripting and check for the existence of a function:
var hasVideo = !!(document.createElement('video').canPlayType);
This simple code line will dynamically create a video element and check for the existence of the canPlayType() function. By using the !! operator, the result is converted to a Boolean value, which indicates whether or not a video object could be created.
Alternatively
You can serve 2 streams with a Flash Fallback:
<video src="video.ogg">
<object data="videoplayer.swf" type="application/x-shockwave-flash">
<param name="movie" value="video.swf"/>
</object>
</video>
The video tag is used by default, if not supported the browser will use the flashplayer.
Edit:
I now see that Red5 supports H.264 (Live Stream Publishing). Read here how to use the HTML5 video tag with the H.264 codec
You also might wanna have a look at: Adobe's Video Player Widget.
A short answer: you can't. The browsers will not support streams over RTMP (RTMFP), RTP or UDP. Your stream must be sent over HTTP to be accessible (in fact you have to emulate a static file on the server).
Also WebM deserves a few words. In May 2010 Google announced a royalty-free codec for HTML5 viceo purposes. As of now, the latest versions of alternative browsers (Mozilla, Opera, Chrome) has the ability to play it. Only the big ones who have invested good bucks to H.264 resist.
Now days a couple of media servers support WebM. I guess the first was Flumotion to implement it. I also have my own GPL software for live-streaming WebM called stream.m. It is a very early release but if you want to give it a try I'm not stopping anyone. :)
RTMFP and HTML5(WebRTC or Websocket) protocols are supported in WCS4
So you can publish RTMFP stream to the server and play this stream using Chrome(WebRTC), Firefox(WebRTC) or iOS Safari browser(Websocket).
Red5 does not support RTMFP.
RTMFP is a peer-to-peer designed protocol, however server can be used like RTMFP peer, therefore it would be simple client-server connection Flash-Server like RTMP.