[FFmpeg-trac] #4404(avcodec:new): Cannot decode PNG or TIF files with libavcodec.

FFmpeg trac at avcodec.org
Sun Mar 29 14:30:24 CEST 2015


#4404: Cannot decode PNG or TIF files with libavcodec.
-------------------------------------+-------------------------------------
             Reporter:  sgan         |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:  avcodec      |                  Version:
             Keywords:  PNG          |  unspecified
  avcodec_decode_video2              |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Summary of the bug:
 With libavcodec dlls, I cannot decode .PNG or .TIF files format but it is
 working fine with .JPEG or .BMP files.
 Remark: with ffmpeg.exe, I am able to decode/encode these files (-i
 input.png -pix_fmt rgb32 output.bmp)
 How to reproduce:
 {{{
 I am using latest dll provided by Zeranoe FFmpeg:
 Build Version: git-cf16b45 (2015-03-29)
 libavutil      54. 20.101 / 54. 20.101
 libavcodec     56. 31.100 / 56. 31.100
 libavformat    56. 26.101 / 56. 26.101
 libavdevice    56.  4.100 / 56.  4.100
 libavfilter     5. 13.101 /  5. 13.101
 libswscale      3.  1.101 /  3.  1.101
 libswresample   1.  1.100 /  1.  1.100
 libpostproc    53.  3.100 / 53.  3.100

 I am just testing the following code with a .png file:
 http://ffmpeg.org/doxygen/trunk/lavfutils_8c_source.html#l00024

 }}}

 Problem:
 At line 77
 {{{ret = avcodec_decode_video2(codec_ctx, frame, &frame_decoded, &pkt);}}}

 ret is >0 and is equal to PNG file size, but frame_decoded=0!!
 AVFrame *frame;

 According to documentation:
 http://ffmpeg.org/doxygen/trunk/group__lavc__decoding.html#ga99ee61b6dcffb7817a275d39da58cc74
 "
 - ''got_picture_ptr:    Zero if no frame could be decompressed, otherwise,
 it is nonzero.''
 - ''Returns: On error a negative value is returned, otherwise the number
 of bytes used or zero if no frame could be decompressed.''"

 In our case, we have at the same time :
 - got_picture_ptr=0
 - Returns=number of bytes used

 It seems incompatible.

 As said, the code is working fine with jpeg or bmp files.
 Problem occurs on 32 or 64 bits dll.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/4404>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list