Skip to content

VideoEncoder performance with hardware acceleration #492

@dustinkerstein

Description

@dustinkerstein

Today I tried to put together a streaming transcoder with WebCodecs. It's functional, and was surprisingly very easy to build, but I am running into some performance issues (and for my use-case, I can't drop frames). To isolate things a bit, I put together a very simple JSFiddle that focuses solely on the VideoEncoder portion of the code. You can find the demo here - https://jsfiddle.net/badru54k/

On my 2018 Macbook Pro, I can only maintain around 25fps. This feels a bit low to me considering it is using the hardware encoder (verified in the Chrome Media tab). With FFmpeg + VideoToolbox, I can encode 3840x2160 h264 at around 65-70fps. Is this amount of overhead to be expected, or is there maybe something else going on?

Thanks,
Dustin

PS - I can also replicate the same behavior in Edge and in Opera (with slightly worse performance).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions