开发者

How to extract random screenshots from a swf file? In Linux

开发者 https://www.devze.com 2023-01-02 14:50 出处:网络
I need to automatically extract some random screenshots from Flash content (swf) in linux. I will app开发者_StackOverflowreciate any advice on this.

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

I will app开发者_StackOverflowreciate any advice on this.

Thanks in advance.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消