How should packages be packaged in a real WebM stream?

I am encoding a live stream with VP9 via libvpx and want to pass it to an HTML5 player. I read the Matroska and W3C WebM Byte Stream Format specs and looked at a couple of WebM files created using the vpxenc tool from libvpx. Everything seems nice, but I could not find any strict rules or recommendations on how to pack encoded video frames inside the media segment described in the W3C specification.

As far as I understand, I have to select media segments containing clusters with block elements inside. From what I understand, I can use a simple block element for each frame that I get from the encoder, since it has one timestamp. But how to organize clusters? It makes sense to me to emit one cluster for each frame with a simple simple block record to reduce buffering and latency. Is this approach generally accepted or is there some kind of disadvantage for this, and I have to buffer for some time interval and then emit a cluster containing a few simple block elements covering the buffering period?

UPDATE

So, I implemented the described approach (allocation of clusters with a single simple block recording), and the video seems to be very behind, so this is probably not the way to go.

+4
source share
2 answers

So, I finally managed to work in multiplexing mode.

It seems that the initial approach that I described (having one cluster with one SimpleBlock ) actually works as such, but it has several drawbacks:

Key frames MUST be placed at the beginning of clusters

  • It splits a possible search if the live stream is stored in a local file with curls or other means. In my opinion, the cluster should consist of a full GOP.

, Cluster "" , , Chrome, VLC ffplay , GOP, .

, SimpleBlock 16- , 32767 . , , 1 - 1 , , 32 . GOP , .

, - ( Big Bck Bunny, ), .

, .

+3

, , . , . , , , , . (, , - .)

, , RTP. , webm, , , webm , , ; RTP.

( , , , , , , , - .)

0

Source: https://habr.com/ru/post/1605802/


All Articles