Results 1 to 4 of 4

Thread: H.264 encoding with x264 (the best encoder around by far)

  1. #1

    Default H.264 encoding with x264 (the best encoder around by far)

    (Background: I run an HD video sharing site, though I'm not going to mention its name here. I might mention it in the “pimp your link” section if people are interested. I try to be an x264 “evangelist” in order to improve the way people compress videos since so many people are using inferior and outdated methods.)

    Unfortunately a lot of the tutorials on the web are very out of date (e.g. using divx or xvid or windows media) or sometimes involve using unsupported and problematic techniques (e.g. H.264 in avi or x264vfw).

    There's also a gap between the people that develop encoders and the people that make videos and use them with the former assuming ridiculous amounts of knowledge in the latter. This is something I'd like to help correct.

    This is a Windows oriented tutorial but for Mac/Linux users there's a similar, but less powerful tool out there called Handbrake. Step 8 onwards is similar except the names might be slightly different.

    Apologies if this repeats obvious information or gets too complicated at times.

    H.264 is the latest and greatest of all video formats so far. x264 is the best of the H.264 encoders although it has a learning curve and so is not used as often as it should. It is heavily used by large companies (Google, Facebook, Vudu to name a few) and its open source nature means it can be modified for live broadcast, Blu-Ray authoring and web video creation as well as many more implementations.

    Comparisons can be found here:

    http://mirror05.x264.nl/Dark/website/compare.html

    (The results of Quicktime would only be a little better than MPEG-2)

    If you're aiming for the best picture quality you should always use x264 instead of your usual encoder (especially if that encoder is Quicktime). x264 is one of the most heavily optimised pieces of software on earth and is also very fast compared to other encoders.

    Virtually all the tools associated with x264 are free and open source!
    The easiest way to get started with x264 is to use MeGUI.

    1. Download MeGUI from here: SourceForge.net: meGUI: Files

    2. MeGUI should download most of the tools necessary.

    3. Output your material from your editing package, either losslessly if possible, or with a very high bitrate so that the picture is effectively lossless. This should be done progressively You will also need the correct input filters for your material (e.g. for H.264, ffdshow or CoreAVC)

    4. Open notepad and copy and paste the following:

    Code:
    DirectShowSource("C:\yourfolder\yourfile")
    ConvertToYV12()
    5. Save this file as input.avs .

    6. Open MeGUI and using the button marked “...” in Avisynth input at the top select your input.avs.
    You can also set audio encoding parameters below but this guide only deals with video right now. You should see a preview of your video.

    7. If you like you can choose one of the presets and skip the next few steps. However, it's worth understanding what the main settings in x264 do.

    8. Find an x264 preset you wish to start from.

    There are two main modes in x264. 2-pass bitrate and CRF (sometimes called “constant quality”).

    2-pass is recommended if you need to hit a target filesize. This method is like other encoders. You choose a bitrate and go from there. Select “Automated 2-pass” if you want this method. Also, check the box marked “Turbo” as this will speed up your first pass significantly with a very, very minimal quality loss.

    CRF is faster and recommended if you don't need to hit a target size. 18 is considered visually transparent though in many cases you can go up to 22-25 without that much quality loss. As CRF value goes up, filesize goes down.

    Personally, I recommend CRF. It's best to stay with High Profile selected unless you have restrictions (e.g iPhones or other media devices)

    The main settings for quality in the other tabs are as follows:

    RC and ME

    M.E Algorithm should be Multi-hex. Set this higher if you have time to spare
    Subpixel Refinement is the most important setting of them all. 8 or 9 is recommended.
    CABAC should be on unless you have specific reasons. (limited playback CPU speed)
    Trellis can be turned up to 2 if you have the time. 1 should be OK though.

    Advanced

    Adaptive B-frames should be on 2 unless you have restrictions on how long your encode time should be.

    9. Save your settings and choose between MKV and MP4 – the only worthwhile formats around right now (except for transports streams, which are used in Blu-Ray and broadcast)

    10. Click on Enqueue. Change the tab to “Queue”, select the first job and click on Start.

    Note: Quicktime has a very limited decoder and so unless you use the Quicktime preset most of your encodes will not work in Quicktime.

    The results you get should outclass most other encoders at a similar bitrate.

    In fact there are loads more settings you could change. There are also lots of other things non-x264 related that could be done. Ask me if you really want to know.

    Glossary.

    x264 (not x.264 or anything else) = an H.264 encoder
    H.264 (or MPEG-4 Advanced Video Coding) = The standard by which H.264 encoders and decoders follow (e.g. Quicktime, Mainconcept etc)
    Last edited by kierank; 04-19-2009 at 09:42 PM.

  2. #2
    Join Date
    Nov 2005
    Location
    Bristol uk
    Posts
    8,938
    Blog Entries
    1

    Default

    I have done my own tests and I prefer wmv at similar bit rates.

    Wmv is also more portable - nearly as eay as flash for other platforms to play.

  3. #3
    Join Date
    Nov 2005
    Location
    Bristol uk
    Posts
    8,938
    Blog Entries
    1

    Default

    As for contacting you to reproduce your guide - this is a forum that anyone can use and most forums are pretty much seen as public domain.

    Why wouldnt you qwant people to copy and pass on your thoughts - that's how forums work innit ?

    It is more a fan post than a guide really too

  4. #4

    Default

    Quote Originally Posted by Mark W View Post
    As for contacting you to reproduce your guide - this is a forum that anyone can use and most forums are pretty much seen as public domain.

    Why wouldnt you qwant people to copy and pass on your thoughts - that's how forums work innit ?

    It is more a fan post than a guide really too
    Yeah, you're right; that message is gone.

    I think it's a justified "fan post" though; it is technically by far the best encoder. (has Adaptive Quantisation, Psychovisual enhancements etc. that other encoders don't have). The results were pretty clear when we tested the various encoders for our site too and it genuinely can do remarkable things like 720p25 that looks pretty good at under 2Mbit/s.

    As for the VC-1 point, it's worth checking out the last comparison here:

    http://mirror05.x264.nl/Dark/website/compare.html

    The VC-1 settings were recommended by Ben Waggoner, one of the guys at Microsoft who's their "Principal Video Strategist" but its pretty clear that VC-1 kills the fine details.
    Last edited by kierank; 04-19-2009 at 09:56 PM.

Similar Threads

  1. Encoder/Decoder PCI card
    By Nios in forum The Perfect Video Editing PC
    Replies: 0
    Last Post: 05-26-2007, 03:31 PM
  2. what encoder to use for DVD playback/authoring ?
    By coreydeep in forum Blu Ray, DVD, SVCD and VCD authoring
    Replies: 2
    Last Post: 05-07-2007, 05:08 PM
  3. Is it possible to have adobe media encoder??
    By zoro_spain in forum Adobe Premiere, Premiere Elements, and After Effects
    Replies: 0
    Last Post: 02-12-2007, 09:12 AM
  4. Using Adobe Media Encoder
    By harikrishka in forum Adobe Premiere, Premiere Elements, and After Effects
    Replies: 2
    Last Post: 11-11-2006, 06:09 PM
  5. Encoding to WMV with Windows Media Encoder
    By Marc Peters in forum Submit Your Own Guides and Reviews
    Replies: 4
    Last Post: 02-28-2006, 01:09 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •