WCM Network: 
 


Go Back   mmorpgforum.net > Machinima > WarcraftMovies.com > Movie Making
Register Projects FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 12-24-2009, 08:39 AM   #1
izolight
Initiate
 
Join Date: Oct 2008
Posts: 2
izolight is an unknown quantity at this point
Guide: Sony Vegas x264 Encoding tutorial

Copied from my OP at http://www.numen-guild.com/forum/vie...php?f=2&t=2010

Since I've seen many wow videos that were either poor quality or with good quality a way too big filesize I wanted to show you how to make decent looking videos with an appropriate filesize using the x264 codec.

What you need:
Sony Vegas up to Version 8.0b
Debugmode frameserver
Avisynth
Simple x264 launcher
mkvtoolnix

When you install the Debugmode frameserver make sure to select the sony vegas plugin. The simple x264 launcher you can just extract anywhere you want.

Vegas Output

When you render your video first render the audio to a seperate file. Select MainConcept AVC/AAC (mp4) as type and then click Custom... and create a new template. Make sure you uncheck the option to include video.



On the audio tab select 44100 or 48000 Hz as sample rate, depending what your source is and the bitrate should be 128k, you could of course go higher, but I haven't heared any difference so far.



Then you save it and let it render.
Now you render the video, select DebugMode FrameServer (avi) as type and for reasons you can see later just name the file untitled.avi.



Leave the settings you see when you click save just as in my screenshot.



Script Creation

Then it begins to frameserve and you can create a Avisynth script.
Open Notepad or any other editor and write:

Code:
AVISource("C:\Users\Gabor\Desktop\untitled.avi")
Now you see why I named the video untitled.avi, so I never have to change the script. Now you can do many more things with avisynth like resizing (faster and better than sony vegas resize). For example I resize my videos from 1920*1200 to 1920*1088, so they can be played back using DXVA(DirectX Video Acceleration), so I add this line:
Code:
LanczosResize(1920, 1088)
You may wonder why I select 1088 and not 1080, well 1st dxva and allows up to that resolution and bluray specs do infact too and it is a mod16 resolution, that means it is dividable by 16 in height and width, that is important for the encoder because x264 does motion search by dividing the picture into 16*16 blocks and if you don't have a resolution that is mod16 your compression will suffer a bit.

Then I save the file as untitled.avs

x264 Launcher settings

Next I open the launcher.exe from the x264 launcher. As source I select the just created avisynth script. You can also select the output container, but to mux it later using mkvtoolnix you should select either Matroksa(.mkv) or Raw H.264 data(.264).



Now comes the important part, the compression settings. As I don't care about filesize (well to an extent, but as long as it is under 1gb I don't care) I select CRF as mode, that means you set a quality and the application decides what bitrate to use, so your videos will always have the same quality.

Under Quantizer/CRF I select something between 24 and 26, 23 is the default and it can be between 0 and 51, with 0 being lossless and 51 worst quality. But when doing some test encodes I didn't notice any difference up to 26 and it still looked good, you can of course go lower, but that's totally up to you and I'd do a few samples with different CRFs when encoding for the first time, so you can choose what value to go for.

As preset I choose slower, because in this mode the preset doesn't effect quality but only final filesize I chose a good tradeoff between the default(medium) and the best compressed(placebo) and I really wouldn't choose any slower setting as you will only have minimal decrease in filesize for 2-3* longer rendering time.

Under Tuning I select none as this isn't a real movie/anime or grainy footage. And for the profile I select the high profile, this setting is only important if you want your video to play on anything other than PC (PS3, Xbox360, ipod etc) but at that resolution you probably want it only to play on systems that support high anyway.

If you want your video to be DXVA compatible you have to specify some custom parameters, for my video that would be:

Code:
--level 4.1 --ref 4 --vbv-bufsize 50000 --vbv-maxrate 62500
If you have a different resolution you only have to change the setting --ref to another number according to the following:

Quote:
The number of reference frames
***1080P Normal movie + Animation***
ref= 4 (max. resolution = 1920x1088) < 3 ref = not good enough for AHD
ref= 5 (max. resolution = 1920x864) < 3 ref = not good enough for AHD
ref= 6 (max. resolution = 1920x720) < 3 ref = not good enough for AHD

***720p Normal movie + Animation***
ref= 09 (max. resolution = 1280x720) < 5 ref = not good enough for AHD
ref= 10 (max. resolution = 1280x648) < 5 ref = not good enough for AHD
ref= 11 (max. resolution = 1280x588) < 5 ref = not good enough for AHD
ref= 12 (max. resolution = 1280x540) < 5 ref = not good enough for AHD
This is how my config looks like:



When you have set your stuff, you click start and it will begin the encode. Remember to not close Sony Vegas or the Frameserver during all that time.

When you're done encoding close the launcher. Now you can also close vegas and the frameserver.

Muxing

Open Mkvmerge GUI (mkvtoolnix) and add your created videofile (Important this is not the untitled.avi it is either a .264 or .mkv file)
If you created a .264 file you get this message:



That means you have to specify the framerate manually so you have to know what fps you set in vegas and then select the videotrack and go to the Format specific options tab and select your fps.



Then you add your audio and if you have multiple audiotracks it might be handy to select which one is default and also a name for it like the genre (Rock, Trance, Ventrilo etc.)

Then you specify the final output name and destination and click Start muxing, that will take about 10 seconds and then your done and have a good looking video.

Last edited by izolight : 01-10-2010 at 03:17 AM.
izolight is offline   Reply With Quote
Old 12-30-2009, 01:58 PM   #2
MingoDynasty
Member
 
Join Date: Jun 2009
Posts: 31
MingoDynasty is unknown at this point
"a way too big filesize" seems a bit too subjective, especially since later in your guide you suggest 1gb to be an ok filesize; 1gb may be alot for certain people.

I noticed you suggested to do quantizer/CRF compression... what makes that better than multipass compression? I thought it was like outdated now that multipass options are available.

Generally a pretty good guide, but imo too much information/control the average machinima maker needs. Most people will be happy enough with the quality they get from clicking the Render As button in SVP and then just selecting x264 as the codec.
__________________
I make videos.
http://www.youtube.com/user/MingoDynasty
MingoDynasty is offline   Reply With Quote
Old 12-30-2009, 11:47 PM   #3
izolight
Initiate
 
Join Date: Oct 2008
Posts: 2
izolight is an unknown quantity at this point
Quote:
Originally Posted by MingoDynasty View Post
"a way too big filesize" seems a bit too subjective, especially since later in your guide you suggest 1gb to be an ok filesize; 1gb may be alot for certain people.

I noticed you suggested to do quantizer/CRF compression... what makes that better than multipass compression? I thought it was like outdated now that multipass options are available.

Generally a pretty good guide, but imo too much information/control the average machinima maker needs. Most people will be happy enough with the quality they get from clicking the Render As button in SVP and then just selecting x264 as the codec.
As an example for the filesize/bitrate with a given crf of 26 and a resolution of 1920*1080

Lord Marrowgar video: ~8700 kbit/s
Lady Deathwhisper video: ~8000kbit/s
Gunship Battle video: ~5500 kbit/s
Deathbringer Saurfang video: ~4000kbit/s

So this should be pretty much the range one can expect with that crf and resolution as the first video has much (camera)movement and fancy effects like the fire on the ground that eat bitrate while the last one is pretty much just one perspective without much happening.

Well the advantage of crf compared to multipass is, you always have the same quality, whereas you have to tweak the bitrate a bit according to your footage with multipass and in most cases you don't have to hit a certain filesize so there is no need for multipass. And crf is also a bit faster than 2pass.

I know that there is also an option in sonyvegas for x264 if you have the vfw codec, but 1st you can only choose avi, which wasn't supposed to have avc content in it and has a bit too much overhead compared to mkv and mp4. Also the vfw version of x264 is very outdated and doesn't include at least 2 new algorithms which really improved the quality/bitrate.

Also it is actually less work than it looks at first because it is basically just clicking render on vegas and then encode on the x264 gui and the muxing part because most times your settings will be the same.

Last edited by izolight : 12-30-2009 at 11:53 PM.
izolight is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Forum time (GMT) 11:05 PM


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.