(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
KingHanco
Hazed
Posts: 79
Joined: Sun Feb 26, 2006 8:08 am

Hmmm...

Post by KingHanco »

Welcome to page 7.

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.

________
All I need is the lame.exe and the mencoder.exe.

Works without all that extra crap. I deleted all the extras. :)

Thanks for the lame.exe update.

So what the bugs on the mencoder.exe? Can you make a fixs of mencoder.exe as well?
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

byuu wrote:I suppose. Wasn't aware c++ was out of the question in ZSNES. You could get around strings with a quick for loop that replaced semicolons with \0 while keeping a count. Seek to the next pointer as path=strlen(path)+1. Replace str* functions with strn* functions. But your decision.
strtok() basically does what you're suggesting, but still have the flaw.
And I started working on a safe popen() for Windows. I'm basically done, except for some reason which I'm not sure of yet, it's not working :/
byuu wrote:I'd probably use it myself for wav->mp3 encoding via LAME.
Make sure you use the LAME I posted above on Windows :P
byuu wrote: Definitely a good idea you have there to use external apps. I was actually going to do that for ZIP support, but you came up with a much better solution for me first.
I actually use popen() with some wrapper code in NSRT for opening RAR files on DOS/Windows. But since there I just have to read once instead of peridoic writings, I never ran into any issues.
KingHanco wrote: Thanks for the lame.exe update.
No problem.
KingHanco wrote: So what the bugs on the mencoder.exe?
mplayer/mencoder reinterpets fractions passed to -ofps or other FPS parameters.
mencoder changes stored FPS in an AVI file when reencoding.
mencoder leaves a bunch of AVI fields blank.
mplayer/mencoder mishandle bitmaps with negative height.
mplayer/mencoder mishandle AVIs with proper FourCCs of DIB and 3, but handle properly non standard rgb0x10 and RGB0x10.
mplayer/mencoder can't find the video stream if the index is broken in some ways, but it works fine with no index at all.

I think I found another issue or two, but I don't remember.
KingHanco wrote: Can you make a fixs of mencoder.exe as well?
mencoder is a huge program which takes a long time to compile, and even harder to track down bugs and fix them.
mencoder updates are also very useful, unlike LAME, where you can have a build which is old and generally not care at all.
I'd have to repatch each new mencoder build that came out, because I doubt I'd get in a patch easily. LAME I think will accept or improve my patch, and even if not it's only a 4 line change and takes less than a minute to compile.

And the only mencoder issue that affects us is the FPS bug. I'm considering putting a work around in ZSNES by having it patch the AVI header after mencoder is done with it.

Edit:
I now have a safe popen() for Windows, let me clean it up a bit, and just double check everything is okay, and I'll commit it.
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 »

Okay, ipher should release a WIP shortly with all the new goodies, to reitterate for everyone who is going to use it.

You need mencoder to record video.
For Windows users, I recommend getting the one here: http://oss.netfarm.it/mplayer-win32.php

If you want plain audio output to be in MP3 format, or to make the temp audio file for a merged video smaller, you need LAME by default (compress audio option).
For Windows, currently all LAME binaries on the net are broken.
The only working one is the one I compiled with a patch I made, here:
http://nsrt.edgeemu.com/lame.zip

mencoder and LAME need to either be in ZSNES' working directory, the PATH, or specified where they are located in zmovie.cfg

The custom option currenly does NOT work.

popen() for Windows and *nix is loads safer now. I did not yet look into DOS yet.

WIP should have a new feature in it that you shouldn't need to set frameskip to 0 before recording.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
franpa
Gecko snack
Posts: 2374
Joined: Sun Aug 21, 2005 11:06 am
Location: Australia, QLD
Contact:

Post by franpa »

ahh... so upon movie dumping it automaticaly sets frame skip to 0 and then resets the value back, after dumping is complete.

great work. (sorry but the above may be incorrect)
Core i7 920 @ 2.66GHZ | ASUS P6T Motherboard | 8GB DDR3 1600 RAM | Gigabyte Geforce 760 4GB | Windows 10 Pro x64
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

franpa_9 wrote:ahh... so upon movie dumping it automaticaly sets frame skip to 0 and then resets the value back, after dumping is complete.

great work. (sorry but the above may be incorrect)
http://cia.navi.cx/stats/project/zsnes/.message/31c3c

Thanks.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
franpa
Gecko snack
Posts: 2374
Joined: Sun Aug 21, 2005 11:06 am
Location: Australia, QLD
Contact:

Post by franpa »

so i was correct?
Core i7 920 @ 2.66GHZ | ASUS P6T Motherboard | 8GB DDR3 1600 RAM | Gigabyte Geforce 760 4GB | Windows 10 Pro x64
KingHanco
Hazed
Posts: 79
Joined: Sun Feb 26, 2006 8:08 am

Post by KingHanco »

ZSNESW_0307.zip (ZSNES 03/07) - I just now try it out. The "dump movie" is broken now. Something have been change on this wip release to broken it. Please check the source over. It not picking up right and I'm sure something went wrong.. The size is 0 kb and nothing been dump.

