Closed Bug 1560092 Opened 4 months ago Closed 3 months ago

Unable to play AVC3 Widevine content

Categories

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

66 Branch
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: teun, Assigned: bryce, NeedInfo)

References

Details

(Keywords: regression)

Attachments

(2 files)

Attached file firefox_medialogs.txt

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36

Steps to reproduce:

This player is configured to autostart and, using dash.js, play a dash manifest with DRM enabled AVC3 content

https://demo.unified-streaming.com/mse-toolbox/player/?o=eyJkYXNoanMiOnt9LCJxdWlldCI6ZmFsc2UsInBsYXlzaW5saW5lIjp0cnVlLCJtdXRlZCI6ZmFsc2UsImNvbnRyb2xzIjp0cnVlLCJhdXRvcGxheSI6dHJ1ZX0=&file=https://qa.unified-streaming.com/test2/firefoxbug/example.ism/.mpd&player=dashjs

Actual results:

Video stalls, unable to load, looks like the media backend is unable to decrypt the content.

logs keeps repeating
"Still waiting for data or key. data(1)/key(0)"

See attached logs, captured using
NSPR_LOG_MODULES=MediaSource:5,MediaSourceSamples:5,MediaFormatReader:5

Expected results:

The video should play without issues

(the above mentioned example works fine in Chrome)

Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core

Bryce, any thoughts here?

Flags: needinfo?(bvandyk)

Got this on my queue, hoping to look at it this week once I clobber some of my backlog. Holding NI.

I've been looking into this, but it appears that some of the media has just gone down from where it was hosted. Teun, do you have control of the test media? Should it still be accessible?

Flags: needinfo?(bvandyk) → needinfo?(teun)

I'm seeing the test media go on and offline, but have got some more testing in. I also see issues where if caching is disabled then sometimes requests to the widevine licensing server fail -- so if anyone else wants to repro, try disabling caching in the networking dev tools.

Think I've found where we're stalling out. The MediaChangeMonitor fails to initially create a decoder because we have no SPS in the extra data. We then keep checking for changes and attempt to initialize the decoder, but encounter the same issue.

:jya, my understanding of the AVC3 entry is that it indicates the SPS is in the sample information, rather than in the earlier metadata. If we've got an encrypted stream of AVC3 content then we won't get our SPS data in the metadata and we'll never be able to inspect the the samples, so we won't get the data there and we'll just stall. Does that sound right?

Flags: needinfo?(jyavenard)

If an mp4 uses the AVC3 sample format then extra data will be stored in sample
data rather than in metadata. In encrypted streams the metadata is unencrypted
but samples are typically encrypted. If all samples are encrypted and the only
SPS data is in samples then the MediaChangeMonitor will never observe any SPS
data.

This change means that once we encounter encrypted data if we have not yet seen
any SPS data we allow of a decoder to be created to attempt to handle the
stream. We could further restrict this scenario to only happen when we're
certain AVC3 data is present, but since the MediaChangeMonitor does not know
about if the media is AVC3 or not, we do not do this extra check.

Flags: needinfo?(jyavenard)
Pushed by bvandyk@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/69cbe658ac7c
Create decoder for encrypted h264 media even if an SPS is not found. r=jya

Teun, could you provide the details of how the test media was created so I can create something similar for automated testing?

Status: UNCONFIRMED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
Assignee: nobody → bvandyk

Hi @bryce

