Process GIF using FFmpeg libraries - can't find parser at av_parser_init

679 views Asked by At

I am playing with ffmpeg libs, namely libswscale and libavcodec for now. My goal is resize GIF files. From my ridiculous understanding, I think I need to

  • decode the GIF and get an AVFrame
  • process the frame with libswscale
  • encode again into GIF

But I am stuck at step 1. Based on official sample at https://github.com/FFmpeg/FFmpeg/blob/master/doc/examples/decode_video.c , I need to get a parser:

codec = avcodec_find_decoder(AV_CODEC_ID_GIF);
parser = av_parser_init(codec->id);

But no parser is found. I am not touching parser in my configure call, so I take all:

Enabled parsers:
aac                       cavsvideo                 dvbsub                    h263                      mpegvideo                 sipr                      xma
aac_latm                  cook                      dvd_nav                   h264                      opus                      tak
ac3                       dca                       dvdsub                    hevc                      png                       vc1
adx                       dirac                     flac                      mjpeg                     pnm                       vorbis
av1                       dnxhd                     g729                      mlp                       rv30                      vp3
avs2                      dpx                       gsm                       mpeg4video                rv40                      vp8
bmp                       dvaudio                   h261                      mpegaudio                 sbc                       vp9

What am I doing wrong? If this is the wrong approach, what is the correct one?

0

There are 0 answers