View unanswered posts | View active topics It is currently Tue Oct 15, 2019 6:44 pm



This topic is locked, you cannot edit posts or make further replies.  [ 504 posts ]  Go to page 1, 2, 3, 4, 5 ... 21  Next
(old) ZMV to AVI video conversion [[archive me]] 
Author Message
ZSNES Developer
ZSNES Developer
User avatar

Joined: Tue Jul 27, 2004 10:54 pm
Posts: 3901
Location: Solar powered park bench
Post (old) ZMV to AVI video conversion [[archive me]]
Welcome to page 1.

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.

________
Note, the top of every page in this thread has this same message, it's what's needed to convert a ZMV to an AVI. We do not plan on changing these basic rules for ZMV to AVI conversion.
The rest of the posts here describe the evolution of the feature. This method wasn't developed till page 5 or so, so posts prior to that deal with the old method, which still works if you set it up properly.

If you have a question, please post about it in this thread, and in the end. But please make sure you've read this message, and skimmed pages 4 to 7 a bit to get an idea how it works.
________

Check it out: http://nsrt.edgeemu.com/mariovid.zip
Requires XviD.

Image

Of course props to ipher, DeHackEd, zsKnight, and pagefault for helping me.

I dumped the raw vid then converted to XviD as follows:

Code:
mencoder -nosound -rawvideo on:format=0x42475220:w=256:h=223:size=228352:fps=60 -ovc xvid -xvidencopts fixed_quant=9:aspect=4/3 -o mario.avi /home/nach/.zsnes/test.bin

_________________
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding


Last edited by Nach on Sat Mar 29, 2008 7:47 pm, edited 4 times in total.



Thu Apr 14, 2005 1:22 am
Profile WWW
Trooper
User avatar

Joined: Thu Jul 29, 2004 6:59 pm
Posts: 530
Location: 127.0.0.1
Post 
Raw video? That's gonna take up a lot of disk space.

Do you have to have a fast machine to do it in realtime so it doesn't drop frames or will it write a constant 50/60 fps and slow down the game?

_________________
"It is better to have tried and failed than to have failed to try, but the result's the same." - Mike Dennison


Thu Apr 14, 2005 1:28 am
Profile WWW
ZSNES Developer
ZSNES Developer
User avatar

Joined: Tue Jul 27, 2004 10:54 pm
Posts: 3901
Location: Solar powered park bench
Post 
The game slows down while outputting, but it writes every frame.

_________________
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding


Thu Apr 14, 2005 1:29 am
Profile WWW
Born to Rule... Impatiently
User avatar

Joined: Wed Nov 17, 2004 8:21 pm
Posts: 265
Location: Everywhere I want to be.
Post 
Just when you think ZSNES couldn't be any cooler... something like this is thrown at us. This rocks so much, I can't even begin to ramble on about how great it is. :D


I'm sure it will not be easy to get used to making the videos, but I hope to catch on eventually. ;)

_________________
My NES palette - better colors with any emulator.

"the more you know, and the more you can do... the more you are."
- daniel bohman


Thu Apr 14, 2005 2:37 am
Profile WWW
Dark Wind
User avatar

Joined: Thu Jul 29, 2004 8:58 pm
Posts: 1270
Location: Texas
Post 
Cool. Any plans to make it spit out raw data in a nice AVI/OGM/MKV container to ease transcoding?

Does the dump raw option just record whatever you're doing, or is it tied to ZMV? I mean, does it just record whatever's on the screen, or does it start playing the specified movie, then start recording?

_________________
#577451


Thu Apr 14, 2005 3:22 am
Profile WWW
ZSNES Developer
ZSNES Developer
User avatar

Joined: Tue Jul 27, 2004 10:54 pm
Posts: 3901
Location: Solar powered park bench
Post 
Noxious Ninja wrote:
Any plans to make it spit out raw data in a nice AVI/OGM/MKV container to ease transcoding?

No. VirtualDub and mencoder exist for a reason, we're not writing a media encoder here.

