(old) ZMV to AVI video conversion [[archive me]]

General area for talk about ZSNES. The best place to ask for related questions as well as troubleshooting.

Moderator: ZSNES Mods

Locked
Noxious Ninja
Dark Wind
Posts: 1271
Joined: Thu Jul 29, 2004 8:58 pm
Location: Texas
Contact:

Post by Noxious Ninja »

Welcome to page 2.

To record a video you need one of the latest work in progress builds of ZSNES. Get them here: http://zsnes.ipherswipsite.com/

You will need a copy of mencoder. For Windows users, I recommend getting mencoder here: http://oss.netfarm.it/mplayer-win32.php
Place mencoder.exe in the same location as zsnesw.exe, you do not need any codecs or other movie programs installed.
Linux users, having mencoder in your path is fine.

If you want to compress the outputted audio, or compress it before it goes into the video as opposed to during, you will need a copy of LAME.
If you use Windows, you must get LAME from here: http://geocities.com/joecool22us/lame.zip
Any other copy of LAME for Windows will not work due to a bug in LAME.

Before you are able to dump an AVI, you must have recorded a movie first, it converts movies, it does not just dump video on the fly.

To play back movies, you'll either need the proper codecs or a video player with built in decoding of the video mode you selected.
I recommend getting mplayer which decodes anything created with mencoder. For Windows, you can get mplayer here: http://oss.netfarm.it/mplayer-win32.php You can download the GUI version.

Advanced users can edit zmovie.cfg and tweak the settings if they want, and even use something other than mencoder and LAME as long as it supports encoding via stdin and you set it up properly.

________
Nach wrote:ZSNES and mencoder are running at the same time.

mkfifo makes the file become shared memory, so as ZSNES outputs the raw, mencoder immediatly encodes it and outputs the AVI.
And the RAM isn't depleted, because as mencoder reads the memory, it disappears from memory.
I know that, but what happens if mencoder isn't able to encode in real-time? Does zsnes wait for it, or do frames get dropped, or what?
Nach wrote:BTW, what shell would you use to run both together? I know cygwin has what you need, but I wouldn't want to make anyone use that.

