I googled around for the error message, and found that “1 >= 0” means that the lzx compiler expects Flash version 5, but that version does not support the video objects. Rats.

 

http://www.laszlosystems.com/developers/community/forums/showthread.php?threadid=2157

 

Here’s some interesting stuff about using swfmill to make a video object:

 

http://lists.motion-twin.com/pipermail/mtasc/2005-May/014573.html

 

Here is the documentation for the instruction we need:

 

http://sswf.sourceforge.net/SWFalexref.html#tag_definevideostream

 

This tag defines a video stream. To playback the video stream, one needs to add a list of VideoFrame tags.

  struct swf_definevideostream {
         swf_tag                f_tag;         /* 60 */
         unsigned short         f_id;
         unsigned short         f_frame_count;
         unsigned short         f_width;       /* WARNING: this is in pixels */
         unsigned short         f_height;
         unsigned char          f_reserved : 5;
         unsigned char          f_deblocking : 2;
         unsigned char          f_smoothing : 1;
         unsigned char          f_codec;
  };

The f_width and f_height are defined in pixels. This is rather uncommon in SWF so it is to be noted multiple times.

The f_deblocking parameter can be set to 0 (use the video packet information); 1 (always off) or 2 (always on). All videos are saved in small blocks of about 32x32 pixels (there are different sizes.) Turning this feature on lets the player mix colors between blocks for better output quality.

The f_smoothing flag can be set to 1 to have the player smooth the video before to render it on the output screen.

The f_codec number specifies which codec was used to compress the video. At this time, the following are defined:

Number

Name

Comments

SWF Version

2

Sorenson H.263

 

6

3

Screen Video

 

7

 

 

This is what the swfmill xml file looks like. It defines the file to be version 7, though, so this probably won’t import directly into lzx. But maybe it can be loaded dynamically.

 

<?xml version="1.0"?>

<swf version="7" compressed="0">

  <Header framerate="12" frames="1">

    <size>

      <Rectangle left="0" right="3200" top="0" bottom="2400"/>

    </size>

    <tags>

      <SetBackgroundColor>

        <color>

          <Color red="255" green="255" blue="255"/>

        </color>

      </SetBackgroundColor>

      <DefineVideoStream objectID="1" frames="0" width="160"

height="120" deblocking="0" smoothing="0" codec="0"/>

      <PlaceObject2 replace="0" depth="1" objectID="1" name="videoObj">

        <transform>

          <Transform transX="0" transY="0"/>

        </transform>

      </PlaceObject2>

      <ShowFrame/>

      <End/>

    </tags>

  </Header>

</swf>

 

Here’s some more interesting stuff about swfmill:

 

http://iterative.org/swfmill/doc/using-swfmill.html

 

It is used with the mtasc actionscript compiler:

 

http://www.mtasc.org/

 

The successor to mtasc is haxe, for that that’s worth:

 

http://haxe.org/

 

It would be wicked cool to figure out a way to use these tools to dynamically generate streaming flv movies on the server, once we get OpenLaszlo playing them!

 

            -Don

 

 

_______________________________________________
Laszlo-dev mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-dev

Reply via email to