Can I somehow determine what timelines are in a SWF File?

.NET Edition of the F-IN-BOX
GuyWithDogs
Posts: 11
Joined: Tue Oct 18, 2005 6:38 pm

Can I somehow determine what timelines are in a SWF File?

Postby GuyWithDogs » Wed Jul 16, 2008 11:00 pm

If I take a random SWF file, can I load it into the f-in-box control and determine how many timelines are contained in it? What I'm finding is that a lot of SWF files, particularly those having video embedded, don't run everything from the main timeline. I'm trying to determine when a SWF file is "done" - as in it reached the last frame it's meant to play. But if the main timeline doesn't have all the frames, then I'm sunk (aren't I?).

As an example, look at Wondershare's PPT2SWF product. It will take a Powerpoint slide show and convert it to a SWF file, including all the animations, etc. Up until v5 of their product, they ended up with the operation on the main timeline, and I could use a timer to query the current frame and compare to the total frame count. However, as of v5, if your Powerpoint has 3 slides, then the SWF file has 3 frames. However, if your slide show is 15 seconds long, it doesn't take 15 seconds to reach the last frame in the SWF. It happens fast, but the SWF does play for 15 seconds.

I need to determine how long the SWF should really be playing for. Can I do that somehow?

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Thu Jul 17, 2008 5:03 pm

Thank you for your question.

There is no an ideal solution. I can suggest you to get snapshots periodically and compare last two (or more). If some number of last snapshots are equal, then a movie has stopped.

Thank you.
Best regards, Artem A. Razin,
F-IN-BOX support
Ask your question here: http://www.f-in-box.com/support.html

GuyWithDogs
Posts: 11
Joined: Tue Oct 18, 2005 6:38 pm

Postby GuyWithDogs » Mon Jul 21, 2008 2:57 pm

Softanics wrote:There is no an ideal solution. I can suggest you to get snapshots periodically and compare last two (or more). If some number of last snapshots are equal, then a movie has stopped.
Thank you.


Have you got code for some sort of fast comparison of snapshots? I can't imagine how this might be done quickly.

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Mon Jul 21, 2008 5:30 pm

How about comparing CRC32 of pixel buffers? If it's equal, then compare pixel-by-pixel.
Best regards, Artem A. Razin,

F-IN-BOX support

Ask your question here: http://www.f-in-box.com/support.html

GuyWithDogs
Posts: 11
Joined: Tue Oct 18, 2005 6:38 pm

Postby GuyWithDogs » Mon Jul 21, 2008 8:32 pm

I was thinking about this further. Since I don't know what a given SWF file looks like ahead of time, then deciding it's done based on a lack of change for some number of (milli)seconds is dangerous. There's nothing that says a SWF couldn't be a slideshow with images shown for 15 seconds each. I don't have any way of knowing that 15 seconds is OK.

Obviously the Flash OCX knows when it's done. I'm surprised (a bit) that there's no event surfaced, or a flag available that indicates that the file is "done playing" or "reached the end".

I was looking at the Adobe.com site for hints. Unfortunately, it looks like you have to have paid for a support plan to actually ask an engineer a question. I've dropped a couple of messages in their forum, but no responses as of yet.

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Tue Jul 22, 2008 8:22 am

GuyWithDogs wrote:Obviously the Flash OCX knows when it's done.


I don't think so.

For example, a movie has the only frame with infinite video inside. There is no "finish" for such movie, right?

Or a flash game.
Best regards, Artem A. Razin,

F-IN-BOX support

Ask your question here: http://www.f-in-box.com/support.html


Return to “.NET Edition”

Who is online

Users browsing this forum: No registered users and 14 guests

cron