[FFmpeg-devel] [PATCH 1/1] libavformat/dashenc: add webm support

Paul B Mahol onemda at gmail.com
Sat Jan 21 19:06:51 EET 2017


On 1/21/17, Peter Grosse <pegro at friiks.de> wrote:
> Use webm muxer for VP8, VP9 and Opus codec, mp4 muxer otherwise.
>
> Signed-off-by: Peter Grosse <pegro at friiks.de>
> ---
>  libavformat/dashenc.c | 46 +++++++++++++++++++++++++++++++++++++++-------
>  1 file changed, 39 insertions(+), 7 deletions(-)
>
> diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
> index bd6bb88..29920fa 100644
> --- a/libavformat/dashenc.c
> +++ b/libavformat/dashenc.c
> @@ -114,6 +114,23 @@ static void set_codec_str(AVFormatContext *s,
> AVCodecParameters *par,
>  {
>      const AVCodecTag *tags[2] = { NULL, NULL };
>      uint32_t tag;
> +
> +    // common Webm codecs are not part of RFC 6381
> +    switch (par->codec_id) {
> +        case AV_CODEC_ID_VP8:
> +            snprintf(str, size, "vp8");
> +            return;
> +        case AV_CODEC_ID_VP9:
> +            snprintf(str, size, "vp9");
> +            return;
> +        case AV_CODEC_ID_VORBIS:
> +            snprintf(str, size, "vorbis");
> +            return;
> +        case AV_CODEC_ID_OPUS:
> +            snprintf(str, size, "opus");
> +            return;
> +    }

Wrong alignment. 'case' stuff should have same offset as 'switch' in FFmpeg.


More information about the ffmpeg-devel mailing list