H.264 Encoding using StaxRipOriginal Page URL: http://www.digital-digest.com/articles/staxrip_h264_page1.html
Date Added: Jun 16, 2006
Date Updated: Jun 16, 2006
What is this guide about?
This guide shows how to encode H.264 video using StaxRip. While the focus is on H.264 encoding, the instructions will be similar for all the video types supported by StaxRip (DivX, XviD ...), so this guide can be considered more of a "How to use StaxRip" guide. This guide assumes you already have some knowledge regarding video conversion, like how to decrypt a DVD (which this guide does not cover).
What is StaxRip?
StaxRip is an all-in-one conversion/encoding tool designed to convert DVD/DVB and other video file formats to DivX, XviD and H.264. It supports outputs in the container formats AVI, MKV, MP4, DivX and PMP (PlayStation Portable). It's designed to be used by people who may not be familiar with all aspects of video conversion, but have enough knowledge to know the process - this is why it doesn't require the user to have Avisynth knowledge and at the same time allows you to configure most of the advanced codec and container settings. The disadvantage is that StaxRip hasn't been updated for a while now (and may not work with the latest version of the software it uses). If you don't mind doing a bit of extra work, then you might want to try MeGUI, which is updated much more frequently - we've written a MeGUI H.264 Conversion Guide which might help you get started.
In terms of H.264 encoding, StaxRip only features a sub-set of options available in the x264 encoder. This is due to the author's wish to simplify the interface of the software and to not have to support the functions that the average user may not need or understand. All of the important x264 options are still present though, the missing options include rate control, and manual quantizer adjustments.
This section talks about how to go about and install StaxRip, which isn't 100% straightforward due to the number of support software needed by the tool (which is really a graphical user interface that combines a number of different tools, just like most all-in-one conversion tools).
.NET Framework 2.0:
The first thing you need to do before you can even install StaxRip is to download and install Microsoft's .NET Framework version 2.0. It's a fairly large file and installation could take more than half an hour. Once you have it fully installed, you can now go on and download StaxRip.
Download StaxRip. There is no installer, so what you need to do is to extract the ZIP file into a directory. For the purpose of this tutorial, I have installed StaxRip to:
Once you have the files extracted (make sure the "Use folder names" option is selected), go to the directory you have extracted the files to and start the StaxRip program by clicking on the "StaxRip.exe" file (you may also want to create a shortcut to the program to place on your desktop, but that is up to you).
Installing StaxRip External Programs:
One of the interesting features that StaxRip supports is an internal download/update engine for all the software that it uses. These software include the actual x264.exe file, VirtualDubMod, DGIndex and more...
The way StaxRip works is that when you load an input file (the file you want to convert to another format), it will tell you which external programs are needed and asks you to install them before you can proceed. My preference (and this is just me, and it also makes this guide easier to write) is to just make sure all the external programs are installed, whether you need it or not (but chances are, you will need it).
To install the external programs:
1. Loading the Source
The first thing we do is to load the input video into StaxRip. From the "Source" section, use the open button to load one of more files. The sample file I will be using is a DVD VOB file.
StaxRip will load the file and at the same time process it to make it ready for encoding (this includes demultiplexing the audio, creating the D2V file, auto cropping, etc...). Once loaded, the "Source" section changes to display details about the loaded video.
2. Selecting the Profile
The next thing we need to do is to select which encoding profile we are going to use. Profiles are pre-saved encoding configurations that we can load and use for encoding, without having to re-configure the settings each time we start the program. To select a profile, go to the "Profile" menu, "Encoder" -> "x264" -> "More" -> select a profile here
Selecting the right profile is quite important, as it will determine the encoding speed and the output quality. I will also go through some of the recommended profiles here. To see the full description for each profile, you should head on to the official forum thread for these profiles (produced by Sharktooth).
If you require compatibility with standalone hardware, you should have a look at the "PD" (Portable Device) profiles, available for iPods, PSPs and even Xboxes. You should also look at either the "CE-QuickTime" or "CE-Baseline" profiles, as these offer Apple QuickTime compatibility (the "Baseline" profile being the most compatible).
If quality is what you are after, and you don't mind the encoding speed, have a look at the "HQ" profiles.
If you don't care about quality and just want the fastest encoding time, then look at the "1P-Maxspeed" profile, which can be useful for real-time video capturing.
Lastly, if you are encoding animated content (eg. anime), use the "AE" profiles.
3. Select Container
The next step involves selecting the container. While we are using H.264 as the video compression, the container can actually be AVI, MKV, MP4, DivX or even the Sony PSP's PMP format. It really is a personal preference thing (although using DivX when the format isn't DivX compatible may be strange), but for H.264 video, the most common container format is MP4, so this is what I will use in this case.
4. Codec Configuration
This step involves configuring the x264 encoder. Technically, we can skip this step because the selected profile should already have set all the options correctly. But we may need to modify at least one setting (the "Loop filter" setting), and there are always some settings you can tweak yourself (eg. the "Input/Output -> Threads" setting if you have a dual core and/or hyperthreaded CPU). If you like this kind of tweaking, please have a look at our x264 Options Explained Guide for information regarding every setting that can be accessed through StaxRip.
To modify the codec setting, click on the "Codec Configuration" option.
From the official forum thread for this profile, it is recommended that the "Loop Filter" setting be set to 0:0 for movies, and as the clip I'm encoding is clip from a movie, I will change the "Loop Filter" setting to 0:0 (Alpha = 0; Beta = 0).
Again, please consult the x264 Options Explained Guide if you want to change more settings (and beware that compatibility may be affected if you deviate from a profile too much).
5. Cropping Configuration (optional)
When StaxRip loaded the source file, cropping has already been performed, so this step is optional. You can have a look at the cropping results by pressing the "F4" key or going to the "View" menu and selecting the "Crop" item. This opens the cropping tool.
Assuming you are familiar with cropping (go to a bright scene and removing the black bars, if any), I'll describe what the cropping tool shows. The light blue bar shows the currently selected side of the picture that you are cropping, while the white bar shows the cropped area. The screenshot above shows that the top and bottom of the picture has been cropped, but the sides remain unchanged. You can adjust the crop by clicking on the white area and dragging it.
Once you are satisfied with the cropping, press the "Close" button to close the cropping window.
6. Audio Configuration
When the source was loaded, the audio from the source was demuxed and loaded into the "Audio Configuration" section. Here, you can adjust the compression/encoding settings for the audio, as well as add new audio tracks.
(screenshot has been modified to fit this article)
Clicking on the button to the right audio track (marked in red above) will allow you to select which compress codec to use. Typically, H.264 clips using MP4 containers tend to have AAC encoded audio, as it is more efficient than MP3. Also, if the audio track has 5.1 channels, AAC supports 5.1 channel encoding as well (which is what I have selected).
7. Compressibility Check
This step will run the compressibility check to give us some indication of what resolution and/or file size we should be setting in the next step, and to give us an estimation of the output quality. Click on the "Run Compressibility Check" option (just below the "Codec Configuration above") to start the compressibility check. This will start x264 and it will encode a portion of the video - you can have a look at the encoding framerate to give you an indication of how long the total encoding will take.
8. Resolution and File size Configuration
Once the compressibility check has been run, the "Target" section will now display the estimate quality and the bitrate of the encoding. You can also change the output file name/path here.
The aim here will be to increase or reduce the file size and/or resolution so that the "Quality" rating is at something acceptable. StaxRip recommends a quality setting of around 55%, and any higher, it will give you a warning about the quality being set too high. Decreasing the resolution and increasing the file size will obviously increase the quality rating, and the trick will be to get a good combination of resolution and file size to produce the right quality (55% being the recommended). To change the resolution, simply drag the resize bar or manually enter the values (any aspect ratio errors as the result of changing the resolution will also be shown).
After some adjustments, this is what I have for my sample clip (the resolution unchanged at the original DVD resolution):
9. Container Configuration (optional)
The container configuration allows you to add subtitle and chapter information for the container format you have selected. SRT subtitle files are supported and chapter information is to be in OGG format.
10. Preview or Cutting
You can preview the output video and also to cut the video by pressing the "F5" key or selecting "Preview" from the "View" menu.
It's important to make sure the video has the right aspect ratio by using the preview.
11. Start Encoding
We are almost ready to start the encoding now. Press the "Next" button to step through the StaxRip wizard, which checks to ensure you have selected all the required settings. Take note of the message displayed in blue text next to the "Next" button for hints on what you may need to do - you can sometimes click on the blue text to perform certain functions (like opening the crop window or adding the current encoding to the job queue).
One of the steps ask you to verify the filters. If you are resizing the video (please note that converting an anamorphic DVD to a non anamorphic video file is considered resizing), then you can right click on the resize filter to select the resize property (Sharp, Neutral or Soft). You can right click and add additional filters if needed.
If a warning/error occurs, the affected options will be highlighted in red and the settings which can help fix the warning/error is highlighted in orange.
Eventually, you'll get to a step where encoding will begin and after what could be several minutes to several hours, your encoding should be ready. And that's all there is to H.264 encoding in StaxRip.
From the clip I used, I was able to produce a 26 MB H.264 MP4 file that had 5.1 AAC audio. I also produced an XviD version of the same clip (using AutoGK) which was nearly 32 MB large and only had 2 channel audio (MP3 VBR), and clearly (at least to me) was worse in quality than the H.264 version (looking at the window blinds and the phone at around 2:55, especially the artifacts present in the XviD version). If you wish, you can download these two clips and see the differences for yourself:
H.264 MP4 with AAC 5.1 (26 MB)
XviD AVI with 2ch VBR MP3 (32 MB)
I even encoded an anamorphic version of the same clip (also with AAC 5.1 audio), and it was only 35 MB with the same video quality. Not bad when you consider the original MPEG-2 VOB file was nearly 110 MB.
About Digital Digest | Help | Privacy | Submissions | Sitemap
© Copyright 1999-2011 Digital Digest. Duplication of links or content is strictly prohibited.