smozoma

GENS: How To Make Game Movies (avi)

36 posts in this topic

How to Make Game Movies

UPDATE: Get the new recording emulator, gens re-recording (Gens11a.zip). The screenshots in this tutorial show an older version (Gens Movie 9.5b), but they are similar.

This tutorial teaches you how to record a game played online and turn it into an AVI movie file. You can then upload the AVI file to YouTube if you want. How to add voice commentary may some day be covered.

I've broken it down into a few sections:

  1. Download and Install Necessary Programs
  2. Record a Game to a KREC File
  3. Convert the KREC File to a GMV File
  4. Convert the GMV file to an AVI Movie
  5. Fix the Audio Sync Problem
  6. Edit the Movie
  7. Add Instant Replays
  8. Record Commentary to WAV File
  9. Add Commentary to the Video
  10. Compress AVI Down to Nice Size (~100MB)
  11. Upload to YouTube

Download and Install Necessary Programs

In this section, you download and install a version of Gens that can record to AVI, a couple video codecs, and a simple free video editor.

  1. Get Gens Re-recording from http://code.google.com/p/gens-rerecording/downloads/list (Gens11a.zip)

    1. You can get an older version of this, called "Gens Movie", attached at the end of this post, but you might as well get the above version.
    2. [*]Unzip to a location of your choice.

      [*]You need to copy the kaillera DLL into the movie emulator's directory. Download it here:

      kailleraclient.zip


      1. gensmovie95directory.png
        (it'll be called gens_11b.exe now)

      [*]Get and install the Lagarith video codec.

      1. http://lags.leetcode.net/codec.html

      [*]Get and install the x264 codec.

      1. http://sourceforge.net/project/showfiles.php?group_id=213809
      2. Above the table, it'll say, "Looking for the latest version? Download x264vfw_(blahblahblah)". Click that! (If your operating system is 64-bit, you could click "x264vfw64", and download the 64-bit version instead. It'll run faster)
      3. Install

      [*]Get VirtualDub

      1. http://virtualdub.sourceforge.net/
      2. Download the Release Build (you'll be redirected, then the file should start downloading)
      3. Unzip to a location of your choice.

      [*]LAME MP3 Encoder

      1. Follow the instructions here: http://users.tpg.com.au/mtam/install_lame.htm
      2. Don't worry about the last step about verifying the codec. It probably installed fine.

      Record a Game to a KREC File

      This section tells you how to record a game to a KREC file so that it can later be played back and converted into a movie.

      This assumes you're using Gens or Gens-netplay and are familiar with how to use the p2p Kaillera. To familiarize yourself with the p2p Kaillera see this thread: http://nhl94.com/forum/index.php?showtopic=4442

      Onwards!

      1. You need the p2p Kaillera installed, though you can still record games playing on a server. Get it from the "Download and Install Necessary Programs" section of this guide, above. Put it in with the emulator .exe file:

          [*]Find someone to play against!

          [*]Load up Gens and start Netplay.

          [*]Start up a game, and remember to put a checkmark next to "Record Game"

          1. recordgamehostp2p.png
          2. recordgameclient-server.png

          [*]Play your game, then shut down Gens as usual when the game is done.

          The game is recorded into a .krec file. The file might be in one of two places (it is inconsistent -- one game might be in the first place, the next might be in the other!).

          They will be in a directory called "records" that is either in the directory the ROM is in or the emulator's directory.

          wherethegameissavedto.png

          My ROMs are in "G:\Games\Emulators\Sega\Games\nhl94" and my emulator is in "G:\Games\Emulators\Sega\gens214", so the saves will be in a folder called "records" in either of those directories. Usually it's under the ROMs directory, but sometimes it's under the emulator directory.

          The file will be named something like 47916BE3_gdlseason3.krec. That hexadecimal number (47916BE3) at the start of the filename represents the number of seconds passed since midnight January 1st, 1970, so the most recently-recorded game will appear at the end of the list of files.

          You can rename the files and they will still work, as long as you keep the .krec extension.

          The KREC file is not a video file. It is basically just a recording of the controller button presses that were sent to Gens by you and your opponent while you were playing. You can't play it in a media player.

          Convert the KREC File to a GMV File

          We have to do a non-intuitive step here.

          Gens Re-Recording can't convert the KREC file (created by Kaillera) directly into an AVI, so we need to first convert the KREC file into a GMV file. To do this, we replay the game from the KREC file, and get Gens ReRecording to record the game to a GMV file. Later, we'll turn the GMV into an AVI movie file.

          1. Run gens_11b.exe
          2. Load the ROM you are going to use (so it knows where to look for the ROM and recorded files later).
          3. Start Netplay from the File menu (if Netplay isn't there, you need to put the Kaillera.dll file in the same directory as gens_11b.exe)
          4. Change the mode to "3. Playback" (instead of "1. P2P" or "2. Client").
            • netplayplayback.png

          [*]Select one of the videos, and click "Play." The recording will start playing.

          [*]Click on the screen, and press the Escape key in order to pause the playback.

          [*]Go to Tools->Movie->"Record New Movie"

          1. recordnewmovie.png
          2. Name the Movie File as you see fit (important if you're going to keep more than one GMV file).

              [*]IMPORTANT: Put a checkmark next to "Record from now and make a savestate"

              [*]Click OK.

              [*]You will be asked to save a GST (state) file. Set the name appropriately (important if you are going to keep more than one GMV file) and click Save (or "OK" or whatever it says).

              [*]Unpause the game by pressing escape.

              The game will start playing back from the KREC file!

              1. Once the game is done, hit ESC again to pause.
              2. Go to Tools->Movie->"Stop Movie"
              3. Go to File->Close ROM
              4. Close the Kaillera/Netplay windows.

              In the Gens ReRecording folder, you should have your .gmv and .gst files.

              Convert the GMV file to an AVI Movie

              In this section, we use Gens ReRecording to convert the GMV game file to a lossless "perfect copy" AVI file. The AVI file will be really big (about 50 MB per minute or 500-600 MB for a 11-minute game), but later on, we'll edit out the boring bits and compress it down to a reasonable size.

              1. Load the ROM in Gens ReRecording.
              2. IMPORTANT: Go to Sound->Rate->44100. If you are not at 44100, your audio and video will not be in synch.
              3. Go to Tools->Movie->"Play Movie/Resume record from savestate"
              4. Use the "..." buttons to select the .gmv and .gst files you created previously. Ignore the "inconsistent" warning.
              5. Click "Play Movie" to start playing the movie.
              6. If nothing is happening, then maybe the emulator is paused... Hit the ESC key to unpause it!
              7. Ensure Tools->AVI Options->"Add Sound to AVI" so it has a checkmark.
              8. Go to Tools->AVI Options->"Start AVI Dump"

                1. startAVIdump.png
                2. You'll be asked to enter an AVI file name.
                3. You'll be shown a "Video Compression" window that allows you to select a video codec.

                    [*]You can make it record as fast as it can by going to Graphics-> Frame Skip->0. On my computer (P4 2.8GHz from 2006), it takes about 5 minutes to record a 10-minute video.

                    [*]When the game is over, go to Tools->AVI Options->"Stop AVI Dump"

                    As just said, don't worry if the video is slow or fast or if the audio is choppy. The video will turn out to be the expected 60 frames per second with clean sound.

                    Fix the Audio Sync Problem

                    If your audio is out of sync (this happens if you record to AVI when your Sound->Rate is set to 22050 instead of 44100), there are are 2 ways to fix this: 1) change the video frame rate 2) stretch the audio.

                    I'll just explain how to fix the video frame rate, since it's easier.

                    Use VirtualDub to change the framerate:

                    1. Go to Video->Frame rate...
                    2. Look at the value at the end of the 3rd option, "Change so video and audio durations match (59.9xx)"
                    3. Write that number value into the 2nd option, "Change to _____ frames per second." You might ask: Why not just use the 3rd option? The answer is: because if you use the third option and then you try to insert highlight clips, you'll have a hard time getting the frame rates to match because the 3rd option uses more decimal places than it shows.
                    4. Enable Video->Direct stream copy
                    5. save

                    If you want to insert highlight clips, then also change their framerates to the same value you used for this video. Because your highlight clips are going to be short, it doesn't matter if their own audio/video sync is perfect – you need the clips to all have the same frame rate.

                    (I haven't tried it this way yet, but I think it should work…)

                    Edit the Movie

                    [not done]

                    Convert to 30 frames-per-second, 640x480

                    Open your video with VirtualDub.exe.

                    If you have multiple parts, you can use File->Append AVI Segment to add other files to the end of the video. It'll try to load multiple files if they're numbered consecutively.

                    1. Gens ReRecording records in 60 frames-per-second, so to bring it down to 30fps by eliminating every other frame, go Video->Frame Rate->"Process every other frame (decimate by 2)"
                    2. We want to resize the video to 640x480.
                      • Video->Filters->Add...->resize.
                      • Aspect ratio: Disabled
                      • New size: Absolute, 640 x 480
                      • Filter mode: Lanczos3.

                    [*]Next, we want to crop a bit of the video so it looks better. Click on the "resize" filter you just added to the list, and then click the "Cropping..." button. X1 offset: 16. X2 offset: 16. Leave the others at 0. Click OK.

                    [*]Set the compression to Lagarith: Video->Compression..., find Lagarith lossless codec in the list and click OK.

                    [*]Save as a new file: File->Save as AVI.... I usually call it something like "game1.30fps.avi". Since we increased the resolution, the file will be about 1.7GB!

                    Cut out boring sections

                    Now, if there are boring parts you want to delete (long pause when your cat knocked your drink over?), here's how:

                    • Open the file you just saved (or do this before saving it)
                    • Search to the end of the segment you want to delete. Then, press the right arrow key to go one frame extra.
                    • Press the "End" key to mark this as the "after the last frame to delete" frame. This frame will still be in the video, but not the rest that you mark to delete.
                    • Search to the start of the segment you want to delete.
                    • Press the "Home" key to mark this as the first frame to delete.
                    • Press "Delete"
                    • If you are editing a file you already saved to 640x480:
                      • Select Video->Direct stream copy to avoid doing the compression over again.
                      • Go into Video->Frame Rate and make sure it's set to "Process all frames" so you don't end up with 15fps!

                    Save to a new file.

                    IMPORTANT: You should only do this kind of editing with Lagarith-compressed video. If you try later to edit x264-compressed video, you'll have problems because you can only cut starting on "key frames."

                    Add Instant Replays

                    [not done]

                    When replaying the games from GMV, you can use the F5, F6, and F7 keys (Quick Save, Next Save Slot, Previous Save Slot) to save up to 10 instant replays. You can later load those saves, and then record yourself controlling the instant replays directly to AVI. Then, you can insert those AVI clips into your video (Note: you can only join video clips using the same compressor (i.e. Lagarith).

                    Record Commentary to WAV File

                    [not done]

                    This is where you get a microphone and record youself doing the commentary for the game. Later on, the commentary can be mixed in with the audio of the video, so you get the sirens, etc.

                    Add Commentary to the Video

                    [not done]

                    Export audio from the movie using VirtualDub (to WAV file).

                    Use an audio tool to combine the WAV files.

                    Compress AVI Down to Nice Size (~100MB)

                    [not done]

                    Uploading a 500+MB file to YouTube could be problematic, so here we use the x264 codec to shrink the movie down. (Plus, I doubt YouTube supports Lagarith).

                    x264 looks way, way better than DivX or XviD when compressing NHL94.

                    1. Open the video in VirtualDub.
                    2. Video->Compression...
                    3. Click on x264vfw - H.264/MPEG-4 AVC codec, then click the Configure button
                    4. There are a couple options you need to use for VirtualDub:

                        [*]Select Single pass - bitrate-based (ABR) in the dropdown and set Average bitrate (kbit/s) to 1280 if you want the video to be about 100MB for 10 minutes, or 2560 if you want it to be about 200MB.

                        [*]Compress the audio to MP3:

                        1. Audio->Full Processing Mode
                        2. Audio->Compression...
                        3. In the left list, find and click on Lame MP3.
                        4. In the right list, find and click on 44100 Hz, 128 kbps CBR, Stereo.
                        5. OK.

                        [*]Save as a new file.

                        Upload to YouTube

                        [not done]

                        Gens_9.5b.zip

                        kailleraclient.zip


                    5. Zero Latency: checked (in the Basic area)
                    6. VirtualDub Hack: checked (in the output area)

                4. Find "Lagarith lossless codec" in the Compressor list.
                5. Click OK to start recording the video! Don't be alarmed if the video is slow or the audio is choppy, the AVI file will turn out fine!

            1. I don't bother, but maybe you could save it in the format "GDL3 - DAL 4 @ QUE 3 OT (2008-01-15).gmv"

        1. kaillerainemulatordirectory.png

    Share this post


    Link to post
    Share on other sites

    Don't worry Tick, we're not going to lose this. Smoz, this post wins the hard work and dedication award for 2008 so far.

    Nice work man. I'd like to get this and some other tutorials linked up on the website eventually.

    -Evan

    Share this post


    Link to post
    Share on other sites

    Wow, awesome smozoma. I've always lost a lot of quality compressing videos - have to try this. Hopefully guys will submit more videos from league games now.

    Share this post


    Link to post
    Share on other sites

    Hey Smozoma,

    Did you get around to adding to this how-to in another thread or is this your 'official' how-to thread? I only ask because I see you have a few sections marked as [not done]. Just curious since I'd like to have this more prominent on the website because it's extremely useful.

    Thanks,

    -Evan

    Share this post


    Link to post
    Share on other sites
    Hey Smozoma,

    Did you get around to adding to this how-to in another thread or is this your 'official' how-to thread? I only ask because I see you have a few sections marked as [not done]. Just curious since I'd like to have this more prominent on the website because it's extremely useful.

    Thanks,

    -Evan

    My computer died last week, so until I get it up and running again, this is on hold.

    Share this post


    Link to post
    Share on other sites

    I have a problem...

    I have played NHL'94 (with Gens 9.5b) without any problem on my computer - with 2xSAI (Kreed) graphics. But one day I came home and run Gens 9.5b and the graphic was strange.. so I clicked on the Graphic in menu and chose Render and here was no Render ticked and only Normal, Double and EXP was albe to tick. So up to now I can play with Normal, Double and EXP graphics only.

    I don't know where's the problem. Nothing happened on my computer, classic Gens works OK - any Render is possible to choose on it, but in Gens 9.5b I still can't. I tried everything but it still doesn't work.

    Help me please, where might be the problem??

    Share this post


    Link to post
    Share on other sites
    I have a problem...

    I have played NHL'94 (with Gens 9.5b) without any problem on my computer - with 2xSAI (Kreed) graphics. But one day I came home and run Gens 9.5b and the graphic was strange.. so I clicked on the Graphic in menu and chose Render and here was no Render ticked and only Normal, Double and EXP was albe to tick. So up to now I can play with Normal, Double and EXP graphics only.

    I don't know where's the problem. Nothing happened on my computer, classic Gens works OK - any Render is possible to choose on it, but in Gens 9.5b I still can't. I tried everything but it still doesn't work.

    Help me please, where might be the problem??

    I'm not sure, but

    try deleting the .INI file (i think it's called gens.ini or config.ini).

    (or rename it to gens.ini.bkp)

    Share this post


    Link to post
    Share on other sites

    The problem was that the Gens 9.5b doesn't work ok with 32 bit graphic resolution on my PC, but with 16 bit it works right:)

    Share this post


    Link to post
    Share on other sites

    Hey, smozoma, to continue that conversation we had a while ago (and to inform people reading this), I'd said that my AVIs were playing back upside-down. Well, here's what happened. I made the AVI as you described and the pure AVI straight from MovieGens (with CorePNG compression) is fine. The AVI produced by cropping/editing in VirtualDub and compressed using CorePNG compression plays back upside-down in WMP. If I reopen the AVI in VirtualDub, it looks just fine. I then recompressed the upside-down AVI (the one that looks fine in VirtualDub but not in WMP) with x264 and it looks fine everywhere, so I guess it really is just an intermediate playback problem.

    Share this post


    Link to post
    Share on other sites
    Hey, smozoma, to continue that conversation we had a while ago (and to inform people reading this), I'd said that my AVIs were playing back upside-down. Well, here's what happened. I made the AVI as you described and the pure AVI straight from MovieGens (with CorePNG compression) is fine. The AVI produced by cropping/editing in VirtualDub and compressed using CorePNG compression plays back upside-down in WMP. If I reopen the AVI in VirtualDub, it looks just fine. I then recompressed the upside-down AVI (the one that looks fine in VirtualDub but not in WMP) with x264 and it looks fine everywhere, so I guess it really is just an intermediate playback problem.

    Yeah, it's something weird with corepng. funny bug.

    My comp is still toast, so.. no updates on this thread yet!

    Also, I need to fix that x264 problem you found, where my link goes to a command-line version, not a version that can be used in virtualdub... what did you find that let you use x264 in virtualdub?

    Share this post


    Link to post
    Share on other sites
    Yeah, it's something weird with corepng. funny bug.

    My comp is still toast, so.. no updates on this thread yet!

    Also, I need to fix that x264 problem you found, where my link goes to a command-line version, not a version that can be used in virtualdub... what did you find that let you use x264 in virtualdub?

    x264 Video for Windows on SourceForge is what I downloaded (I think). In any case, it looks like the file available from that SourceForge site should be what it takes to install x264 as a codec for use in VirtualDub.

    I was able to upload my first highlight video to YouTube tonight. Thanks for the guide!

    Share this post


    Link to post
    Share on other sites

    hmm you should mention in the title that this is for gens so i dont bother reading it :rolleyes:

    Share this post


    Link to post
    Share on other sites
    hmm you should mention in the title that this is for gens so i dont bother reading it :rolleyes:

    I adjusted the topic title just for you my friend. Anyway I just started updating the videos section of the site and I put a link their to this thread for how to create videos. Eventually, we'll make it all pretty but it's great for now as we're still kind of learning the process.

    -Evan

    Share this post


    Link to post
    Share on other sites
    hmm you should mention in the title that this is for gens so i dont bother reading it :P

    Whoops :)

    Share this post


    Link to post
    Share on other sites

    wow. great stuff smoz.

    im def. gonna do this now!

    Share this post


    Link to post
    Share on other sites

    I KNEW SMOZOMA2 WAS HIS ALT ACCT

    Share this post


    Link to post
    Share on other sites

    Any updates on how to compress videos and add the commentary? I'm a little stuck

    Share this post


    Link to post
    Share on other sites
    Any updates on how to compress videos and add the commentary? I'm a little stuck

    catch me on AIM some time. I'll try to tailor the guide to the things you need to know.

    Share this post


    Link to post
    Share on other sites

    I changed my lossless codec recommendation from CorePNG to Lagarith.

    Lagarith doesn't make the files quite as small as the old one (about 50% bigger), but it encodes 4 times faster and doesn't have glitches like playing upside-down (or not at all) in windows media player.

    Share this post


    Link to post
    Share on other sites

    update with info about fixing the audio sync problem.

    Share this post


    Link to post
    Share on other sites

    updated with a better fix for the audio problem:

    Set your Sound->Rate to "44100" in the emulator to avoid having the audio and video go out of sync.

    Share this post


    Link to post
    Share on other sites

    I added more information under Edit the Movie and Compress AVI Down to Nice Size (~100MB) .

    I also added an MP3 compressor for virtualdub to the download/install list.

    Share this post


    Link to post
    Share on other sites

    I'm having a problem.

    I recorded 4 games yesterday, but can't play back any of the KREC files. They appear in the Netplay - Playback mode, but when I hit Play they just start the ROM and nothing happens. It just plays the music and cycles through the credits as if the ROM was opened by itself with no playback video.

    Any suggestions?

    Share this post


    Link to post
    Share on other sites

    I think you have to load the rom first, or the list won't work right. It's been a while since I played around with them.

    Share this post


    Link to post
    Share on other sites

    I think you have to load the rom first, or the list won't work right. It's been a while since I played around with them.

    I've tried loading the ROM first, still get the same problem.

    Share this post


    Link to post
    Share on other sites

    I'm having a problem.

    I recorded 4 games yesterday, but can't play back any of the KREC files. They appear in the Netplay - Playback mode, but when I hit Play they just start the ROM and nothing happens. It just plays the music and cycles through the credits as if the ROM was opened by itself with no playback video.

    Any suggestions?

    Nothing comes to mind, sorry. How big are the files?

    I know that if you check Record Game after the game has started (both players already hit 'mark as ready', it doesn't work, but I can't remember if, when you do that, it doesn't make the files at all, or it makes them but they are empty or corrupt or something.

    Share this post


    Link to post
    Share on other sites

    Nothing comes to mind, sorry. How big are the files?

    I know that if you check Record Game after the game has started (both players already hit 'mark as ready', it doesn't work, but I can't remember if, when you do that, it doesn't make the files at all, or it makes them but they are empty or corrupt or something.

    Never mind, I think I figured it out!

    My problem was that I was closing the Netplay window. Although that didn't seem to affect my p2p movies, it did affect the Client movies.

    Edited by da94wookiee

    Share this post


    Link to post
    Share on other sites

    I recorded some 2on2 games, which use 4 controllers. I can replay the .krec games via netplay with no problem and I thought I was converting to .gmv with no problem either. However, when I play back the .gmv to convert to .avi, the game is not the same! I noticed that the .gmv records just two controllers, and it has a checkbox to record a 3rd controller. When I redid it with the 3rd controller checked, it recorded 3 controllers.

    Now...the obvious question, how can I get this to record all 4 controllers?

    I see there are some awesome 2vs2 videos out there, so I'm curious if this was done using the method described in this thread, or with a different capture device (i.e. hypercam, etc)

    Share this post


    Link to post
    Share on other sites

    Is this still the best way to make game movies or, is there an easier way?

    Edited by jackandjose

    Share this post


    Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!


    Register a new account

    Sign in

    Already have an account? Sign in here.


    Sign In Now

    • Who's Online   0 Members, 0 Anonymous, 17 Guests (See full list)

      There are no registered users currently online