Difference between revisions of "Gens Re-Recording"

From Sega Retro

old>Hivebrain
old>MathUser
(more encylopedic.)
Line 3: Line 3:
  
 
== Creating DVD-compliant video from emulator output on Windows ==
 
== Creating DVD-compliant video from emulator output on Windows ==
It is easily possible to create 100% DVD compliant video from the 320x240 Gens Movie Test raw emulator output. This requires [http://www.avisynth.org/ Avisynth], the MPEG-2 encoder of your choice - this editor recommends [http://www.tmpgenc.net/ TMPGEnc] (but you can use any MPEG-2 encoder as long as it properly supports interlaced video) and [http://www.doom9.org/index.html?/ac3machine.htm AC3Machine] (using [http://dspguru.doom9.net/ BeSweet] as it's AC3 encoder). This can also require lots of hard drive space depending on the length of the movie. This guide is primarily concerned with NTSC video, but can be easily modified to generate PAL instead, although I haven't done so myself.
+
It is easily possible to create 100% DVD compliant video from the 320x240 Gens Movie Test raw emulator output. This requires [http://www.avisynth.org/ Avisynth], the MPEG-2 encoder of your choice - a recommendation is [http://www.tmpgenc.net/ TMPGEnc] (but any MPEG-2 encoder can be used as long as it properly supports interlaced video) and [http://www.doom9.org/index.html?/ac3machine.htm AC3Machine] (using [http://dspguru.doom9.net/ BeSweet] as it's AC3 encoder). This can also require lots of hard drive space depending on the length of the movie. NTSC video is dealt with primarily in this guide, but can be easily modified to generate PAL instead, although I haven't done so myself.
  
 
=== Generating the raw AVI ===
 
=== Generating the raw AVI ===
First of all, load Gens Movie Test and load your ROM. Next, press '''ESC''' to pause the emulator. Go to the following menu items and select them:
+
First of all, load Gens Movie Test and load a ROM. Next, press '''ESC''' to pause the emulator. Go to the following menu items and select them:
  
 
*'''Graphic''' -> '''Sync AVI with movie'''
 
*'''Graphic''' -> '''Sync AVI with movie'''
Line 13: Line 13:
 
*'''Graphic''' -> '''Frame Skip''' -> '''0'''
 
*'''Graphic''' -> '''Frame Skip''' -> '''0'''
 
*'''CPU''' -> '''Play Movie/Resume record from savestate'''
 
*'''CPU''' -> '''Play Movie/Resume record from savestate'''
*(optional) '''Option''' -> '''Misc...''' enable '''Show frame counter''', '''Show input''', and choose a position (I recommend lower-right)
+
*(optional) '''Option''' -> '''Misc...''' enable '''Show frame counter''', '''Show input''', and choose a position (lower-right is recomended)
  
In the dialog that appears, browse to find the GMV file that you wish to use as your source, and ensure that '''Play from start''' is selected. Press OK. Whenever you're ready to begin dumping the AVI, press '''ESC''' once more, and choose a lossless codec (I use the Camstudio Lossless Codec in GZIP compression at level 9, but a codec like [http://neuron2.net/www.math.berkeley.edu/benrg/huffyuv.html Huffyuv] will work just as well). When the movie is finished playing back, select '''Graphic''' -> '''Stop AVI Dump''' and exit the emulator.
+
In the dialog that appears, browse to find the GMV file that is desired to be used as the source, and ensure that '''Play from start''' is selected. Press OK. Whenever ready to begin dumping the AVI, press '''ESC''' once more, and choose a lossless codec (Camstudio Lossless Codec in GZIP compression at level 9 is recomended, but a codec like [http://neuron2.net/www.math.berkeley.edu/benrg/huffyuv.html Huffyuv] will work just as well). When the movie is finished playing back, select '''Graphic''' -> '''Stop AVI Dump''' and exit the emulator.
  
 
=== Conforming the raw AVI to NTSC DVD specs ===
 
=== Conforming the raw AVI to NTSC DVD specs ===
At this point you will likely have multiple AVIs that are around 1GB apiece. Use the following script (place it in the same folder as your raw AVIs and give it the same name but with an AVS extension):
+
At this point there will likely have multiple AVIs that are around 1GB apiece. Use the following script (place it in the same folder as your raw AVIs and give it the same name but with an AVS extension):
  
 
  AVISource("gens.avi")+AVISource("gensA.avi")+AVISource("gensB.avi") # make sure you put all your AVIs here in order
 
  AVISource("gens.avi")+AVISource("gensA.avi")+AVISource("gensB.avi") # make sure you put all your AVIs here in order
Line 31: Line 31:
 
  ResampleAudio(48000) # fix the audio sample rate from the framerate modification
 
  ResampleAudio(48000) # fix the audio sample rate from the framerate modification
  
To visually inspect the output of this script, you can use [http://virtualdubmod.sourceforge.net/ VirtualDubMod], although you won't have to render video with it if you are using TMPGEnc to encode your video. You should see video that is 720x480, that exhibits 'mice teeth', and depending on which resize method you used, video that looks slightly soft in the horizontal direction.
+
To visually inspect the output of this script, [http://virtualdubmod.sourceforge.net/ VirtualDubMod] can be used, although video won't have to be rendered with it if TMPGEnc is being used to encode the video. The video should be seen to be in a 720x480 aspect ratio, that exhibits 'mice teeth', and depending on which resize method you used, video that looks slightly soft in the horizontal direction.
  
 
=== Encoding to MPEG-2 with TMPGEnc ===
 
=== Encoding to MPEG-2 with TMPGEnc ===
This guide assumes you are using TMPGEnc, which can directly accept AVS files for input. If you are using an MPEG-2 encoder that does not, then you will have to use VirtualDubMod to render the AVS script to another AVI file, which should also be lossless. The general settings for the MPEG-2 encoding should be applicable to other encoders, however. In TMPGEnc, I recommend '''not''' using the wizard mode, and instead, finetuning the encoding parameters yourself. First of all, in assuming you want the best quality, I recommend using a Constant Bit Rate of 8000kbps for the video, unless the video is longer than an hour or so. You'll be using LPCM in TMPGEnc, which you'll encode to AC3 later.
+
This guide assumes that TMPGEnc is being used, which can directly accept AVS files for input. If using a MPEG-2 encoder that does not, then VirtualDubMod will have to be used to render the AVS script to another AVI file, which should also be lossless. The general settings for the MPEG-2 encoding should be applicable to other encoders, however. In TMPGEnc, it is recommended to '''not''' use the wizard mode, and instead, finetune the encoding parameters yourself. First of all, in assuming the best quality is desired, use Constant Bit Rate of 8000kbps for the video, unless the video is longer than an hour or so. You'll be using LPCM in TMPGEnc, which will be encoded to AC3 later.
  
 
'''Video''' tab:
 
'''Video''' tab:
Line 70: Line 70:
 
*'''Channel mode''' -> '''Stereo'''
 
*'''Channel mode''' -> '''Stereo'''
  
Press OK. Go to '''Output file name''', press '''Browse''', and choose a filename for your encoded output (it will automatically generate both .m2v and .wav files with that name). Press '''Start''' at the top and go out for a meal, because it will take a good while to encode.
+
Press OK. Go to '''Output file name''', press '''Browse''', and choose a filename for the encoded output (it will automatically generate both .m2v and .wav files with that name). Press '''Start''' at the top and go out for a meal, because it will take a good while to encode.
  
 
=== Encoding the audio to AC3 ===
 
=== Encoding the audio to AC3 ===
Line 80: Line 80:
 
*'''Bitrate''' -> '''448'''
 
*'''Bitrate''' -> '''448'''
  
Now press '''Give me AC3!''' and wait a little bit (this will take far less than the video encoding did). Once it's done, you should have both an .m2v and .ac3 file.
+
Now press '''Give me AC3!''' and wait a little bit (this will take far less than the video encoding did). Once it's done, there should be both an .m2v and .ac3 file.
  
 
=== Authoring the DVD ===
 
=== Authoring the DVD ===
This is the part where it really doesn't matter so much what DVD authoring tool you use, I use '''TMPGEnc DVD Author''' but as long as it accepts  m2v and ac3 input then you're good to go, and you can set up menus as you like. Since all DVD authoring tools are different, I won't even get into describing how to do it, but at this point, if you've authored other DVDs before, then you just do the same thing that you'd be used to doing.
+
This is the part where it really doesn't matter so much what DVD authoring tool you use, '''TMPGEnc DVD Author''' is reccomended but as long as it accepts  m2v and ac3 input then it's good to go, and me nus can be set up as desired.
  
 
== Downloads ==
 
== Downloads ==

Revision as of 15:34, 26 September 2009

GensRerecording11a.png

Gens Rerecording, formerly known as Gens Movie Test, is a modification of the highly popular Gens emulator by Stéphane Dallongeville (also known as Stef). This modification includes slowdown, recording and playback of controller input logs, dumping of AVI files, and Lua scripting. This emulator is primarily used by the Nesvideos community, and was created and modified by Jyzero, Nitsuja, and Upthorn.

Creating DVD-compliant video from emulator output on Windows

It is easily possible to create 100% DVD compliant video from the 320x240 Gens Movie Test raw emulator output. This requires Avisynth, the MPEG-2 encoder of your choice - a recommendation is TMPGEnc (but any MPEG-2 encoder can be used as long as it properly supports interlaced video) and AC3Machine (using BeSweet as it's AC3 encoder). This can also require lots of hard drive space depending on the length of the movie. NTSC video is dealt with primarily in this guide, but can be easily modified to generate PAL instead, although I haven't done so myself.

Generating the raw AVI

First of all, load Gens Movie Test and load a ROM. Next, press ESC to pause the emulator. Go to the following menu items and select them:

  • Graphic -> Sync AVI with movie
  • Graphic -> Add sound to AVI
  • Graphic -> Start AVI Dump
  • Graphic -> Frame Skip -> 0
  • CPU -> Play Movie/Resume record from savestate
  • (optional) Option -> Misc... enable Show frame counter, Show input, and choose a position (lower-right is recomended)

In the dialog that appears, browse to find the GMV file that is desired to be used as the source, and ensure that Play from start is selected. Press OK. Whenever ready to begin dumping the AVI, press ESC once more, and choose a lossless codec (Camstudio Lossless Codec in GZIP compression at level 9 is recomended, but a codec like Huffyuv will work just as well). When the movie is finished playing back, select Graphic -> Stop AVI Dump and exit the emulator.

Conforming the raw AVI to NTSC DVD specs

At this point there will likely have multiple AVIs that are around 1GB apiece. Use the following script (place it in the same folder as your raw AVIs and give it the same name but with an AVS extension):

AVISource("gens.avi")+AVISource("gensA.avi")+AVISource("gensB.avi") # make sure you put all your AVIs here in order
AssumeBFF()
AssumeFieldBased()
Crop(1,0,0,0) # remove garbage pixel on left
#PointResize(638,240) # this is for 'perfect' video
BilinearResize(638,240) # this is for video that looks closer to a real RGB output
AddBorders(42,0,40,0) # pad to 720x240
Weave() # weave fields into 720x480 frames
AssumeFPS(29.97,true) # adjust framerate from 30fps to 29.97fps for NTSC
ResampleAudio(48000) # fix the audio sample rate from the framerate modification

To visually inspect the output of this script, VirtualDubMod can be used, although video won't have to be rendered with it if TMPGEnc is being used to encode the video. The video should be seen to be in a 720x480 aspect ratio, that exhibits 'mice teeth', and depending on which resize method you used, video that looks slightly soft in the horizontal direction.

Encoding to MPEG-2 with TMPGEnc

This guide assumes that TMPGEnc is being used, which can directly accept AVS files for input. If using a MPEG-2 encoder that does not, then VirtualDubMod will have to be used to render the AVS script to another AVI file, which should also be lossless. The general settings for the MPEG-2 encoding should be applicable to other encoders, however. In TMPGEnc, it is recommended to not use the wizard mode, and instead, finetune the encoding parameters yourself. First of all, in assuming the best quality is desired, use Constant Bit Rate of 8000kbps for the video, unless the video is longer than an hour or so. You'll be using LPCM in TMPGEnc, which will be encoded to AC3 later.

Video tab:

  • File -> New Project
  • Load the AVS with Video source at the bottom of the window
  • Choose ES (Video+Audio)
  • Press Setting
  • Stream type -> MPEG-2 Video
  • Size -> 720x480
  • Aspect Ratio -> 4:3 Display
  • Frame Rate -> 29.97 fps
  • Rate control mode -> Constant bitrate (CBR)
  • Bitrate -> 8000 kbits/sec
  • Encode mode -> Interlace
  • DC component precision -> 10 bits
  • Motion search precision -> Motion estimate search (fast)

Advanced tab:

  • Video source type -> Interlace
  • Field order -> Bottom field first (field B)
  • Source aspect ratio -> 4:3 525 line (NTSC)
  • all other options on this tab disabled

GOP Structure tab:

  • Number of I picture in GOP -> 1
  • Number of P picture in GOP -> 17
  • Number of B picture in GOP -> 0
  • Output interval of sequence header -> 1
  • MAX number of frames in a GOP -> 18
  • Detect Scene Change

Audio tab:

  • Stream type -> LPCM
  • Sampling frequency -> 48000 Hz
  • Channel mode -> Stereo

Press OK. Go to Output file name, press Browse, and choose a filename for the encoded output (it will automatically generate both .m2v and .wav files with that name). Press Start at the top and go out for a meal, because it will take a good while to encode.

Encoding the audio to AC3

All players will support both LPCM and AC3 audio, but LPCM is also much larger. Instead, we will be making a 448kbps AC3 file. Load AC3 machine, select your input .wav file and and output .ac3 file.

  • Channels Mode -> stereo
  • Auto Find Maximum Gain
  • Set delay to 0 msecs
  • Bitrate -> 448

Now press Give me AC3! and wait a little bit (this will take far less than the video encoding did). Once it's done, there should be both an .m2v and .ac3 file.

Authoring the DVD

This is the part where it really doesn't matter so much what DVD authoring tool you use, TMPGEnc DVD Author is reccomended but as long as it accepts m2v and ac3 input then it's good to go, and me nus can be set up as desired.

Downloads

Download.svg Download Gens Re-Recording
File: Gens_Movie_Test_v11a.7z‎ ("Gens_Movie_Test_v11a.7z‎" does not exist) (info)
Current version: 11a

Prior Versions