[Ffmpeg-devel] Problems with img_convert()

Cool_Zer0 c00jz3r0
Wed Dec 6 10:59:11 CET 2006


Hi.

I'm getting a strange error...

I'm using the apiexample.c and the "Using libavformat and
libavcodec<http://www.inb.uni-luebeck.de/%7Eboehme/using_libavcodec.html>"
tutorial.

I have something like:


    AVCodec *codec;
    AVCodecContext *c= NULL;
    int frame, size, got_picture, len;
    FILE *f;
    AVFrame *picture;
    uint8_t inbuf[INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE], *inbuf_ptr;
    char buf[1024];

    AVFrame *pFrameRGB;
    int     numBytes;
    uint8_t *buffer;
        ...
           len = avcodec_decode_video(c, picture, &got_picture, inbuf_ptr,
size);
            printf("Largura:%d Altura:%d\n", c->width, c->height);
            if (len < 0) {
                fprintf(stderr, "Error while decoding frame %d\n", frame);
                exit(1);
            }
            if (got_picture) {
                printf("saving frame %3d\n", frame);
                fflush(stdout);

                printf("Starting conversion...\n");
                img_convert((AVPicture *)pFrameRGB, PIX_FMT_RGB24,
(AVPicture*)picture,
                            c->pix_fmt, 176, 174);
                printf("... end conversion\n", frame);

           ...


The program enters on the got_picture condition and when is trying to the
the conversion between YUV and RGB is gives me a "Datatype misalignment".

Here's the output that appears on Visual C++ (with Windows Mobile 5.0 SDK).

Largura:176 Altura:144
saving frame   0
Starting conversion...
Data Abort: Thread=82f71718 Proc=80227cd0 'decoder.exe'
AKY=00080001 PC=00021f6c(decoder.exe+0x00011f6c) RA=00015de8(
decoder.exe+0x00005de8) BVA=82c333fa FSR=0000000d
Data Abort: Thread=82f71718 Proc=80227cd0 'decoder.exe'
AKY=00080001 PC=03f8104c(coredll.dll+0x0002104c) RA=7d7d7d7e(???+0x7d7d7d7e)
BVA=a5b2f376 FSR=00000003
Data Abort: Thread=82f71718 Proc=80227cd0 'decoder.exe'
AKY=00080001 PC=03f8104c(coredll.dll+0x0002104c) RA=7d7d7d7e(???+0x7d7d7d7e)
BVA=a5b2f376 FSR=00000003
Unhandled exception at 0x03f8104c in decoder.exe: 0x80000002: Datatype
misalignment.
The program '[62f716f6] decoder.exe' has exited with code 1067 (0x42b).


Anyone can help me?


Tanks




More information about the ffmpeg-devel mailing list