Closed Bug 1499560 Opened 6 years ago Closed 5 years ago

Playing Video fails with decoding error using a valid webm video blob

Categories

(Core :: Audio/Video: Playback, defect, P3)

62 Branch
defect

Tracking

()

RESOLVED DUPLICATE of bug 1514581

People

(Reporter: mannion, Unassigned)

References

Details

(Keywords: regression, Whiteboard: [need info jya 2018-10-18])

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36

Steps to reproduce:

See example here: https://jsfiddle.net/drmannion/q6nymgfs/


Attempted to play video blob created with MedaiRecorder failed with the following error:

Media resource blob:null/46fda0f4-c1cc-45eb-96a7-8f20e213cecc could not be decoded. 
Media resource blob:null/46fda0f4-c1cc-45eb-96a7-8f20e213cecc could not be decoded, error: Error Code: NS_ERROR_DOM_MEDIA_METADATA_ERR (0x806e0006)

At other times, the error code was NS_ERROR_DOM_MEDIA_DEMUXER_ERR (0x806e000c).

However, if I save the same blob to file, download it and reopen it in Firefox (or Chrome), it plays without error.  Also, if I read the blob into an ArrayBuffer, create a new File with the result, the video also plays without error.  As far as can tell the length and content of the blobs are identical.



Actual results:

Error is thrown and video will not play.


Expected results:

