Difference between revisions of "Gens Re-Recording"

From Sega Retro

m
m (Hivebrain moved page Gens Rerecording to Gens Re-Recording)
 
(30 intermediate revisions by 16 users not shown)
Line 1: Line 1:
 +
{{EmuBob
 +
| bobscreen=GensRerecording11a.png
 +
| system=[[Sega Mega Drive]], [[Mega-CD]], [[32X]]
 +
| os=Windows, Linux
 +
| developer=Stéphane Dallongeville (Gens); Jyzero, Nitsuja, Upthorn
 +
| language=Assembly, C++
 +
| date=2013-10-20{{ref|https://web.archive.org/web/20161231015044/https://code.google.com/archive/p/gens-rerecording/downloads}}
 +
| version=11c SVN prerelease
 +
}}
 +
'''{{PAGENAME}}''', formerly known as '''Gens Movie Test''', is a modified version of the [[Sega Mega Drive]] emulator [[Gens]] by Stéphane Dallongeville. It was developed by Jyzero, Nitsuja, and Upthorn and is based upon the Gens version 2.12 source code. The modification includes slowdown, recording and playback of controller input logs, dumping of AVI files, and Lua scripting. This emulator is primarily used by the [http://www.tasvideos.org/ TASVideos] community.
  
'''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, and dumping of AVI files. This emulator is primarily used by the [http://bisqwit.iki.fi/nesvideos/ Nesvideos] community.
+
==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 - 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===
== Creating DVD-compliant video from emulator output ==
+
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:
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.
 
 
 
=== 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:
 
  
 
*'''Graphic''' -> '''Sync AVI with movie'''
 
*'''Graphic''' -> '''Sync AVI with movie'''
Line 14: Line 21:
 
*'''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 recommended)
  
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 recommended, 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 32: Line 39:
 
  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 i
+
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.
n TMPGEnc, which you'll encode to AC3 later.
 
  
 
'''Video''' tab:
 
'''Video''' tab:
Line 72: Line 78:
 
*'''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===
 
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.
 
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.
  
Line 82: Line 88:
 
*'''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===
 +
This is the part where it really doesn't matter so much what DVD authoring tool you use, '''TMPGEnc DVD Author''' is recommended but as long as it accepts m2v and ac3 input then it's good to go, and menus can be set up as desired.
 +
 
 +
==Downloads==
 +
{{Download|version=11c SVN prerelease|file=GensRR v11c svn.7z}}
 +
 
 +
===Old Versions===
 +
* {{file|GensRerecording old versions.7z|Versions 9c, 9f, 9j, 9z, 9.5b, 9.5c, 10, 10a, 11, 11a, 11b, 11svn296, 11c, plus versions 10, 11 source code.}}
 +
** Versions Test9, Test9a, Test9b, 9d, 9e, 9g, 9h, 9i, 9.5 are missing.
 +
 
 +
==External links==
 +
* [https://github.com/TASVideos/gens-rerecording {{PAGENAME}} on GitHub]
 +
* [http://tasvideos.org/EmulatorResources/Gens.html {{PAGENAME}} on TASVideos.org]
 +
* [https://code.google.com/archive/p/gens-rerecording/ {{PAGENAME}} on Google Code]
  
=== Authoring the DVD ===
+
==References==
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.
+
<references/>

Latest revision as of 15:47, 11 August 2017

Video game console emulator

GensRerecording11a.png
Gens Re-Recording
System(s): Sega Mega Drive, Mega-CD, 32X
OS: Windows, Linux
Developer: Stéphane Dallongeville (Gens); Jyzero, Nitsuja, Upthorn
Programmed in: Assembly, C++
Last release date: (11 years ago)
Last version: 11c SVN prerelease

Gens Re-Recording, formerly known as Gens Movie Test, is a modified version of the Sega Mega Drive emulator Gens by Stéphane Dallongeville. It was developed by Jyzero, Nitsuja, and Upthorn and is based upon the Gens version 2.12 source code. The modification includes slowdown, recording and playback of controller input logs, dumping of AVI files, and Lua scripting. This emulator is primarily used by the TASVideos community.

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 recommended)

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 recommended, 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 recommended but as long as it accepts m2v and ac3 input then it's good to go, and menus can be set up as desired.

Downloads

Download.svg Download Gens Re-Recording
File: GensRR v11c svn.7z (905 kB) (info)
Current version: 11c SVN prerelease

Old Versions

External links

References