Using mkfifo, you can have ZSNES output the video stream directly into mencoder thus encoding without having a massive raw file in between.

_________________
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding


Thu Apr 14, 2005 3:25 am
Profile WWW
Dark Wind
User avatar

Joined: Thu Jul 29, 2004 8:58 pm
Posts: 1270
Location: Texas
Post 
Oh, I didn't know VirtualDub could open raw data.

_________________
#577451


Thu Apr 14, 2005 4:24 am
Profile WWW
Paladin

Joined: Fri Jul 30, 2004 2:25 am
Posts: 75
Post Re: ZMV to AVI conversion!!! (finally, sort of)
Nach wrote:
Of course props to ipher, DeHackEd, zsKnight, and pagefault for helping me.
zsKnight???!!! :shock: I thought he left.

_________________
System Specs:

2.2GHz Athlon64 X2 4400+, 2GB DDR 400 SDRAM
EVGA Geforce 7600GT 256MB
Realtek AC '97
Microsoft Windows Vista Home Premium


Thu Apr 14, 2005 6:42 am
Profile
Lurker

Joined: Mon Aug 09, 2004 1:40 am
Posts: 153
Post Re: ZMV to AVI conversion!!! (finally, sort of)
Cecil wrote:
zsKnight???!!! :shock: I thought he left.


He's long gone, but much of his code remains.


Thu Apr 14, 2005 11:09 am
Profile WWW
ZSNES Developer
ZSNES Developer
User avatar

Joined: Tue Jul 27, 2004 10:54 pm
Posts: 3901
Location: Solar powered park bench
Post Re: ZMV to AVI conversion!!! (finally, sort of)
Cecil wrote:
Nach wrote:
Of course props to ipher, DeHackEd, zsKnight, and pagefault for helping me.
zsKnight???!!! :shock: I thought he left.


I used his color space conversion techniques for getting an image that can be converted to MPEG4.

_________________
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding


Thu Apr 14, 2005 11:23 am
Profile WWW
Dark Wind
User avatar

Joined: Thu Jul 29, 2004 8:58 pm
Posts: 1270
Location: Texas
Post 
How exactly does this work? I checked out CVS (from right before your latest change, since that seems to have broken things for now), but the Dump Raw Movie button doesn't seem to do anything. Is it currently a dummy in public code, or do I just not understand it?

_________________
#577451


Thu Apr 14, 2005 4:59 pm
Profile WWW
ZSNES Developer
ZSNES Developer
User avatar

Joined: Tue Jul 27, 2004 10:54 pm
Posts: 3901
Location: Solar powered park bench
Post 
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.

_________________
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding


Thu Apr 14, 2005 5:06 pm
Profile WWW
Hero of Time
User avatar

Joined: Fri Jul 30, 2004 2:49 am
Posts: 2646
Location: In front of the monitor
Post 
Wow, this is awesome news. Imagine the possibilities...

_________________
Try out CCleaner and other free software at Piriform
Image


Thu Apr 14, 2005 11:03 pm
Profile WWW
Rookie
User avatar

Joined: Mon Nov 22, 2004 12:56 am
Posts: 27
Post 
Sweet! Thanks for the update Nach.


Thu Apr 14, 2005 11:11 pm
Profile
Rookie
User avatar

Joined: Thu Aug 26, 2004 3:24 am
Posts: 21
Post 
Personally, I prefer this idea than using MNG. Though, adding both this and MNG can be a good idea for those that only want animation without sounds.


Fri Apr 15, 2005 9:23 pm
Profile
ZSNES Developer
ZSNES Developer
User avatar

Joined: Tue Aug 17, 2004 5:24 am
Posts: 812
Location: In your garden
Post 
On an unrelated note. For people wanting to rip sprites I will be adding a command-line option to choose the default background colour (other than black) when you disable layers so you can easily set up transparencies. I know some of you have been wanting this for some time.


Fri Apr 15, 2005 9:28 pm
Profile
Born to Rule... Impatiently
User avatar

