« Making Server Changes | Main | Flex 3 Beta on Adobe Labs »

Where I'm stuck, with importing Mathematica FLV into Flash

Below is a short description of how I might import a video file into Flash. I wrote it to explain to the folks at Wolfram what I want to do with flv or swf files generated by Mathematica . I'm hoping that someone may have some insights on how to resolve the problem I'm having when working with the files generated by Mathematica in Flash. Please note that this is not a tutorial. If it was, I'd be a lot more careful about defining my terms and not leaving out any steps or details.


Having trouble with importing a swf generated by Mathematica, I've decided to document the process with a short video filmed with my camera. This is a process I would like to apply to an flv file generated by Mathematica, starting at step 3. Currently, flv and swf files generated by Mathematica 6 have no user interaction and are essentially frame-by-frame animation loops.

I'm starting out with very basic importing. I want to import and embed the whole video, so that I can add a layer above the video. I am not making use of streaming at all.

1. Creating the video

a. take a short film with digital camera --This file is in avi format.
b. download it to desktop.

2. Convert to flv file -- (this converts the avi file to the flash video format)

a. open the Flash 9 Video Encoder.
b. chose the"add; option
c. selected video and added it to the queue.
d. click on "Start Queue"
e. wait for the encoder to finish the job.

Voila! An flv formatted version of the video.

3. Importing the flv into Flash authoring environment.

a. Open Flash, and create a new Flash File (ActionScript3)
b. Open interface for Importing Video (File>Import>Import Video)

c. Select file to import from my system

d. Select option to embed video in Swf

e. Embed as MovieClip Symbol type, instead of as an embedded video.embedAsMovieClipSymbol2.gif

  • Be sure to select "Expand timeline if needed" option.
  • De-select the "place instance on stage" options. We want to import into the library only, at this point.
  • The video will be imported into the library.

f. The video is now in the library of the Flash file, and we can drag an instance of it to the stage.nowInLibrary2.jpg

4. Adding Animation to Timeline above imported video

a. Drag an instance of the MovieClip onto the stage.

b. Double-click on the instance and open it's timeline. You'll see the timeline of the video. If you scrub through the timeline, you can see the video still-by-still (or frame-by-frame).

  • Note: this is the step that fails, when I try this with a flv created with Mathematica export. The timeline of the flv does not expand, and remains inaccessible.

c. Add a new layer, in the timeline, and create an animation that runs on top of the video timeline.addingAnimationToVideo2.gif

This is where I would add an interactive element, to let the user interact with and control the playback of the Mathematica generated animation loop.

d. Play the movie. The keyboard shortcut Ctrl+Enter (for windows), will tell Flash to generate and play the swf.


Under the 'deployment' option I would export the video as 'progressive download' from web server and then use video.Maru to create the video interface so that the user could scrub the video: polygeek.com/videomaru/.

But I'm biased because I wrote video.Maru. (Note: if you have Flash CS3 let me know and I'll give the a beta of v2.0 that works in the new IDE.)

I would do a progressive download rather than embed the video.

You can add cue points to the .flv and make things happen in your interactive elements via cue point events.

Yes, if this was a normal project, I'd want progressive download and not embed.

But I want to do more than use que points with the embedded file.

What I'm more concerned about, is why the file I'm importing is not exposing it's frames? Any ideas?