 |
own-age

Site Developer
Join Date: 11/3/2002
Posts: 3758
Location: St. Louis, Missouri
|
 |
|
I've decided to take a small break from coding and sit down and explain a few codec features along with the best practices for creating a better quality final video. This article will explain: 1. Planning what codec you should use for your footage 2. Advanced methods of capturing image quality 3. Common codec features 4. Why gaming videos are larger in size
First I want to state that in no way do I consider myself an expert on the use of codecs nor can I explain everything about them. But through a lot of trial and error I can explain some of its features and save you quite a bit of time and hopefully, give you a better quality final video.
1. Planning what codec you should use for your footage.
Now, before you go run off and make all your avi's trying some of the steps mentioned in this article, you have to realize that your final project can only be as good as its source. So you must take proper steps to get and preserve the quality of your footage files before you make your final project.
Most computers today have a fairly large amount of hard drive space. If quality is what you want, you must be willing to sacrifice some storage for footage. If you have a large amount of extra storage and really want to have a good quality video, I would suggest rendering all your footage files as uncompressed avi's. Uncompressed = undamaged/untampered footage. It contains an exact replica of the source. Uncompressed comes at a great expense.. Large hard drive space.
1 Minute of 320x240x24 uncompressed avi ~ 402 megs 1 Minute of 640x480x24 uncompressed avi ~ 1.57 gigs 1 Minute of 720x480x24 uncompressed avi ~ 1.76 gigs (this is dvd resolution) 1 Minute of 800x600x24 uncompressed avi ~ 2.45 gigs
This should give you an idea of what kind of room you may need if you are wanting your source files in uncompressed avi's.
If you are working in uncompressed, save all footage/non-final videos in uncompressed format to preserve the quality your keeping.
If you are limited on space, I would suggest using the highest possible quality that divx can provide. Read below to figure out exactly how to get the highest quality. If you already are not using uncompressed, your results may not be as good as you would like.
2. Advanced methods of capturing image quality. the following section can be considered overkill and can be very tedious and time consuming
This section assumes you already have your FSAA on as well as anisotropic settings on. This section also requires that you have photoshop installed to do some of the steps provided.
Even if you cl_avidemo your commands with a great visual config and with all your fsaa and anisotropic features set to the max, your footage still contains flaws. This section will help you to clean up those flaws and give you a sharper, cleaner, more vivid screenshots.
Here are 2 image examples of the difference between a regular image taken at 800x600 and a resized image from 1600x1200 (zoomed to 300%):
 |  |
Notice the detail and the edges between the two.
Below are the same 2 images, except in 100% zoom
 |  |
