We have an ogg vorbis stream from an icecast2 server. When the metadata is enabled within the stream, the stream will stop playing (though still connected to the server) when a new logical stream is started (when the metadata changes) within chrome and firefox using the native html5 tag. However, this does not happen when the metadata is disabled from the audio stream.
<p><b>Example of audio tag in HTML5.</b></p>
<audio src="http://mysite:port/stream.ogg" controls ></audio>
We need the metadata in the stream so we can't disable it. Does anyone know a work around for this? Any insight would be helpful. Thanks.
Related
I'm currently streaming my microphone from c++ with an standard socket. Now i want to listen to this stream from the web.
I have tried accessing the stream from the audio tag directly, but this didn't work.
I also tried to set the Content Type to audio/wav, but this also didn't work.
I have tried to write to an file and access it directly from the audio element, but it wasnt adding the new written parts to the audio element. Also it started from the beginning of the audio and i read that it had a high delay.
Is there a way to stream audio with very low latency?
I have thought on making a get request every 50ms and adding the new data to the audio or recording 50ms of audio and changing the src of the audio at the end of the last clip.
Streaming audio buffers through a WebSocket and then trying to play it with an <audio> element is not the way to go.
The way to stream audio to your browser with low latency is to use WebRTC.
WebRTC is built in the browser to enable peer-to-peer real-time communications.
That said, you can use some WebRTC implementation in C++ like libwebrtc or Gstreamer to stream your mic input, and then use the native JavaScript API on your browser to receive the audio stream and place it in the srcObject property of an <audio> element to listen in the browser.
At first I have a voice call in a vLine session, I hear the audio by getting the audio tag calling createAudioElement() on the media stream and appending it to the $(body)
Then on when the remote user opens his video, I send this piece of info to the other user using an x-msg, after received I get the video stream by calling createVideoElement() on the media stream.
After that I find a lag between the audio and the video, the audio always reaching faster than the video, how can I synchronize the audio with the video in this case?
When you call createVideoElement on the stream it will create a <video> element, which plays both audio and video, so at that point there is no need for the <audio> element that you created with createAudioElement.
The browser handles synchronizing the audio and video in a single MediaStream, so if they are consistently out of sync, you may need to file a WebRTC bug.
Can I click on some time and eventhough the video is not downlaoded till that time and the video starts playing from the time I clicked?
If yes, what would be a better option for viewing streamed video- HTML5 or flash player like JW player? WHich one will have less lag?
HTML5 browsers generally don't support this, however I believe the video tag in Safari will work with the Apple HTTP Streaming format for this functionality. For something that works across all browsers, Flash Player can do it using either RTMP streaming or HTTP Streaming (either with our without OSMF to support this). Probably the easiest place to start is with OSMF, which supports both RTMP and HTTP streaming of video.
I have tested this with Firefox and Firebug and while you can "seek" to a point in the video without having to watch video preceding the point you wish to seek, this still causes the entire video file to download.
Indeed, each time you seek in Firefox 4, the entire video downloads.
This may change and improve as HTML 5 video implementations become more mature and may differ based on the actual browser being used.
More information on the test here:
http://www.stevefenton.co.uk/Content/Blog/Date/201106/Blog/HTML-5-Video-In-Real-Life/
I understand you can feed the HTML5 <video> element RTP/RTSP video streams.
Streaming via RTSP or RTP in HTML5
Great! Now how would one go about setting up the stream?
To be clear, I'm not looking to stream live video, just encode and stream existing media/video files. Think Flash Media Server (I have a working example of the Flash route already). I'm wondering how to approach setting up the streaming server backend to serve up all the right codecs for HTML5 video in all different browsers (H.264/Ogg/WebM)
I'm looking at maybe FFServer? Or possibly the new VOD feature for VLC for streaming in H.264 (Safari, Flash) over RTSP. Possibly Icecast server for the Ogg video? Is this even possible? Are there currently any working examples of this type of html5 VOD true streaming in the wild?
This is no answer, however I would suggest trying to solve one problem at a time.
Example:
Q: Can I stream from Flash Media Server via HTML 5 "video" tag?
A: No, but progressive download is possible. (Reference: http://forums.adobe.com/thread/855764)
I intend to put together a web based player for myself. Is it possible to stream audio files using the html5 tag? or will they fully download and then play. Is any special server configuration required to play these files
Also what if the audio is not a file on the server but being dynamically generated on the server side with the raw bytes being written to the response stream
http://www.w3.org/TR/2010/WD-html5-20101019/video.html#audio
edit:
What's up with all that downloading?
Opera, Chrome and Safari will automatically download the whole video file even if it hasn't started to play yet. Firefox 3.6 only loads enough to render a frame and determine duration, unless the autobuffer attribute is present. Note that the spec changed from autobuffer to preload, which hasn't been implemented anywhere yet. Opera plans to change to the Firefox behavior of only loading enough to render a frame and determine duration by default, unless the preload attribute says otherwise.
source: http://dev.opera.com/articles/view/everything-you-need-to-know-about-html5-video-and-audio/