PDA

View Full Version : GA movie


murder inc.
10-22-2008, 09:43 AM
here is my evil plan:

set lowest possible settings for maximum recording performance
record as many demos i can get
set highest possible settings for maximum quality pictures, go to 800x600 resolution, that will be used for my video.
find those interesting parts
convert them to image sequences:

/cl_avidemo 30
/demo [demoname]

this will store each frame in my demo as a TARGA picture (note, 30 frames per second * 10 minutes * 1.2mb filesize on 800x600 makes for about 20 GB (!!!) of diskspace usage)

find these images containing the scene i want to encode, trash the rest

use virtualdub and xvid codec to convert them to avi

whew, now i got a nice movie without sound.
in hl2 engine, it works quite the same way, but it also saves the sound into a wav file, seems IW forgot about that part.
well, now it gets a little dirty, i use some recording program like audacity and let it listen to stereomix input. then i get ingame and do

/cl_avidemo 0
/demo [demoname]

and hope no other programs will produce sound while its playing. not really state of the art, but it works.. it will record sound before and after playback that needs to be cut off.

that is where i am stuck for now, still looking for a nice freeware tool to synch audio and video and put them together...

edit:

nvm, works with virtualdub too.

sooo, time to catch some frags :p

everyone, if you want to contribute to this, record demo's of yourself or other players, your name will be shown in credits (if you like) :D the more people contribute, quicker will we have our first release :p
if you cought some epic kills on tape, get me on xfire and i will see how i can build them in.

keep in mind, this shall not be a simple frag movie - quality over quantity :)
only footage that actually contains some epic scenes will be considered.
epic for example = rush in a building and kill the entire team, pull off some lucky headshots across the map, kill someone with a smoke nade, jump of a building and get some crazy kills etc...

for obvious reasons i can't implement every random frag you folks get, so don't be offended if your contribution won't make it in ;)

Col. Bat Guano
10-22-2008, 10:22 AM
So you want demos, right? Does it matter what video settings we have?

Torpedo Ted
10-23-2008, 01:41 AM
It doesnt matter what video setting you have. The person watching the demo will see it with their settings not yours. Thats why i always demo with low quality for max fps, and i fraps demo with high graphics for the looks.

