Get gnash:
git clone git://git.sv.gnu.org/gnash.git
You'll need a bunch of dependencies before you can build it (should be able to apt-get them all):
libsdl-dev
libboost-dev
libagg-dev
Then configure and build the gnash video dumper:
cd gnash
./autogen.sh
./configure --enable-renderer=agg
--enable-gui=dump
--disable-menus
--enable-media=ffmpeg
--disable-jemalloc
make
you can then point dump-gnash at a swf and it will render out the raw video and audio
dump-gnash -1
-D /tmp/out.raw@30
-A /tmp/out.wav
-P "FlashVars=myURL=http://example.com/blah&online=true"
http://example.com/blah/some.swf
This will write out /tmp/out.raw
(which is bgra aka rgb32 video) at 30fps (the @30
bit) and /tmp/out.wav
These need re-combining into e.g. mp4 using:
ffmpeg -i /tmp/out.wav
-f rawvideo
-pix_fmt rgb32
-s:v 800x550
-r 30
-i /tmp/out.raw
-c:v libx264
-r 30
-b 160k
/tmp/out.mp4
because its raw video, ffmpeg needs to know colourspace (rga32) dimensions and input fps. We tell it to combine the audio (160kbps mp3), render the video back out at 30fps
You'll need additional flags to get the lossless mp4.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…