Mame Video Capturing: Unterschied zwischen den Versionen

Aus Hardedge Wiki
Zur Navigation springen Zur Suche springen
Zeile 49: Zeile 49:
* The default folder for your input files is called '''inp'''. If your mame does not have one create this folder it and place your input files there when mame asks you to. When you chose to play and record inputs mame will ask you where to save the input file. Save them to the inp folder. Otherwise the later batch script won´t work and you will have to set up different paths for your input folder inside the Mame Options. So it is better to work with the inp folder in the first place.
* The default folder for your input files is called '''inp'''. If your mame does not have one create this folder it and place your input files there when mame asks you to. When you chose to play and record inputs mame will ask you where to save the input file. Save them to the inp folder. Otherwise the later batch script won´t work and you will have to set up different paths for your input folder inside the Mame Options. So it is better to work with the inp folder in the first place.


== Capturing using mngwrite and wavewrite ==  
== Recording MAME Inputs ==  


To record inputs in mame simply rightclick your game and select: ''Play and Record Input''


[[Image:VideoEdit_Record_Input.png]]


A simple recording example
== A simple recording example ==


You need to create a little batch file which does the entire capturing work for you. Here is an example. It is explained below.
You need to create a little batch file which does the entire capturing work for you. Here is an example. It is explained below.

Version vom 10. Januar 2009, 12:28 Uhr

Introduction

Motivation behind this guide

  • I own quite a lot Jamma PCBs including NeoGeo MVS, CPS1/CPS2 and recording from such devices was and will always be a real pain. Plus analog capturing suffers from loss of picturequality. So my main motivation behind this guide was to record clean and hardware-native fps arcade footage.
  • The second point is to provide a solid mame capture guide for combomovie performers and other editors as well. Most of them are already familiar with the well known and awesome kawaks emulator but only a few tried mame based projects. Mame features such nice and wellmade (but yet! unexplored) fighting games. I want to encourage other combomakers to try theses new grounds.
  • This guide makes it possible to record inputfiles from online played sessions without the usage of shareware screen capture tools. Everything in this guide is done with freeware tools.

General Introduction and current problems

The mame emulator is always under heavy development and a lot things may change but it is getting better with every new version. I am trying to show the current capture abilities as they are now. Mame was designed to emulate arcade systems/chipsets as accurate as possible. This strength is sometimes also it´s greatest weakness. You may have heard this sentence: All games run at 60fps. This is simply false information! And it will be the first problem you will encounter when capturing with mame. Mame emulates the internal system frequency and that means: A game like Ultimate Mortal Kombat will not run at 60fps but at 54.815170Hz. This is where the real capturing fun starts. 4245 out of 6930 mame 0122u2 games run at 60fps. I will show a virtualdub workaround to correct this to 60fps later in this guide. And I will also update this guide if another (mame internal) solution becomes available.

Capturing Methods

Requirements

  • MAMEUI32: It is recommended to use the default MAME builds. But every newer build will do its job (e.g. 0.119 or newer). Newer, bugfixed versions are recommended. I am using the newest MAMEUI32 version (0.129) available. Download.
  • Roms: Small reminder on roms: This guide does not provide any information where to get roms. Plus you are only allowed to use this emulator and roms if you own the original game!
  • AdvanceCOMP: This is a collection of recompression utilities for various mame files. Download.
  • VirtualDub: Version 1.8.0 or higher recommended. Download
  • Lagarith Lossless Codec: Lagarith is a lossless video codec intended for editing and archiving. We will be using this codec to preserve the higherst possible quality. Download.
  • Recorded input files: Your inputfile version and mame version must match. Version missmatches will result in desyncs or won´t work at all.

Setting up the capture environment

Installing the Lagarith video codec

Installing lagarith is very simple. Just unpack the zip file and rightclick the file lagarith.inf and choose install. The installer will copy the files in the appropriate location.

VideoEdit Installing Lagarith.png

Configuring MAMEUI32

  • First configure your mame and game settings as you wish. The video output does not depend on the video settings you have made so don´t worry to mess up your capturing result. The output is always raw and unfilterd. Its recommended to run mame in a window.
  • The second thing you should do is a little but necessary modification in the default game properties window. Enable the Skip game info scren. It disables the infoscreen upon startup. Some games need this to be enabled otherwise the input playback desyncs.
VideoEdit Mame Default Options.png
VideoEdit Skip Game Info.png
  • The default folder for your input files is called inp. If your mame does not have one create this folder it and place your input files there when mame asks you to. When you chose to play and record inputs mame will ask you where to save the input file. Save them to the inp folder. Otherwise the later batch script won´t work and you will have to set up different paths for your input folder inside the Mame Options. So it is better to work with the inp folder in the first place.

Recording MAME Inputs

To record inputs in mame simply rightclick your game and select: Play and Record Input

VideoEdit Record Input.png

A simple recording example

You need to create a little batch file which does the entire capturing work for you. Here is an example. It is explained below.

This is the line for capturing Super Street Fighter 2 X. I´ve chosen this game as an example. What this batch file does is quite simple:

   * This batch script opens up your mame with your inputfile as an argument and does a playback of the
     stuff you have recorded previously.
   * The next thing it does is: It writes a mng video stream to your harddisk together with an uncompressed
     wave file. The mng stream is nothing more than a every frame of gameplay saved to a png file and then
     merged together to a mng file.
   * The resulting mng video stream can be found in your snap folder


