Main > Software Forum

MAME Movie Maker released

(1/153) > >>

Buddabing:
There is no need to read this entire thread, just read the first post for instructions!

Link to documentation page

Hello,

I have implemented Trimoor's idea of generating attract videos with MAME.

MAME generates a bunch of screen shots and a video encoding script which tells how to arrange the screen shots and audio into a movie. To encode the video, you need to get VirtualDub version 1.6.2 or later. You can get it here. Note: you need to install it into a directory named \virtualdub on the same drive as MAME in order for the batch processes to work right.

By default, MAME uses the 'XVid' video compression software. If you use the defaults when you do not have the Xvid software installed, your videos will be huge. Zookeeper, for example, should produce an AVI that is less than 1/4 megabyte with Xvid. If it is not installed, Zookeeper will produce a 250 megabyte file! This page has XVid software that will work with this project.

I am distributing binaries and source of version 0.89 and v0.90 of MAME.
Link to binary and source of MAME 0.89
Link to binary and source of MAME 0.90
Link to binary and source of MAME 0.91
Link to binary and source of MAME 0.92
Link to binary and source of MAME 0.93
Link to binary and source of BuddaMAME 0.94
Link to binary and source of BuddaMAME 0.95
Link to binary and source of BuddaMAME 0.96
Link to binary and source of BuddaMAME 0.97
Link to binary and source of BuddaMAME 0.98
Link to binary and source of BuddaMAME 0.99
Link to binary and source of BuddaMAME 0.100
Link to binary and source of BuddaMAME 0.101
Link to binary and source of BuddaMAME 0.102
Link to binary and source of BuddaMAME 0.103
Link to binary and source of BuddaMAME 0.104

Link to latest version of ListGen

Once you have the utilities to create the files, you'll need a batch file to run the utilities for each game. You'll need two batch files: batch.bat and makemovies.bat. Here's a sample batch.bat. Cut and paste into a file and modify according to your mame installation, and save into your mame directory.

@if "%1"=="" goto badparm
@if "%2"=="" goto badparm
@if "%3"=="" goto badparm
@if "%4"=="" goto badparm
@if "%5"=="" goto badparm
@goto goodparms
:badparm
@echo This batch file requires 5 parmaeters:
@echo 1) rom name
@echo 2) resolution
@echo 3) movieloops flag (usually 1)
@echo 4) moviestartframe value (usually 0)
@echo 5) movieendframe value (usually 0)
@echo Please reread the directions on how to use this utility!
@pause
@goto end
:goodparms
@if not exist movies mkdir movies
@if exist movies\%1.avi goto end
@if exist nvram\%1.nv goto rungame
@mame %1 -window -noartwork -resolution %2 -nothrottle -ftr 100
:rungame
time /T
@mame %1 -window -noartwork -makemovie -resolution %2 -wavwrite %1.wav -movieloops %3 -moviestartframe %4 -movieendframe %5
@if not exist %1.vdb goto end
@\virtualdub\virtualdub /s"%1.vdb" /x
@del %1.wav
@del /Q moviesnp\*.png
@del %1.vdb
@move /Y %1.avi movies
time /T
:end

As of version 1.6.4 of VirtualDub, there is a command line executable named "vdub.exe" which you should use instead of virtualdub.exe for streamlining the operation.

The second batch file you need is called makemovies.bat, which calls batch.bat for each of your ROMs.

@call batch 005 224x256 1 0 0 will use the existing loop detection
@call batch 005 224x256 2 100 200 will generate a movie starting at frame 100 and ending at frame 200.

You can generate your own makemovies.bat by using my ListGen utility, a link to it is above.

Here are the new options I have created for this utility:

makemovie        Create series of snapshots and stop when cycle is detected
minmoviestart    Lowest possible start frame of movie
minmovielength   Lowest possible movie length (in frames)
maxmovielength   Highest possible movie length (in frames)
moviethreshold   Lowest 8-bit value for non-black pixel
movieaudio       Movie audio compression type 0=none, 1=mp3
movievideo       Movie video compression type 0=none, 1=DivX, 2=Cinepak, 3=Xvid (default)
skip_warnings    skip MAME warnings
movieloops disable loop detection (0), use normal loop detection(1)
or use fixed starting and ending frames (2)
moviematchlength number of consecutive matched frames that determine a loop

Here is the mame.ini I use when generating movies. The autoframeskip and swtichres parameters are particularly important to get the movies to generate reasonably quickly.
skip_validitychecks 1
skip_gameinfo 1
skip_disclaimer 1
skip_warnings 1
rompath ..\roms
switchres 0
window 1
autoframeskip 0
artwork 0
frameskip 0
matchrefresh 1
waitvsync 1
minmovielength 800
maxmovielength 10000
movievideo 3
movieaudio 1
intmakectrl 1
extmakectrl 0
moviematchlength 10

Thanks to Trimoor for providing the idea for this project, and I owe a huge debt of gratitude to Silver for his help with the encoding.

Please post problems to this thread.

Regards,
Buddabing

Buddabing:
The default video compressor is currently the one with the fourcc value 'DIVX'. That, obviously, is some flavor of DivX, but I don't know which.

Apparently, the DIVX video doesn't handle Missile command correctly. So, I found a compressor that could. It has a fourcc value of 'CVID' and I believe is Cinepak.

You can tell the fourcc values if you generate a job script with Virtual Dub. In the line that has "SetCompression" in it, the data will have an

2600:
I believe this is relevant.

Here's a txt file that has the frames to skip before the attract mode starts.  I got this a while ago when the -ssf patch was released.  It may be helpful if when people make videos for games not on the list to contribute and keep a tally of the frames to skip.

Silver:

--- Quote from: 2600 on December 30, 2004, 02:27:37 pm ---I believe this is relevant.

Here's a txt file that has the frames to skip before the attract mode starts.  I got this a while ago when the -ssf patch was released.  It may be helpful if when people make videos for games not on the list to contribute and keep a tally of the frames to skip.

--- End quote ---

I think Buddabing's patch is be able to generate the the number of frames to skip for each game as it detects the loop - its basically the the first frame of the loop.

Buddabing - could you add to your patch to save the first frame number along with romname to a txt file as it detects the loop?

Buddabing:

--- Quote from: Silver on December 30, 2004, 03:06:43 pm ---
--- Quote from: 2600 on December 30, 2004, 02:27:37 pm ---I believe this is relevant.

Here's a txt file that has the frames to skip before the attract mode starts.
--- End quote ---

--- End quote ---

Navigation

[0] Message Index

[#] Next page

Go to full version