[FFmpeg-trac] #9260(undetermined:closed): avcodec_open2 fails for raw video (AV_CODEC_ID_RAWVIDEO) in 32-bit ffmpeg DLL

FFmpeg trac at avcodec.org
Tue May 25 13:04:14 EEST 2021

#9260: avcodec_open2 fails for raw video (AV_CODEC_ID_RAWVIDEO) in 32-bit ffmpeg
             Reporter:  Thomas       |                    Owner:  (none)
                 Type:  defect       |                   Status:  closed
             Priority:  normal       |                Component:
                                     |  undetermined
              Version:  unspecified  |               Resolution:  invalid
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
Changes (by mkver):

 * status:  new => closed
 * resolution:   => invalid


 There is no "the 32-bit DLL of ffmpeg v4.3.1"; FFmpeg does not distribute
 official binaries.
 I think I know what your problem is: Since
 dcc39ee10e82833ce24aa57926c00ffeb1948198, AV_CODEC_ID_MPEG4 == 12,
 AV_CODEC_ID_RAWVIDEO == 13; before said commit, AV_CODEC_ID_MPEG4 == 13
 and AV_CODEC_ID_RAWVIDEO == 14. It seems to me that your code uses the new
 codec IDs (i.e. you use avcodec_find_encoder(13)), but links against an
 old version of libavcodec that is somewhere in your (32-bit) PATH. And
 therefore you get the MPEG-4 encoder.

 PS: Anyway, avcodec_open2() does not return a codec; it expects the codec
 to be either already set (when the AVCodec has already been set in
 avcodec_alloc_context()) or it expects it to be given to avcodec_open2().
Ticket URL: <https://trac.ffmpeg.org/ticket/9260#comment:2>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker

More information about the FFmpeg-trac mailing list