[libav-bugs] [Bug 580] av_guess_codec ignores parameters and returns surprising values

bugzilla at libav.org bugzilla at libav.org
Mon Oct 28 07:20:34 CET 2013


https://bugzilla.libav.org/show_bug.cgi?id=580

Anton Khirnov <anton at khirnov.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |anton at khirnov.net

--- Comment #1 from Anton Khirnov <anton at khirnov.net> 2013-10-28 07:20:34 CET ---
(In reply to comment #0)
> Example case:
> 
> avconv -i test.wav test.ogg
> 
> This will produce a test.ogg which is FLAC. This should be vorbis.
> 
> More importantly, this code:
> 
> AVOutputFormat *oformat = av_guess_format(NULL, "test.ogg", NULL);
> enum AVCodecID codec_id = av_guess_codec(oformat, "vorbis", "test.ogg", NULL,
> AVMEDIA_TYPE_AUDIO);
> 
> AVCodec *codec = avcodec_find_encoder(codec_id);
> 
> codec will be the FLAC codec, but it should be the vorbis codec.
> 
> 
> I took a quick peek at the implementation of av_guess_codec and it is
> completely ignoring filename, codec_short_name, and mime_type parameters.

What makes you think it should be vorbis. Ogg is (or claims to be) a generic
container, it supports a bunch of different codecs.

In this case, the "problem" (if you can call it that) is not in the
av_guess_codec function, but in the ogg muxer, which declares FLAC as the
default audio codec for itself. The reason for that decision is probably
because we have a quite good internal FLAC encoder, but a very sucky internal
vorbis encoder.

-- 
Configure bugmail: https://bugzilla.libav.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.


More information about the libav-bugs mailing list