Trick to Take Flash Screenshots on Headless Linux

Jump To:   «  1 2 3 4 5 6  View All »

A man with a magnifying glass, trying to increase the size.
Along with the Slunked blog site I also run a Flash Game site, Recently I have been wanting to hack the code a little to provide a screenshot of each game. Unfortunately, all of my servers are linux based and have no monitor attached (headless). I began thinking a little bit outside of the box and came up with a trick to capture a flash game screenshot (should also capture with or without in-game ads) on a 256MB VPS server I run. The script is very lightweight, and easy to setup for automation with with a cron jobs. I find that the screenshots for the Games to be of decent quality, especially for something that takes a small amount of time and effort to setup. Let’s get onto the requirements.

Setting up the server (if not already setup) is the first step. Since I am a Debian / Ubuntu fanboy, I will assume that you are also working on Debian as well. First things first, install Debian with the basics, ssh, sudo, a user account. I will assume that you know enough about server management to set that up (or have someone who does). Once your Debian install is setup and working we will start to install the required packages (we will need the nonfree repository added to /etc/apt/sources.list):

# apt-get install iceweasel flashplugin-nonfree vnc4server imagemagick

Those are the essentials. If you want to use a type of API request, you will need to install a webserver like Nginx or Apache and along with server side code, like PHP to call and execute the script. I may elaborate on the API setup in a different article, however, for this article I will explain how to use SSH with SCP to call to the screenshot script and send the captured image file over to the main server using some nifty tricks. Once the essentials have been installed a test of the VNC Server is in order.

Jump To:   «  1 2 3 4 5 6  View All »

No Comments

Leave us a comment

No comment posted yet.

Leave a Comment