SDL: FCEUX can now be muted for avi capturing / updated videolog documentation

This commit is contained in:
shinydoofy 2008-12-24 01:19:48 +00:00
parent 5cb9c50814
commit f270b8ee4f
4 changed files with 52 additions and 28 deletions

View File

@ -1,4 +1,5 @@
---version 2.0.4 yet to be released--- ---version 2.0.4 yet to be released---
24-dec-2008 - shinydoofy - sdl - added option to mute FCEUX for avi capturing, check the docs for more detail
23-dec-2008 - adelikat - Win32 - Undo/redo loadstate and Undo/redo savestate context menu items added 23-dec-2008 - adelikat - Win32 - Undo/redo loadstate and Undo/redo savestate context menu items added
23-dec-2008 - adelikat - undo/redo loadstate and undo/redo savestate implemented 23-dec-2008 - adelikat - undo/redo loadstate and undo/redo savestate implemented
22-dec-2008 - adelikat - backupSavestate system added. 22-dec-2008 - adelikat - backupSavestate system added.

View File

@ -8,7 +8,7 @@ Here's an example:
./fceux \ ./fceux \
--xscale 1 --yscale 1 --special 0 \ --xscale 1 --yscale 1 --special 0 \
--pal 0 \ --pal 0 \
--sound 1 --soundq 1 --soundrate 48000 \ --sound 1 --soundq 1 --soundrate 48000 --mute 1 \
--nospritelim 1 \ --nospritelim 1 \
--videolog "mencoder - -o myfirstencodedrun.avi \ --videolog "mencoder - -o myfirstencodedrun.avi \
-ovc x264 -x264encopts qp=0 \ -ovc x264 -x264encopts qp=0 \
@ -19,27 +19,29 @@ Here's an example:
Now let's see what is done and why we did it: Now let's see what is done and why we did it:
First of all, we started fceux with "./fceux" and gave it some options: First of all, we started fceux with "./fceux" and gave it some options:
--xscale and --yscale determine how much bigger the video in comparison to its regular size. It's no point to use anything other than 1 here because you can always see your video on fullscreen or at least scale it, can't you? As a nice addon, it saves time to create the avi file and also saves valuable space on your hard disk. "--xscale" and "--yscale" determine how much bigger the video in comparison to its regular size. It's no point to use anything other than 1 here because you can always see your video on fullscreen or at least scale it, can't you? As a nice addon, it saves time to create the avi file and also saves valuable space on your hard disk.
--special would usually do something fancy to your picture when you're playing a ROM, but again, it's mostly pointless to use for an avi. "--special" would usually do something fancy to your picture when you're playing a ROM, but again, it's mostly pointless to use for an avi.
--pal 0 lets the game run at ~60Hz. Set this so 1 if you are using a PAL region ROM. "--pal 0" lets the game run at ~60Hz. Set this so 1 if you are using a PAL ROM.
--sound 1 activates sound. "--sound 1" activates sound.
--soundq 1 activates high quality sound. "--soundq 1" activates high quality sound.
--soundrate 48000 sets the sound at 48kHz. "--soundrate 48000" sets the sound rate to 48kHz.
--nospritelim deactivates the NES's 8 sprites per scanlines limit. "--mute 1" mutes FCEUX while still passing the sound to mencoder. This way you can capture a movie and still listen to your music without having the NES sounds in the background.
--videolog calls mencoder: "--nospritelim" deactivates the NES's 8 sprites per scanlines limit.
- states we're getting the video stream from stdin. "--videolog" calls mencoder:
-o determines the name of the produced avi file. "-" states that we're getting the video stream from stdin.
-ovc x264 set the video codec to be x264 and is highly recommended for quality reasons. "-o" determines the name of the produced avi file.
-x264encopts qp=0 tells the x264 codec to use a quantizer of 0, which results in lossless video quality. "-ovc x264" sets the video codec to be x264 and is highly recommended for quality reasons. However, if you using a version of x264 from Sep 28th 2008 or newer, mplayer will not be able to decode this again properly. Until this is fixed this mplayer, you might want to replace "-ovc x264 -x264encopts qp=0" with "-ovc lavc -lavcopts vcodec=ffv1:format=bgr32:coder=1:vstrict=-1". Watch out, though, as this needs *way* more space than x264 does.
-oac pcm saves the audio data uncompressed (watch out, this might turn out really big). "-x264encopts qp=0" tells the x264 codec to use a quantizer of 0, which results in lossless video quality.
-noskip makes sure that no frame is dropped. "-oac pcm" saves the audio data uncompressed (this might turn out really big).
-nocache is responsible for immediate encoding and not using any cache. "-noskip" makes sure that no frame is dropped during capturing.
-mc 0 makes sure that the sound does not go out of sync. "-nocache" is responsible for immediate encoding and not using any cache.
-aspect 4/3 sets the avi's aspect ratio so you can see it in fullscreen and have no borders to the left and right. "-mc 0" makes sure that the sound does not go out of sync.
NESVSETTINGS takes care of proper recognition of the audio and video data from FCEUX. "-aspect 4/3" sets the avi's aspect ratio so you can see it in fullscreen and have no borders to the left and right.
&> mencoder.log lets mencoder's output log into a file called mencoder.log in your current working directory. "NESVSETTINGS" takes care of proper recognition of the audio and video data from FCEUX.
--playmov reads which movie file we want to load (here it's mymovie.fm2) and which ROM to use for it (myROM.ns). "&> mencoder.log" lets mencoders log its output into a file called "mencoder.log" in your current working directory.
"--playmov" reads which movie file we want to load (here it's mymovie.fm2).
Lastly, we load our desired ROM (in this case it's "myROM.nes").
To go for faster encoding and thus less quality, change "-ovc x264 -x264encopts qp=0" to "-ovc xvid -xvidencopts bitrate=200" and "-oac pcm" to "-oac mp3lame -lameopts mode=3:preset=60" to create a 200 kbps xvid video with 60 kbps of mono mp3 audio. To go for faster encoding and thus less quality, change "-ovc x264 -x264encopts qp=0" to "-ovc xvid -xvidencopts bitrate=200" and "-oac pcm" to "-oac mp3lame -lameopts mode=3:preset=60" to create a 200 kbps xvid video with 60 kbps of mono mp3 audio.
One last reminder: setting all these options for FCEUX of course changes the settings you've set before (like sound quality or whether or not to scale the video image). So be sure to backup your config file first (you'll find it in ~/.fceux/) if you don't want set it all up again after encoding.
One last reminder: setting all these options for FCEUX of course changes the settings you've set before (like sound quality or whether or not to scale the video image). So be sure to backup your config file first (in ~/.fceux/) if you don't want set it all up again after encoding. Good luck! :)

View File

@ -188,6 +188,7 @@ InitConfig()
#ifdef CREATE_AVI #ifdef CREATE_AVI
config->addOption("videolog", "SDL.VideoLog", ""); config->addOption("videolog", "SDL.VideoLog", "");
config->addOption("mute", "SDL.MuteCapture", 0);
#endif #endif
config->addOption("fcmconvert", "SDL.FCMConvert", ""); config->addOption("fcmconvert", "SDL.FCMConvert", "");

View File

@ -57,6 +57,9 @@ int eoptions=0;
static void DriverKill(void); static void DriverKill(void);
static int DriverInitialize(FCEUGI *gi); static int DriverInitialize(FCEUGI *gi);
int gametype = 0; int gametype = 0;
#ifdef CREATE_AVI
int mutecapture;
#endif
char *DriverUsage="\ char *DriverUsage="\
--pal {0|1} Uses PAL timing.\n\ --pal {0|1} Uses PAL timing.\n\
@ -124,6 +127,7 @@ static void ShowUsage(char *prog)
#endif #endif
#ifdef CREATE_AVI #ifdef CREATE_AVI
puts ("--videolog c Calls mencoder to grab the video and audio streams to\n encode them. Check the documentation for more on this."); puts ("--videolog c Calls mencoder to grab the video and audio streams to\n encode them. Check the documentation for more on this.");
puts ("--mute {0|1} Mutes FCEUX while still passing the audio stream to\n mencoder.");
#endif #endif
puts(""); puts("");
} }
@ -312,6 +316,7 @@ FCEUD_Update(uint8 *XBuf,
if(inited & 1) if(inited & 1)
{ {
if(Count > GetWriteSound()) Count = GetWriteSound(); if(Count > GetWriteSound()) Count = GetWriteSound();
if (!mutecapture)
if(Count > 0 && Buffer) WriteSound(Buffer,Count); if(Count > 0 && Buffer) WriteSound(Buffer,Count);
} }
if(inited & 2) if(inited & 2)
@ -337,6 +342,9 @@ FCEUD_Update(uint8 *XBuf,
if(can > Count) can=Count; if(can > Count) can=Count;
else uflow=0; else uflow=0;
#ifdef CREATE_AVI
if (!mutecapture)
#endif
WriteSound(Buffer,can); WriteSound(Buffer,can);
//if(uflow) puts("Underflow"); //if(uflow) puts("Underflow");
@ -351,9 +359,15 @@ FCEUD_Update(uint8 *XBuf,
if(NoWaiting) { if(NoWaiting) {
can=GetWriteSound(); can=GetWriteSound();
if(Count>can) Count=can; if(Count>can) Count=can;
#ifdef CREATE_AVI
if (!mutecapture)
#endif
WriteSound(Buffer,Count); WriteSound(Buffer,Count);
} else { } else {
while(Count>0) { while(Count>0) {
#ifdef CREATE_AVI
if (!mutecapture)
#endif
WriteSound(Buffer,(Count<ocount) ? Count : ocount); WriteSound(Buffer,(Count<ocount) ? Count : ocount);
Count -= ocount; Count -= ocount;
} }
@ -364,6 +378,9 @@ FCEUD_Update(uint8 *XBuf,
if(Count > tmpcan) Count=tmpcan; if(Count > tmpcan) Count=tmpcan;
while(tmpcan > 0) { while(tmpcan > 0) {
// printf("Overwrite: %d\n", (Count <= tmpcan)?Count : tmpcan); // printf("Overwrite: %d\n", (Count <= tmpcan)?Count : tmpcan);
#ifdef CREATE_AVI
if (!mutecapture)
#endif
WriteSound(Buffer, (Count <= tmpcan)?Count : tmpcan); WriteSound(Buffer, (Count <= tmpcan)?Count : tmpcan);
tmpcan -= Count; tmpcan -= Count;
} }
@ -556,6 +573,9 @@ SDL_GL_LoadLibrary(0);
{ {
NESVideoSetVideoCmd(s.c_str()); NESVideoSetVideoCmd(s.c_str());
LoggingEnabled = 1; LoggingEnabled = 1;
g_config->getOption("SDL.MuteCapture", &mutecapture);
} else {
mutecapture = 0;
} }
#endif #endif