H.264 Encoding using StaxRip

Collapse
This is a sticky topic.
X
X
 
  • Time
  • Show
Clear All
new posts
  • admin
    Administrator
    • Nov 2001
    • 8951

    H.264 Encoding using StaxRip

    <b>What is this guide about?</b>

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

    <b>What is StaxRip?</b>

    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 <a href="http://www.digital-digest.com/articles/MeGUI_H.264_Conversion_Guide_page1.html">MeGUI H.264 Conversion Guide</a> 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.

    <b>Software Requirements:</b><ul><li> <a href="http://www.digital-digest.com/software/staxrip.html" title="StaxRip" target="_blank">StaxRip</a>
    </ul>Technically, other software are required as part of the StaxRip installation process, but this will be covered in the next section.
    Last edited by admin; 24 Nov 2006, 09:58 PM.
    Visit Digital Digest and dvdloc8.com, My Blog
  • admin
    Administrator
    • Nov 2001
    • 8951

    #2
    Installation

    <b>Installation:</b>

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

    <u>.NET Framework 2.0:</u>

    The first thing you need to do before you can even install StaxRip is to download and install <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=0856eacb-4362-4b0d-8edd-aab15c5e04f5&displaylang=en" target="_blank">Microsoft's .NET Framework version 2.0</a>. 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.

    <u>Installing StaxRip:</u>

    <a href="http://www.digital-digest.com/software/staxrip.html#downloads" target="_blank" title="Download StaxRip">Download StaxRip</a>. 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:

    c:\Program Files\StaxRip

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

    <u>Installing StaxRip External Programs:</u>

    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:<ol><li> From the StaxRip "Tools" menu, select "External Applications".

    <center><img src="http://www.digital-digest.com/images/articleimages/staxrip_h264/staxrip_tools_external.gif" alt="StaxRip: Tools -> External Applications" title="StaxRip: Tools -> External Applications" border="0"></center>

    <li> This opens the External Applications download manager, where you can check the installation status of the required software and also download them without going to any websites.

    <center><img src="http://www.digital-digest.com/images/articleimages/staxrip_h264/staxrip_external.jpg" alt="StaxRip: External Applications" title="StaxRip: External Applications" border="0"></center>

    <li> As I mentioned above, I will normally just select each and every program listed (on the left hand side, eg. "General -> AviSynth" as shown in the screenshot above) and then click on the "Download" button at the top to start the download and install the software.

    <center><img src="http://www.digital-digest.com/images/articleimages/staxrip_h264/staxrip_external_download.gif" alt="StaxRip: External Applications Download" title="StaxRip: External Applications Download" border="0"></center>

    <li> Please note that you may already have some software installed (eg. the <a href="http://www.divx-digest.com/software/divxcodec6.html" target="_blank" title="DivX Codec">DivX codec</a>) so if the status of the programs is "OK", then you can skip downloading it. Sometimes you may actually have a version of a software that is newer than what StaxRip supports, and in this case, you may need to download and install the version that StaxRip requires. Once you have all the applications installed, press the "Close" button to close the External Applications window.
    </ol> We can now proceed with the actual conversion/encoding.
    Last edited by admin; 15 Jun 2006, 10:03 PM.
    Visit Digital Digest and dvdloc8.com, My Blog

    Comment

    • admin
      Administrator
      • Nov 2001
      • 8951

      #3
      StaxRip Encoding: Step 1 to 6

      <b>1. Loading the Source</b>

      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.

      <center><img src="http://www.digital-digest.com/images/articleimages/staxrip_h264/staxrip_source.gif" alt="StaxRip: Source" title="StaxRip: Source" border="0"></center>

      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.

      <center><img src="http://www.digital-digest.com/images/articleimages/staxrip_h264/staxrip_source_loaded.gif" alt="StaxRip: Source Loaded" title="StaxRip: Source Loaded" border="0"></center>

      <b>2. Selecting the Profile</b>

      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

      <center><img src="http://www.digital-digest.com/images/articleimages/staxrip_h264/staxrip_profile_select.gif" alt="StaxRip: Profile Select" title="StaxRip: Profile Select" border="0"></center>

      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 <a href="http://forum.doom9.org/showthread.php?t=101813" target="_blank">official forum thread</a> 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.


      <b>3. Select Container</b>

      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.

      <center><img src="http://www.digital-digest.com/images/articleimages/staxrip_h264/staxrip_container.gif" alt="StaxRip: Container Select" title="StaxRip: Container Select" border="0"></center>

      <b>4. Codec Configuration</b>

      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 <a href="http://www.digital-digest.com/articles/x264_options_page1.html" target="_blank" title="x264 Options Explained Guide">x264 Options Explained Guide</a> for information regarding every setting that can be accessed through StaxRip.

      To modify the codec setting, click on the "Codec Configuration" option.

      <center><img src="http://www.digital-digest.com/images/articleimages/staxrip_h264/staxrip_codec.gif" alt="StaxRip: Codec Configuration" title="StaxRip: Codec Configuration" border="0"></center>

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

      <center><img src="http://www.digital-digest.com/images/articleimages/staxrip_h264/x264_loop_filter.gif" alt="StaxRip: Loop Filter" title="StaxRip: Loop Filter" border="0"></center>

      Again, please consult the <a href="http://www.digital-digest.com/articles/x264_options_page1.html" target="_blank" title="x264 Options Explained Guide">x264 Options Explained Guide</a> if you want to change more settings (and beware that compatibility may be affected if you deviate from a profile too much).

      <b>5. Cropping Configuration (optional)</b>

      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.

      <center><img src="http://www.digital-digest.com/images/articleimages/staxrip_h264/staxrip_crop.jpg" alt="StaxRip: Crop" title="StaxRip: Crop" border="0"></center>

      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 <font style="background: #87CEEB; font-color: #000000">light blue</font> 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.

      <center><img src="http://www.digital-digest.com/images/articleimages/staxrip_h264/staxrip_audio.gif" alt="StaxRip: Audio" title="StaxRip: Audio" border="0">
      (screenshot has been modified to fit this article)</center>

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

      <center><img src="http://www.digital-digest.com/images/articleimages/staxrip_h264/staxrip_audio_select.gif" alt="StaxRip: Audio Select" title="StaxRip: Audio Select" border="0"></center>
      Last edited by admin; 15 Jun 2006, 10:05 PM.
      Visit Digital Digest and dvdloc8.com, My Blog

      Comment

      • admin
        Administrator
        • Nov 2001
        • 8951

        #4
        StaxRip Encoding: Step 7 to 11

        <b>7. Compressibility Check</b>

        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.

        <center><img src="http://www.digital-digest.com/images/articleimages/staxrip_h264/x264_encoding.gif" alt="x264: Encoding" title="x264: Encoding" border="0"></center>

        <b>8. Resolution and File size Configuration</b>

        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.

        <center><img src="http://www.digital-digest.com/images/articleimages/staxrip_h264/staxrip_target.gif" alt="x264: Target" title="x264: Target" border="0"></center>

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

        <center><img src="http://www.digital-digest.com/images/articleimages/staxrip_h264/staxrip_resize.gif" alt="x264: Resize" title="x264: Resize" border="0"></center>

        After some adjustments, this is what I have for my sample clip (the resolution unchanged at the original DVD resolution):

        <center><img src="http://www.digital-digest.com/images/articleimages/staxrip_h264/staxrip_target_after.gif" alt="x264: Target" title="x264: Target" border="0"></center>

        <b>9. Container Configuration (optional)</b>

        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.

        <center><img src="http://www.digital-digest.com/images/articleimages/staxrip_h264/staxrip_container_config.gif" alt="x264: Container Config" title="x264: Container Config" border="0"></center>

        <b>10. Preview or Cutting</b>

        You can preview the output video and also to cut the video by pressing the "F5" key or selecting "Preview" from the "View" menu.

        <center><img src="http://www.digital-digest.com/images/articleimages/staxrip_h264/staxrip_preview.gif" alt="x264: Preview" title="x264: Preview" border="0"></center>

        It's important to make sure the video has the right aspect ratio by using the preview.

        <b>11. Start Encoding</b>

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

        <center><img src="http://www.digital-digest.com/images/articleimages/staxrip_h264/staxrip_next.gif" alt="x264: Next" title="x264: Next" border="0"></center>

        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.

        <center><img src="http://www.digital-digest.com/images/articleimages/staxrip_h264/staxrip_filters.gif" alt="x264: Filters" title="x264: Filters" border="0"></center>

        If a warning/error occurs, the affected options will be highlighted in <font style="background: #FF0000; font-color: #000000">red</font> and the settings which can help fix the warning/error is highlighted in <font style="background: #FFA500; font-color: #000000">orange</font>.

        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 <a href="http://www.divx-digest.com/software/autogk.html" target="_blank" title="AutoGK">AutoGK</a>) 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:

        <a href="http://files.digital-digest.com/downloads/articles/staxrip_h264_guide/sample_h264_mp4.zip">H.264 MP4 with AAC 5.1</a> (26 MB)
        <a href="http://files.digital-digest.com/downloads/articles/staxrip_h264_guide/sample_xvid.zip">XviD AVI with 2ch VBR MP3</a> (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.
        Last edited by admin; 15 Aug 2007, 02:10 AM.
        Visit Digital Digest and dvdloc8.com, My Blog

        Comment

        • coldfire82
          born to die
          • Jan 2007
          • 5

          #5
          well ...really an awsome tool !

          regards
          coldfire
          ______________________________________________
          A good resource of H.264/MPEG4
          Last edited by coldfire82; 22 Aug 2008, 11:42 PM.

          Comment

          • dr_ml422
            Lord of Digital Video
            Lord of Digital Video
            • May 2007
            • 1903

            #6
            Hi admin. ok, I finally found the h.264 encoding forum. I saw STAXRip in the divx forum also. Is it still recommended to use for encoding to h.264 even though you mentioned it has slow updates to some of the software it uses? Or is it better to learn and use this http://www.digital-digest.com/articl...de_page1.html?

            Also is Super something like this also? I'm new to this part of conversion but I need to convert some format to h.264 to test my hd playback on my computer. Thnx.
            SAMSUNG SH-S203B, SAMSUNG SH-S223F,

            Take the suggestions and follow the directions. The results will speak for themselves.



            Google is definitely our friend.

            Comment

            • admin
              Administrator
              • Nov 2001
              • 8951

              #7
              I would try RipBot264 first, since it's the easiest one to use:

              A guide that shows you how to use RipBot264 to encode files to MPEG-4 AVC/H.264 for use on your PS3 or Xbox 360, with bonus M2TS muxing instructions for the PS3


              Then try MeGUI which is a bit more advanced, and is the one I like to use.

              Super works too, but I don't like the interface that much (too confusing, and too many options).

              If you don't want to make your own H.264 HD clips, you can download them from the movies section of ddigest (http://www.digital-digest.com/movies/index.php), or get them from this site:



              (the trailers there are all QuickTime-HD or WMV-HD, the former using H.264, the latter using VC-1. Using the Apple QuickTime player sucks because it's very inefficient, so I use the QuickTime Alternative player which allows QuickTime-HD movies to play under MPC or WMP with greater efficiency)
              Visit Digital Digest and dvdloc8.com, My Blog

              Comment

              • dr_ml422
                Lord of Digital Video
                Lord of Digital Video
                • May 2007
                • 1903

                #8
                Ok. Thnx. 1 ?. Since I'll be downloading these to my pc I won't need an hd/blu-ray optical drive correct? I almost 4got I don't have 1 yet and it doesn't make sense to endeavor into the hd revolution if I don't have all the toys to support it.

                I'm going to have to download MPC which I'm guessing is media player classic? WMP is windows media player? That 1 I just have disabled in xp home.
                SAMSUNG SH-S203B, SAMSUNG SH-S223F,

                Take the suggestions and follow the directions. The results will speak for themselves.



                Google is definitely our friend.

                Comment

                • admin
                  Administrator
                  • Nov 2001
                  • 8951

                  #9
                  If you want to play around with H.264/VC-1/HD, you don't need a Blu-ray drive. But if you do get one to play Blu-ray movies, just make sure you meet the system requirements first.

                  And yes, MPC is Media Player Classic. It looks simple, but you'll grow to love it over the bloated players such as QuickTime or WMP (Windows Media Player).
                  Visit Digital Digest and dvdloc8.com, My Blog

                  Comment

                  • dr_ml422
                    Lord of Digital Video
                    Lord of Digital Video
                    • May 2007
                    • 1903

                    #10
                    Thnx admin. I'm almost sure the build I put together w/chewy's help meets the requirements, but I'll check that out asaic. The Blu-ray drives are out of my reach right now, but testing my build w/h.264/vc-1/hd is something I need to do b4 I even think about purchasing a Blu-ray drive. I'll post back my progress and any ?'s that arise regarding this process.
                    SAMSUNG SH-S203B, SAMSUNG SH-S223F,

                    Take the suggestions and follow the directions. The results will speak for themselves.



                    Google is definitely our friend.

                    Comment

                    • dr_ml422
                      Lord of Digital Video
                      Lord of Digital Video
                      • May 2007
                      • 1903

                      #11
                      Admin is the latest MPC 6.4.9.0 ok? Also is it better to download it to the c:drive where xp is under program files or it really doesn't matter? I was going to put it under a folder in my d:drive which has more space. I also need this, http://www.digital-digest.com/softwa...ternative.html ,right to be able to view them on MPC? Thnx.
                      SAMSUNG SH-S203B, SAMSUNG SH-S223F,

                      Take the suggestions and follow the directions. The results will speak for themselves.



                      Google is definitely our friend.

                      Comment

                      • admin
                        Administrator
                        • Nov 2001
                        • 8951

                        #12
                        QuickTime Alternative includes a newer version of MPC (6.4.9.1 Rev 53), so you don't necessarily need to install it separately. You can always replace whatever version is included with QuickTime Alternative with the latest build (6.4.9.1 Rev 72) here:

                        Download Media Player Classic, a multimedia player capable of playing DivX movies


                        Please note that QuickTime Alternative is a codec pack of sorts, and I know many people don't like codec packs (but it's easy to uninstall).

                        For the WMV-HD trailers, you don't need to download anything - the latest WMP version (or I think any version later than 9) will play it.
                        Visit Digital Digest and dvdloc8.com, My Blog

                        Comment

                        • dr_ml422
                          Lord of Digital Video
                          Lord of Digital Video
                          • May 2007
                          • 1903

                          #13
                          Ok. Thnx. I'm new to the whole codec thing. I'm guessing that the WMV files can only be played w/WMP or QuickTime Alternative takes care of both formats? Probably both. I'm guessing the name says it all?
                          SAMSUNG SH-S203B, SAMSUNG SH-S223F,

                          Take the suggestions and follow the directions. The results will speak for themselves.



                          Google is definitely our friend.

                          Comment

                          • admin
                            Administrator
                            • Nov 2001
                            • 8951

                            #14
                            QuickTime Alternative will allow you to play .mov files (either normal QuickTime, or HD ones) without the need to have the Apple QuickTime player installed (which is bulky and inefficient).

                            WMP (version 9 or later) will play WMV and WMV-HD files without additional software.
                            Visit Digital Digest and dvdloc8.com, My Blog

                            Comment

                            • dr_ml422
                              Lord of Digital Video
                              Lord of Digital Video
                              • May 2007
                              • 1903

                              #15
                              Ok. I got it so far. I'll post back w/any concerns or ?'s after trying it out. Thnx.
                              SAMSUNG SH-S203B, SAMSUNG SH-S223F,

                              Take the suggestions and follow the directions. The results will speak for themselves.



                              Google is definitely our friend.

                              Comment

                              Working...