[Ffmpeg-devel] Help understanding AVParser

Cool_Zer0 c00jz3r0
Mon Dec 18 19:37:22 CET 2006


On 12/18/06, Michael Niedermayer <michaelni at gmx.at> wrote:
>
> Hi
>
> On Mon, Dec 18, 2006 at 11:04:47AM +0000, Cool_Zer0 wrote:
> > Hi there.
> >
> > I'm trying to use AVParser but I'm a bit lost and I can't find any
> > documentation.
> >
> > So... Here's what I'm doing...
> >
> >
> > I'm calling *av_parser_init(CODEC_ID_H263)* and then I think that I have
> to
> > call *av_parser_parse()* for each H.263 packet that I receive.
> > My main problem is understanding the parameters of the last function:
> >
> > AVCodecParserContext
> > AVCodecContext
> > poutbuf
> > poutbuf_size
> > buf
> > buf_size
> > pts
> > dts
> >
> > The first ones I understand but the last 6 I can't understand what they
> > are...
> > Other question...  If buf_size takes the value 0 it means that I have a
> > complete frame, right? So... Where is that frame and how can I put on a
> > AVFrame/AVPicture in order to convert it to BGR24?
> >
> > If you don't want to answer my question at least give me some link to
> any
> > documentation about AVParser.
>
> see av_read_frame_internal() in utils.c and the doxygen comment above
> av_parser_parse in parser.c



Hi.
When I update my code the comment appear :)
But I'm having the same problems that I had without the AVParser :(


AVCodecParserContext *parser_context;
uint8_t *poutbuf = new uint8_t[6000];
int poutsize=0;

{
...
parser_context = av_parser_init(CODEC_ID_H263);
...
}

void video_decode(unsigned char* payload, int payloadsize)
{
    static int frame_numero = 0;

    int len = 0;
    while (payloadsize) {
        len = av_parser_parse(parser_context, c, &poutbuf, &poutsize,
payload, payloadsize, frame_numero, frame_numero);

        payload += len;
        payloadsize -= len;

        if (len < 0)
            return;

        len = avcodec_decode_video(c, picture, &got_picture, poutbuf,
poutsize);
        if (got_picture) {
            img_convert((AVPicture *)pFrameRGB, PIX_FMT_RGB24,
(AVPicture*)picture, c->pix_fmt, 176, 144);
            //showFrame(pFrameRGB->data[0]);
            rgb_save(pFrameRGB->data[0], "frame");
            frame_numero++;
        }
    }
}


I'm getting kind of desesperated because I don't know what I'm doing
wrong... There's something that I'm missing and I can't see what it is :(



[...]
> --
> Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
>
> No evil is honorable: but death is honorable; therefore death is not evil.
> -- Citium Zeno
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> http://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel
>




More information about the ffmpeg-devel mailing list