====== Snapshots, audio and video capture in MESS ====== MESS provides a series of options to capture not only static images of the emulated system, but audio and video streams too. This feature actually might not work as it is normally intended - as they say, //it's not a bug, it's a feature!// - soon we'll explain why... but first of all, here are the commands: * A snapshot is taken by pressing F12 (provided you are in UI mode and you haven't redefined the snapshot key): a ''.png'' file will appear in the directory defined by the ''[[mess:mess.ini:snapshot_directory|-snapshot_directory]]'' option. Two further options, ''[[mess:mess.ini:snapname|-snapname]]'' and ''[[mess:mess.ini:snapview|-snapview]]'' control the name of the snapshot and the part of the picture (in MESS jargon, the [[mess:files:artwork#view|view]]) that's actually captured. If the system uses multiple [[mess:files:artwork#screen|screens]], all of them will be captured at once. * Those who have enabled the [[:debugger]] might find useful the ''[[:debugger:general#snap|snap]]'' command, which gives more control about the name of the ''.png'' file and allows the capture of single screens. To capture audio and video streams it is not necessary to use the user interface, since the relevant options are provided by the command line. * To capture the audio output, it is sufficient to provide to MESS a filename using the ''[[mess:mess.ini:wavwrite|-wavwrite]]'' option. The resultant ''.wav'' file will contain **all** the audio of the MESS session, from the beginning to the end. * To capture the video, the same mode of action is employed, with the important difference that the user is allowed to choose between two formats: ''[[mess:mess.ini:mngwrite|-mngwrite]]'' will create an **audioless movie** in ''.mng'' format. Of course, ''-wavwrite'' can be used on the same command line to provide an audio track which can be mixed with the video capture. * Lazy users can use ''[[mess:mess.ini:aviwrite|-aviwrite]]'' to dump **both audio and video** to an ''.avi'' file at the same time: the price to pay is a greater overhead and consequently a slower and more sluggish emulation. The audio file will be located in the same directory as the MESS executable while the video file, regardless of its format, will be located in the [[mess:mess.ini:snapshot_directory|snapshot directory]]. ===== Raw pixels ===== So now you have successfully taken a screenshot of your favourite game running on MESS and going open it in a graphic editor just to discover that the picture is totally different from what MESS had displayed on screen - surely there must be a bug somewhere... The answer is that there is no bug in the screen dump code - the reason is in the way the image that you see on the screen is actually drawn: to make a long discussion short, MESS has to draw, in the worst case, a certain number of entities on the screen: - an //[[mess:files:artwork|artwork]]//, i.e. one or more pictures (divided into [[mess:files:artwork#bezel|bezels]], [[mess:files:artwork#backdrop|backdrops]] and [[mess:files:artwork#overlay|overlays]]) that give a more realistic appearance to the emulated system or enhance its usability. These images depict elements that on a "real" machine are represented by "real" objects, e.g. a sheet of transparent plastic to lay on the TV set, or the keyboard of calculator machine. - a //[[mess:files:artwork#screen|screen]]//, the picture generated by the emulated system, i.e. the image which the "real" system would draw on the screen of the TV set. - an //[[mess:files:artwork#effects|effect]]//, i.e. a small picture which, tiled and superimposed on the screen, mimics the scanlines pattern that can be observed on old TV sets. - the //user interface//, if activated by the user. Each one of these elements has different requirements: * the artwork can extend far beyond the area occupied by the screen, and can also overlap it. * the screen usually must be squashed to a 4:3 ratio (most systems use rectangular rather than square pixels). * the effect must overlap the screen, but not the artwork. In order to meet these requirements MESS draws these pictures separately and subsequently merges them using a //renderer//: a lengthy and very interesting explanation of its capabilities is provided by its author, the maintainer of MAME, Aaron Giles [[http://aarongiles.com/?p=173|here]], [[http://aarongiles.com/?p=176|here]] and finally [[http://aarongiles.com/?p=182|here]].