Convert SWF to PNG

一个人想着一个人 提交于 2019-12-29 04:43:08

问题


I'd like to be able to take a 1-frame SWF file and convert it to PNG through PHP. I'm okay with using command-line tools to get this done.

How could I go about doing this? I found an ActiveX library, but that seems like one too many layers. I also see that Gnash seems to have a PNG output class, but I can't figure out how to get to that from the command line without doing some deep coding of my own. Are there any other clever solutions available? Thanks!

EDIT: To clarify, this is not a one-time task I just want to be able to do once. I'd like to be able to have a PHP script perform this task on command. Thanks!

Another EDIT: One more clarification. This is not a situation in which, say, a user makes a drawing in Flash. I am downloading raw 1-frame SWF files, and want to save PNG copies in order to reduce download time. Is such a task possible? Thanks again!


回答1:


you can use swftools.
swfrender file.swf -X pixelsize -Y pixelsize -o output.png

If only one between -X -Y parameter is specified then proportions are respected




回答2:


not really a server based solution, but i developed an AIR utility to convert SWF to PNG sequences: http://swfrenderer.kurst.co.uk/




回答3:


See From Google: Flash screenshot




回答4:


Depending on the type of swf's you have you could try FFmpeg from the command line:

ffmpeg -i movie.swf -f image2 -vcodec png movie%d.png


来源:https://stackoverflow.com/questions/2001946/convert-swf-to-png

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!