Doing work converting Flash to HTML5. Doing a lot of interactive maps. Depending on the map, I might only need the main image from the swf, or I may need several.
swfrender is provided by swftools, and has been a help.
$ swfrender Movie1.swf -o output.png
and you get the first image of the animation in the png output. No need to decompress or extract.
Sadly, this doesn’t seem to work well with transparent backgrounds. This also doesn’t work with flashvars. What then are we to do?
From the FAQ:
19.) How can I convert SWF frames to bitmap? There's a "swfrender" utility in the CVS, which isn't finished yet, and will only work for *very* simple SWF files. (No Actionscript, no gradient fills, no morph shapes, no blending modes, no filters, etc.) Probably other Flash Open-Source projects (like Gnash) have some more sophisticated utilities for this. (One user reported that swfdec (http://swfdec.freedesktop.org/wiki/) and pyswfdec (http://www.gnome.org/~gianmt) work good) If you find other tools that work, I'd like to know about it.
Welp, I have found another tool that is a great help: http://swfrenderer.kurst.co.uk/
Simply select your SWF and export folder, and save as an image sequence:
Basically, this tool plays your swf, and exports a screen shot according to your settings. In my usage, where I’m just trying to grab the “main” screen before any user interaction has occurred, the default frame setting of 24 frames a second is fine, if maybe a little too generous. Usually said screen appears after a few seconds of a loading screen, and perhaps there is transition flourish. But 3 seconds is usually all I need (checking “after time elapsed radio”). Depending on how the swf is coded, you might get better results with “when last frame is reached,” as theoritcally, without user interaction the last frame may be exactly what you are going for. In fact, I assumed that would be my case, but that last frame was pretty far in and there were tons of redundant images. Anyway, should be too hard to experiment with.