Explanation in detail:

This basic commandline contains 8 arguments in order to work correctly. Each argument is explained below:

   * The 1st word is the name of your mame exe file. We are using Mame32 Plus Plus v0.119 so in
     this case its: mameppkgui.exe
   * The 2nd word (or argument) is the romset name of your game. I have captured
     Super Street Fighter 2 X so its romname is: ssf2xj You will find the corresponding
     romnames in the main list window.
   * The 3rd word is called an option switch. The -pb optionswitch tells your mame to
     open up a input file and start a playback.
   * The 4th word is the input file you want to record. My file is called: ssf2xj.inp
   * The 5th word is another option switch. The -mngwrite switch tells your mame to
     record your gameplay into a mng stream file.
   * The 6th word specifies the name of your mng stream file . My mng file is called: ssf2xj.mng
   * The 7th word is the last option switch. The -wavwrtie switch tells your mame to
     record sound to a uncompressed wave stream.
   * The last word specifies the name of your uncompressed wave file.

Writing your own batch file and recording

Writing your own batch files is simple. Just follow the above example line and replace it with your own romname and filenames. Follow the steps above and then save the resulting file in your mame folder where your mame exe is. Remember to save it as a batch file (extension: .bat). Something like: record.bat or ssf2xj-combo-01.bat for better workflow. Its up to you how you name it.


After you have finished your batch script launch it by doubleclicking on your batch file. The result should look like this:

Note: The gameplay will stutter during the whole recording process. It sure depends on your equipment but it is because mame still needs to emulate the game and the mng writing process is very cpu consuming. Don´t worry. The resulting video and audiostream will be fine. To end recording just close mame and you are done.


Converting the mng stream to editable video

You will find your mng file inside the snap folder and the wave inside the root folder of your mame. The mng stream file needs to be extracted to an usable png image sequence. AdvanceCOMP will do that work for us. Extract the contents of advancecomp-1.15-windows-pentium.zip into a folder.


The easiest way to deal with the next commandline commands is to copy your mng and wave file into your AdvanceCOMP folder. Next. Open a command prompt. You can do this by clicking on start then on run. The run window pops up: Type in cmd and hit enter or click ok.


Navigate to your AdvanceCOMP folder (in my case its: E:\mame-guide\advancecomp-1.15-windows-pentium\). Here is a little help on old DOS navigation. You can navigate by typing cd.. for a parent folder or cd somefolder to navigate to a desired subfolder. To change to another drive type E:\ or another letter. In my case its drive E. This depends on how your drives are named. Notice that my ssf2xj.mng and ssf2xj.wav are already copied into this folder.

Now the interesting part: To extract the png sequence type in: advmng.exe --extract yourfile.mng (in my case its advmng.exe --extract ssf2xj.mng)

The result should look like this. The window output shows numbered png images scrolling down. The advmng tool is extracting the png image sequence to your AdvanceCOMP folder. Just wait until the extraction stops and you are done. The number at the end of the extraction is the framerate of this mng stream. It may vary.

Remember the following:

   * Nearly all games run with 60fps which means: If your mng file duration is 2min the resulting png sequence will be:
     60 frames per second * 120 seconds = 7200 png files
   * If you are recording kaillera matchvideos or local ones make sure to have enough space on your hdd. Mng and the resulting png
     sequences tend to be very large. Their size is similar to uncompressed avi material.

Putting it all together

I am not going to do any detailed introduction on virtual dub. Just the things you need to know to complete this part. Open up virtual dub and choose the first!! png file of the sequence:


Virtualdub should import the sequence without problems. Then: Click on Audio and then on WAV Audio. This brings up a file select dialog. Select your recorded wav file and hit OK. The next thing you need to do is to setup the correct framerate of the footage. To do so click on Video then select Frame Rate. This step is important. The framerate depends on the frecuency of your game. I mentioned the framerate at the end of the mng extraction earlier.

   * If the number shows 60 then select the second option change frame rate to (fps) and change it to 60.
   * For all other odd numbers (like 59 if you capture cps2) select the third option and chose: change so video and audio durations match
     like in the screenshot shown below. Note that my screenshot shows a 59.634 framerate. This is absolutley ok because if you visit the mame
     database maws ( http://www.mameworld.net/maws/romset/ssf2xj ) and scroll down to frequency you will notice: The game runs at
     59.633333Hz. This is not an error. The game really runs at that frequency. A lot older games have such strange frequencies.

You can do additional work like resize the video, add some filter and do other editing. Remember: Uncompressed AVI files are very large! Try a lossless codec to preserve quality for further editing. Select file and then Save as AVI to save your footage.

If your framerate was 60 you are done. This is probably what you wanted in the first place Sit back and enjoy your crisp, fluid 60fps video footage. If your framerate was odd ( like 59.634 for CPS2 games ) then adjust it to match 60fps. Trust me you will not notice the difference between 59.634 and 60.


Contact, credits and final notes

If you have further questions or suggestions feel free to contact me: via MSN schwarzpantsu at hotmail.com via MIRC (quakenet) #hardedge via www.hardedge.org forums (subarashii) via www.cyberfanatix.com forums (schwarzpantsu)



Copyright (c) subarashii 2008