[FFmpeg-devel] [PATCH]Add Opus and Speex muxer

James Almer jamrial at gmail.com
Sat Nov 30 02:53:08 CET 2013


On 29/11/13 10:01 PM, Carl Eugen Hoyos wrote:
> On Saturday 30 November 2013 01:47:14 am James Almer wrote:
>> On 29/11/13 9:09 PM, Carl Eugen Hoyos wrote:
>>> HI!
>>>
>>> Attached patch - mostly untested - tries to address ticket #3181
> 
> [Sorry, I cannot comment on the mimetypes.]
> 
>>> +#if CONFIG_SPEEX_MUXER
>>> +AVOutputFormat ff_speex_muxer = {
>>> +    .name              = "speex",
>>> +    .long_name         = NULL_IF_CONFIG_SMALL("Speex"),
>>> +    .mime_type         = "application/ogg",
>>
>> This needs to be changed to "audio/ogg".
> 
> Thank you, fixed.
> 
>>> +    .extensions        = "spx",
>>> +    .priv_data_size    = sizeof(OGGContext),
>>> +    .audio_codec       = AV_CODEC_ID_SPEEX,
>>
>> .video_codec = AV_CODEC_ID_NONE,
> 
> Changed (although I wonder why this needed).

I saw it used in other audio only muxers and assumed it was needed to prevent 
video from being muxed (Either by default or even by forcing it with arguments), 
but after some quick tests it seems that the behavior is the same in both cases.

Disregard this then.

>>> +    .write_header      = ogg_write_header,
>>> +    .write_packet      = ogg_write_packet,
>>> +    .write_trailer     = ogg_write_trailer,
>>> +    .flags             = AVFMT_TS_NEGATIVE,
>>> +    .priv_class        = &ogg_muxer_class,
>>> +};
>>> +#endif
>>
>> Same for Opus.
>>
>> Also, you should add relevant _select lines to configure so the Opus and
>> Speex muxers get enabled when the existing ogg muxer is enabled.
> 
> I don't think this is a good idea.
> 
>> Otherwise 
>> any build that does something like "--disable-everything
>> --enable-muxer=ogg" alone will have trouble muxing opus and spx files even
>> though the necessary code is all present.
> 
> I believe many such combinations / configure lines are possible, the 
> question - as we interpreted it so far - was not if it makes sense but if it 
> is possible without additional trouble to have one symbol less.

My main concern is that a command like "ffmpeg -i in.wav out.opus" will now fail 
with a configuration like "--disable-muxers --enable-muxer=ogg" whereas before 
this patch it would succeed.
Not sure if that's considered a regression or not.

A workaround would be "ffmpeg -i in.wav -c:a libopus out.ogg" or "ffmpeg -i 
in.wav -c:a libopus -f ogg out.opus", but some users might not know that.

> Thank you, Carl Eugen
> 

In any case this needs a minor bump.

Regards.


More information about the ffmpeg-devel mailing list