Access spatial and temporal layers using WebAPI's VideoDecoder without WebRTC

395 views
Skip to first unread message

Matthew Kim

unread,
Aug 14, 2024, 5:43:01 AM8/14/24
to Chromium-dev
Following the svc.html example, is there a way I can access the temporal and spatial layers from the WebAPI's VideoDecoder without using WEBRTC?

EncodedVideoChunkMetadata provides the temporal layer ID of that object. Does that mean each layer is encoded into it's own chunk?


Dale Curtis

unread,
Aug 14, 2024, 12:49:51 PM8/14/24
to ma...@shuttle.video, Chromium-dev, media-dev

On Wed, Aug 14, 2024 at 2:42 AM Matthew Kim <ma...@shuttle.video> wrote:
Following the svc.html example, is there a way I can access the temporal and spatial layers from the WebAPI's VideoDecoder without using WEBRTC?

EncodedVideoChunkMetadata provides the temporal layer ID of that object. Does that mean each layer is encoded into it's own chunk?


--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/5e9a73de-1379-4227-829c-e7b35c24142dn%40chromium.org.

Dale Curtis

unread,
Aug 15, 2024, 1:17:37 PM8/15/24
to Matthew Kim, Chromium-dev, media-dev
No, we haven't completed the design for SVC support yet, there's still a lot of discussion ongoing on what shape it should take:

It's unclear what level of hardware / software support SVC would have either, so if this is required for your use case you'll likely need a fallback wasm decoder anyways.

- dale

On Thu, Aug 15, 2024 at 9:29 AM Matthew Kim <ma...@shuttle.video> wrote:
Thank you Dale. Is there any way to get the spatial layers? Seems like it is on the docket: https://github.com/w3c/webcodecs/pull/756, but is there an existing workaround for this? Our use case doesn't involve WebRTC.

Apologies for the broad question, I'm just a chunk of coal and would like some guidance.

Sincerely,
Matthew

Dale Curtis

unread,
Aug 15, 2024, 1:49:17 PM8/15/24
to Matthew Kim, Chromium-dev, media-dev
I'm unfamiliar with the term SF middlebox, but yes the app would be responsible for everything around sending and receiving after/before VideoEncoder/VideoDecoder.

- dale

On Thu, Aug 15, 2024 at 10:25 AM Matthew Kim <ma...@shuttle.video> wrote:
Very interesting -- thank you! 

Another question just to confirm: implementing a SF middlebox would be the developers responsibility? My current thinking is since the VideoEncoder can dispatch video chunks by temporal layers, the underlying mechanism to selectively send which chunks needs to be implemented.

Is there a good example of this? Am I thinking correctly?

Thank you again.
Matthew

Dale Curtis

unread,
Aug 15, 2024, 3:24:17 PM8/15/24
to Matthew Kim, Chromium-dev, media-dev
Sorry I did mean encoder. I believe the decoders will output the highest layer for av1, vp8, vp9. I'm not sure about h264, h265. I've asked Dan to summarize the results of his investigation on the bug:

To be clear, you should be able to use temporal SVC today w/o issue, it's just spatial SVC that's not wired up. AFAIK that's the extent of what is supported in WebRTC in Chrome.

- dale

On Thu, Aug 15, 2024 at 12:02 PM Matthew Kim <ma...@shuttle.video> wrote:
> It's unclear what level of hardware / software support SVC would have either, so if this is required for your use case you'll likely need a fallback wasm decoder anyways.

Interesting. I don't mean to nit, but do you mean decoder and encoder? Only needing a wasm decoder would be super cool; suppose I configure my VideoEncoder to follow the AV1 codec, then would every EncodedVideoChunk follow an AV1 specific format?

I ask because Chromium's AV1 decoder calls libgav1 to parse and decode the video frame. So would libgav1's decoder plug in nicely in place of VideoDecoder?

The question I mean to ask is: Our use case requires retrieving chunks by spatial and temporal layers. But without reimagining the entire process, I would like to leverage the VideoEncoder/VideoDecoder to get such insight.

I'm inspired by the SVC extension for WebRTC. If they can do it, why can't I?

Thank you again for your super helpful responses.
Matthew




On Thu, Aug 15, 2024 at 2:41 PM Matthew Kim <ma...@shuttle.video> wrote:
Apologies, when I say SF middlebox, I meant the selective forwarding middlebox.

Thank you for your help! I really appreciate it.

Matthew Kim

unread,
Aug 16, 2024, 6:54:33 AM8/16/24
to Dale Curtis, Chromium-dev, media-dev
Very interesting -- thank you! 

Another question just to confirm: implementing a SF middlebox would be the developers responsibility? My current thinking is since the VideoEncoder can dispatch video chunks by temporal layers, the underlying mechanism to selectively send which chunks needs to be implemented.

Is there a good example of this? Am I thinking correctly?

Thank you again.
Matthew


Matthew Kim

unread,
Aug 16, 2024, 7:02:27 AM8/16/24
to Dale Curtis, Chromium-dev, media-dev
Thank you Dale. Is there any way to get the spatial layers? Seems like it is on the docket: https://github.com/w3c/webcodecs/pull/756, but is there an existing workaround for this? Our use case doesn't involve WebRTC.

Apologies for the broad question, I'm just a chunk of coal and would like some guidance.

Sincerely,
Matthew

On Wed, Aug 14, 2024 at 12:48 PM Dale Curtis <dalec...@chromium.org> wrote:

Matthew Kim

unread,
Aug 16, 2024, 7:02:28 AM8/16/24
to Dale Curtis, Chromium-dev, media-dev
Apologies, when I say SF middlebox, I meant the selective forwarding middlebox.

Thank you for your help! I really appreciate it.
Matthew

Matthew Kim

unread,
Aug 16, 2024, 7:03:32 AM8/16/24
to Dale Curtis, Chromium-dev, media-dev
> It's unclear what level of hardware / software support SVC would have either, so if this is required for your use case you'll likely need a fallback wasm decoder anyways.

Interesting. I don't mean to nit, but do you mean decoder and encoder? Only needing a wasm decoder would be super cool; suppose I configure my VideoEncoder to follow the AV1 codec, then would every EncodedVideoChunk follow an AV1 specific format?

I ask because Chromium's AV1 decoder calls libgav1 to parse and decode the video frame. So would libgav1's decoder plug in nicely in place of VideoDecoder?

The question I mean to ask is: Our use case requires retrieving chunks by spatial and temporal layers. But without reimagining the entire process, I would like to leverage the VideoEncoder/VideoDecoder to get such insight.

I'm inspired by the SVC extension for WebRTC. If they can do it, why can't I?

Thank you again for your super helpful responses.
Matthew




On Thu, Aug 15, 2024 at 2:41 PM Matthew Kim <ma...@shuttle.video> wrote:
Reply all
Reply to author
Forward
0 new messages