The plus side to this is your edges will be smoother. There will also be a slight increase in depth and textures as well as more vivid colors.
Before you can take advantage of this method, you must know what size you want your final video to be. This involves resizing images down to the final image. Resizing videos/images to a size greater than its original size is not recommended because it will cause your video to look blurry and lose colors.
I mentioned this section was overkill because in order to take advantage of this feature, you must render your initial images (using cl_Avidemo) at a high resolution (much greater than your final product). Some video cards/monitors may not be able to produce a higher resolution, which I recommened in this segment. If your card is capable of handling such resolutions and you want to have the absolute best image quality, I would recommend reading this segment. (otherwise skip this section)
I will walk you through the steps required to make a video in 640x480 resolution using my 'advanced image quality capturing' technique.
First, in your video config, (whether it be quake/jk2/rtcw/sof2 or any other game that renders images out of the game) you will need to change your resolution to a higher amount than your game config. I suggest using 2 times whatever resolution you plan to have your final video at. In this example, my final video will be 640x480 so I will need to change my video config rez to 1280x960. If that resolution setting is not available, you may want to make some changes to your action file before resizing the image down to your final image (in this case, 640x480).
Once you change your rez, render out a few shots at the given resolution. You may notice that while in the demo, demo playback may seem very choppy and especially very slow and sluggish when using your 'cl_avidemo' command (or whatever command you use for the game). Don't worry, your video will still be just as smooth as any other setting. Quake automatically slows down the gameplay to capture the given framerate entered into your cl_avidemo command. So bottom line, it may be choppy/sluggish/slow while recording, but that doesn't mean it's going to be choppy/sluggish/slow when it's the final product.
Alright, now that you have your tga's, you will have to set yourself up with a photoshop action. (you can re-use this action for later videos if you wish)
To create an action in photoshop follow the steps provided below:
- Open photoshop
- Create a new document (doesn't matter what size it is..but just to be on the safe side.. create it as the size of your original screenshot sizes.. for this example I will use 1280x960)
- You will need to show your action toolbar which can be done by going to:
Window : Actions.
First, lets get familiar with the action window:

yeah, that pic just about sums it up.. moving on ..
- create a new set, give it a name, and hit 'ok'
- Next, create a new action. Give this a name as well and then hit record. Now, before you go off and start trying to do stuff, remember that once you hit that record button photoshop is recording every action you complete. If you edit your image, and then do what you want it to do, it will repeat all the steps unless you edit it after stopping the action..
- now that you have photoshop recording your action go to:
Image : Image size...
A new window should appear similar to this:

Here you set your image size and everything according to how you want it. If your final avi size is going to be 640x480, set it as shown in the image above. Important: To get the best image quality, make sure resample is selected and make sure the resample listbox is set to "bicubic" as shown in the image above.
- After that, stop recording your action by clicking the red stop light looking button found in your actions toolbar. (the toolbar that looks like the first image)
Now that you have your new action, you will have to run a batch process on all your screenshots created from your cl_avidemo command which was done earlier.
Here are the steps for running a resize batch process on your screenshots:
- go under file/automate/ batch...
in play: under set: select the action folder where you created your resize action under action: select your resize action
- choose the source (your q3 screenshots folder with all the screenshots in it)
- under destination, select save and close, and run the batch.
Now, while the batch is running, you should notice your images being opened and then resized and closed. It may take some time to go through all your screenshots, so please let the batch run and you will know when it's done when photoshop is just sitting idle. (not doing anything)
Now you have your sharper, cleaner, more vivid images which will provide a better source file than just rendering your footage in just 640x480 mode. Render your screenshots to uncompressed avi's (or whatever codec you are using for source files) and you're ready to edit.
3. Common codec features explained.
Quantizer Restrictions
Ah.. quantize.. If you've been snooping around on this forum you may see this often. Quantize in codecs is kind of like picmip in quake/jk2/rtcw/sof2 or any other quake engine based game. The higher the number, the lower the quality. 1 Being the highest (quality near uncompressed). The ACTUAL definition of quantizer is the level of detail removal.... You can see where the higher the number.. the lower the quality comes from.
Most codecs that have the quantize feature customizable (a good known example is XviD) have 4 settings (some have only 2). These settings will look something like this: Min I-Frame quantizer Max I-Frame quantizer Min P-Frame quantizer Max P-Frame quantizer Some codecs may only have 2 settings like 3ivx, they just lump the P and I together and use: Min quantizer Max quantizer
Now you're thinking, yea that's nice, but what do they mean?!?! I'll explain the 4 settings(seen in XviD):
First off, each one of these settings should contain a whole number (1,2,3...) that is greater than 0 and less than 32. 1 being the highest quality, 31 being the lowest. (I believe you can use higher then 31.. but who would want to??)
Here are the definitions:
Min I-Frame quantizer - The highest acceptable quality image the I-Frame, also known as the keyframe, can be. I will explain what I-frame/keyframe means in a second.
Max I-Frame quantizer - The lowest acceptable quality image the I-Frame can be. Again, I will talk about what exacty I-frame/keyframe is in a moment.
Min P-Frame quantizer - The highest acceptable quality image the P-Frame, also known as a delta-frame, can be. I will explain what P-frame/delta-frame means in a second.
Max P-Frame quantizer - The lowest acceptable quality image the P-Frame can be. Again, I will talk about what exacty P-frame/delta-frame is in a moment.
Alright, now that you know what the quantize values stand for, you have to know a little bit more about videos and what exactly the I-frame (aka keyframe) and P-frame (aka delta-frame) are.
Best way of explaining what P-frame and I-frame mean is to show you an image:

As you see, there are more delta(p-frames) than keyframes(i-frames) so it is important not to set your min/max pframe settings to such a low number. It will create an outrageous file. Your Keyframe(i-frame) is in sense the primary frame which the delta frames follow. It is important that the keyframe(i-frame) is set to a high quality(low quantize number). Here are a few sample videos taken from the AnnihilatioN complete uncompressed source (original size 800x600):
(All the files are From a 10 second clip found in the "rob zombie" section. For filesize demonstration purposes the avi's do not contain sound.)
The following avi's are using the xvid 1.0 beta codec which can be downloaded at: http://www.xvid.org/
Also, the avi's below were all rendered in single pass with the exact same settings unless specified in the table.
Now, before I explain how you should define your quanitize settings, let me explain the bitrate setting: Bitrate, in most codecs, means what average rate (KB), per second ,you would like to achieve. This does not mean it will max out at this specified bitrate nor does it guarantee that the rate will be at least this rate or better. Depending on your quantize min and max ranges, it will help determine for each frame what quantize setting to use.
Defining your bitrate/quantize settings...
Now, when defining your quantize settings you wish to use, things can get a little tough. Depending on what quality you want, you can determine your bitrate/quantize settings. If you use a bitrate that's too low or not suitable for your avi, your avi will constantly be hitting the max-p setting (the lowest acceptable quality p-frame setting) which may result in your video looking bad (but it may exceed your bitrate entered in by a large number). Now if you set your bitrate too high, it will run on your min-p and min-i frames which will produce an avi that's too large in size. So each video will have a different setting and may require a few attempts to get the proper bitrate/quantize setting. Remember: always render a few different settings before you publish your video.
As a bitrate/quantize setting example, In the past, I have used the following settings for my AnnihilatioN video: (using the XviD codec) Min I-Frame quantizer = 1 Max I-Frame quantizer = 3 Min P-Frame quantizer = 1 Max P-Frame quantizer = 8 Bitrate = 2,350 kbps
4. Why gaming videos are larger in size.
Alright, as many of you probably download other forms of media, you may ask yourself "Why is this 60 minute movie only 300 megs.. when my 22 minute quake video is 300 megs?"
With today's games, there are more vivid colors, more detailed maps, and also the major contributor, there is more motion involved. A video's size greatly depends on the amount of motion or math that is involved inside the video. Take a look at some of these avi's from quake 3 arena for example:
Note: All the avi's found in the table below are rendered using xvid 1.0 settings with Quantize settings set at: min-I 3, max-I 4, min-P 3, max-P 4. and the bitrate: 1500kbps
As you can see by the avi's given above, the more movement, the higher the filesize. Also notice that I included a real high picmip version as well. Now because you see a better filesize turnout on the picmip 10 avi, doesn't mean we should all use picmip 10 and ruin the effects the game produces.
I included the 10 picmip to show that detail also is a large factor for filesize. You're not going to see a huge change from picmip 1 to picmip 3 or vice versa. It's better to use the better picmip and lock in your game's quality. After all, what good is all this stuff mentioned in this thread if your source looks like crap to begin with?
Most videos today contain special effects and/or non-first person perspective shots which SHOULD improve their final project filesize. Hopefully with what I've shown in the above table, it will drive you to make more third person pov/special angle shots. The more of those you have, the more "unique" your video may be. Also, as a benefit, your video will become smaller in filesize while locking in that good quality look to it.
That about sums up what I have taught myself over the past 2 years for quality and codecs while editing gaming videos. I decided to write this thread because I feel most people don't know what all is involved in getting quality images and transferring the quality to the final video. Hopefully, we can see some better compressed videos, being both higher quality and lower filesize, in the future.
 Sean 'own-age' Kuehnel |
IP: Logged Modified by IP: Logged |
Posted: 12.3.03 @ 5:38 PM Last modified: 12.5.03 @ 5:43 PM |
|
 |
|
|
 |
rocketheat

Regular User
Join Date: 12/6/2002
Posts: 256
Location: Dallas, Texas
|
 |
|
finally my friend, maybe this will educate, and not edumacate.... :) read em and weep, the man knows his shiz.

quake 4 is a ton of fun. |
| IP: Logged |
Posted: 12.3.03 @ 10:51 PM |
|
 |
n1ghtw1ng

Regular User
Join Date: 6/1/2003
Posts: 387
Location:
|
 |
|
|
|
 |
spookmineer

Site Admin
Join Date: 11/8/2002
Posts: 1435
Location: the netherlands
|
 |
|
Very good tutorial :D

|
IP: Logged Modified by IP: Logged |
Posted: 12.5.03 @ 5:24 PM Last modified: 12.5.03 @ 5:43 PM |
|
 |
oTis

Site Admin
Join Date: 6/22/2003
Posts: 1531
Location: ON, Canada
|
 |
|
wow, this was quite the lengthy and informative tutorial sean, nicely done! i'm sure many people will definately get what they need from this one.

 |
| IP: Logged |
Posted: 12.5.03 @ 10:27 PM |
|
 |
SmileY

New User
Join Date: 11/26/2003
Posts: 13
Location: Netherlands
|
 |
|
Nice... :)
There is one thing that you should do some tests with Anti-Aliasing... I say this mainly because when you have to resize your video file, the quality will also be dependant on the editing program you use.. some resize better then others. With anti-aliasing set to 6x, you can record video (or play a game) under 640x480, whilst the image quality is comparable with at least 1280x960
 ~Alpha Brainwave Activity~
 |
