New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 688490 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 606000
Owner: ----
Closed: Feb 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

MediaSource API: Appending chunks to a SourceBuffer creates gaps and playback stops

Reported by demia...@gmail.com, Feb 3 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36

Steps to reproduce the problem:
1. Load attached extension to Chrome
2. Go to chrome-extension://<id>/recorder.html
3. Record 30-second video
4. Click on 'play URL'

What is the expected behavior?
Video should play smoothly without stopping due to gaps in buffer.

What went wrong?
This is heavily related to this issue: https://bugs.chromium.org/p/chromium/issues/detail?id=606000

But some users report that bug has been solved, no one is answering me and I'm still having weird issues.

Somehow, MediaRecorder API is generating video chunks that when appended to a SourceBuffer creates gaps in the buffer and many TimeRanges objects.
This causes video to stop playing and user needs to seek forward in order to play the next buffer chunk.

I'm attaching a demo because it's still unclear which are the needed conditions to reproduce this problem.
For example, recording and playing videos on my machine works fine. (OSX 10.12.3)
But, a co-worker still runs OSX 10.11 and SOME videos can be played and SOME others don't!
Even Firefox fails with the exact same problem.

I'm still asking people to try this demo in order to gather more information on how to reproduce this problem.

In the meantime, can someone please test with attached demo? This is blocking my project development and I'm willing to do anything to get help from you guys.

Thanks.

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 56.0.2924.87  Channel: stable
OS Version: OS X 10.12.3
Flash Version: Shockwave Flash 24.0 r0

Not sure if problem relies on MediaRecorder or MediaSource. One of those are too stupid to handle video chunks.

 
Components: Blink>Media

Comment 2 by demia...@gmail.com, Feb 3 2017

Guys, reporting a bug here is a pain in the ass, I tried to submit report 4 times and now the attached demo is missing. Where is it?
Attaching again...
chrome-recorder.zip
5.4 KB Download
Mergedinto: 606000
Status: Duplicate (was: Unconfirmed)
This issue looks similar to the issue id: 606000. Hence, merging into the issue id: 606000.

Thanks...!!

Comment 4 by demia...@gmail.com, Feb 17 2017

Hi, please consider splitting issues again because both bugs are different.
I'm still having the same issue!

Comment 5 Deleted

Comment 6 Deleted

Comment 7 by mcasas@chromium.org, Feb 17 2017

Cc: demia...@gmail.com
#4: demian85: first please read [1] :-)
and with that in hand, please try the potential bug in the description
with the latest Canary, and paying attention to the comments in [2]
re. SourceBuffer.busy flag. (I can see that the .busy behaviour is 
a bit counterintuitive, but I'm afraid that's an issue with the 
Spec [3]).

If your error is still present, then it's not a duplicate, we'll de-dup
it and investigate.  As usual, providing the tiniest use case to
repro is the surest way for a fix (which you can also code yourself
and upload for review).


[1] https://bugs.chromium.org/p/chromium/issues/detail?id=606000#c84
[2] https://bugs.chromium.org/p/chromium/issues/detail?id=606000#c50
[3] https://www.w3.org/TR/media-source/

Comment 8 by demia...@gmail.com, Feb 17 2017

Okay, I understand. But I'm only asking for directions on where to find the
respective patches so I can submit them to Electron for evaluation.
The patch that I mentioned before has been accepted because I provided a
demo to reproduce the bug.
Unfortunately, problem didn't seem to go away, so it's a possibility that
many other changes after M54 somehow fixed this issue in latest Canary.

Thanks.
Unfortunately its very hard to speculate what change make the difference between these two milestones - there are tons of changes. My best guess (no promises):
https://codereview.chromium.org/2343543002/

You might try forking Electron and just rolling it forward to 56. Sorry, I know thats not easy. 

One other thing you might try is using plain <video src=stream> rather than MSE. You can see a demo of this here:

https://storage.googleapis.com/chcunningham-chrome-shared/mr_to_mse.html?enable_src_eq=true

(note the arg to enable_src_eq=true. clear your cache if its not working - I've just uploaded a new version)

I find that the src=stream approach works in current chromium stable and may work in electron as well

Comment 11 by demia...@gmail.com, Feb 18 2017

I'm not sure what you are suggesting. How can I use 'src' video attribute
to feed video chunks instead of MSE? I don't have a single video file, I
have many video chunks!
Your demo prints warnings on Chrome 56 stating that "MSE has gaps" and
video feed gets stuck sometimes, however it plays fine on Chrome Canary.
The demo I linked has two <video> tags. The one on the left (under SRC=) does not use MSE. Instead the video is wired directly to the recording stream with this code:

srcEqVideo.src = (window.URL || window.webkitURL).createObjectURL(stream);

Take a look at the surrounding javascript. Perhaps you can pipe your stream directly into the video tag in a similar fashion. 

The video tag on the right uses MSE and will not work reliably until M58 ships to stable. 

Comment 13 by demia...@gmail.com, Feb 20 2017

Unfortunately that's not my use case. I have a desktop app, so one user
records screen with MR and other consumes the video chunks with MSE...
So are you completely sure that M58 is needed for this to work?
I may loose my job if I cannot make this work on Electron.
Thanks anyway.

Sign in to add a comment