http://unxutils.sf.net I believe has ZSH which probably supports the & technique to run two programs together. If their coreutils also comes with mkfifo, I'd recommend using that instead.
OK. I'll try it with msys, then, if that doesn't work, I'll try unxutils.
[u][url=http://bash.org/?577451]#577451[/url][/u]
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Player1 wrote:what requirements does this feature needs that is usable?
ZSNES, a game, a ZMV for that game, a raw video player or converter.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Noxious Ninja wrote:
Nach wrote:ZSNES and mencoder are running at the same time.

mkfifo makes the file become shared memory, so as ZSNES outputs the raw, mencoder immediatly encodes it and outputs the AVI.
And the RAM isn't depleted, because as mencoder reads the memory, it disappears from memory.
I know that, but what happens if mencoder isn't able to encode in real-time? Does zsnes wait for it, or do frames get dropped, or what?
You worry too much. It'll take a while, but not frames get dropped. Just make sure you set frame skip to 0 in ZSNES.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

2 pass 400 bit XviD:

Code: Select all

./zsnesd -md -mc -zm 1 /mnt/D/roms/nintendo/snes/punchout.smc & mencoder -nosound -rawvideo on:format=0x42475220:w=256:h=223:size=228352:fps=60 -ovc xvid -xvidencopts pass=1:aspect=4/3 -o /dev/null /home/nach/.zsnes/rawvideo.bin

Code: Select all

./zsnesd -md -mc -zm 1 /mnt/D/roms/nintendo/snes/punchout.smc & mencoder -nosound -rawvideo on:format=0x42475220:w=256:h=223:size=228352:fps=60 -ovc xvid -xvidencopts pass=2:bitrate=400:aspect=4/3 -o punchout.avi /home/nach/.zsnes/rawvideo.bin
http://nsrt.edgeemu.com/punchout.zip
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Dead
Lurker
Posts: 118
Joined: Sat Sep 25, 2004 10:59 am
Location: I don't know where I am

Post by Dead »

They look great, Nach.
Noxious Ninja
Dark Wind
Posts: 1271
Joined: Thu Jul 29, 2004 8:58 pm
Location: Texas
Contact:

Post by Noxious Ninja »

@Nach: Did you get the PM I sent you?
[u][url=http://bash.org/?577451]#577451[/url][/u]
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Noxious Ninja wrote:@Nach: Did you get the PM I sent you?
I got one with the words "Cool" "Test" and "Tonight". Is that what you're referring to?
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Noxious Ninja
Dark Wind
Posts: 1271
Joined: Thu Jul 29, 2004 8:58 pm
Location: Texas
Contact:

Post by Noxious Ninja »

Oops, I didn't send the message I thought I did. :oops: Anyway, I tested it, and it crashed whenever I hit the Record button in Movie Options.

Anonymous CVS seems to be WAY behind right now, so I can't try building it myself.
[u][url=http://bash.org/?577451]#577451[/url][/u]
Noxious Ninja
Dark Wind
Posts: 1271
Joined: Thu Jul 29, 2004 8:58 pm
Location: Texas
Contact:

Post by Noxious Ninja »

Update: I now have the source, built it myself, and it still crashes when pressing the record button. It creates the file then dies.
[u][url=http://bash.org/?577451]#577451[/url][/u]
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Strange I'll have to go check if one of my recent changes screwed up ZSNESW.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

I decided to pit XviD and libavcodec head to head.

Guys, tell me which vid looks better, punchout2.avi or punchout3.avi.

http://nsrt.edgeemu.com/punchout2.zip
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Noxious Ninja
Dark Wind
Posts: 1271
Joined: Thu Jul 29, 2004 8:58 pm
Location: Texas
Contact:

Post by Noxious Ninja »

Whenever the recording option starts working again, I'm going to try a speed run for Prince of Persia. I don't think anybody's done that game yet.

Is the ZMV format stable yet?
[u][url=http://bash.org/?577451]#577451[/url][/u]
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Noxious Ninja wrote: Is the ZMV format stable yet?
I may add on an extra byte in last input field within chapters if I see it's not large enough to contain special controllers. Other than that, I don't plan on changing the format. So if you don't use chapters, you should be fine.
Unforunetly grinvader is away right now, and when he comes back, I'll have to make sure current format meets his approval. Probably will though.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
sweener2001
Inmate
Posts: 1751
Joined: Mon Dec 06, 2004 7:47 am
Location: WA

Post by sweener2001 »

i'm just going to say puchout2 because 3 wouldn't play, and i don't feel like getting another media player.
[img]http://i26.photobucket.com/albums/c128/sweener2001/StewieSIGPIC.png[/img]
Phil
Rookie
Posts: 21
Joined: Thu Aug 26, 2004 3:24 am

Post by Phil »

Like mentionned before, you need FFdshow installed.
Dead
Lurker
Posts: 118
Joined: Sat Sep 25, 2004 10:59 am
Location: I don't know where I am

Post by Dead »

punchout3.avi seems to clean up a little better than punchout2.avi.
Phil
Rookie
Posts: 21
Joined: Thu Aug 26, 2004 3:24 am

Post by Phil »

I am somewhat deceived about that. VirtualDub doesn't seem to handle RAW video and it creates too large file. I think it's a bad idea.
Noxious Ninja
Dark Wind
Posts: 1271
Joined: Thu Jul 29, 2004 8:58 pm
Location: Texas
Contact:

Post by Noxious Ninja »

Well, I can't get mkfifo to work. The GnuWin32 version tells me it can't create the file, even if I run it with Admin privilages, and the UnxUtils page says their version of mkfifo is a dummy. I'll have to post to the GnuWin32 mailing list or something

ZSNES, however, is now working nicely, and I can encode videos just fine with mencoder. There seems to be some issues with using fast-forward when dumping the video, but I'm not sure if that's on your list of things to work on or not.
[u][url=http://bash.org/?577451]#577451[/url][/u]
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Noxious Ninja wrote: There seems to be some issues with using fast-forward when dumping the video, but I'm not sure if that's on your list of things to work on or not.
As said in the readme, fast foward means frame skipping. If you want to skip frames while creating a movie, that's your problem.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Noxious Ninja
Dark Wind
Posts: 1271
Joined: Thu Jul 29, 2004 8:58 pm
Location: Texas
Contact:

Post by Noxious Ninja »

I know. I guess I should've clarified what I meant:

1) While fast-forward is enabled, and the frame coutner is enabled, the frame counter is shown in the recorded movie. It is not shown when fast-forward is disabled.

2) Some way to dump movie data to disk as fast as possible would be nice.
[u][url=http://bash.org/?577451]#577451[/url][/u]
Noxious Ninja
Dark Wind
Posts: 1271
Joined: Thu Jul 29, 2004 8:58 pm
Location: Texas
Contact:

Post by Noxious Ninja »

BTW, you can do better with the XviD encodes if you add :vhq=4:hq_ac to the -xvidencopts section. :gmc works well for games with scrolling backgrounds (i.e., most of them). There's also :qpel, which can sometimes give a sharper image, at the cost of a higher bitrate.
[u][url=http://bash.org/?577451]#577451[/url][/u]
user222
Rookie
Posts: 15
Joined: Sun Feb 13, 2005 8:26 am

Post by user222 »

Nach wrote:
Player1 wrote:what requirements does this feature needs that is usable?
ZSNES, a game, a ZMV for that game, a raw video player or converter.
Does this work with the Windows version of ZSNES? The screenshot looks like the Linux version.
Agozer
16-bit Corpse | Nyoron~
Posts: 3534
Joined: Sun Aug 01, 2004 7:14 pm
Location: Nokia Land

Post by Agozer »

user222 wrote:
Nach wrote:
Player1 wrote:what requirements does this feature needs that is usable?
ZSNES, a game, a ZMV for that game, a raw video player or converter.
Does this work with the Windows version of ZSNES? The screenshot looks like the Linux version.
Yes, it does work with the Windows version.
whicker: franpa is grammatically correct, and he still gets ripped on?
sweener2001: Grammatically correct this one time? sure. every other time? no. does that give him a right? not really.
Image
Sun_Fire
New Member
Posts: 4
Joined: Wed Apr 27, 2005 8:43 am

Post by Sun_Fire »

Nach wrote:The button is currently a dummy. If you want to dump a video right now, you'll have to tie the raw_video*() functions in zmovie.c into something.
Hi, i'm new here 8)

Well my problem is: I cannot find the "raw_video*()" functions in that file.

I have a zsnes wip 1.41 source code and my OS is win 2k3
Locked