Closed
Bug 1181981
Opened 9 years ago
Closed 8 years ago
mozGetMediaSource doesn't work on youtube videos
Categories
(Core :: Audio/Video: Playback, defect, P2)
Core
Audio/Video: Playback
Tracking
()
RESOLVED
FIXED
mozilla47
Tracking | Status | |
---|---|---|
firefox47 | --- | fixed |
People
(Reporter: paul, Unassigned)
References
Details
Attachments
(3 files)
874.38 KB,
image/png
|
Details | |
3.15 KB,
patch
|
Details | Diff | Splinter Review | |
1.73 KB,
patch
|
mozbugz
:
review+
|
Details | Diff | Splinter Review |
+++ This bug was initially created as a clone of Bug #1177793 +++ Using mozCaptureStream() on any youtube video will freeze/pause the video. It can be due to the fact videos on youtube use a mediasource instead of a file. Some more context can be found in bug 1177793.
Comment 1•9 years ago
|
||
I did some testing of this with my current WIP patch in bug 1172394 applied (uploading it soon). One obvious problem was that the audio track and the video track were added by the MediaDecoderStateMachine with the same ID. With my patch (pull based feeding of the stream) it caused some assertions. Without my patch (push based feeding of the stream) it's probably causing a freeze because not all added tracks have data. They can't all ever get data either, since you add data per ID. I'm guessing you're on a prod build because there should really be assertions going off if we for instance try to push video data to an audio track. I hardcoded some track IDs with my patch applied and it just worked! See the screenshot.
Reporter | ||
Comment 2•9 years ago
|
||
(In reply to Andreas Pehrson [:pehrsons] (Telenor) from comment #1) > Without my patch (push based feeding of the stream) it's probably causing a > freeze because not all added tracks have data. They can't all ever get data > either, since you add data per ID. I'm guessing you're on a prod build > because there should really be assertions going off if we for instance try > to push video data to an audio track. See bug 1177793 comment 2. > I hardcoded some track IDs with my patch applied and it just worked! See the > screenshot. Great! I'm surprised you don't have the black screen issue. Should this bug be a dupe of bug 1172394? Any ETA for a fix? (July?) Thanks for looking at this.
Comment 3•9 years ago
|
||
(In reply to Paul Rouget [:paul] from comment #2) > Should this bug be a dupe of bug 1172394? No, I expect this to work once we fix the duplicate track ids. > Any ETA for a fix? (July?) If the source of the duped track ids is simple to fix it should be in sometime next week. We did some debugging and it was indeed coming from MediaSourceReader (=MSE), not sure where the exact origin is yet though.
Comment 4•9 years ago
|
||
It's coming from here: https://hg.mozilla.org/mozilla-central/file/e7e69cc8c07b/media/libstagefright/binding/DecoderData.cpp#l115 My understanding of this issue is that audio and video come as separate chunks with MSE and so they can have the same track IDs. However, both HTMLMediaElement and DecodedStream rely on the track IDs to be unique for mozCaptureStream() to work. I guess we can have MediaDecoderStateMachine assign unique output trackIDs when Metadata gets read or perhaps even rewrite to make them unique. Unless, of course, we can fix it at the source. jya, can you take care of this? Or tell me your preferred solution and I can implement it. Some MSE-person should write a test for this as well IMHO.
Flags: needinfo?(jyavenard)
Comment 5•9 years ago
|
||
This should be fixed with the new MSE btw, as the track ID are properly set. Could you try setting media.mediasource.format-reader to true and see how that goes for you?
Flags: needinfo?(jyavenard)
Comment 6•9 years ago
|
||
(In reply to Jean-Yves Avenard [:jya] from comment #5) > This should be fixed with the new MSE btw, as the track ID are properly set. > > Could you try setting media.mediasource.format-reader to true and see how > that goes for you? Didn't do much. See the attached patch to better understand what is failing. This is the output with that patch trying to play (no need to capture to a stream) a video on youtube: > MP4VideoInfo track ID 2 => 1 > MP4VideoInfo track ID 1 => 1 > Assertion failure: !(HasAudio() && HasVideo()) || mInfo.mAudio.mTrackId != mInfo.mVideo.mTrackId (Duplicate track ids in MediaInfo), at /Users/pehrsons/Comoyo/gecko-dev/dom/media/MediaDecoderStateMachine.cpp:1893 I'm on self-built m-c from July 8.
Flags: needinfo?(jyavenard)
Reporter | ||
Comment 7•9 years ago
|
||
Any update on this? Anything I can do to help?
Updated•9 years ago
|
Component: Audio/Video → Audio/Video: Playback
Comment 8•9 years ago
|
||
Maybe this doesn't work with MSE video?
Comment 9•9 years ago
|
||
This is supposed to be fixed, apparently. Can you confirm please?
Flags: needinfo?(paul)
Reporter | ||
Comment 10•9 years ago
|
||
(In reply to Ralph Giles (:rillian) from comment #9) > This is supposed to be fixed, apparently. Can you confirm please? It's not. Open any youtube video, open the js console, and type: ``` let v = document.querySelector('video'); let stream = v.mozCaptureStream(); ``` Video freezes.
Flags: needinfo?(paul)
Updated•9 years ago
|
Priority: -- → P2
Comment 11•8 years ago
|
||
YouTube sets the track ID at 1 for both audio and video tracks. Attempting to use mozCaptureStream would cause an assert as it always expect tracks to have a different track Id.
Attachment #8715252 -
Flags: review?(gsquelart)
Updated•8 years ago
|
Flags: needinfo?(jyavenard)
Attachment #8715252 -
Flags: review?(gsquelart) → review+
Comment 13•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/be37af7fca76
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox47:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
You need to log in
before you can comment on or make changes to this bug.
Description
•