http://files.ipherswipsite.com/zsnes/ZSNESW_0307.zip
Aekeron
Rookie
Posts: 14
Joined: Tue Mar 07, 2006 12:12 pm

Post by Aekeron »

I'm also having problems once again (and hopefully this time I'm remembering how to dump movied properly ;p )...

Here's what I did:

#Created a new zSNES folder.
#Extracted mencoder, lame (Nach's modded version), x264 and the new zSNES WIP to that folder.
#Did the usual configure zSNES stuff.
#DIDN'T install mencoder/lame to my PATH (will try that in a mo).
#Recorded a zmv of MarioKart (plays back fine).
#Tried to dump the movie using all the combinations of options I could. With/without audio (compressed and not), x264, xVid (codecs installed). No dice. In the best case scenario, a 0 byte .avi was created.

Here's the text that came up in mencoder when it was doing it's "thing" (or not, as the case is here):

CPU: Advanced Micro Devices Athlon 64/FX Sledgehammer,San Diego,Venice (Fam
15, Stepping: 1)
CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 0 SSE2: 0
Compiled for x86 CPU with extensions: MMX MMX2 3DNow 3DNowEx

Reading from stdin...
success: format: 0 data: 0x0 - 0x0

Closing zSNES left this running, I then pressed return in the window and got:

[V] filefmt:26 fourcc:0x42475218 size:256x224 fps:59.95 ftime:=0.0167
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
==========================================================================
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 256 x 224 (preferred colorspace: BGR 24-bit)
Could not find matching colorspace - retrying with -vf scale...
Opening video filter: [scale]
VDec: using BGR 24-bit as output csp (no 0)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
SwScaler: using unscaled BGR 24-bit -> Planar YV12 special converter
x264 [info]: using SAR=149/128
x264 [info]: using cpu capabilities MMX MMXEXT SSE SSE2 3DNow!
Selected video codec: [rawbgr24] vfm: raw (RAW BGR24)
==========================================================================

When it was used, LAME just hung with a completely blank screen.

Hope this info is useful in some way.
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Aekeron wrote: #Extracted mencoder, lame (Nach's modded version), x264 and the new zSNES WIP to that folder.
For what reason did you get x264 for? We don't use the x264 program at all.

I'll look into things to see if there are MSVC vs MinGW issues, or if something screwed up at the last moment.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
franpa
Gecko snack
Posts: 2374
Joined: Sun Aug 21, 2005 11:06 am
Location: Australia, QLD
Contact:

Post by franpa »

oops sorry for posting in the other thread... sorry.
Core i7 920 @ 2.66GHZ | ASUS P6T Motherboard | 8GB DDR3 1600 RAM | Gigabyte Geforce 760 4GB | Windows 10 Pro x64
Aekeron
Rookie
Posts: 14
Joined: Tue Mar 07, 2006 12:12 pm

Post by Aekeron »

I'm not sure why I put x264 in there lol. I think it must've been mentioned earlier in the thread when you were thinking about what exactly to use in the movie dumping and for some reason I downloaded it (it was kind of late at night when I first tried to set it all up...). I'll get rid of it ;)

Cheers for looking into the issues. Looking forward to making some more zsnes movies...
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Try this:

http://nsrt.edgeemu.com/zsnesw-mov.zip

It works for me, if it doesn't work for you guys, not sure, if it does, I know where the problem is.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
franpa
Gecko snack
Posts: 2374
Joined: Sun Aug 21, 2005 11:06 am
Location: Australia, QLD
Contact:

Post by franpa »

will edit this post within 5 - 10 minutes with result.

EDIT: used default options... except for changing it so that audio was merged with the avi... movie was made succesfully... but no sound.

EDIT: upon choosing custom the screen that says mencoder is missing starts appearing no matter what you choose... till you quit and reopen zsnes.
Core i7 920 @ 2.66GHZ | ASUS P6T Motherboard | 8GB DDR3 1600 RAM | Gigabyte Geforce 760 4GB | Windows 10 Pro x64
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

franpa_9 wrote: EDIT: used default options... except for changing it so that audio was merged with the avi... movie was made succesfully... but no sound.
Need more details.
franpa_9 wrote: EDIT: upon choosing custom the screen that says mencoder is missing starts appearing no matter what you choose... till you quit and reopen zsnes.
Did you read what I said above?
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
Aekeron
Rookie
Posts: 14
Joined: Tue Mar 07, 2006 12:12 pm

Post by Aekeron »

Joy. I left my settings as they were before and simply overwrote the zsnes.exe file. Worked perfectly first time.

Thank you kindly :)

Out of interest, what was different?

Oh, btw, settings were:

x264, audio, compress, audio in video.

I'll give xvid a quick try too.

Yup, xvid is fine too.
franpa
Gecko snack
Posts: 2374
Joined: Sun Aug 21, 2005 11:06 am
Location: Australia, QLD
Contact:

Post by franpa »

xvid losless, audio in video = correct avi dump with no sound.

