Opened 3 years ago

Closed 20 months ago

#6640 closed defect (fixed)

Assertion failed when stream copying gif

Reported by: llogan Owned by:
Priority: important Component: avformat
Version: git-master Keywords: crash abort gif
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


$ ./ffmpeg -f lavfi -i testsrc=d=1:r=10 out.gif
$ ./ffmpeg -i out.gif -c copy out2.gif
ffmpeg version N-87209-gf4e593f7b5 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 7.1.1 (GCC) 20170630
  libavutil      55. 74.100 / 55. 74.100
  libavcodec     57.105.100 / 57.105.100
  libavformat    57. 81.100 / 57. 81.100
  libavdevice    57.  8.100 / 57.  8.100
  libavfilter     6.102.100 /  6.102.100
  libswscale      4.  7.103 /  4.  7.103
  libswresample   2.  8.100 /  2.  8.100
Input #0, gif, from 'out.gif':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: gif, bgra, 320x240, 10 fps, 10 tbr, 100 tbn, 100 tbc
Assertion video_par->format == AV_PIX_FMT_PAL8 failed at libavformat/gif.c:130
Aborted (core dumped)

Unknown if it is a regression.

Change History (2)

comment:1 Changed 2 years ago by Gyan

Encountered this today.

The input GIF's palette is processed only by the decoder, which only outputs bgra frames, and that's what find_stream_info will set for the input stream.

The GIF muxer will generate a generic palette if the input stream is not PAL8 but the called function only accepts pixel formats that the GIF encoder does. During streamcopy, we can't use a scaler to transform to one of these formats so a remux fails.

The trivial and probable solution is to set the pixel format in the demuxer. Will have to test.

comment:2 Changed 20 months ago by richardpl

  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.