| IP: Logged |
Posted: 12.8.03 @ 2:47 AM |
|
 |
own-age

Site Developer
Join Date: 11/3/2002
Posts: 3758
Location: St. Louis, Missouri
|
 |
|
| SmileY wrote: | Nice... :)
There is one thing that you should do some tests with Anti-Aliasing... I say this mainly because when you have to resize your video file, the quality will also be dependant on the editing program you use.. some resize better then others. With anti-aliasing set to 6x, you can record video (or play a game) under 640x480, whilst the image quality is comparable with at least 1280x960 |
This is why I wrote the advanced stuff with photoshop, because it has bicubic resampling.
 Sean 'own-age' Kuehnel |
| IP: Logged |
Posted: 12.8.03 @ 7:18 AM |
|
 |
raVenn

Regular User
Join Date: 12/8/2003
Posts: 75
Location: Poland, Tarnów
|
 |
|
Sean, i make evertthing as u said, but if i export movie with xvid, my quality is good :) but the filesize is very bad, i have 10 secs long avi, but its size is 60 mb:( what do i do wrong?? i saw your file in tutorial with fast motion bitrate 1500 quantize 3,4 3,4. I made everything as you told in the tutorial, and my size is terrible :(
SORRY FOR SPELLING MISTAKES
edit: I use the newest xvid 1.0, the only thing I didnt do as u said, is the FSAA and something with the graphic card because I dunno where is it:P I looked everywhere but it isnt trouble because my quality is good and the problem is my filzesize :( PLEASE HELP ME:P
 Tomasz "raVen" Slusarczyk...
My productions:
1.Fragtime
2.The pa1nful movie
Upcoming production:
Fragtime 2
raVen - e-movie.pl redactor ;)
|
IP: Logged Modified by IP: Logged |
Posted: 12.8.03 @ 9:12 AM Last modified: 12.8.03 @ 9:16 AM |
|
 |
own-age

Site Developer
Join Date: 11/3/2002
Posts: 3758
Location: St. Louis, Missouri
|
 |
|
your quantize settings may be set too high, also, what codec are you using? if its xvid, make sure that "motion search precision" is set to 6 (very high) Because gaming videos has a ton of motion.
 Sean 'own-age' Kuehnel |
| IP: Logged |
Posted: 12.8.03 @ 9:19 AM |
|
 |
SmileY

New User
Join Date: 11/26/2003
Posts: 13
Location: Netherlands
|
 |
|
This is why I wrote the advanced stuff with photoshop, because it has bicubic resampling
^I see.. but is that still better then using 8x anti-aliasing? I'll do a test later today...
also... in these quake-engine based games, image are exported as .tga but in other games there is usually the choice between .bmp or .jpg... now ofcourse .bmp seems like the most logical step, but for some reason the text in-game is much sharper using .jpg .... what could be the cause of that?
 ~Alpha Brainwave Activity~
 |
| IP: Logged |
Posted: 12.9.03 @ 7:35 AM |
|
 |
own-age

Site Developer
Join Date: 11/3/2002
Posts: 3758
Location: St. Louis, Missouri
|
 |
|
that I can't say cause I've only worked with the q3 engine.
You can use FSAA 8x AND the advanced stuff with photoshop.. It should be a bit better then 4x.. My graphics card only does 4x so thats why I mentioned 4x
 Sean 'own-age' Kuehnel |
| IP: Logged |
Posted: 12.9.03 @ 7:52 AM |
|
 |
raVenn

Regular User
Join Date: 12/8/2003
Posts: 75
Location: Poland, Tarnów
|
 |
|
sean, what card do u use?? geforce, radeon, or maybe something other :P??
 Tomasz "raVen" Slusarczyk...
My productions:
1.Fragtime
2.The pa1nful movie
Upcoming production:
Fragtime 2
raVen - e-movie.pl redactor ;)
|
| IP: Logged |
Posted: 12.9.03 @ 9:56 AM |
|
 |
x.deffy

Regular User
Join Date: 11/7/2002
Posts: 1062
Location: Ft. Worth, TX
|
 |
|
later today, i can give you a step by step tutorial (very quickly) on how to change anti aliasing and anistropic filtering on ATI Radeon cards... maybe even nVidia cards but its been a while so dont bet on it..
 ...like these blossoms, we are all dying. To know life in every breath. Every cup of tea. Every life we take. The way of the warrior.
TCL - coming in like 2035...but hopefully by this summer. |
| IP: Logged |
Posted: 12.9.03 @ 10:16 AM |
|
 |
own-age

Site Developer
Join Date: 11/3/2002
Posts: 3758
Location: St. Louis, Missouri
|
 |
|
i have a msi gf4 4200
 Sean 'own-age' Kuehnel |
| IP: Logged |
Posted: 12.9.03 @ 1:00 PM |
|
 |
raVenn

Regular User
Join Date: 12/8/2003
Posts: 75
Location: Poland, Tarnów
|
 |
|
| x.deffy wrote: | | later today, i can give you a step by step tutorial (very quickly) on how to change anti aliasing and anistropic filtering on ATI Radeon cards... maybe even nVidia cards but its been a while so dont bet on it.. |
it would be very helpful :D 333
 Tomasz "raVen" Slusarczyk...
My productions:
1.Fragtime
2.The pa1nful movie
Upcoming production:
Fragtime 2
raVen - e-movie.pl redactor ;)
|
| IP: Logged |
Posted: 12.10.03 @ 2:31 AM |
|
 |
