mediastream

MediaStream Capture Canvas and Audio Simultaneously

℡╲_俬逩灬. 提交于 2019-12-17 03:39:12
问题 I'm working on a project in which I'd like to: Load a video js and display it on the canvas. Use filters to alter the appearance of the canvas (and therefore the video). Use the MediaStream captureStream() method and a MediaRecorder object to record the surface of the canvas and the audio of the original video. Play the stream of both the canvas and the audio in an HTML video element. I've been able to display the canvas recording in a video element by tweaking this WebRTC demo code: https:/

Where is a comprehensive list of supported media types when recording with the Media * API?

安稳与你 提交于 2019-12-12 10:57:51
问题 I am trying to learn how to record media in the browser and I may be over-complicating things. There is an abundant supply of straight-forward examples but I got bogged down at the part when the recordings are pushed to a Blob object with an arbitrarily selected media type without checking whether that format is supported. Therefore I assume there is a list or people just keep building on past experiences. For example, from Mido22/MediaRecorder-sample: mediaOptions = { video: { tag: 'video',

StreamTrack's readyState is getting changed to ended, just before playing the stream (MediaStream - MediaStreamTrack - WebRTC)

走远了吗. 提交于 2019-12-11 08:14:44
问题 The jsfiddle (https://jsfiddle.net/kalyansai99/mm1b74uy/22/) contains code where the user can toggle between front and back camera of the mobile. In few mobiles its working fine (Moto g5 plus, Moto E3 and so on - Chrome Browser) and in few mobiles (Mi Redimi Note 4 - Chrome Browser) when I am switching to back camera, initially the stream is loading with a track of "readyState" as "live". But when i am about to play the stream in video player, the "readyState" is getting changed to "ended"

Changing FocusMode not working using MediaStream API in Google Chrome

落爺英雄遲暮 提交于 2019-12-07 05:23:31
问题 In Google Chrome Browser i was able to get live feed of my connected USB Camera using getUserMedia() API. I have a slider to change the brightness value and this is working fine. I also want focusMode to toggle from continuous to manual (The camera always starts with continuous focusMode). I have the below Javascript code to change FocusMode. const video_constraints ={}; //Create the following keys for Constraint video_constraints.video = {}; video_constraints.video.width = {}; video

MediaRecorder - How to play chunk/blob of video while recording?

丶灬走出姿态 提交于 2019-12-07 02:17:05
问题 I currently have a MediaStream which is being recorded using MediaRecorder . At the end of the recording after recorder.stop() , it produce a Blob and I am able to play that video back. My goal is to play not the entire video at the end, but play a chunk while recording . For the moment, a chunk is not playable while recording is not ended. How can i do that using javascript? The final objective is to send a chunk by websocket that is playable even if recording is in action. I am not able to

MediaRecorder - How to play chunk/blob of video while recording?

半腔热情 提交于 2019-12-05 06:19:36
I currently have a MediaStream which is being recorded using MediaRecorder . At the end of the recording after recorder.stop() , it produce a Blob and I am able to play that video back. My goal is to play not the entire video at the end, but play a chunk while recording . For the moment, a chunk is not playable while recording is not ended. How can i do that using javascript? The final objective is to send a chunk by websocket that is playable even if recording is in action. I am not able to bring new solutions. Can anyone help or at least explain me the things ? What I've tried was navigator

Capturing an image in HTML5 at full resolution

孤人 提交于 2019-12-04 14:37:36
It is possible to capture an image in javascript using the MediaStream API. But in order to do so it is first necessary to instantiate a video object, then paint a frame into a canvas to get an image. But unfortunately many devices (e.g. phones) don't allow you to capture a video at the full native resolution of the device. For instance, on my phone the maximum image resolution is on the order of 4000x3000 but the maximum video resolution is a mere 1920x1080. Obviously capturing an image which is only barely 1/6th of the available resolution is unacceptable. So how can I access the full

Saving desktopCapturer to video file in Electron

拟墨画扇 提交于 2019-12-03 14:15:49
问题 The desktopCapturer api example shows how to write a screen capture stream to a <video> element. // In the renderer process. var desktopCapturer = require('electron').desktopCapturer; desktopCapturer.getSources({types: ['window', 'screen']}, function(error, sources) { if (error) throw error; for (var i = 0; i < sources.length; ++i) { if (sources[i].name == "Electron") { navigator.webkitGetUserMedia({ audio: false, video: { mandatory: { chromeMediaSource: 'desktop', chromeMediaSourceId:

Blob video duration metadata [duplicate]

廉价感情. 提交于 2019-12-03 11:56:20
问题 This question already has answers here : How can I add predefined length to audio recorded from MediaRecorder in Chrome? (3 answers) Closed last year . I am writing a software that manipulates camera stream video in firefox. I am generating a Blob with video type recorded with MediaRecorder API . What i am doing to save the blob as video in local storage is using FileSaver library : FileSaver.saveAs(BlobVideo,"video.mp4"); It seems the video doesnt have any max duration, so i cannot navigate

webRTC convert webm to mp4 with ffmpeg.js

北城以北 提交于 2019-12-03 08:26:44
问题 I am trying to convert webM files to mp4 with ffmpeg.js. I am recording a video from canvas(overlayer with some information) and recording the audio data from the video. stream = new MediaStream(); var videoElem = document.getElementById('video'); var videoStream = videoElem.captureStream(); stream.addTrack(videoStream.getAudioTracks()[0]); stream.addTrack(canvas.captureStream().getVideoTracks()[0]); var options = {mimeType: 'video/webm'}; recordedBlobs = []; mediaRecorder = new MediaRecorder