Skip to content

Commit

Permalink
avformat/img2: Add support for AVIF mux in image2
Browse files Browse the repository at this point in the history
Add support for AVIF muxing in the image2 muxer.

Tested with this example:
ffmpeg -lavfi testsrc=duration=1:size=320x320 -g 1 -flags global_header -c:v libaom-av1 -f image2 img-%2d.avif

Signed-off-by: Vignesh Venkatasubramanian <[email protected]>
  • Loading branch information
Vignesh Venkatasubramanian authored and GyanD committed May 19, 2022
1 parent b8ede4d commit dd99d34
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libavformat/img2enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ static int write_header(AVFormatContext *s)
img->muxer = "gif";
} else if (st->codecpar->codec_id == AV_CODEC_ID_FITS) {
img->muxer = "fits";
} else if (st->codecpar->codec_id == AV_CODEC_ID_AV1) {
img->muxer = "avif";
} else if (st->codecpar->codec_id == AV_CODEC_ID_RAWVIDEO) {
const char *str = strrchr(s->url, '.');
img->split_planes = str
Expand Down Expand Up @@ -265,7 +267,7 @@ const AVOutputFormat ff_image2_muxer = {
.long_name = NULL_IF_CONFIG_SMALL("image2 sequence"),
.extensions = "bmp,dpx,exr,jls,jpeg,jpg,jxl,ljpg,pam,pbm,pcx,pfm,pgm,pgmyuv,"
"png,ppm,sgi,tga,tif,tiff,jp2,j2c,j2k,xwd,sun,ras,rs,im1,im8,"
"im24,sunras,vbn,xbm,xface,pix,y",
"im24,sunras,vbn,xbm,xface,pix,y,avif",
.priv_data_size = sizeof(VideoMuxData),
.video_codec = AV_CODEC_ID_MJPEG,
.write_header = write_header,
Expand Down

0 comments on commit dd99d34

Please sign in to comment.