Firefox isn't capable to record "CanvasCaptureMediaStream" object.

RESOLVED DUPLICATE of bug 1182426

Status

()

Core
Audio/Video: Recording
P2
normal
Rank:
25
RESOLVED DUPLICATE of bug 1182426
2 years ago
2 years ago

People

(Reporter: muthusmkmtp, Unassigned)

Tracking

({testcase})

Trunk
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

118.90 KB, application/javascript
Details
91.94 KB, application/javascript
Details
1.11 KB, text/html
Details
(Reporter)

Description

2 years ago
User Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.80 Safari/537.36

Steps to reproduce:

I would want to record my full-browser screen using MediaStream API, On passing the stream to the API , I pass as the CanvasCaptureMediaStream oblect, which firefox couldn't record that object. I get the CanvasCaptureMediaStream object with the following syntax, canvas.captureStream().
Can you please provide a test page or url where this issue can be reproduced?
Flags: needinfo?(muthusmkmtp)

Updated

2 years ago
Keywords: testcase-wanted

Updated

2 years ago
Component: Untriaged → Canvas: 2D
Product: Firefox → Core
(Reporter)

Comment 2

2 years ago
<script>
var elementToShare = document.body;

document.getElementById('stop').disabled = false;
var options = {
    mimeType: 'video/webm'
};
var recorder = new CanvasRecorder(elementToShare);

document.getElementById('start').onclick = function() {
    recorder.record();
};

document.getElementById('stop').onclick = function() {
    recorder.stop(function(blob) {
        console.log(blob);
        var url = URL.createObjectURL(blob);
        var video = document.createElement('video');
        video.src = url;
        video.setAttribute('style', 'height: 100%; position: absolute; top:0;');
        document.body.appendChild(video);
        video.controls = true;
        video.play();
    });
};
</script>

This is the script code that attached to a document with start and stop button. For this you have to attach RecordRTC.js and Screenshot.js which I have attached with this bug.

On executing after setup it throws an error

"The UA cannot provide the codec or recording option that has been requested. error { target: MediaRecorder, isTrusted: true, name: "GenericError", currentTarget: MediaRecorder, eventPhase: 2, bubbles: false, cancelable: false, defaultPrevented: false, timeStamp: 1624.1685901254423, originalTarget: MediaRecorder, explicitOriginalTarget: MediaRecorder }"

and also while retaining the blob url it throws a warning as
"Media resource blob:http://localhost/365d88e6-6c5d-4955-9f45-03a8cce461cd could not be decoded."

and inside the video attribute it shows the error as 
"Video can't be played because the file is corrupt"

The discussion with the author of RecordRTC is in the below link
https://disqus.com/home/discussion/recordrtc/class_canvasrecorder/#comment-2354729296

And from that discussion the conclusion is "Firefox isn't capable to record CanvasCaptureMediaStream object through MediaRecoder API". The CanvasCaptureMediaStream  Object is obtained using canvas.captureStream()
Flags: needinfo?(muthusmkmtp)
(Reporter)

Comment 3

2 years ago
Created attachment 8686685 [details]
RecordRTC.js
(Reporter)

Comment 4

2 years ago
Created attachment 8686686 [details]
screenshot.js

Refer Comment2 for this usage
(Reporter)

Comment 5

2 years ago
Comment on attachment 8686685 [details]
RecordRTC.js

Refer Comment2 for this usage
(Reporter)

Comment 6

2 years ago
(In reply to Sebastian H. [:aryx][:archaeopteryx] from comment #1)
> Can you please provide a test page or url where this issue can be reproduced?

Refer Comment2

Comment 7

2 years ago
Created attachment 8686706 [details]
1224111.html (testcase)

Updated

2 years ago
Keywords: testcase-wanted → testcase
It's not clear to me if this is a canvas bug or a webrtc bug. Maire what does this look like to you?
Flags: needinfo?(mreavy)
Version: 45 Branch → Trunk
What version of Firefox?  pehrsons modified MediaRecorder recently to allow it to record canvas streams (differing buffertypes).

See Bug 1182426.  This is on 44 and 45 (Developer Edition/Aurora and Nightly).
Flags: needinfo?(muthusmkmtp)

Updated

2 years ago
Flags: needinfo?(mreavy)
This is definitely a Media Recorder issue, and as Randell says in Comment 9, this is likely fixed in later versions of Firefox.  If the reporter could verify the fix, that would be much appreciated.
Rank: 25
Component: Canvas: 2D → Audio/Video: MediaStreamGraph
Priority: -- → P2
Component: Audio/Video: MediaStreamGraph → Audio/Video: Recording
(Reporter)

Comment 11

2 years ago
In Firefox browser , MediaRecorder API doesm't record CanvasCaptureMediaStream. This is my issue. My aim is to record the browser screen.
Flags: needinfo?(muthusmkmtp)
(Reporter)

Comment 12

2 years ago
It works on Firefox Developer Edition v44.0a2 and doesn't work on Firefox v42.0. Any idea when the firefox will get update to support the CanvasCaptureMediaStream Object Recording as that of Firefox Developer Edition v44.0a2. Will the change in Firefox Developer Edition moved to Firefox future releases?
Yes, 44 will go to release in around 9 or 10 weeks.  Thanks for testing the fix!
Status: UNCONFIRMED → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1182426
You need to log in before you can comment on or make changes to this bug.