2

I have searched the depths of the internet for a solution but unfortunately all the posts discussing the issue are outdated and provide no solutions.

I need to be able to dynamically generate a screenshot from a SWF file and save it locally to the server. Some posts suggest the use of FFMPEG, but I don't think it supports the SWF format. Another suggested to use the Internet Explorer grabscreen function, but that's Windows only.

Any answers on how to do this are greatly appreciated.

David Hinojosa
  • 221
  • 2
  • 10
  • Possible duplicates:[link]( http://stackoverflow.com/questions/1130574/creating-thumbnails-from-a-swf-file-in-php) [link]( http://stackoverflow.com/questions/4531247/how-to-make-thumbnail-from-a-swf-in-php) – Tomáš Zato Jan 16 '13 at 11:30
  • Wow, that mini-Markdown formatting mentioned in help is really crap. – Tomáš Zato Jan 16 '13 at 11:32
  • Those questions are over 4 years old! Dead links. – David Hinojosa Jan 16 '13 at 11:32
  • You ain't gonna make it without graphics, X11 or similar. http://stackoverflow.com/questions/125951/command-line-program-to-create-website-screenshots-on-linux – Teson Jan 16 '13 at 11:39

2 Answers2

2

If you own a server, you can install extension for PHP (http://php.net/manual/en/swf.setup.php) however, this is a little overkill for getting one frame.

Other solution is using this class: http://www.sephiroth.it/swfreader.php

Also, you can write your own parser, in this case refer to Adobes flasg format specification: http://www.adobe.com/content/dam/Adobe/en/devnet/swf/pdf/swf_file_format_spec_v10.pdf

Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
0

If I understand you correctly you need to generate an image on server side. Please look at the solution described here: http://techblog.floorplanner.com/post/20528549445/server-side-png-rendering-of-swf-images-using-gnash

I didn't try it myself but hopefully it will help. Also if it is possible to generate an image after the first user opens the swf and there is a possibility to change the code of the SWF, I'd recommend you to look at this article: http://www.flepstudio.org/forum/tutorials/507-swf-png-actionscript-3-0-bytearray-class.html

Mikhail Payson
  • 923
  • 8
  • 12