Joined: Wed Nov 17, 2004 8:21 pm
Posts: 265
Location: Everywhere I want to be.
Post 
Phil wrote:
Personally, I prefer this idea than using MNG. Though, adding both this and MNG can be a good idea for those that only want animation without sounds.

Yeah, I can't wait for the onset of widespread popularity of the MNG format. From what I've read about it, MNG is superior to GIF in every way, so why don't people start using it? :?

_________________
My NES palette - better colors with any emulator.

"the more you know, and the more you can do... the more you are."
- daniel bohman


Fri Apr 15, 2005 10:22 pm
Profile WWW
Rookie
User avatar

Joined: Thu Aug 26, 2004 3:24 am
Posts: 21
Post 
Good question.

Logically, I think it should.


Fri Apr 15, 2005 10:56 pm
Profile
Winter Knight
User avatar

Joined: Mon Aug 16, 2004 10:16 pm
Posts: 467
Post 
Very little software supports it.

Mozilla implemented MNG at one point, but later took it out for no logical reason that I can think of.


Sat Apr 16, 2005 1:46 am
Profile WWW
Dark Wind
User avatar

Joined: Thu Jul 29, 2004 8:58 pm
Posts: 1270
Location: Texas
Post 
Aerdan wrote:
Very little software supports it.

Mozilla implemented MNG at one point, but later took it out for no logical reason that I can think of.


They took it out because there was no maintainer. Now there is a maintainer, and I _THINK_ it was going to be back in 1.8 (and Firefox 1.1?) but I'm not sure.

Firefox will be getting SVG in either 1.1 or 1.2, which will be good.

_________________
#577451


Sat Apr 16, 2005 2:05 am
Profile WWW
ZSNES Developer
ZSNES Developer
User avatar

Joined: Tue Jul 27, 2004 10:54 pm
Posts: 3901
Location: Solar powered park bench
Post 
Added command line stuff and finally tied in that button, it's super cool now :)

First I did
Code:
mkfifo /home/nach/.zsnes/rawvideo.bin


And presto:

Code:
./zsnesd -md -mc -zm 3 /mnt/D/roms/nintendo/snes/btoad_bm.smc & mencoder -nosound -rawvideo on:format=0x42475220:w=256:h=223:size=228352:fps=60 -ovc xvid -xvidencopts fixed_quant=10:aspect=4/3 -o btoad.avi /home/nach/.zsnes/rawvideo.bin


Encoded straight to a nice little XviD without some monstrosity of a raw video file in between :)

http://nsrt.edgeemu.com/btoad.zip

_________________
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding


Mon Apr 18, 2005 3:06 am
Profile WWW
Dark Wind
User avatar

Joined: Thu Jul 29, 2004 8:58 pm
Posts: 1270
Location: Texas
Post 
How does that work? Assuming mencoder isn't able to encode the video in real-time, does ZSNES slow down, or does it write to memory and eventually fill up your entire page file?

And does Windows have an equivalent to mkfifo?

EDIT: The GnuWin32 CoreUtils package has mkfifo. I'll give it a shot.

_________________
#577451


Mon Apr 18, 2005 4:19 am
Profile WWW
ZSNES Developer
ZSNES Developer
User avatar

Joined: Tue Jul 27, 2004 10:54 pm
Posts: 3901
Location: Solar powered park bench
Post 
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.

_________________
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding


Mon Apr 18, 2005 5:16 am
Profile WWW
ZSNES Developer
ZSNES Developer
User avatar

Joined: Tue Jul 27, 2004 10:54 pm
Posts: 3901
Location: Solar powered park bench
Post 
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.

_________________
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding


Mon Apr 18, 2005 5:42 am
Profile WWW
Hazed

Joined: Sun Oct 03, 2004 10:03 pm
Posts: 74
Post 
what requirements does this feature needs that is usable?


Mon Apr 18, 2005 2:12 pm
Profile ICQ
Display posts from previous:  Sort by  
This topic is locked, you cannot edit posts or make further replies.   [ 504 posts ]  Go to page 1, 2, 3, 4, 5 ... 21  Next

Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software.