i am having bad day for reading and i overlooked what was said about custom.
if this info is not whats needed then please elaborate on what your after.

EDIT: x264 when played sits at 0:00 but says the correct length of film... it justs sits at 0:00 while playing. (screen is black)

i have media player classic (latest version) installed along with k-lite mega codec pack (30mb approx. v1.52 beta)
Last edited by franpa on Wed Mar 08, 2006 12:43 pm, edited 4 times in total.
Core i7 920 @ 2.66GHZ | ASUS P6T Motherboard | 8GB DDR3 1600 RAM | Gigabyte Geforce 760 4GB | Windows 10 Pro x64
grinvader
ZSNES Shake Shake Prinny
Posts: 5632
Joined: Wed Jul 28, 2004 4:15 pm
Location: PAL50, dood !

Post by grinvader »

YOU NEED BOTH "AUDIO" AND "AUDIO IN VIDEO" TO GET SOUND COMPRESSED AT ENCODING TIME

'Audio in video' without 'Audio' will NOT dump sound.
皆黙って俺について来い!!

Code: Select all

<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
franpa
Gecko snack
Posts: 2374
Joined: Sun Aug 21, 2005 11:06 am
Location: Australia, QLD
Contact:

Post by franpa »

thanks that worked for xvid.
Core i7 920 @ 2.66GHZ | ASUS P6T Motherboard | 8GB DDR3 1600 RAM | Gigabyte Geforce 760 4GB | Windows 10 Pro x64
Aekeron
Rookie
Posts: 14
Joined: Tue Mar 07, 2006 12:12 pm

Post by Aekeron »

Have you tried using VLC, franpa? I'm using the latest release version and it plays fine.

Here's a small vid of the very start of mkart that plays okay on mine:

x264, audio, compressed audio, audio in avi

http://web.ukonline.co.uk/elandras/davpics/merged.rar
franpa
Gecko snack
Posts: 2374
Joined: Sun Aug 21, 2005 11:06 am
Location: Australia, QLD
Contact:

Post by franpa »

same thing occurs the screen stays black and the timer stays at 0:00 yet the length of the film is calculated correctly... this does not appear to be a codec problem as i can play other x264 compressed avi files perfectly... and am yet to confirm whether or not (via the authors) if some other videos i have downloaded are desynced for everyone or if its just me.

length of your movie... 24 seconds.

not tried vlc yet.
Last edited by franpa on Wed Mar 08, 2006 1:00 pm, edited 2 times in total.
Core i7 920 @ 2.66GHZ | ASUS P6T Motherboard | 8GB DDR3 1600 RAM | Gigabyte Geforce 760 4GB | Windows 10 Pro x64
Aekeron
Rookie
Posts: 14
Joined: Tue Mar 07, 2006 12:12 pm

Post by Aekeron »

Oops...

*re-reads your post properly*

So, it doesn't play in VLC either?
franpa
Gecko snack
Posts: 2374
Joined: Sun Aug 21, 2005 11:06 am
Location: Australia, QLD
Contact:

Post by franpa »

thanks to grinvader and nach xvid outputs correctly. however x264 does not.

EDIT: is h264 the same as x264?
Core i7 920 @ 2.66GHZ | ASUS P6T Motherboard | 8GB DDR3 1600 RAM | Gigabyte Geforce 760 4GB | Windows 10 Pro x64
Nach
ZSNES Developer
ZSNES Developer
Posts: 3904
Joined: Tue Jul 27, 2004 10:54 pm
Location: Solar powered park bench
Contact:

Post by Nach »

Aekeron wrote: Out of interest, what was different?
My build is compiled with MinGW.
franpa_9 wrote: however x264 does not.
You have yet to prove that there is an output problem as opposed to your video player having an input problem.
franpa_9 wrote: EDIT: is h264 the same as x264?
h264 is the format, x264 is the encoder, two pages back was talk on it, and links to all the info on the subject.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
franpa
Gecko snack
Posts: 2374
Joined: Sun Aug 21, 2005 11:06 am
Location: Australia, QLD
Contact:

Post by franpa »

getting vlc now... its 9mb so will take 5 - 10 min.

some h264 videos i have run perfect in every way... yet others from the same site run with video at 60hz and sound at 50hz... causes weird things to happen with the seek bar and when video finishes before music does.

- media player classic (latest)
- windows media player 9
- windows media player 6.4
- winamp 5.2
- all programes cant play x264 movies dumped by zsnes... yet can play other h264 videos fine.

vlc does play the movie correctly, thank you everyone for your help in solving my ordeal.
Core i7 920 @ 2.66GHZ | ASUS P6T Motherboard | 8GB DDR3 1600 RAM | Gigabyte Geforce 760 4GB | Windows 10 Pro x64
Aekeron
Rookie
Posts: 14
Joined: Tue Mar 07, 2006 12:12 pm

Post by Aekeron »

Maybe try updating your h264 codecs?

http://www.neowin.net/forum/index.php?s ... pic=319922

I'm going to try that now and see what MPC thinks of it..
Locked