media-source

Delete a TextTrack from a video

一曲冷凌霜 提交于 2019-12-14 01:46:27
问题 Is there a good way to delete a single TextTrack added via JavaScript to a HTML5 <video> tag? The following code is a simple demo of how to add a track, but I haven't found a good way to remove one: document.querySelector('video#myVideo').addTextTrack(...); 回答1: There is no mechanism to remove an added text-track (probably a flaw (?) in the current specification. There is also an onremovetrack event but...). The only thing we can do is to disable or hide it. Make sure you keep a reference to

Display getUserMediaStream live video with media stream extensions (MSE)

心不动则不痛 提交于 2019-12-13 12:05:53
问题 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

Unable jump into stream from media recorder using media source with socket.io

吃可爱长大的小学妹 提交于 2019-12-12 18:45:06
问题 The following code works when the video observing client is loaded first then the webcam client is loaded second it works flawlessly, however, if the order is switched or in any way the stream is interrupted for example by refreshing either client the stream will fail and the Media Source will change its ready state to closed. My assumption is that the video being received on start needs initialization headers for starting and since the stream is being read midstream it never gets said

Stream video through socket to html5 video tag

旧时模样 提交于 2019-12-11 02:28:57
问题 Hello i`ve been trying to stream a webm video through a socket.io socket directly to the html5 video tag. The client and server code follows below: Server: (function() { var Alert, Channel, Receiver, Takeover, express, pathLib; pathLib = require("path"); fs = require("fs"); express = require("express"); module.exports = function(app, sockets) { router = express.Router(); router.get("/clearAlerts", function(req, res) { console.log("reached!"); return sockets.emit("alert-deleted"); }); router

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

随声附和 提交于 2019-12-09 14:51:46
问题 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:

Media Source Extensions appendBuffer of WebM stream in random order

。_饼干妹妹 提交于 2019-12-06 13:52:14
问题 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

Get mime type for MediaSource.isTypeSupported

你。 提交于 2019-12-05 04:32:22
How do I get the Mime type I need to pass to MediaSource.isTypeSupported with ffprobe/ffmpeg? For instance, on my computer, that returns true : MediaSource.isTypeSupported('video/mp4; codecs="avc1.64000d,mp4a.40.2"') while that doesn't MediaSource.isTypeSupported('video/mp4') I'm not sure how to get what would correspond to the avc1.64000d,mp4a.40.2 part for a given video. Here is a larger list of what this part may look like. ffprobe -show_streams -i video.mp4 returns a number of interesting informations, including codec_type=video codec_time_base=1/40 codec_tag_string=avc1 codec_tag

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

寵の児 提交于 2019-12-04 20:19:52
问题 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

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-04 15:16:09
问题 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

Different between fragmented mp4 files generated by ffmpeg and by code

▼魔方 西西 提交于 2019-12-04 12:33:19
问题 Currently I have a problem when generating fragmented MP4 file from code using libavformat. My file can be played using VLC, but can't be streamed (via WebSocket) and played (via MediaSource) in (Chrome) browser. (I used this to test streaming fragmented MP4 file to browser via WebSocket). Note: The files below is encoded by Baseline profile, level 4. So you should change the MIME type (in index.html) to const mimeCodec = 'video/mp4; codecs="avc1.42C028"'; to be able to play them. I checked