[FFmpeg-devel] Ticket4753 question
Paul B Mahol
onemda at gmail.com
Mon Aug 10 19:35:33 CEST 2015
On 8/8/15, Ganesh Ajjanagadde <gajjanag at mit.edu> wrote:
> On Fri, Aug 7, 2015 at 6:05 PM, Paul B Mahol <onemda at gmail.com> wrote:
>> Dana 7. 8. 2015. 22:44 osoba "Ganesh Ajjanagadde" <gajjanag at mit.edu>
>> napisala je:
>>>
>>> On Fri, Aug 7, 2015 at 4:09 PM, Paul B Mahol <onemda at gmail.com> wrote:
>>> > On 8/7/15, Ganesh Ajjanagadde <gajjanag at mit.edu> wrote:
>>> >> On Fri, Aug 7, 2015 at 11:59 AM, Paul B Mahol <onemda at gmail.com>
>>> >> wrote:
>>> >>> On 8/7/15, Ganesh Ajjanagadde <gajjanag at mit.edu> wrote:
>>> >>>> https://trac.ffmpeg.org/ticket/4753:
>>> >>>> The issue seems to come from the fact that there are multiple frames
>> per
>>> >>>> packet.
>>> >>>> In fact, the duration field of the packet is set incorrectly,
>>> >>>> and reports the duration of a single frame only (80).
>>> >>>> Unfortunately, I do not know about where/how this needs to be done,
>>> >>>> but can do this if a dev outlines the process.
>>> >>>
>>> >>> Write trivial g729_parser which splits input into 8 byte packets.
>>> >>
>>> >> Thanks, I have implemented the 8 byte case.
>>> >>
>>> >>>
>>> >>> Problem is how to tell parser from demuxer that another non 8 byte
>>> >>> mode is in operation.
>>> >>> Because decoder operates in one of two modes, either 8 byte or 10
>> byte.
>>> >>
>>> >> This is tricky. A dirty but simple solution would be to add a field to
>>> >> the priv_data of the avctx,
>>> >> i.e to G729Context to represent the format, and use that in the
>>> >> parser.
>>> >> I have not seen any other parser do this though.
>>> >>
>>> >> Note that the parser is quite limited in what it can see:
>>> >> the AVCodecParserContext can't contain this information as far as I
>>> >> can
>>> >> tell,
>>> >> so only AVCodecContext can.
>>> >> In this case I don't know how to do this without resorting to the
>> priv_data.
>>> >
>>> > At decoder level you can not guess it, neither at demuxer level and
>>> > AFAIK only wav does
>>> > put multiple frames into single packet. The only way is via option but
>>> > AFAIK you can not read decoder options from parser.
>>>
>>> I must be missing something, g729dec.c decode_frame does set packet_type
>>> to the appropriate mode based on avpkt->size.
>>> In fact, this is how currently the two modes (8k vs 6.4k) are
>> differentiated.
>>> Why can't this be used to set a flag in avctx->priv_data (barring the
>> ugliness)?
>>
>> For example 80 is multiple of 8 and 10 you can't use that to guess mode.
>
> True, but that is a general failing of the decoder currently present.
> By setting the priv_data,
> we are making as good an effort as the decoder currently does.
>
If you have working solution please send it.
More information about the ffmpeg-devel
mailing list