The test media is produced by our dynamic packager Unified Origin. (https://www.unified-streaming.com/products/unified-origin)

If it’s helpful we can share static content prepared in a similar way that you can test with?

(In reply to Huseyin from comment #9)

Hi @bryce

The test media is produced by our dynamic packager Unified Origin. (https://www.unified-streaming.com/products/unified-origin)

If it’s helpful we can share static content prepared in a similar way that you can test with?

Thanks! Does that packager support outputting clearkey encrypted media? If so, would it be possible to get a short and openly licensed video? Something like 4 seconds of big buck bunny. This would be useful to put in place automated testing to prevent regressions.

You can use the following link for your tests:

https://qa.unified-streaming.com/test2/firefoxbug/example.ism/.mpd

The key for clear key decryption is:
key ID: C001DE8E567B5FCFBC22C565ED5BDA24
key: 533A583A843436A536FBE2A5821C4B6C

Hi @bryce

Is there any update about your tests?

Meanwhile, we had to update our test server and that caused I need to create new content. I am sharing the new content's details as below;

key ID: 10000000100010001000100000000001
key: 3A2A1B68DD2BD9B2EEB25E84C4776668"

https://qa.unified-streaming.com/firefoxbug/example.ism/.mpd

(In reply to Huseyin from comment #12)

Hi @bryce

Is there any update about your tests?

Meanwhile, we had to update our test server and that caused I need to create new content. I am sharing the new content's details as below;

key ID: 10000000100010001000100000000001
key: 3A2A1B68DD2BD9B2EEB25E84C4776668"

https://qa.unified-streaming.com/firefoxbug/example.ism/.mpd

Thanks for the update. Apologies for not replying sooner. I've downloaded one of the video streams, which I believe should be sufficient for me to try and generate a test. I'm currently trying to clear some other bugs, so it may be awhile before I create a test, but I appreciate you providing the media. If it's not problem for you, it may still prove useful to have the mpd and media files available if they can be left up.

Flags: needinfo?(bvandyk)

Sure, no problem Bryce. I will keep them in our test server. Please let me know if you don't need them anymore.

Flags: qe-verify+
Flags: needinfo?(anca.soncutean)

I can’t access the provided link in order to reproduce/verify this issue. Huseyin is there any other link that you can give me or could you confirm the fix on the latest Fx Beta (https://archive.mozilla.org/pub/firefox/candidates/) ? Thank you!

Flags: needinfo?(anca.soncutean)
Flags: needinfo?(huseyin)

Hi Anca,

I just checked the file and I can get an output. Could you please try again and share what kind of error(s) are you getting?

Flags: needinfo?(huseyin) → needinfo?(anca.soncutean)

(In reply to Huseyin from comment #16)

Hi Anca,

I just checked the file and I can get an output. Could you please try again and share what kind of error(s) are you getting?

When testing I see the link on the original comment cannot access the mpd. Is there a way to have the player play the clearkey content?

I've built a player and added the content with keys. You can test it with using the link below;

https://qa.unified-streaming.com/firefoxbug/test.html

Flags: needinfo?(anca.soncutean)

Thank you for your help and sorry for the late reply. I’ve reproduced the issue with Fx 69.0a1 (2019-06-19) on macOS 10.14. The issue is verified fixed with Fx 70.0b14 across platforms (Windows 10 x64, macOS 10.14 and Ubuntu 18.04).
On latest Nightly ( 71.0a1 - 2019-10-11) instead, the provided link works fine only on Windows 10 x64. Both on Ubuntu (18.04 x64) and macOS (10.14) I’ve encountered a tab crash, but with different signatures.

(In reply to Anca Soncutean [:Anca], Desktop Release QA from comment #19)

Thank you for your help and sorry for the late reply. I’ve reproduced the issue with Fx 69.0a1 (2019-06-19) on macOS 10.14. The issue is verified fixed with Fx 70.0b14 across platforms (Windows 10 x64, macOS 10.14 and Ubuntu 18.04).
On latest Nightly ( 71.0a1 - 2019-10-11) instead, the provided link works fine only on Windows 10 x64. Both on Ubuntu (18.04 x64) and macOS (10.14) I’ve encountered a tab crash, but with different signatures.

Testing this it looks like my above patch causes the crash on those platforms -- I'd expect the regression to occur in 70. Can you please test again and see if that's the case? I'll investigate mitigating the issue on those platforms.

Flags: needinfo?(bvandyk)
Flags: needinfo?(bvandyk)

(In reply to Bryce Seager van Dyk (:bryce) from comment #20)

Testing this it looks like my above patch causes the crash on those platforms -- I'd expect the regression to occur in 70. Can you please test again and see if that's the case? I'll investigate mitigating the issue on those platforms.

It seams you are right, since using mozregression I've ended up with the following regression range (tested on Ubuntu): https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=e20833cc231da9cc3aefdde282cf2b770c5920e0&tochange=cb2d564879e3e441c2220f389448e71e7280de6e . I confirm that on mac, also the crash occurred on the official Nightly 70.0a1 between 11.07 and 12.07.

Bugbug thinks this bug is a regression, but please revert this change in case of error.

Keywords: regression
See Also: → 1588198
You need to log in before you can comment on or make changes to this bug.