[FFmpeg-devel] [PATCH] avformat: add H264 and HEVC support in IVF muxer

Carl Eugen Hoyos ceffmpeg at gmail.com
Sun Sep 30 22:18:04 EEST 2018


2018-09-28 20:51 GMT+02:00, alx.sukhanov at gmail.com <alx.sukhanov at gmail.com>:
> From: Alex Sukhanov <asukhanov at google.com>

>      if (par->codec_type != AVMEDIA_TYPE_VIDEO ||
>          !(par->codec_id == AV_CODEC_ID_AV1 ||
> +          par->codec_id == AV_CODEC_ID_H264 ||
> +          par->codec_id == AV_CODEC_ID_HEVC ||
>            par->codec_id == AV_CODEC_ID_VP8 ||
>            par->codec_id == AV_CODEC_ID_VP9)) {
> -        av_log(s, AV_LOG_ERROR, "Currently only VP8, VP9 and AV1 are
> supported!\n");
> +        av_log(s, AV_LOG_ERROR, "Currently only AV1, H264, HEVC, VP8 and
> VP9 and AV1 are supported!\n");
>          return AVERROR(EINVAL);

>      }
>      avio_write(pb, "DKIF", 4);
>      avio_wl16(pb, 0); // version
>      avio_wl16(pb, 32); // header length
> -    avio_wl32(pb,
> -              par->codec_id == AV_CODEC_ID_VP9 ? AV_RL32("VP90") :
> -              par->codec_id == AV_CODEC_ID_VP8 ? AV_RL32("VP80") :
> AV_RL32("AV01"));
> +    switch (par->codec_id) {
> +      case AV_CODEC_ID_AV1:
> +        avio_wl32(pb, AV_RL32("AV01"));
> +        break;
> +      case AV_CODEC_ID_H264:
> +        avio_wl32(pb, AV_RL32("H264"));
> +        break;
> +      case AV_CODEC_ID_HEVC:
> +        avio_wl32(pb, AV_RL32("HEVC"));
> +        break;
> +      case AV_CODEC_ID_VP8:
> +        avio_wl32(pb, AV_RL32("VP80"));
> +        break;
> +      case AV_CODEC_ID_VP9:
> +        avio_wl32(pb, AV_RL32("VP90"));
> +        break;

> +      default:
> +        break;

Please either remove this or make it an assert().

Carl Eugen


More information about the ffmpeg-devel mailing list