[vlc-devel] [PATCH 3/4] avformat mux: Mark keyframe blocks as such.

Rafaël Carré funman at videolan.org
Fri Aug 16 13:40:41 CEST 2013


Hello,

Le 15/08/2013 00:12, Steinar H. Gunderson a écrit :
> Some browsers, such as Firefox, are very picky about WebM streams needing to
> start with a keyframe. To be able to handle this correctly when streaming,
> the avformat mux needs to mark keyframe-containing blocks (or clusters, in
> Matroska terminology) as such even after they have been muxed. The next patch
> in the series will make httpd actually care about this flag.
> 
> Unfortunately, as avformat does not actually propagate this status, we need
> to use some heuristics to figure out which blocks contain keyframes. The natural
> thing to do would be to say that when we write a keyframe, the block that comes
> back has to be a keyframe block, but the WebM/Matroska muxer thwarts this by
> having its own internal buffering of clusters, flushing the _previous_ cluster
> when we send it a keyframe. In this case, we need to look at the _next_ cluster
> after the one that comes back when we mux a keyframe.
> 
> I couldn't find a way to reliably autodetect this behavior (think for instance
> about the audio packet caching that the WebM mux does), short of simply making
> a list of such muxes and checking for them.

This patch seems to be intimately linked to internal code of avformat,
and I don't like this.

libavformat developers can and will change this buffering behaviour so I
doubt we can rely on it.

If it's useful to know if a webm container packet comes with a keyframe
then I guess avformat should be modified to include that information.


Also I find this telling that this patch is only needed for Firefox..
Is it only Firefox or other browsers as well?



More information about the vlc-devel mailing list