Dang i had a crazy clutch ace in a scrim last night, but i didnt make a demo of it. I wish i did so bad :(

Dopefish
10-23-2008, 02:19 AM
Murder, I do something similar for videos, but I take far more steps and make mine far more complicated because the quality it produces has yet to be surpassed.

Tools I use:
AviSynth
x264
VirtualDub/Vegas/Final Cut/whatever works for you

When producing the TGA files, I set the game to 1280x720 for native 720p. I crank every graphic setting up, and I use the console to force AA to 16x (since the menu only goes up to 4x for some reason).

I'll usually go through the demos and find the scenes I want. I use cod4player to easily fast-forward to the spot I want (later) once I've found it.

From here, I'll drop the console and use /cl_avidemo 300. Yes, 300. There's a lot of nice things you can do if you record at a higher frame-rate. Since you're just recording specific clips at once, the time isn't too long and you won't run out of space. Once I have the clip, I'll store it in a lossless file to save space (more on this later).

Now, once you have the clip you want at 300 FPS, you use AviSynth to throw it into a script, like so:

ImageSource("shot%04d.tga", 0, 4990, 300)
AssumeFPS(300)
ConvertToYV12()

Save it as "video.avs" or whatever you want. You can then play this .avs file inside of MPC or whichever media player you use.

At this point in time, you can store it in a lossless file with x264 to save on space. You can do this by using this command:

x264 --qp 0 -o output.264 input.avs

This will cut down on the size considerably.

Now repeat the process for all the clips you want.

For compatibility with VirtualDub, you can try to store it in a lossless huffyuv format. It will take a little bit more space than the x264 version, but it's faster for loading and editing.

Having the higher framerate allows you to do nice things like slow-motion scenes and proper motion-blur. You want to do motion-blur as one of your last steps so that the framerate is consistent. If you want to slow a scene down by half, and have it remain smooth, you'll be cutting down the framerate to 150. In the non-slow scenes, you'll also want to drop these to 150 FPS (drop every other frame) so that the overall framerate is consistent.

Once you have your final product, and using 150 FPS as an example, I usually re-dump these to PNG files (not TGA) so that it still uses less space, but I have access to the direct frames.

Then I'll throw together another AVS script to add motion-blur:

ImageSource("%08d.png", 0, 9998, 150)
AssumeFPS(150)
ConvertToYV12()

bv = MVAnalyse(isb=true, truemotion=true)
fv = MVAnalyse(isb=false, truemotion=true)

last.MVFlowBlur(bv, fv, blur=75).TemporalSoften(1, 255, 255, 50, 2)

SelectEvery(5, 1)

A lot of videos online use a technique called "frame-blending." This is not the same thing as actual motion-blur. With frame-blending, they're basically taking previous flames and kind of fading them out and letting the frame trail on slightly. The problem with this method is that the previous frame is still "sharp." You can see all the detail and it just looks kind of bad.

The method above actually calculates motion-blur based on the motion-vectors of each frame. It analyzes the previous and next frames for the motion-vectors and it actually applies a blur. The end result of this is pretty amazing.

The SelectEvery(5, 1) function will select every 5th frame. 150 / 5 = 30 FPS, which will be the final frame-rate for the video.

From here, you can add film-grain or other effects if you wish.

Now you need to encode it to the final format.

Again, we use x264. The options I list below will provide the absolute best quality encoding. Also, it will take a long time to render. :)

x264 --bframes 16 --b-pyramid --direct auto --ref 16 --crf 22 --partitions all --weightb --me tesa --subme 9 --mixed-refs --8x8dct --no-fast-pskip --no-dct-decimate --trellis 2 --qpmin 0 --threads auto --progress -o video.264 input.avs

--crf 22 is the overall quality (like bitrate). The difference is that it maintains a constant quality. This makes predicting output filesize and bitrate difficult. The benefit is that the video will have consistent quality throughout. The lower the number, the higher the overall quality.

If you want to specify a bitrate, you'll want to do two passes, and it will take longer. To switch from CRF to bitrate, remove --crf 22 from the line, and replace it with: --pass 1 --bitrate 3000. Run that once. When it is done, do not delete, move, or touch any files it produced. Edit the command and replace --pass 1 with --pass 2. When that is finished, you'll have your final product.



Once you have all of the video stuff done, it's time for the audio.

The audio isn't complex. Just make sure you use an uncompressed WAV file the entire time so you can add-on and splice everything together. Once that is done, I usually encode to AAC since its quality is superior to that of MP3, yet still remains small.

If you want to normalize the audio, I use... normalize (http://normalize.nongnu.org/). You can normalize it based on the overall audio dB, or based on the peak dB.

I use neroaacenc for this. I forget where to get it, but a Google search should yield it. It's a free tool put out by Ahead.

neroaacenc -lc -if audio.wav -of audio.mp4 -q 0.35

This will encode the wave to AAC. It unfortunately outputs it inside of a MP4 container already. For this, I use mp4box to extract it:

mp4box -raw 1 audio.mp4

You should have audio_track1.aac afterwards and you can delete the MP4 file.


Now it's just a matter of multiplexing these files together into a container.

You can use MP4 or MKV. MP4 is more common and supported, but MKV is superior in features. It's up to you.

For MP4, use (this may need slight tweaking since I don't use this much):
mp4box -add video.264 -add audio.aac -fps 30.000 output.mp4

For MKV, you'll still create an MP4 first, so that MKV can extract information:
mp4box -add video.264 -fps 30.000 output.mp4
mkvmerge output.mp4 -D audio.aac -o output.mkv



Complicated? Yes. :)

I have a few samples online of the process of this. Not all of them employ the stuff I listed above since it's an ever-evolving process, but you'll get an idea of the quality.

CoD4, 1280x720, 60 FPS, Motion-Blur, Super-Smooth, No Audio.
http://imk.cx/temp/cod4mbtest.mkv

WiC, 1280x720, 30 FPS, Motion-Blur, No Audio.
http://imk.cx/videos/WiC_FuelAirBomb.html

WiC, 1280x720, 30 FPS, Motion-Blur, Film Grain, No Audio.
http://imk.cx/videos/WiC_A2A_3.html

CS:S, 1280x720, 30 FPS, Motion-Blur, Simple Effects, Sped-Up Scenes.
http://imk.cx/videos/CSS_Ace.html

CS:S, 1280x720, 30 FPS, Motion-Blur, Simple Effects, Sped-Up Scenes.
http://imk.cx/videos/CSS_1v4.html

CS:S, 1280x720, 30 FPS, Motion-Blur, Bilateral Filtering, Sobel Edge Detection, RGB Adjustments
http://imk.cx/videos/CSS_3xM4HS_1.html
http://imk.cx/videos/CSS_3xM4HS_2.html

murder inc.
10-23-2008, 04:41 AM
hi dopefish, your input is highly appreciated.
this is my first video, so i tried to keep steps as simple as possible for the beginning. getting the right settings for xvid in virtual dub alone took me a few hours.. lol :p
your procedure seems like a ton more professional and that post will sure help me on my way through all this!
:) thanks!

edit:

i just found time to read through all this, damn that stuff is pretty deep :p
i guess without that tut i'd sit for two month without getting anywhere... you just saved me a lot of time and brain cells :D

KocK GoBlin
10-23-2008, 09:27 AM
Whatever just happened to using good ole Fraps :icon_eek:
Remind me to pin this to the Technical Help forum when you guys are done in here.

Torpedo Ted
10-23-2008, 04:42 PM
Wow i was frapsing my demos, im gonna try it this way, the quality should be much nicer. But with avidemo at 300, how does it make your video choppy.

Edit: wow im an idiot, of course its gonna slow down its taking tga's, i had to think on that for a while. Just never mind the question above.

Well i tried your method out, and i played the script in virtualdub, but its like in super slow motion.

Dopefish
10-23-2008, 08:26 PM
Yeah. It's not going to play fast since your harddrive can't support reading 300 FPS with large TGA files. ;)

It's just for preview before you start making your changes.

murder inc.
10-27-2008, 11:08 AM
problem i am stuck with...

http://img384.imageshack.us/img384/5943/00000008dn1.png

that is how my png files look like when i re-dump them with mplayer from the lossless x264 file.

thats also how my lossless x264 file looks like when i play it in vlc...

plain fugly :p


ImageSource("shot%04d.tga", 0, 4990, 300)
AssumeFPS(300)
ConvertToYV12()


x264 --qp 0 -o output.264 input.avs

thats what i used to produce the lossless file. filesize is about 1,3 GB.
when i extract the png files with

mplayer -vo png output.264

the files look like above, and are also slightly bigger then the initial tga files - with compression z=1, the files are about half the size.

edit:

the input.avs script looks proper when playing in virtualdub.

Alien
03-25-2009, 09:22 PM
I'm not as tech savy as some of you so I am stuck on the part where you use Avisynth to make the first script out of the TGA's. I can get the TGA's and everything but I don't get how to get the script to include every single TGA in the file.

murder inc.
03-25-2009, 09:35 PM
i will see where i have my scripts on weekend.
the movie making ain't a problem so far, the problem i still have is to get the ingame sound into my movie and make it fit...

n00b
03-26-2009, 12:37 AM
Maybe this link (http://nickyguides.digital-digest.com/audio-synch.htm) can help. Assuming there are problems.