Open Bug 1663218 Opened 6 years ago Updated 4 years ago

Video canPlayType for 'video/mp4; codecs="avc1.64003c"' reports "" should report "maybe" or "probably"

Categories

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

80 Branch
defect

Tracking

()

People

(Reporter: naktinis, Unassigned, NeedInfo)

References

Details

Attachments

(1 file, 1 external file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:80.0) Gecko/20100101 Firefox/80.0

Steps to reproduce:

  1. const video = document.createElement('video')
  2. video.canPlayType('video/mp4; codecs="avc1.64003c"')
  3. open such a video in the browser

Actual results:

canPlayType returns "".

The video plays fine.

Expected results:

canPlayType should return "maybe" or "probably".

Bugbug thinks this bug should belong to this component, but please revert this change in case of error.

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

The video plays fine.

What video? Was there supposed to be a link or an attachment here?

Flags: needinfo?(naktinis)
Attached video hawaii_8k.mp4 —

Attached an example of a video identified as video/mp4; codecs="avc1.64003e". This video plays fine on my Firefox. Let me know if you need a screenshot for that. In my original post it was "64003c", because I used a different high-res video, but the idea is the same.

To check the codec for yourself, you can run:

ffprobe -v error -select_streams v:0 -show_entries stream=profile:stream=level -of default=noprint_wrappers=1 hawaii_8k.mp4
profile=High
level=62

"High" translates to 100 in decimal, or 64 in hexadecimal. Level "62" translates to "3e" in hexadecimal. Setting "constraint_set flags" to 0 we get "ObjectTypeIndication" as "64003e".

Now you can check for playability:

const video = document.createElement('video')
video.canPlayType('video/mp4; codecs="avc1.64003e"')

Which returns an empty string (but as describe above, the video plays just fine).

See also:
https://tools.ietf.org/html/rfc6381#section-3.3
https://stackoverflow.com/questions/16363167/html5-video-tag-codecs-attribute/16365526#16365526

Flags: needinfo?(naktinis)

Thanks for the additional info. I've confirmed the video plays despite canPlayType for what seems to be the right MIME type returning "". I'll need to do a bit more research to see what's going on here and if there's a simple fix.

Severity: -- → S2
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3

Similar to bug 1437003, update to allow H264 level up to 6.2 inclusive.

Also, rename IsWhitelistedH264Codec() in accordance with bug 1642790.

Assignee: nobody → jbauman
Status: NEW → ASSIGNED

Per https://docs.microsoft.com/en-us/windows/win32/api/codecapi/ne-codecapi-eavench264vlevel?redirectedfrom=MSDN ;
no level higher than 5.2 is supported by Microsoft WMF framework.

It maybe that it works, but Windows is by far our biggest platform and Windows 7 still make for a considerable amount.

Hey naktinis,
Can you still reproduce this or should we close it?

Flags: needinfo?(naktinis)

Yes, I can still reproduce this on latest nightly 91.0a1 (macOS Big Sur 11.4).

video.canPlayType('video/mp4; codecs="avc1.64003e"')

The above command returns an empty string, but the actual video with this codec (attached to this issue) plays fine.

Flags: needinfo?(naktinis)
QA Whiteboard: [qa-not-actionable]
Assignee: jbauman → nobody
Status: ASSIGNED → NEW

Hi, guys, do the firefox tema have plan to fix this?
this bug makes some live streams can not play in Firefox 104.0.2,
on mac, if firefox playing avc1.64003c live, the firefox console always output
Cannot play media. No decoders for requested formats: video/mp4; codecs="mp4a.40.2 avc1.64003c"
And live stream stop.
But edge and chrome can play them with no problems.
My mac is 12.5.1 with m1 max cpu,
canPlayType in firefox with avc1.64003c is still return empty string.
But chrome and edge are return probably

ChunMin, this looks similar to the other work we did with codec strings. Mind taking a look when you have a chance?

Severity: S2 → S4
Flags: needinfo?(cchang)
Priority: P3 → --

FYI, this codec (level >5.2) is not supported by platform decoder per their official document, see here. Although it might be still able to play by the platform decoder, if they actually support it (like comment8). So in this context, it seems returning maybe or probably makes sense?

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

Attachment

General

Creator:
Created:
Updated:
Size: