| x264 encoding update |
|
|
|
| Wednesday, 28 June 2006 | |
|
This is a ground up set up and encoding guide, so if you already have tons of shit on your PC like MeGui, x264, and Xvid, start uninstalling shit. With certain updates, you need to uninstall then reinstall, I usually do this if its required or not by the developers just to keep stuff clean. X264 GUIDE Getting started First render out your video and audio(PCM uncompressed) separately, from whatever editor you use (Premiere, Vegas, etc) Using the Huffyuv lossless codec. This will save space and speed up things. Larger files are harder to work with. This is a lossless codec so you shouldn't be losing information, full uncompressed.avi works too. Also for best results your resolution should be divisible by 16 and a multible of 2. A widescreen res of 720x400 works for example.
See File Links section.Install latest stable full package of x264(r532), MeGui, Avisynth (v2.56). UPDATE: or grab this, all you need for encoding package \o/ MeGui now has a internal updater, audio encoding abilities, Avisynth script creator, and Mp4 Muxer. Some files may error though on the updater (for me it did) but such as the nero code, are not needed. Drop any profiles into /megui/profiles/video/. Installation is much quicker and easier then 6months ago. You then go into Tools -> Settings and configure file locations. Which in this case was all filled out in this set up/version. Encoding the videoThe Avisynth script creator in MeGui gave me some problems but you can play around with it if you like. Best part about it is you now can just copy/paste out lines that the GUI added for you (such as resize and cropping filters) that you can use in your own script. In the menu Tools -> Avisynth Script Creator. AVISource("videofilename.avi") ConvertToYV12() Is all I need for that. You can edit scripts in notepad, then save as whateverfilename.avs . In MeGui main window: under Video: Avisynth Script ... select your .avs and you should get a window pop up showing your video(or this step is done for you if you used the script creator). If you see just a gray box, that might be a problem, adjust your script. Now close it. Video output: select whatever you want your output filename to be. Codec: x264 Container: RAW Now hit the config button and the fun starts. After configuring all those options in the Tabs, save your config at the bottom with the New button.
Things to worry about in the settings. Passes: Always 2-pass, and if you got the time, might as well run another to clean up some areas that don't get compressed great. Most of the time completely unneeded though. Bit rate: depending on FPS, Resolution, source quality, source motion, color, and sharpness, you will need to tune your bits to your video. Try any where from 1000 to 4000! M.E. range: don't go above 32 M.E. algo: exhaustive give little to no difference in quality but adds a ton of time to the encode. Subpixel refinement: RDO7 for a final encode, level 5 or 6 for tests. Different Quantizer Matrices are worth trying, depending on your source and bit rate levels.
Its a game of time vs quality. Longer you take to encode should give you a better end result, in theory. (3-pass, ME range 32, exhaustive, RDO-7,... for a final encode only and on very new PCs.) Now hit the Enqueue button to add the jobs. Then hit the Queue tab then Start button. Now you will have a filename.264 which is your video. Now on to audio. Audio
Get your separate audio file ready. (Either export your audio, making sure to have the same area selected on your time line as you had for your video, or you can extract the audio from the original video file exported from your time line. I usually use VirtualdubMod to save out the .wav audio from the video+audio clip. In Vdubmod: Open video file.. find your video+audio clip.... Streams -> Stream List Save .wav audio File->Jobs-> Start. Now you can compress your audio many different ways(just end up with a .m4a or .aac file) but might as well use MeGui since its open. Audio Input .. (select the audio file you just extracted with vdubmod) Audio Output .. whatever you want to call it Codec: FAAC (Free Advanced Audio Codec) Config: Defaults (I like VBR, 70-100 range.) Container: RAW-AAC Audio Profile: same as video profile, saves your settings. Then Enqueue->Start Audio is really quick, then once you have audio and video, you join them together in MeGui Tools-> Muxer-> Mp4 Muxer. YAMB wasn't giving me (at least not easily seen) an option to select frame rate, and MeGui is just as good at Muxing so might as well not use YAMB. Add in your video and audio, set FPS, output file name, add to Queue then Start Test in Media Player Classic and VLC. See decoding section for trouble shooting. DecodingCan't play back the movie? Give these suggestions to people that have Downloaded your movie. 1. Try using the VideoLan Client for playback of your files. It has built in x264 support, so installing the ffdshow playback filter, is not required. 2. Check your CPU stats, if it's below 2GHz(depending on how the file was encoded) you may not be able to play the movie properly. Turn off other programs running on your computer. 3. Install latest version of ffdshow then play the file with Media Player Classic. (if it fails, you need to reboot your computer, then run the install again) Note: ffdshow has been known to cause a few problems. 1. While installing ffdshow make sure you check decoding of x264, and un-check everything else, especially decoding of Xvid (Xvid handles itself fine.) Also un-check post processing in the install, if checked. Also for audio decoding, un-check all boxes. 2. Install the MatroskaSplitter (make sure to check support for avi and mp4) If you still cant play back the movie, you will need to watch a different version. This is where the Xvid encode comes in. XVID Xvid can also be done in MeGui (make sure you get the full MeGui not the x264 version of it) with just about the same process as x264. Different being that you are working with the audio codec MP3 and the container AVI. Advanced Tab would just be guess work for me, try the defaults. And the power is in the Zones and the custom quantizer maxtrix, just like as in x264. Note: Xvid is almost 8-15 times faster then the slowest encode of x264 in my limited tests. LinksBasic info thread. http://forum.doom9.org/showthread.php?t=89979 These installers are easiest and needed for this guide. Latest x264 installer mirror, and MeGui AviSynth. - [This is the frame server, it sends the video into MeGUI for encoding ...and so much more] VLC – [built in decoding features and multi-platform support] Archive extractor http://www.7-zip.org/download.html Comment (0) |
|
| Last Updated ( Monday, 23 July 2007 ) |
| < Prev | Next > |
|---|



As I am preparing to encode Unity, and haven't looked at compression in at least 6months and haven't did a overhaul of the guide in more then that, here we go..