Posts tagged: flash

The Wizarding World of Harry Potter now online

Mediastation are proud to announce our involvement in the production of The Wizarding World of Harry Potter TV commercial & website experience. Both these are to officially launch at the US Superbowl on the 8th February (The most expensive 30 second advertising slot in the world!). Mediastation were commissioned by Rosso Media to produce the CGI and special FX for the commercial along with production of the high-profile website for Universal Orlando Resort.Click this to view our work: www.universalorlando.com/harrypotter

 

Watch the commercial here:

 

TV starting to cover it see here: http://www.youtube.com/watch?v=sHvtpHxQsyk

What’s really incredible is that all this was created with our in-house team, making them one of the only companies in the world which can handle the diversity and quality of production required to achieve all this under one roof. Goto www.mediastation.co.uk to find out more.

Rendered 3D vs Real Time 3D in Flash

With the latest versions of flash player it is now possible to create environments and 3D objects for use in the standard flash player - Here are two examples of using 3D in flash:

This first version is a rendered video - with the playback (Forwards and Backwards) programmed in flash to give interactivity:

www.mediastation.co.uk/flash3d

Now this version is using the 3D capabilities of the flash player, its much more interactive as we can control the model in real time (note by clicking and dragging you can rotate the object in all directions) and it is a much smaller file size for download. The disadvantage is that you can only use a limited amount of polygons in the mesh (note the round edges are squared off in places) It also suffers from rather flat shading.

www.mediastation.co.uk/flash3d/rt

Mediastation are currently developing out own proprietary flash 3D engine that will bring better shaders and lighting.

F4V Cue Point Solution

I have produced a simple to use workaround (you saw it here first) to enable cue points in F4V files.

I came up with the solution after the same question came up in the office twice on separate occasions:

Why are my F4V cue points not working?

The first time it came up I was shown CS4 media encoder with cue points clearly in place, but the cue point events did not appear to be firing in flash.

With a bit of googling we found the following article from adobe entitled “Cue points for FLV and F4V video files”, perhaps we were doing something wrong?

But then at the at the bottom of the page in the comments we found a link to the adobe tech note:

F4V-format video exported from Adobe Media Encoder CS4 does not contain cue points”

Reason:

“The F4V format is based on the format specified by ISO/IEC 14496-12: ISO base media file format which is not specific to Flash and does not have native support for the cue points that the FLV format uses.

So we gave up and used a FLV.

Then the question came up again this time it was pointed out to me the fact that when imported to flash the FLVPlayback component inspector clearly showed the cue points added in CS4 encoder showing up in the component inspector! The cue point events still where not working but this finding meant the data had to be in the file.

After some experimentation I found that the cue point information was being stored in the XMP metadata, this data is available in flash at runtime using the onXMPData event.

Whilst researching XMP I came across this useful adobe page “Using cue points and metadata” whilst detailing how to parse cue points from the XML it also further reinforced by use of a table f4v not supporting the onCuePoint event.

Runtime F4V FLV
Flash Player 9/ AIR1.0 OnCuePoint
OnMetaData
Flash Player 10 OnCuePoint
OnMetaData OnMetaData
OnXMPData OnXMPData

The Solution

I wanted to come up with a simple fix for non-codey types to use.

The solution uses a single action script class file XMPCuePointClient.as that you can place with your FLA it can then be enabled using two lines of code:

import fl.video.VideoPlayer;
VideoPlayer.netStreamClientClass = XMPCuePointClient;

The class works by parsing the XMP data and inserting FLVPlayback action script versions of the cue points. Cue points can then be consumed using usual code something like:

import fl.video.MetadataEvent;
function onCuePoint(e:MetadataEvent):void
{
trace(e.info.time,e.info.name,e.info.parameters.typeConverted);
}
myFLVPlayback.addEventListener(MetadataEvent.CUE_POINT, onCuePoint);

Worth noting with this solution is the cue point types are converted to actionscript, but the class does store the original type (event|navigation) in parameters.typeConverted.

A sample fla, f4v video, and the XMPCuePointClient.as file can be downloaded here:

XMP Cue Point Client.

If you find this code useful please return the favour by giving us a web link on your site or blog.

Fastest way to populate a complete Matrix3D (initialize a Vector)

I wanted to find out the fastest way to populate a complete Matrix3D this really comes down to the fastest way to initialize a Vector.

I made a quick bench mark the results where interesting to know:

test1: 2078ms
var m1:Vector.<Number> = Vector.<Number>([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]);

test2: 869ms

var m2:Vector.<Number> = new Vector.<Number>();
m2.push(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);

test3: 1586ms

var m3:Vector.<Number> = new Vector.<Number>();
m3[0]=1; m3[1]=0; m3[2]=0; m3[3]=0;
m3[4]=0; m3[5]=1; m3[6]=0; m3[7]=0;
m3[8]=0; m3[9]=0; m3[10]=1; m3[11]=0;
m3[12]=0; m3[13]=0; m3[14]=0; m3[15]=1;

I have seen plenty of code using test1 which you might think the correct method but flash is in fact creating a new array and a new vector then stepping through the slower array to populate the vector.

Test2&3 where quite interesting I would have said they would be about the same if anything test3 might have been faster.

Populating the Matrix, obvious really but had to check…

test4: 320ms
var mx1:Matrix3D = new Matrix3D(m4);

test5: 362ms

var mx2:Matrix3D = new Matrix3D();
mx2.rawData = m4;

Creating the class instance has the bigger overhead, so nout in it.

I then wondered if having a fixed vector size would be faster not much in but also worth noting.

test6: 995ms

var m5:Vector.<Number> = new Vector.<Number>(15);
m5.push(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);

test7: 864ms

var m6:Vector.<Number> = new Vector.<Number>();
m6.push(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);

Results based on 600000 operations each on a (IntelC2Quad2.4)

WOWvx Flash Player and Action Script API

We have developed a flash player and AS3 API to display flash content on the WOWvx 3D Display. Designers create a 960×540 swf our player then automatically renders depth using flashes layering, special variables can be placed in movies to give advanced control of the display, and set depth data dynamically.

Performance was the biggest issue we had to overcome after much experimentation we found native rendering in flash was pretty much out of the question mainly due to the high overhead of scan converting the flash content to the required 1920×1080 interlaced image.

Our solution uses a special projector executable developed using visual studio .Net that hooks into the flash player. The projector performs the image conversion and a flash API controls the display via the projector, and renders depth data.

We are currently working to furthur optimise the system. If you have a project for the WOWvx display that you think could make use of our player please get in contact via our website: www.mediastation.co.uk.

CS4 Workspace Cant Resize Window

adobemissingresizehandel

Floating windows in the Adobe Flash CS4 workspace do not have a top resize handle.

Somehow my floating window had become taller than my maximum display resolution masking the bottom part of the window including the resize handle, with no top resize the window could not be restored and resetting the workspace did not correct the problem.

After finding a mention of this issue on the net with no solution provided I have come up with the following fix, if anybody finds a better one please comment.

Solution:

  • Exit Flash
  • Documents and Settings (or windows vista,..x equivalent):
    <you user name >\Local Settings\Application Data\Adobe\Flash CS4\en\Configuration\Workspace
  • Delete the workspacename.xml that matches your current workspace.
  • Restart Flash.

Mediastation Creative Solutions Ltd