fei

Regular User
Join Date: 7/14/2003
Posts: 1846
Location: retirement home
|
 |
|
|
|
 |
twisted

New User
Join Date: 1/2/2003
Posts: 5
Location:
|
 |
|
| excellent article! |
| IP: Logged |
Posted: 2.20.04 @ 7:03 PM |
|
 |
joker86

Regular User
Join Date: 3/11/2003
Posts: 110
Location:
|
 |
|
| good article :] |
| IP: Logged |
Posted: 2.21.04 @ 7:48 PM |
|
 |
[PT] TANIA
![[PT] TANIA](/avatars/useruploaded/[PT] TANIA604164proclamation_avatar.jpg)
Site Admin
Join Date: 12/11/2003
Posts: 4327
Location: FOREVER3
|
 |
|
Read it all, i used to put Dr Divx in the work but i've tried Mpeg4 Xvid (don't know if is the same as xvid1.0) and been testing and is very cool to control better the quality, but you are pro coders and you must feel right with this codec lol Divx is more lam to code :D
And thanks for explaining the I and P's, what i understood is that the keyframe is supossed to be as high as possible because all the other will guide themselfs by that one only the diferences etcs right?
 Premonition (lame trailer) Proclamation (lame thread) Tania's tips for a top movie
FOREVER 3 |
| IP: Logged |
Posted: 2.25.04 @ 7:04 PM |
|
 |
xelage

New User
Join Date: 3/1/2004
Posts: 1
Location:
|
 |
|
hi @ all i search a tutorial in german... do you now, where it is one?
greetz xelage
ps: i can't good english... |
| IP: Logged |
Posted: 3.1.04 @ 4:08 PM |
|
 |