[FFmpeg-devel] [PATCH] Speex parser

Baptiste Coudurier baptiste.coudurier
Fri Sep 4 03:27:09 CEST 2009

On 08/30/2009 06:26 PM, Justin Ruggles wrote:
> Baptiste Coudurier wrote:
>> On 8/30/2009 5:50 PM, Justin Ruggles wrote:
>>> Justin Ruggles wrote:
>>>> Justin Ruggles wrote:
>>>>> Michael Niedermayer wrote:
>>>>>> On Sun, Aug 30, 2009 at 10:40:45AM -0400, Justin Ruggles wrote:
>>>>>>> Hi,
>>>>>>> Here is a Speex parser.  It does not split any frames, but only analyzes
>>>>>>> them in order to set the proper AVCodecContext parameters.
>>>>>> the decoder can do this, av_find_stream_info() should already create a
>>>>>> decoder to fill these in when they are missing.
>>>>> Why should it have to rely on the decoder...especially since we do not
>>>>> have a native decoder?  So that one MUST compile in an external library
>>>>> for stream copy to work properly.
>>>> If there is no problem with packet duration being 0 or wrong, then I
>>>> think stream copy could work without the parser or decoder.  I tried flv
>>>> to ogg and it seemed to work since timestamps were just copied from one
>>>> container to the other.  Packet duration was still wrong though, and I
>>>> don't know if that causes other problems.
>>> Ok, I think I figured out the solution to this part at least.  Speex
>>> needs to be added to the list of codecs in has_codec_parameters() that
>>> require frame_size to be non-zero, then the libspeex decoder should not
>>> set frame_size at init when it does not have extradata since it could be
>>> the wrong value.
>> Or finally set sample_fmt to SAMPLE_FMT_NONE triggering decoding of the
>> first frame.
> That seems like a hack.  We always know the sample format at decoder
> init, but we don't necessarily know the frame size.

This depends on codec. Codecs supporting different bit depth certainly 
don't know the bit depth at init. Does it look like a hack ? I really 
don't think so.

Baptiste COUDURIER                              GnuPG Key Id: 0x5C1ABAAA
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org

More information about the ffmpeg-devel mailing list