[FFmpeg-trac] #4706(avformat:new): av_guess_codec ignores short_name, filename, and mime_type

FFmpeg trac at avcodec.org
Thu Jul 9 10:52:57 CEST 2015

#4706: av_guess_codec ignores short_name, filename, and mime_type
             Reporter:  andrewrk    |                    Owner:
                 Type:  defect      |                   Status:  new
             Priority:  normal      |                Component:  avformat
              Version:  git-master  |               Resolution:
             Keywords:              |               Blocked By:
             Blocking:              |  Reproduced by developer:  0
Analyzed by developer:  0           |

Comment (by andrewrk):

 My example was confusing. Let me clarify it to replace "test.flac" with

 #include <stdio.h>
 #include <libavcodec/avcodec.h>
 #include <libavformat/avformat.h>

 int main(int argc, char **argv) {

     AVOutputFormat *oformat = av_guess_format(NULL, "test.ogg", NULL);
     enum AVCodecID codec_id = av_guess_codec(oformat, "flac", NULL, NULL,
     AVCodec *codec = avcodec_find_encoder(codec_id);
     fprintf(stderr, "%s\n", codec->name);

     return 0;

 In this example, we intend to save a file with the file name "test.ogg"
 and store FLAC data inside of it. But it prints libvorbis instead of flac.
 The format should be ogg and the codec should be flac.

Ticket URL: <https://trac.ffmpeg.org/ticket/4706#comment:2>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker

More information about the FFmpeg-trac mailing list