media-source

Display getUserMediaStream live video with media stream extensions (MSE)

孤街醉人 提交于 2019-12-04 05:28:29
I am trying to display a MediaStream taken from a webcam using getUserMedia, and to relay it to a remote peer using whatever mechanism possible for it to be played (as an experiment). I am not using webRTC directly as I want control over the raw data. The issue I encounter is that my video element displays nothing, and I don't get any errors back. I am using Chrome Version 51.0.2704.103 (64-bit) on Elementary OS (Ubuntu 14.04 based linux OS). As a sidenote, if I record all the blobs into an array and then create a new blob and set the video's src element to URL.createObjectUrl(blob), it

Calculate .m4s segment file suffix in HTML5 video streaming when user seeks to another time

心已入冬 提交于 2019-12-04 00:46:26
I have created fixed length segments for a long MP4 video using Mp4Box. Mp4Box creates a meta info file mv_init.mp4 and segments like mv_1.m4s , mv_2.m4s , … I stream the video using HTML5 Media Source Extensions and the streaming is working properly. The problem is that I am unable to utilize time seeking feature of my HTML5 player . When a user uses the seekbar to seek to another time point, I need to fetch the correct segment file ( mv_{number}.m4s ) for that currentTime . For example: video duration: 2 hours segment size: 10 seconds user seeks to time: 25 minutes 25 minutes = 25 × 60

How to keep a live MediaSource video stream in-sync?

杀马特。学长 韩版系。学妹 提交于 2019-12-03 23:38:01
I have a server application which renders a 30 FPS video stream then encodes and muxes it in real-time into a WebM Byte Stream . On the client side, an HTML5 page opens a WebSocket to the server, which starts generating the stream when connection is accepted. After the header is delivered, each subsequent WebSocket frame consists of a single WebM SimpleBlock. A keyframe occurs every 15 frames and when this happens a new Cluster is started. The client also creates a MediaSource , and on receiving a frame from the WS, appends the content to its active buffer. The <video> starts playback

Media Source Extensions appendBuffer of WebM stream in random order

雨燕双飞 提交于 2019-12-03 21:40:12
I am trying to achieve video downloading in parallel from multiple sources. However MSE appendBuffer method always fails when not following sequence order of video file. I would like to append parts in random order and play video "as soon as possible". I was exploring SourceBuffer mode property as well as timestampOffset. None of those were helpful. I am wondering if source webm file i have could be in "not supported format" for such a task (sequential approach works fine). source video file Thank you for any advices. UPDATE: I tried to analyse well known example video file and i figured out

Live-Streaming webcam webm stream (using getUserMedia) by recording chunks with MediaRecorder over WEB API with WebSockets and MediaSource

我们两清 提交于 2019-12-03 13:05:36
I'm trying to broadcast a webcam's video to other clients in real-time, but I encounter some problems when viewer's start watching in the middle. For this purpose, I get the webcam's stream using getUserMedia (and all its siblings). Then, on a button click, I start recording the stream and send each segment/chunk/whatever you call it to the broadcaster's websocket's backend: var mediaRecorder = new MediaRecorder(stream); mediaRecorder.start(1000); mediaRecorder.ondataavailable = function (event) { uploadVideoSegment(event); //wrap with a blob and call socket.send(...) } On the server side (Web

Getting “Not allowed to load local resource” error while trying to attach a MediaSource object as the source of a HTML5 video tag

岁酱吖の 提交于 2019-12-03 09:30:05
I am trying to get this example to work. It works fine when I click the link. But when I try to download the HTML file on my local machine and try the same, it is throwing this error. Not allowed to load local resource: blob:null/6771f68d-c4b8-49a1-8352-f2c277ddfbd4 The line of code that seems to be causing the issue is this, video.src = window.URL.createObjectURL(mediaSource); What this line of code is doing is basically trying to set the source of the video tag media element to the MediaSource object. I have tried various permutations without much luck. I am using Chrome Version 28.0.1500.72

MediaSource error: This SourceBuffer has been removed from the parent media source

帅比萌擦擦* 提交于 2019-12-03 03:41:51
问题 I'm experimenting with the new MediaSource API available in Chrome. I'm trying to append binary data on the fly from a WebSocket to the video media source. Starting with the example at https://html5-demos.appspot.com/static/media-source.html, my code is currently: var websocket = new WebSocket('ws://localhost:8080'); websocket.binaryType = 'arraybuffer'; var mediaSource = new MediaSource(); var buffer; var queue = []; var video = $('.video')[0]; video.src = window.URL.createObjectURL

How to identify that html5 media element is stalled and waiting for further media to continue playing

社会主义新天地 提交于 2019-11-30 16:08:36
I am working with MediaSource and SourceBuffer to play html5 video. I am sequentially fetching DASH fragments to continue uninterrupted video play. But sometimes, due to network conditions, SourceBuffer runs out of data to continue play. When that data arrives play resumes. But between this period, video looks stalled. I want to add some visual indication over media element, that it is paused as its buffering required data. I tried binding 'waiting' and 'stalled' events on video, but none of the events get fired. var vid = $('video')[0]; vid.addEventListener('stalled', function(e) { console

H264 video works using src attribute. Same video fails using the MediaSource API (Chromium)

拈花ヽ惹草 提交于 2019-11-30 15:29:27
http://www.youtube.com/html5 indicates that Google Chrome is compliant with MediaSource Extensions & H.264. I make a simple test checking that my video is supported by Chromium, using the <video id='player' autoplay='true'> <source src='/test.mp4' type='video/mp4' /> </video> The video plays smoothly. A second alternative that also works fine consists in loading through AJAX the byte chain and converting the buffer to a URI object. Then asigning such URI to the (video) source.src attribute. Finally I try to load the same video through AJAX and inject it into a MediaSource Buffer. It fails with

Unable to get MediaSource working with mp4 format in chrome

家住魔仙堡 提交于 2019-11-30 04:24:29
Based on the example here I downloaded the webm file and encoded as an mp4 file which will play locally but I'm unable to use it as a media source. MP4Box reports the codec to be avc1.64000d,mp4a.40.2 but adding it to the source buffer did not help. Here is a demo of the problem (I don't expect it to work in firefox as Media Source Extensions are not supported yet) and here is the code I'm testing with: var FILE,CODEC,mediaSource; var NUM_CHUNKS = 5; var video = document.querySelector('video'); window.MediaSource = window.MediaSource || window.WebKitMediaSource; if (!!!window.MediaSource) {