Anri-chan

From SDA Knowledge Base

Jump to: navigation, search

Introduction

If you want to encode game video yourself, you should use Anri, which will handle virtually all of the process for you. Anri-chan is free software licensed under the GPL.

Of course, if you want to learn about what goes on behind the scenes, you can check out the other articles here in the KB, but be warned - video encoding on a level considered acceptable for SDA takes a lot of experience to get right.

Alternatively, you can submit your raw video files to nate for encoding. Let Flip know when you submit your run whether you will be using Anri-chan or sending the raw files to nate.

Development

Source is available at Anri-chan/Source.

Download

Currently, Anri-chan is only for Microsoft Windows 2000/XP/Vista/7. There may be a Mac/other *ix version when nate gets around to it (Avisynth 3.0 is dead). There are currently no plans to support Windows 9X/ME.

How-to

If you're encoding from DVD, you should check out RaneofSOTN's guide. Otherwise, read on.

Installation

Double-click on the .exe file you downloaded. Extract it to your Desktop. Open the resulting folder on your Desktop and double-click the install.bat file. If you are using Vista, you will need to right-click on the install.bat file and choose Run as Administrator.

The rest of the installation process is self-explanatory. Once installation is complete, you will have three Anri-chan icons on your Desktop. The main program is labeled simply "Anri-chan". Double-click this icon to start Anri-chan.

It's safe to delete the anrichan folder on your Desktop once installation is complete.

Getting Started

Project Name

Anri-chan will begin by prompting you for a project name. This name will be used as the basename for your encoded videos (e.g. the high quality video will be called projectname_HQ.mp4, etc.). Avoid using spaces or characters other than letters and numbers in your project name. Also, avoid using single digits (like "1") for the project name ("run1" is okay, but "1" is not).

All files associated with this project will appear in a folder of the same name on your Desktop.

Video Source

If you are encoding from a DVD source, answer the next question with "y". As explained in the Anri-chan window, if you don't want to keep the disc in the drive the whole time you're encoding, you can simply copy the VIDEO_TS folder located on the DVD to the root (lowest) level of a hard drive, e.g. C:\, so that it is now located at C:\VIDEO_TS. Then, when Anri-chan asks for the DVD drive letter, input that hard drive letter (in this case, C) instead. In this way you can "trick" Anri-chan into thinking a hard drive is a DVD drive with a disc inside of it. Otherwise, you will need to have the DVD in the drive the entire time Anri-chan is running.

