Monday, November 02, 2009

Video Encoding h.264 (x264)


I'm getting ready to switch my FRAPS captures from XVid to H.264 (x264). What I'm finding is that in GTA3: San Andreas, where I capture at 1600x900, encoding to XVid results in a lost of fine detail (even at 2.8-3.0 Mbps settings). The H.264 codec seems to do a much better job at preserving the fine detail while staying at a reasonable bitrate.

StaxRip - This is a very good tool for using in conjunction with FRAPS. If you separate your raw FRAPS AVI files into separate directories prior to encoding, it becomes very easy to merge the AVIs together.

x264 settings - A page at the MeGUI wiki regarding what the different x264 settings are. Pay close attention to "profile", "preset", "tune" and "level".

x264 Encoding Options for Hardware Compatibility & DXVA - Talks about compatibility:

The Bottom Line Everybody should be encoding HD content (1080p, 720p) to Profile High @ Level 4.1. For smooth playback, "--level 4.1" should be used to mark the file as compatible when encoding. The best MeGUI profile for x264 is the DXVA-HD-HQ profile.

The options to xvid are as follows:

--level 4.1 --ref 4 --mixed-refs --bframes 3 --b-rdo --bime --weightb --direct auto --filter -1:-1 --trellis 2 --partitions p8x8,b8x8,i4x4,i8x8 --8x8dct --vbv-bufsize 50000 --vbv-maxrate 50000 --me umh


And the following quote from that page about standard-def content:

Everybody should be encoding SD content (576p, 480p, or less) to Profile High @ Level 3.1 For smooth playback, "--level 3.1" should be used to mark the file as compatible when encoding. The best MeGUI profile for x264 is the DXVA-SD-HQ profile.

The MeGUI DXVA-SD-HQ profile options:

-level 3.1 --ref 8 --mixed-refs --bframes 3 --b-rdo --bime --weightb --direct auto --filter -1:-1 --trellis 2 --partitions p8x8,b8x8,i4x4,i8x8 --8x8dct --vbv-bufsize 14000 --vbv-maxrate 17500 --me umh


Note: StaxRip doesn't seem to have an equivalent profile for hi-def encoding. However, using the "Slower" preset takes care of the majority of settings. You'll just have to set the following:

Analysis (Partitions): All enabled except for P4x4"
Frame Options (Misc): Set Reference Frames to 4
Rate Control (VBV): Buffer Size and Max Bitrate to "50000"
Command Line (Custom Switches): Add "--level 4.1"

Which should result in a command line similar to the following:

--crf 24 --preset slower --partitions p8x8,b8x8,i4x4,i8x8 --vbv-bufsize 50000 --vbv-maxrate 50000 --sar 3:4 --level 4.1 --output "" ""

Labels: , , ,



posted by Wuphon's at 5:49 AM

Comments: Post a Comment
Powered by Blogger Who's linked to me?