swftools-common
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Swftools-common] avi2swf/h.263 bug?


From: Alexander Mishin
Subject: [Swftools-common] avi2swf/h.263 bug?
Date: Sun, 25 Apr 2004 19:22:31 +0400

Hello,

I have built a library on Windows platform with Visual C++
and noticed that the output of avi2swf utility is a 'black box'.
Of course, there is no AVIFILE library on Windows platform,
but it's possible to simulate an image sequence by modifying
some _avifile_ functions in avi2swf module for test purposes.
For example:

int videoreader_avifile_getimage(videoreader_t* v, void*buffer)
{
    ...
    
    frameno++;
    i->frame++;

    int color = rand() % 255;
    int x,y;
    for(y=0;y < v->height; y++) {
       unsigned char *to;
       to = &((unsigned char*)buffer)[y*v->width*4];
       for(x=0;x < v->width;x++) {
          to[x*4+0] = 0;
          to[x*4+1] = color;
          to[x*4+2] = color;
          to[x*4+3] = color;
       }
    }

    ...
}

the full source code of modified avi2swf is located at:
   http://almin.amillo.net/misc/avi2swf.cpp

This  avi2swf lets test the module on Windows platform (without
AVIFILE library).
Unfortunately, the video is a completely black box :(
   http://almin.amillo.net/misc/swf.zip (output.swf)

I tested h.263 encoder by compiling
lib/h.263/swfvideo.c file with MAIN preprocessor directive.
I simulated the image sequence with the same trick:
...
    //getPNG(fname, &width, &height, &data);
    width = 100;
    height = 100;
    data = (unsigned char*)malloc(width*height*sizeof(RGBA));
    for (int ii=0; ii < width*height; ii += 4)
    {
        data[ii+0] = 0;
        data[ii+1] = 255;
        data[ii+2] = 255;
        data[ii+3] = 0;
    }
...

The result was the same black video:
 http://almin.amillo.net/misc/sfw.zip (video3.swf)

Is there a bug in h.263 encoder?


Alexander





reply via email to

[Prev in Thread] Current Thread [Next in Thread]