tags:

views:

22

answers:

1

Hi, I need to automatically extract some random screenshots from Flash content (swf) in linux.

I will appreciate any advice on this.

Thanks in advance.

A: 

I don't think this is going to be easy, a guess at a possible implementation may be

  • Run a virtual X server such as Xvfb (this is easy)
  • Write a program which encapsulates the flash plugin, either by using a browser (for example Mozilla / xulrunner) or implementing the plugin interface directly and invoking the necessary logic. The Netscape plugin interface is documented.
  • Have some way of waiting for the SWF to fully load, including all sub-components; I don't know how easy it is to tell, as there may not be callbacks for this.
  • Wait until the flash has got to an interesting section (You may use some arbitrary criteria for this, either just time-based or content based)
  • Stop the flash (possibly just by suspending the thread etc), and snapshot the window / screen you're using.

If you've got a Xvfb server you can use whatever resolution you want and use the whole screen.

MarkR
Thanks for your answer MarkR!
Daniel