If you are not encoding from a DVD source, you will be asked for the location of the video file you will be encoding. You will need the appropriate codecs installed on your system to read the video file (Anri-chan doesn't come with any codecs). A good codec pack is the CCCP. When entering the path to the video file, be sure not to use quotation marks, even if there are spaces in the pathname.

The next few questions assume you are encoding from a DVD source. If you are not encoding from a DVD source, skip down to the section titled "Video Properties."

DVD Drive Letter

Enter your DVD drive letter (or hard drive letter if you copied the VIDEO_TS folder to one as per the instructions above). You can find out what letters Windows assigned to your drives by opening My Computer. Make sure that the DVD you want to encode from is in this drive at this time.

Extraction & Indexing

Anri-chan will now explain that it is going to "extract" the DVD files. This step is necessary to ensure proper audio sync. You will need at least as much free space on your main hard disk drive (usually C:) as is on the DVD (this is because Anri-chan is actually copying the DVD contents to your hard drive). Normally, a full DVD (1 hour of recording on XP speed, 2 hours on SP) takes up about 4.3 gigabytes.

After extraction is complete, Anri-chan will explain that it is opening the DGIndex program to index the MPEG-2 video from the DVD. Indexing is necessary to open the video in Avisynth. This step is performed automatically by Anri-chan.

Note that if you are using a rare kind of DVD recorder that encodes the audio to MPA format and doesn't write .IFO files, Anri-chan will have to index the DVD twice. This is normal behavior.

Video Properties

D

Anri-chan will next ask for the D of the game video. D stands for Dimensions and has two possible values, 1 and 4. Which of these two your game is can be found by locating your game in Anri-chan's built-in games database. Note that all Game Boy and Game Boy Advance video played through the Game Boy Player accessory for the GameCube are going to be D4 F1. You will need to enter these values manually, because GB and GBA games are currently not included in Anri-chan's games database.

(If you're curious, Anri-chan's auto-update system downloads a new version of the games database which is made using the DF page here in the KB as a template. More information on D and other game video terms can be found in the Glossary.)

If your game is not listed yet in Anri-chan's games database, you can use the Anri-chan Extract Sample tool on your Desktop to make a small sample video to upload to one of the free video hosting services. Once you've uploaded the sample video, post the link in the DF topic in the Tech Support forum, and one of us will let you know what the D is (as well as add the game to the DF page). Don't forget to tell us the title of the game and the system you're playing it on.

F

Now Anri-chan wants to know the F for your game. F stands for framerate and has three possible values: 1, 2 and 3. F, like D, will also be filled in for you if you use Anri-chan's built-in games database. Again, if your game is not listed, you can use the Extract Sample utility to post a sample video to Tech Support so we can identify F for you. You can find out more about F in the Glossary.

2D/3D

Whether your game is considered "2D", too, can be found using Anri-chan's games database. Though most games that appear 2D are classified as 2D here at SDA, some 2D games are considered 3D, and some 3D games are considered 2D. It's important to look up this answer for every game you encode.

(If you're curious, this value actually has nothing to do with whether the game is 2D or 3D - it actually controls the so-called Framerate Decimation Paradigm, that is, whether lower quality versions of your video will be F2 or F3. The distinction is made by whether there are F1 blinking effects in the game, which are much more common in 2D games than in 3D ones. If a game with such effects is encoded at F2, blinking objects will either disappear or stop blinking entirely. Therefore, lower quality versions of so-called 2D games are encoded at F3 instead of F2 to avoid this problem. Lower quality versions are encoded at less than F1 in the first place to ensure that people with bad video hardware can see the run.)

Scanning

Next Anri-chan wants to know whether your video is progressive or interlaced. If you don't know, it's most likely interlaced (answer "n" to the question). However, if your video is a PC screen capture (made using e.g. FRAPS or Camtasia) and never touched a VCR or DVD recorder, then it may be progressive. If you answer "y" to the Progressive question, Anri-chan will skip over the next six questions automatically (because they are about interlaced video, not progressive).

VHS

If your video was ever on VHS, answer "y" to the VHS question. It doesn't matter that it was copied to a DVD later--if it was originally VHS, then it will need some additional filters applied to it.

Field Dominance

This question is a tough one. You will most likely not know the answer if this is your first time using Anri-chan with your DVD recorder. If you make the wrong choice, then your encoded video will display a rapid jerking effect. This effect is probably best described in numbers: a video normally plays its frames in order, like this: 1, 2, 3, 4. If you make the wrong choice at the Odd Dominant question, then your video will play its frames as follows: 2, 1, 4, 3. This is obviously unacceptable, and you will have to run Anri-chan again, this time answering the other way. However, once you know whether your DVD recorder is odd dominant or not, you should never have to worry about this question again.

If you are recording using a PAL DVD recorder, there is more of a chance your video will be odd dominant than if it were an NTSC DVD recorder. However, PAL DVD recorders often make even dominant (the opposite of odd dominant) video, as well, so watch out.

Note that field (odd or even) dominance is irrelevant for F2 video. It is only important for F1 and F3 video. That is, if you are encoding F2 video, you will not see this question.

1 pixel bob

The "1 pixel bob" question should be answered "n" unless you have already run Anri-chan once and are seeing a jittering effect in your video. This effect is like someone is shaking the video up and down rapidly.

If you are seeing this effect and answering "y" to the 1 pixel bob question does not solve it, you may be working with so-called "deflickered" video. Answer "y" to the below Deflickering question and see if it helps. You can always use the Extract Sample utility to post a sample to Tech Support as explained earlier to have one of us confirm whether your video is deflickered. Deflickered video is most often found in ports of older games such as the Sonic Mega Collection or the Wii Virtual Console. Please see this forum topic for more on deflickering.

NES

The next question is important to answer with "y" if your game is played on an NES. NES games ported to other systems are not included (if you're curious, it has to do with how many channels the mono audio is on as well as an ugly gray line on the left side of the NES image).

Game Boy Advance

Obviously, answer "y" if you are playing a Game Boy Advance game through the Game Boy Player accessory for the GameCube.

Game Boy

Answer "y" if you are playing an original Game Boy game, a Super Game Boy game or a Game Boy Color game through the Game Boy Player accessory for the GameCube.

Content Properties

Trimming

Anri-chan will now ask whether you would like to trim off unwanted video from the beginning and end of your video. If you have more than one video per DVD you'd like to encode, you can use this function to accomplish that by trimming down to one video at a time.

Drag the slider at the bottom of the VirtualDub window that appears to find the numbers of the first and last frames you want to keep for your final video. Note that the image appearing in the VirtualDub window is low quality as it has not been encoded yet.

If you want trim off the first 80 frames but leave the end of the video alone, enter 80 for "First frame to keep" and 0 for "Last frame to keep". 0 is shorthand for the first or last frame of the video.

Station ID

You are next asked whether you want to append a so-called Station ID ("StatID" for short) to your video. You will only want to do this if your video has already been accepted to SDA. For more on StatIDs, see the StatID section of the Avisynth page. Because the StatID is the only thing standing between your video and YouTube pirates who will post it and claim it as their own, you will definitely want to write a StatID for your run if you are having it published on SDA.

If you want to see a preview of what your StatID will look like, use the Station ID Preview tool included with Anri-chan (a shortcut to it should be on your Desktop).

Review Settings

You're almost ready to encode! Anri-chan asks whether everything is in order with the settings you chose. If not, you can answer "n" and go back and enter them again.

Ready to Encode

Anri-chan notifies you that it has saved your settings in the projectname_job.bat file. Find this file inside your project directory on your Desktop. To start the project again with the same settings at any time, start anri-chan again and enter the same project name.

Encoding Options

Anri-chan will ask you which type of videos you want to encode. Only the H.264 MP4 types it asks about are required for submission to SDA. If you are encoding only for yourself or for SDA verifiers, answer "y" to only the "XviD-Normal-Quality (576Kbps) movie" option.

(If you're curious, you can divide the number before the "Kbps" by 8 to find out how many kilobytes per second the video will take up ("Kbps" stands for kilobits per second, and there are normally 8 bits in a byte). The first three or four video options are for H.264 MPEG-4 video encoded by x264, which is very high quality. The last two are for XviD-encoded (DivX-compatible) video, which is of lower quality than the H.264.)

Encoding

Encoding begins. Note that the "eta" (estimated time of arrival) displayed by x264 will not tell you very much, because every video is a 2-pass encode, and because the figure is not that accurate to begin with. Anri-chan encodes the qualities in the following order: LQ MP4, MQ MP4, HQ MP4, IQ MP4, LQ AVI, MQ AVI.

Encoding may take a very long time depending on the speed of your computer and on what answers you gave Anri-chan earlier. Answering D1 has the most serious effect on encoding time; it is not unheard of for the encode to take up to several weeks if you have a very long video for which you requested a high or insane quality D1 encode. You can speed up the process by closing down programs you are not using. Also, you can leave your computer on at night so the encode can finish.

When your encodes finish, you will find .mp4 and/or .avi files (depending on which video types you chose to encode) in the project directory. Contact Flip for instructions on how to send these in to the site for publishing.

Credits

In reality, Anri-chan is merely an overgrown batch script controlling a multitude of excellent, open source video and audio tools.

Avisynth

Anri-chan probably would not have even been possible without the non-linear video scripting language called Avisynth. Each of the questions Anri-chan asks corresponds to a bit of Avisynth code (usually written by nate). Deinterlacing is accomplished through the superior Avisynth plug-in mvbob.

mplayer

Anri-chan uses mplayer to rip DVD material due to potentially discontinuous audio timestamps (a common problem among cheap consumer DVD recorders), which cause A/V desync. If full DVD support information (i.e. .ifo files) is present in the DVD source, Anri-chan will attempt to use mplayer to rewrite the DVD .VOB files title by title to avoid audio desync across title boundaries within a single source .VOB.

DGMPGDec

Donald Graft's DGMPGDec package handles index file creation for MPEG-2 video sources. DGMPGDec is thus the "missing link" between DVD video and Avisynth.

x264

x264 is probably the greatest video encoding application in the world. SDA uses x264-encoded H.264 video in the MP4 container.

VirtualDub

Avery Lee's VirtualDub remains a staple of digital video editing. More recently, his command-line driver allowed the program to be used in conjunction with others. In Anri-chan, VirtualDub is used for the trimming and StatID previews, as well as for exporting PCM audio in preparation for encoding to AAC.

Nero AAC Encoder

Although not true free software, Nero AG has been kind enough to offer their digital audio tools free of charge to enthusiasts. Anri-chan creates AAC audio using Nero's encoder ("naac").

MP4Box

MP4Box takes the x264-encoded video and naac-encoded audio and muxes them into the MP4 container.

Xvid

xvid_encraw is the simple command line Xvid encoder used by Anri-chan. Xvid is an open source, MPEG-4 compliant video codec.

FFmpeg

FFmpeg is capable of much more than what Anri-chan uses it for: muxing to AVI and encoding the associated audio to MP3.

Anri-chan

Finally, the authors of Anri-chan are nathan jahnke ("nate"), Ian Bennett ("B-man") and Philip Cornell ("ballofsnow").

Personal tools