Closed Bug 1612665 Opened 5 years ago Closed 4 years ago

HTML5 video stutter

Categories

(Core :: Graphics: WebRender, defect)

72 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla74
Tracking Status
firefox74 --- fixed

People

(Reporter: padamide, Assigned: sotaro)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.4 Safari/605.1.15

Steps to reproduce:

here is an example of the issue side by side with chrome (FF on the right): https://streamable.com/z1kpl

Actual results:

Video stutter can be seen on the right in the example above.
here is my support dump: https://pastebin.com/Pgqv9aPB

Expected results:

Video should not stutter
I ran a mozilla regression and it was able to narrow it down to a single commit: https://hg.mozilla.org/integration/autoland/rev/f0dfc557b20c1dd9c2865df1db2a34dc783c92f8

Here's the regression output:

2020-01-31T21:38:12: INFO : Narrowed inbound regression window from [a0e0c81e, d25c3e10] (3 builds) to [a0e0c81e, f0dfc557] (2 builds) (~1 steps left)
2020-01-31T21:38:12: DEBUG : Starting merge handling...
2020-01-31T21:38:12: DEBUG : Using url: https://hg.mozilla.org/integration/autoland/json-pushes?changeset=f0dfc557b20c1dd9c2865df1db2a34dc783c92f8&full=1
2020-01-31T21:38:13: DEBUG : Found commit message:
Bug 1596630 - Remove mSyncObject->Synchronize() in RenderCompositorANGLE::BeginFrame() r=nical

mSyncObject->Synchronize() was necessary to handle a case that D3D Texture was created on main thread of content process and the Texture does not have a keyed mutex. But with WebRender, the situation does not happen often. Further the Synchronize() is sometimes very slow. Therefore it is better to remove it from RenderCompositorANGLE::BeginFrame().

Canvas 2d does not use keyed mutex yet. Then the change adds keyed mutex usage for the canvas 2d.

D3D11DXVA2Manager still uses the Synchronize(). In this case, the Synchronize() is manually called in D3D11DXVA2Manager::CopyToImage(). Then RenderCompositorANGLE still needs to create SyncObjectHost.

Differential Revision: https://phabricator.services.mozilla.com/D53168

2020-01-31T21:38:13: DEBUG : Did not find a branch, checking all integration branches
2020-01-31T21:38:13: INFO : The bisection is done.

Blocks: wr-73
Component: Untriaged → Graphics: WebRender
Flags: needinfo?(sotaro.ikeda.g)
Product: Firefox → Core
Regressed by: 1596630
Has Regression Range: --- → yes
Keywords: regression

padamide, can you explain what "H264 plugin enabled" mean? Thanks!

Flags: needinfo?(padamide)

The OpenH264 Video Codec provided by Cisco Systems, Inc. It's a plugin that comes with the browser. If I disabled it I could get the issue to stop. I'm also able to stop the issue by setting gfx.webrender.force-disabled to true.

Flags: needinfo?(padamide)

Thanks for the info!

(In reply to padamide from comment #2)

The OpenH264 Video Codec provided by Cisco Systems, Inc. It's a plugin that comes with the browser. If I disabled it I could get the issue to stop. I'm also able to stop the issue by setting gfx.webrender.force-disabled to true.

Hmm, it seemed weird that OpenH264 affect to the problem. OpenH264 seems to be used only for WebRTC. And For video playback, Windows media API is used like WMFVideoMFTManager class.
https://searchfox.org/mozilla-central/rev/2e355fa82aaa87e8424a9927c8136be184eeb6c7/dom/media/platforms/wmf/WMFVideoMFTManager.cpp

:jya, is there a case that OpenH264 Video Codec is used for video playback?

Flags: needinfo?(jyavenard)

It’s possible that the 264 codec is a red herring. Disabling it probably disabled WebRender. That seems to be the common denominator. Perhaps the title needs to be edited.

Assignee: nobody → sotaro.ikeda.g
Flags: needinfo?(sotaro.ikeda.g)

D3D11DXVA2Manager::CopyToImage() copy decoded video data to ID3D11Texture2D. It uses SyncObjectD3D11Client::Synchronize(). It was added by Bug 1340398 . To make it work correctly, Host side also needs to call SyncObjectD3D11Host::Synchronize(). Then it seems better to backout Bug 1596630.
https://searchfox.org/mozilla-central/rev/2e355fa82aaa87e8424a9927c8136be184eeb6c7/dom/media/platforms/wmf/DXVA2Manager.cpp#971

Flags: needinfo?(jyavenard)
Summary: HTML5 video stutter when H264 plugin enabled → HTML5 video stutter
Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74
QA Whiteboard: [qa-74b-p2]
See Also: → 1635629
See Also: → 1745096
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: