On Fri, Aug 7, 2015 at 4:09 PM, Paul B Mahol <[email protected]> wrote: > On 8/7/15, Ganesh Ajjanagadde <[email protected]> wrote: >> On Fri, Aug 7, 2015 at 11:59 AM, Paul B Mahol <[email protected]> wrote: >>> On 8/7/15, Ganesh Ajjanagadde <[email protected]> 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)? > >> >> Any suggestions? >> >>> >>>> >>>> Thanks, >>>> Ganesh >>>> _______________________________________________ >>>> ffmpeg-devel mailing list >>>> [email protected] >>>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel >>>> >>> _______________________________________________ >>> ffmpeg-devel mailing list >>> [email protected] >>> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel >> _______________________________________________ >> ffmpeg-devel mailing list >> [email protected] >> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel >> > _______________________________________________ > ffmpeg-devel mailing list > [email protected] > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel _______________________________________________ ffmpeg-devel mailing list [email protected] http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
