Emulator Resources / Making AVI / Dega / Linux

This page is part of the Emulator resources / Making AVI page collection. Back to:
<< Emulator Resources / Making AVI / Dega
<< Emulator Resources / Making AVI
<< Emulator Resources

This page explains how to take a MMV file and convert it to a TASvideos.org quality AVI file suitable for publicaton.

This was written by me, Bisqwit, and explains my method. There are certainly many ways to accomplish the same outcome.

Common instructions

Acquiring and compiling Dega

  1. Download Dega source code. (Direct link: http://www.doc.ic.ac.uk/~pcc03/dega/downloads/dega-1.14.tar.gz)
  2. Extract source code in a directory of your choice.
    • Such as $HOME/nes/dega.
  3. Patch the source code:
  4. Compile dega. (make P=unix)
    • If it complains of missing dependencies (such as libraries that were not found), fulfill those dependencies and try again. I know it requires libgd2, for instance.

Note: Dega only works on 32-bit platforms. If you need to run it on a 64-bit platform, you will need to compile it on a 32-bit platform, and copy all the 32-bit libraries on which it depends, to the 64-bit host.

Using this version of Dega

  1. Copy the Dega binary to the directory where you want to use Dega. Such as $HOME/nes/dega.
  2. Create the script for running Dega for the initial encoding pass. Example below.

   #!/bin/sh
   #
   EXE=~/nes/dega/dega
   #
   # Which file do you want to place your audio and video in.
   VIDEO_RESULT="`pwd`/test0.avi"
   #
   #
   VIDEO="-ovc x264 -x264encopts crf=0:me=dia:turbo=2:frameref=4"
   AUDIO="-oac mp3lame -lameopts mode=3:preset=60:aq=1"
   VIDEO="$VIDEO -vf decimate=10:0:0:1 -nocache"
   VIDEO="mencoder \
         - -o '$VIDEO_RESULT' \
         -mc 0 -aspect 4/3 \
         NESVSETTINGS \
         $VIDEO \
         $AUDIO \
         &> mencoder.log"
   #
   rm -f s.log
   $EXE $* -r --videolog "$VIDEO"
Call this script as RUN. Needless to say, you only need to create it once.

To create the initial encoding of the movie, simply execute this script like this:

   ./RUN --autodemo moviefile.mmv romfile.sms
The emulator will execute and produce a test0.avi file. You can stop the emulator at the time of your choosing by hitting ESC; this terminates the recording. The emulator window does not need to be "on top"; task switching is ok.

For the the instructions of what to do after the initial encoding, read the common Linux-specific instructions.

Encoding logo

This version of the Dega patch uses the nesvideos-piece mechanism for embedding the logo animation into the movie. It works by reading a sequence of PNG files from a predetermined location and overlaying them with the movie image.

For Dega recordings, which are of 256x192 resolution, it accesses the files from: /home/bisqwit/povray/nesvlogov5/logo_256_192_fXXX.png, where XXX is the frame number. The path /home/bisqwit/povray/nesvlogov5/ is hardcoded within the program. To change it, simply edit nesvideos-piece.cc, find the setting, change it and recompile Dega.

The logo timing is determined by the following settings in nesvideos-piece.cc

   #define LOGO_LENGTH_OVERLAP (6.3-LOGO_LENGTH_HEADER)
   #define LOGO_LENGTH_HEADER (1.0)
This instructs the emulator that the total length of the logo animation is up to 6.3 seconds, and that the first 1.0 seconds of it will be displayed before the Dega movie even loads. The rest of it will be overlayed with the Dega movie.

Get Firefox!EmulatorResources/MakingAVI/Dega/Linux last edited by Bisqwit on 2008-02-20 14:46:05
Page info and history | Latest diff | List referrers