解析flash格式的swf文件
问题:项目中遇到需要从展示全景的swf文件中提取缩略图,使用ffmpeg等视频转换文件不能解析这个swf文件
从网上找到一个可以解析swf并能获取图片的方法,原文链接:https://blog.csdn.net/bbc2005/article/details/78885172
非常感谢这位博主提供的方法,但是它提供的解析图片不能满足我的需要,需要自己去拓展
if (o instanceof FImage) {
System.out.println(o);
FImage fImage = (FImage) o;
BufferedImage image = fImage.getImage();
File file = new File(dir + "/" + inputFileName );
if (!file.exists()) {
file.mkdir();
}
try {
ImageIO.write(image, "jpg", new FileOutputStream(new File(dir + "/" + inputFileName +"/"+ i + ".jpg")));
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
上面代码是我在原博主提供的工具类swfTest.java这个文件下的export()方法中一个遍历方法加上自己要解析的代码就能出来了
其中需要的源码包地址 SWFTools-Core