Video should play without error.
jya: do you have an idea of what is going on here?
Flags: needinfo?(jyavenard)
Whiteboard: [need info jya 2018-10-18]
Can you please provide the steps you used to reproduce the issue?
Or maybe the test case is no longer valid (I see 404 error in there=: https://fiddle.jshell.net/drmannion/q6nymgfs/show/MediaRecorder%20examples%20-%20Record%20video%20and%20audio_files2/record-video-and-audio.js.download

That fiddle doesn't do anything for me and the behaviour is the same as in chrome. Thank you
Flags: needinfo?(jyavenard) → needinfo?(mannion)
(In reply to Jean-Yves Avenard [:jya] from comment #2)
> Can you please provide the steps you used to reproduce the issue?
> Or maybe the test case is no longer valid (I see 404 error in there=:
> https://fiddle.jshell.net/drmannion/q6nymgfs/show/
> MediaRecorder%20examples%20-%20Record%20video%20and%20audio_files2/record-
> video-and-audio.js.download
> 
> That fiddle doesn't do anything for me and the behaviour is the same as in
> chrome. Thank you

I am still getting the same error in 63.0.1.  I have created a new fiddle with nice file names, but the code is all the same:
https://jsfiddle.net/drmannion/dcbfnpy1/

Better Steps:
1: Download HTML from jsfiddle above and save as FirefoxBug.html
2: Create subfolder in same directory as FirefoxBug.html, called FirefoxBug
3: Download css from jsfiddle above and save as style.css in subfolder called FirefoxBug, created in step 2
4: Download javascript from jsfiddle above and save as FirefoxBug.js in subfolder called FirefoxBug, created in step 2
5: Open FirefoxBug.html with Firefox on a a computer with webcam and microphone.
6: Click allow, to give page permission to use webcam and microphone. You should see a live feed from your webcam in the "live preview" video element.
7: Click Record
8: Wait a few seconds (~3), click Pause.
9: Click Get. The recorded stream should start playing back in the "recorded clip" video element.
10: Click Resume.
11: Wait a few seconds (~3), click Pause.
12: Click Get. You should see the message "Video can't be played because the file is corrupt." message in the "recorded clip" video element.  If you don't get this error, repeat steps 10- 12 several times until you do.
13: Click on the Download File link and save the file locally.
14: Open the downloaded file in Firefox (or Chrome) and it should play fine, without any errors.
Flags: needinfo?(mannion)
(In reply to mannion from comment #3)
> (In reply to Jean-Yves Avenard [:jya] from comment #2)
> > Can you please provide the steps you used to reproduce the issue?
> > Or maybe the test case is no longer valid (I see 404 error in there=:
> > https://fiddle.jshell.net/drmannion/q6nymgfs/show/
> > MediaRecorder%20examples%20-%20Record%20video%20and%20audio_files2/record-
> > video-and-audio.js.download
> > 
> > That fiddle doesn't do anything for me and the behaviour is the same as in
> > chrome. Thank you
> 
> I am still getting the same error in 63.0.1.  I have created a new fiddle
> with nice file names, but the code is all the same:
> https://jsfiddle.net/drmannion/dcbfnpy1/
> 
> Better Steps:
> 1: Download HTML from jsfiddle above and save as FirefoxBug.html
> 2: Create subfolder in same directory as FirefoxBug.html, called FirefoxBug
> 3: Download css from jsfiddle above and save as style.css in subfolder
> called FirefoxBug, created in step 2
> 4: Download javascript from jsfiddle above and save as FirefoxBug.js in
> subfolder called FirefoxBug, created in step 2
> 5: Open FirefoxBug.html with Firefox on a a computer with webcam and
> microphone.
> 6: Click allow, to give page permission to use webcam and microphone. You
> should see a live feed from your webcam in the "live preview" video element.
> 7: Click Record
> 8: Wait a few seconds (~3), click Pause.
> 9: Click Get. The recorded stream should start playing back in the "recorded
> clip" video element.
> 10: Click Resume.
> 11: Wait a few seconds (~3), click Pause.
> 12: Click Get. You should see the message "Video can't be played because the
> file is corrupt." message in the "recorded clip" video element.  If you
> don't get this error, repeat steps 10- 12 several times until you do.
> 13: Click on the Download File link and save the file locally.
> 14: Open the downloaded file in Firefox (or Chrome) and it should play fine,
> without any errors.

I ran through this on Nightly 64 (a bit old indeed, Oct 20) on a modified fiddle [1] so I could avoid all the downloading and code-copying steps (if gUM doesn't work, make sure you "show only this frame" from the context menu). 10 iterations of step 10-12 but I could not reproduce. I also tried to play around with different combinations of pause/resume/get but no luck on reproducing any issues either.

Could you provide more information that could help narrow down what's triggering this? What's the sequence of events when this occurs?

[1] https://fiddle.jshell.net/pehrsons/g31o4yj0/4/show/light/
Flags: needinfo?(mannion)
Please comment out lines 147 through 155 of the JavaScript and repeat the steps.  This is the code that is compensating for the problem.  I should have commented that out for you.  Sorry.
Flags: needinfo?(mannion)
Thanks. I can repro with [2] and steps 6-14 in comment 3.

We're getting a NS_ERROR_DOM_MEDIA_METADATA_ERR, but after downloading the blob can indeed be played. jya, can you take a look?


[2] https://fiddle.jshell.net/pehrsons/g31o4yj0/show/light/
Status: UNCONFIRMED → NEW
Rank: 25
Ever confirmed: true
Flags: needinfo?(jyavenard)
Priority: -- → P3
See Also: → 1511006
So a mix of file-backed blobs and memory-backed blobs is causing this based on bug 1511006.

Hopefully bug 1513596 fixes this too.
Nope, this is still an issue with bug 1511006 fixed and all blobs being of type Blob.
I traced this to bug 1403706. At least that's the most suspicious candidate based on my mozregression results below.

STR (based on bug 1511006):
1 go to https://bug1511006.bmoattachments.org/attachment.cgi?id=9028607
2 approve gUM request
3 verify in console one of the (non-first and non-last) blobs are larger than your "media.recorder.max_memory" pref (default 1024000). If not, go to 1.
4 When the recording is done, click play on the lower media element.

Expected:
Video in lower media element plays

Actual:
Demuxer error


This version passes:
mozregression --launch 2017-09-29 --pref "media.recorder.max_memory:512000"

This version fails:
mozregression --launch 2017-10-11 --pref "media.recorder.max_memory:512000"

Bug 1403706 landed on 2017-10-06.


Baku, can you take a look?
Blocks: 1403706
Flags: needinfo?(amarchesini)
Keywords: regression
Blocks: 1511006
See Also: 1511006
I don't have time to work on this at the moment. Andrew, can you suggest somebody who can take a look?
Flags: needinfo?(amarchesini) → needinfo?(overholt)
This is a dup of bug 1514581. I just submitted a patch for that bug.
Status: NEW → RESOLVED
Closed: 5 years ago
Flags: needinfo?(overholt)
Flags: needinfo?(jyavenard)
Resolution: --- → DUPLICATE
Depends on: 1515032
You need to log in before you can comment on or make changes to this bug.