PDA

View Full Version : MAME2AVI Attract Creation Batch File Now Available



chillinwater
06-17-2011, 09:47 AM
Get it here:
MAME2AVI Attract Creation Batch File Now Available (http://dosmame.mameworld.info/index.php/Special_Blog?cmd=post&id=31)
Thanks to "dosmame"

I didnt create this but I have been doing some testing with it and it also works with "MisfitMame"
and probably most Mame derived emulators (with a little "User Option" tweaking).
i.e. (untested)
-PSXMame
-Mess (may have to add the system parameter)
...etc
It also takes an unadvertised (undocumented) screen shot and places it in a "romnamed" subfolder in your emulators snap directory.

This is a start and walk away version so you can leave it un-attended because the process does take a long time.

-user options
-directories you need to change
-emulator your using if not mame
(i.e. for misfit "misfitgui.exe" or "mis.exe")
-PREREQUISITES and stuff I added to speed it up. The pause at the end just lets you see the "error" in the command window if you didnt configure your directories correctly.
Otherwise the command screen will just flash and you cant really see what you did wrong.

[MAME2AVI(faster).bat]

@echo off
::::::::::::::::::::::::::::::::::::::::::::::::::
::: :::
::: MAME ATTRACT CREATOR SCRIPT :::
::: :::
::: DOSMAME V1.0 June 2011 :::
::: :::
::: http://DOSMAME.MAMEWORLD.NET :::
::: :::
::::::::::::::::::::::::::::::::::::::::::::::::::

::::::::::::::::::::::::::::::::::::::::::::::::::
::: :::
::: MAME2AVI.BAT :::
::: :::
::: PREREQUISITES: :::
::: MENCODER :::
::: http://oss.netfarm.it/mplayer-win32.php :::
::: PUT MENCODER AND THIS SCRIPT IN THE :::
::: 'tools' DIRECTORY SPECIFIED IN THE USER :::
::: OPTIONS BELOW :::
::: :::
::: A WORKING WINDOWS COMMAND-LINE VERSION :::
::: OF MAME :::
::: :::
::: :::
::: :::
::: THIS SCRIPT WILL; :::
::: .SKIP AVI CREATION IF THE MOVIE ALREADY :::
::: EXISTS IN %mame_dir%\avi\ :::
::: .SKIP ROMS NOT AVAILABLE IN %mame_dir%\roms:::
::: :::
::: :::
::: :::
::: BEFORE RUNNING, SETUP YOUR USER OPTIONS! :::
::: :::
::: MAKE A BACKUP! :::
::: :::
::: USAGE IS ENTIRLY AT YOUR OWN RISK :::
::: xDOSMAMEx :::
::::::::::::::::::::::::::::::::::::::::::::::::::

::::::::::::::::::::::::::::::::::::::::::::::::::
:::
::: DEBUG OPTIONS
:::

set debug=0
set debug_rom=8ballact
:: SET DEBUG TO 1 AND SET A ROM NAME IF YOU NEED TO DEBUG
:: A ROM AND SKIP THROUGH EACH STEP OF THE SCRIPT

:::
::: END OF DEBUG OPTIONS
:::
::::::::::::::::::::::::::::::::::::::::::::::::::


::::::::::::::::::::::::::::::::::::::::::::::::::
:::
::: SET USER OPTIONS BELOW
:::

set clones_only=0
:: SET THIS TO 1 IF YOU ONLY WANT CLONES, OR 0 (ZERO) FOR ALL

set game_duration=50
:: THIS IS THE AMMOUNT OF TIME THE MOVIE WILL RUN IN SECONDS

set trim=25
:: THIS IS THE AMOUNT OF TIME IN SECONDS TO TAKE OFF THE BEGINNING OF THE MOVIE

set mame_dir=J:\HyperSpin\Emulators\Mame\137
:: THIS IS THE DIRECTORY OF MAME.EXE

set mame_exe=mame.exe
:: THIS IS THE MAME EXECUTABLE

set tools=J:\HyperSpin\Emulators\Mame\Roms2AVI
:: THIS IS THE FOLDER WHERE THIS SCRIPT AND MEMCODER LIVES

:::
::: END OF USER OPTIONS
:::
::::::::::::::::::::::::::::::::::::::::::::::::::



::::::::::::::::::::::::::::::::::::::::::::::::::
:::
::: MAIN SCRIPT - DON'T TOUCH THIS BELOW
:::

if %debug% == 1 @echo on
cd %mame_dir%
if %clones_only% == 1 for /f "tokens=2" %%a in ('%mame_dir%\%mame_exe% -listclones') do call :doIt %%a
if %clones_only% == 0 for /f "tokens=1" %%a in ('%mame_dir%\%mame_exe% -listfull') do call :doIt %%a

:doIt
set rom=%1
if exist %mame_dir%\avi\%rom%.avi goto aviExist
if not exist %mame_dir%\roms\%rom%.zip goto romNotExist
if not exist avi mkdir avi

echo.
echo Running game %rom%
echo.
if %debug% == 1 if %rom% == %debug_rom% rem pause
start /min /wait %mame_dir%\%mame_exe% %rom% -aviwrite %rom%.avi -str %game_duration% -nouse_backdrops -nouse_bezels -window
if %debug% == 1 if %rom% == %debug_rom% rem pause

:createVideo
echo.
echo Creating video for %rom%
echo.

if %debug% == 1 if %rom% == %debug_rom% rem pause
if not exist snap\%rom%.avi goto noAviFound
%tools%\mencoder -oac copy -ovc copy snap\%rom%.avi -ss %trim% -oac mp3lame -ovc lavc -lavcopts acodec=mp3,1bitrate=128,vcodec=mpeg4,vbitrate=800, vhq,vm4v -o avi\%rom%.avi
if %debug% == 1 if %rom% == %debug_rom% rem pause
goto aviComplete

:noAviFound
echo.
echo Error: no snap\%rom%.avi output found - check roms
echo Error: no snap\%rom%.avi output found - check roms >> movie-log.txt

:aviComplete
echo.
echo Process complete for %rom%
if %debug% == 1 if %rom% == %debug_rom%

echo Cleaning up %rom%
echo.
del snap\%rom%.avi

:aviExist
echo.
echo %rom%.avi exists - skipping %rom%
goto :end

:romNotExist
echo.
echo %rom% rom not found
goto :end

:end

:::
::: END OF MAIN SCRIPT
:::
::::::::::::::::::::::::::::::::::::::::::::::::::
pause

Marcoqwerty
06-21-2011, 11:58 PM
Very Tk's

i will try it tonight ! :five:

Marcoqwerty
06-22-2011, 11:35 PM
I have tested the batch!

this it's my configuration:

- Windows seven 64 bit
- Athlon dual core 3Ghz
- Ram 2 Gb
- Mame optimized for 64 bit system (mame64.exe)
- Completed mame romset correct with romcenter (not CHD at this time)
- Last mame version
- Set of 3000 .avi downloaded from other resource :flute:

(hyperspin worked great at maximum speed)

RESULT:

I have followed the guide for configure the path...work perfect...but in the avi folder was create 2000 .avi with 4 kb size (empty), i take a screenshot of the cmd :

http://img832.imageshack.us/img832/8095/immaginefli.th.png (http://imageshack.us/photo/my-images/832/immaginefli.png/)

See this for all roms,dont think it's correct...

Finally i have deleted all the .avi file.

I have a last question...but where is the path for compare the .avi files this batch? (i set all the path but not the .avi for hyperspin, do it automatically?)

Any suggestion has appreciate :tee:

Marcoqwerty
06-29-2011, 06:19 AM
:smokin:

BladeZX
06-29-2011, 08:10 AM
This looks interesting.
What can be used to convert all of the avi files into flv, since flv is needed for hyperspin.

chillinwater
06-29-2011, 07:35 PM
@Marcoqwerty, Im not sure I understand. The batch creates .avi files in the \mame\avi\ -folder.
These are not for Hyperspin Directly, you have to convert them to flv and once converted to flv, put them in the Hyperspin\media\mame\video - folder or whatever emu\system your using.
I would copy them there but if you already have EmuMovies videos dont overwrite them. I would consider this a supplement to Emumovies if Circo hasnt created these already.

for your error in the pic,
Best guess is somthing is not configured right on your end.
Why 0-4 bytes? Dont know. I didnt have any with 0-4bytes.
Maybe check your paths in the batch and mame.ini rom paths.
I didnt create the batch so questions should go to the Maker-"dosmame", link on first post.

@BladeZX, I was using "Avs4You" to convert but there are lots of programs out there that may convert better (check Emumovies theres lots of tuts). I think even the old "Hyperspin Total Editor" did some conversion satisfactarily.

legtod2
06-30-2011, 03:27 AM
I copied the script and modified it slightly to work with my needs. It running thru my roms now creating avi files. When I play them back I noticed some have no sound (puck man). Guess I never realized some of the promos had no sound.
Some of the avi are really skinny, not sure why.
After the script finishes I will need to convert them to flv , not sure what to use for that job yet.

Will try these promos on front end soon.

dosmame
06-30-2011, 03:47 AM
Hi, thanks for the interest in my script.

To address a couple of points....

1.if you're having problems, set the debug to 1 - this will allow you to step through the (original) script to see what went wrong on your system

2.try and use a standard version of mame.exe and rename mame.ini to mame.old whilst the script runs to see if that helps

3.the script isn't hyperspin specific

4.some movies will look skinny by design. MAME actually corrects the machine resolution for you - Galaxian for example has a video aspect of 224x768, which is tall and skinny. There may be a way to pass some options to memcoder to set the aspect to 4:3 or 3:4 but I didn't get round to it (something for version 2!)

5.the script uses the defaul MAME avi path. So if mame in in C:\MAME the avi path is C:\MAME\AVI (something for version 2!)

6.games with no sound - not all the attact modes use sound, so it wont record any

Cheers
DM