How to make flash (swf) screenshot in linux, (updated)?
So after long time I will tell how to make flash screenshot. First of all we will need few dependencys:
- Xvfb - will be our virtual screen
- gnash or flashplayer it will open our flash file
- ImageMagic it will make screenshot and some other tasks
That's it. Let's go to do some testing.
Basic idea is to run Xvfb, then in virtual desktop run gnash or flashplayer and make screenshot with ImageMagic.
./xvfb-run.sh --server-args="-screen 0, 1024x2730x24" ./screenshot.sh
xvfb-run.sh file can be downloaded from http://svn.exactcode.de/t2/trunk/package/xorg/xorg-server/xvfb-run.sh
So, how does looks like out ./screenshot.sh file content:
#!/bin/sh #we use gnash this time gnash --hide-menubar -r 1 ./13.swf & #./flashplayer ./05.swf & # we wait till flash loads sleep 15 import -window root screen.jpg convert screen.jpg -fuzz 80% -trim +repage -crop +0+30 screen_cropped.jpg pkill gnash #pkill flashplayer
I add crop of 30px because I do not want that our gnash menu bar in this case be visible. That's all. You will have nice flash screenshot.
Update 2
Benjamin Wolsey noticed that since 0.8.7 version. gnash has native screenshots support. So all above code can be reduced regarding gnash native screenshot capabilities.
Back »
gnash has supported screenshot creation in PNG natively since version 0.8.7 and has jpeg output for the next release.
Thank you for notice. I will update article regarding your notice.