w3c / webcodecs

WebCodecs is a flexible web API for encoding and decoding audio and video.
https://w3c.github.io/webcodecs/
Other
941 stars 132 forks source link

Add H.265/VP8/VP9/AV1 samples to video decoding page. #695

Closed StaZhu closed 1 year ago

StaZhu commented 1 year ago

This should be helpful for developer to test the browser implement or compare the performance between different codecs on different platforms and devices.

Note that the previous version of mp4box is not able to parse AV1 video codec string correctly, so to support AV1, we also need to upgrade mp4box to version 0.5.2.

Safari doesn't support gl.createShader so change the default renderer to 2d.

All sample videos are encoded from bbb-1920x1080-cfg06.mp4 using ffmpeg and shaka packager.

dalecurtis commented 1 year ago

We've been meaning to trim down these videos actually. Can you reduce them all to only about 5-10s content, or whatever fits in about ~5mb per clip?

StaZhu commented 1 year ago

We've been meaning to trim down these videos actually. Can you reduce them all to only about 5-10s content, or whatever fits in about ~5mb per clip?

That wont be hard, and I was indeed considered doing like what you said. However after some consideration, I am not sure if a 10s video could be used to measure decoding performance of different codecs, since its too fast to renderer a 10s video in 1000~5000fps, the previous sample video is a 20mins video and leave some time to stable the fps. i was thinking some developer maybe already get used to the 20mins video sample.

dalecurtis commented 1 year ago

Is measuring decoding performance that useful? I think we just want to show how to use the various codecs. Speed testing codecs seems like something folks can trivially figure out.

StaZhu commented 1 year ago

Is measuring decoding performance that useful? I think we just want to show how to use the various codecs. Speed testing codecs seems like something folks can trivially figure out.

How about let's find a compromise point. for example: reduce 20mins -> 4mins, then the H264,VP8 sample will be 18MB approximately, and the H265,VP9,AV1 will be 9MB, is that still too large?

aboba commented 1 year ago

It's useful to have BBB encoded with different codecs, but not clear to me why we need that much video for the WebCodecs samples.

It would make more sense for WebTransport samples, where we are trying to understand network performance for use cases like streaming and you need to watch a considerable amount of video to get a sense of how well various transport approaches work (e.g. to notice video stalls or skips).

So my vote would be to trim the video down as Dale suggests, and upload the longer videos for use in WebTransport samples/demos.

dalecurtis commented 1 year ago

I don't mind compromising if there's a real use case for benchmarking decoder performance, but it's actually misleading if the take away from these samples is that a given codec is always faster. In reality folks would need to use MediaCapabilities or run a decoder micro-benchmark on their target devices. Does a sample size of 1 minute work?

My main concern is hosting too much data on our public repo though. #537 was the bug we filed to use smaller samples.

StaZhu commented 1 year ago

Okey, I've uploaded the samples to 1mins now, please review the rest ! :)

dalecurtis commented 1 year ago

@aboba did you want to review as well?