1. Post #1
    The Cold Wind Of France
    Dennab
    November 2008
    18,691 Posts
    Software you will require:

    Source Filmmaker (bet you didn't see this one coming)
    Any software capable of interpreting PNG sequences together (VirtualDub, Vegas, Premiere, After Effects, etc.)
    Video editing software (that may or may not be capable of the above). For this tutorial we're assuming you'll be using Sony Vegas 11.
    UT Video Codec suite, an excellent lossless AVI-based codec (grab the latest one here)
    XMedia Recode MediaCoder's latest versions do some really weird shit

    If you want the benefits of H.264's great compression without the awful implementation by Valve that plagues TF2 and SFM, here's what you gotta do. Export as Image Sequence > PNG. This will allow lossless export. AVI files are also lossless, but unlike PNG, they're slow, huge, and unreliable, because they're uncompressed (and Valve hasn't implemented OpenDML so they corrupt real fast)

    From here, you have TWO choices.

    If you are using a video editor that allows you to import image sequences, you can skip ahead to that part. If not (or if you'd rather transform the image sequence to an AVI first), read on.



    VirtualDub is easy enough to use, drag-and-dropping the first frame of the PNG sequence will automatically open the whole thing as a clip. You will need to go adjust the framerate (Video > Frame rate) and choose UTVCS RGB (Video > Compression).

    UT Video is there as a lossless "working" format. Uncompressed AVIs are slow and bulky. UT is an AVI VFW (video for windows) codec that losslessly compresses frames. Compared to the final upload, anything, UT or uncompressed AVI, is too large. Until the final result (.mp4 / .mkv file), you should always be lossless.



    Onto Sony Vegas now.

    FIRST OFF: TWEAK YOUR GODDAMN SONY VEGAS PROJECT SETTINGS!!! So few people do this, and their video ends up looking muddy or terrible as a result. Make sure your project framerate matches with your footage or it will look like this instead of this terrible frame ghosting effects!

    Make sure that you're not using the default for-US-broadcast-television settings Vegas comes installed by default with. Set field order to none, pixel aspect ratio to 1.00, framerate to whatever you think you'll be using the most, and of course the width/height. Tick "start all new projects with these settings", click OK, and restart Vegas.

    You should also make sure you're in 8-bit color mode if you're importing the PNGs into Vegas directly. Speaking of which, here's how to do that: go to file > import > media.



    Select the first frame of your PNG sequence, and make sure to tick that checkbox at the bottom. It says "open still image sequence".

    You can edit your footage however you want in Vegas, cut it together etc etc the usual stuff.

    Once you're done with it, make sure to reexport from Vegas as a lossless AVI compressed with UTVCS. Sony Vegas's encoders are pretty terrible too.

    There's a double trap here; the exporter settings don't always read off your project settings. You could be exporting as something completely different than what you put in the project properties.

    Expand the Video for Windows (.avi) category, pick any preset, and click "customize template". Here's what you should put in (don't forget to tweak that goddamn framerate to whatever you're using!!)



    (also head to the audio tab and make sure everything's in order)

    Let's hope you did everything correctly and export your AVI from Vegas!

    Now grab your final lossless AVI and drag and drop it into the XMedia Recode window. Then click on the file row at the top (or you won't get the format tabs)

    Recommended encoding settings (don't steer off that path unless you're familiar with how video compression works):



    Set the format to Matroska Audio/Video. Mastroska is one of the most flexible containers available to you.

    Important distinction to make since it's where most people don't make the distinction: a container holds audio/video streams. It is not the format per se. When people say "MP4", they usually mean either H.264 (the video format in the MPEG4 specs) or AAC (the audio format from the same specs). But MP4 is first and foremost a container type. You can have "MP4 video" (H.264) in another container in our case, Matroska.



    Set Codec to MPEG4 AVC / H.264. Set the bitrate to ~5000 if you're encoding 720p, ~8000 if you're encoding 1080p. More if you have a lot of fast moving scenes etc., and less if you have lots of static shots that don't require a lot of bitrate.

    Set rate control mode to 2pass. In a nutshell, this will ensure that the bitrate is adequately distributed where it's needed.

    Set the preset to at least medium. Go for very slow if you're got a good CPU.



    Set B-frames to 3 and adaptive b-frames to optimal.



    Audio settings! Use Vorbis. (it's what people think of when they say "ogg". as we said above, OGG is actually just the name of the container) It's superior to AAC-LC, especially since XMedia Recode's AAC encoding library is very bad. q5 160kbps should do you fine :)

    Then click add job, and you can go to the Jobs tab to review the list of things that are going to be encoded once you press encode (so in our case, there should be only one).

    And there you go! You'll have a much

    Here's a comparison between x264 and MainConcept (Sony Vegas' default H.264 encoder).

    Reply With Quote Edit / Delete Reply Windows 7 France Show Events Winner x 26Informative x 2Useful x 2Dumb x 1Friendly x 1 (list)

  2. Post #2
    BART!'s Avatar
    July 2010
    200 Posts
    Great! Thanks again, Max.
    Reply With Quote Edit / Delete Reply Windows 7 Chile Show Events Agree Agree x 1 (list)

  3. Post #3
    Abused by Girlfriend
    geogzm's Avatar
    January 2010
    19,785 Posts
    Max's tutorials should be stickied
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Agree Agree x 8Friendly Friendly x 1Disagree Disagree x 1 (list)

  4. Post #4

    July 2010
    62 Posts
    I disagree with your bitrate choices.

    With videos that don't have much constant full motion like rain and grain, you can get away easily with a 2500 kbps encode, while adding such things can force you up to around 18000 kbps. You could argue that since Youtube compresses videos regardless, that you should save space and render at a constant bit-rate, but you never know when Youtube might decide to do an upgrade, or you may want to upload a video to an alternate source.

    Oh, and just so you know, those bitrates are estimates from 1080p24, as opposed to 720p30 that most people do.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Dumb Dumb x 4Disagree Disagree x 2 (list)

  5. Post #5
    The Cold Wind Of France
    Dennab
    November 2008
    18,691 Posts
    I disagree with your bitrate choices.

    With videos that don't have much constant full motion like rain and grain, you can get away easily with a 2500 kbps encode
    I can agree with that, I think

    I disagree with your bitrate choices.

    With videos that don't have much constant full motion like rain and grain, you can get away easily with a 2500 kbps encode, while adding such things can force you up to around 18000 kbps. You could argue that since Youtube compresses videos regardless, that you should save space and render at a constant bit-rate, but you never know when Youtube might decide to do an upgrade, or you may want to upload a video to an alternate source.

    Oh, and just so you know, those bitrates are estimates from 1080p24, as opposed to 720p30 that most people do.
    18mbps for 1080p with x264 would be really seriously overkill, even if you used the default "fast" preset... half of that will be more than enough already :/

  6. Post #6

    July 2010
    62 Posts
    I can agree with that, I think



    18mbps for 1080p with x264 would be really seriously overkill, even if you used the default "fast" preset... half of that will be more than enough already :/
    Grain takes a huge toll on your video :/

  7. Post #7
    The Cold Wind Of France
    Dennab
    November 2008
    18,691 Posts
    Grain takes a huge toll on your video :/
    I personally don't see the interest of grain as an effect to apply onto a whole video from start to finish. It's possible to get the whole "grain" vibe (old reel, etc.) with other postprocessing effects that don't cost nearly as much as you pointed out, it requires tons of bitrate.

    Hell, for the past 100 years, technology in photography has been actively trying to get RID of grain.
    Reply With Quote Edit / Delete Reply Windows 7 France Show Events Funny Funny x 4Late Late x 1 (list)

  8. Post #8
    CAS303's Avatar
    September 2009
    394 Posts
    Got UT Video Codec suite to show up in vegas and export fine, but MediaCoder fails to encode the AVI with a 014 error using identical settings to the image. Anyone else get this?

  9. Post #9
    dgg
    I ❤ Angel Beats
    dgg's Avatar
    October 2005
    26,535 Posts
    The only thing I disagree with here is that you don't put the audio quality at 320kbp/s (or whatever the max limit is for the AAC codec if it's below 320 (can't remember the limit in my head)).

    Audio on videos takes absolutely no toll on the filesize and there is no reason to compress it that low, no matter how you look at it.

    You're exporting video at several megabytes a second but don't like spending a few hundred kilobytes on audio? I'm sorry, what?
    Reply With Quote Edit / Delete Reply Windows 8 Norway Show Events Disagree Disagree x 3Agree Agree x 1 (list)

  10. Post #10
    The Cold Wind Of France
    Dennab
    November 2008
    18,691 Posts
    The only thing I disagree with here is that you don't put the audio quality at 320kbp/s (or whatever the max limit is for the AAC codec if it's below 320 (can't remember the limit in my head)).
    It's a personal preference thing, I guess.

    I see no reason to go up to 320kbps with AAC. With MP3, *maybe*, but with AAC? It's overkill. AAC encoders (nero and qt) are fully mature now, and even LC-AAC is much more efficient than MP3 (which always slightly fuzzes stuff even at 320).

    (on a side note: in MPEG4, YouTube compresses audio with AAC at 96/128/152 in 360p / 480p / 720p respectively)

    Audio on videos takes absolutely no toll on the filesize and there is no reason to compress it that low, no matter how you look at it.
    160kbps AAC is certainly not "low". Average, maybe; low, hell no (unless your audio track is 96khZ)

    You're exporting video at several megabytes a second but don't like spending a few hundred kilobytes on audio? I'm sorry, what?
    There's no perceptible difference by 99,9% of people between 160kbps and 320kbps AAC. However, with the settings I've provided, that's a difference of about 6% in the final filesize. I'll personally take the psychoacoustically imperceptible loss in audio quality.
    Reply With Quote Edit / Delete Reply Windows 7 France Show Events Zing Zing x 3Informative Informative x 1 (list)

  11. Post #11
    Gold Member
    gaminji's Avatar
    December 2010
    5,267 Posts
    Unless I did something wrong (and I probably did), my video lacks audio.

    Is there any step along the way where this might've happened to anyone else?

  12. Post #12
    The Cold Wind Of France
    Dennab
    November 2008
    18,691 Posts
    Unless I did something wrong (and I probably did), my video lacks audio.

    Is there any step along the way where this might've happened to anyone else?
    Does your AVI have the audio track in it? If no, that's where you went wrong.

    If you're using VDub, you need to import it through the audio menu.

    If your AVI does contain audio, then maybe you accidentally unticked "audio" in the audio tab in media coder
    Reply With Quote Edit / Delete Reply Windows 7 France Show Events Friendly Friendly x 1 (list)

  13. Post #13
    Gold Member
    gaminji's Avatar
    December 2010
    5,267 Posts
    Does your AVI have the audio track in it? If no, that's where you went wrong.

    If you're using VDub, you need to import it through the audio menu.

    If your AVI does contain audio, then maybe you accidentally unticked "audio" in the audio tab in media coder
    Thanks, that fixed it!

    And the final product does look a ton better than an MP4 rendered through SFM.
    Reply With Quote Edit / Delete Reply Windows Vista United States Show Events Friendly Friendly x 1 (list)

  14. Post #14
    I still use Sony Vega's H.264 because it has OpenCL support, and seeing I have a AMD graphics card, its really my only choice of not waiting 3 hours for something to compress.

  15. Post #15
    The Cold Wind Of France
    Dennab
    November 2008
    18,691 Posts
    I still use Sony Vega's H.264 because it has OpenCL support, and seeing I have a AMD graphics card, its really my only choice of not waiting 3 hours for something to compress.
    Despite what you might think accelerating something with video cards is not always the solution to everything :p

    There are a lot of things x264 can do that OpenCL encoders can't, by their very nature.

    And x264, even in with its very fast preset (!!), beats all other h.264 encoders hands down.
    Reply With Quote Edit / Delete Reply Windows 7 France Show Events Agree Agree x 1 (list)

  16. Post #16
    Despite what you might think accelerating something with video cards is not always the solution to everything :p

    There are a lot of things x264 can do that OpenCL encoders can't, by their very nature.

    And x264, even in with its very fast preset (!!), beats all other h.264 encoders hands down.
    Yeah, its fast; not going to disagree with that. But its another step I have to take, I have to export from SonyVegas to AVI, which takes up a ton of space depending on video resolution / vid length, and at that point HDD speeds become a bottleneck.

    If I had an Nvidia card, I've love to use CUDA (As much as I hate CUDA).

    I do look forward to x264 optimizing for OpenCL. It may not be good with ONLY a GPU, but using CPU and GPU in tandem makes things amazingly fast.

  17. Post #17
    THE FRESH PRINCE OF COMPTON
    Rayss's Avatar
    November 2011
    564 Posts
    This is great. If I understood this right, the next step after you export as a lossless .avi if you're using VD is to skip right to the MediaCoder section? Or am I in the dark here?

  18. Post #18

    July 2010
    62 Posts
    This is great. If I understood this right, the next step after you export as a lossless .avi if you're using VD is to skip right to the MediaCoder section? Or am I in the dark here?
    If you aren't doing any additional editing, then yes
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Agree Agree x 2Informative Informative x 1 (list)

  19. Post #19
    THE FRESH PRINCE OF COMPTON
    Rayss's Avatar
    November 2011
    564 Posts
    Comparison between my usual method and my new export made by following this tutorial. Both shots (sloppily) taken from youtube uploads.
    Pretty noticeable difference!



    Old



    New
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Funny Funny x 1 (list)

  20. Post #20
    Gold Member
    JoshuaC's Avatar
    February 2005
    897 Posts
    Excuse me if I'm being ignorant, but isn't youtube just gonna shit all over the quality once you upload it to them anyways? I can see if you were hosting the video yourself, or someplace decent, but youtube always seems to take a fair amount out of the video quality even at the best of situations.

  21. Post #21
    Excuse me if I'm being ignorant, but isn't youtube just gonna shit all over the quality once you upload it to them anyways? I can see if you were hosting the video yourself, or someplace decent, but youtube always seems to take a fair amount out of the video quality even at the best of situations.
    Yeah, but at-least when giving it [youtube] higher quality video it won't do as bad a job.

  22. Post #22
    THE FRESH PRINCE OF COMPTON
    Rayss's Avatar
    November 2011
    564 Posts
    Excuse me if I'm being ignorant, but isn't youtube just gonna shit all over the quality once you upload it to them anyways? I can see if you were hosting the video yourself, or someplace decent, but youtube always seems to take a fair amount out of the video quality even at the best of situations.
    The above shots were stills from youtube. So yeah, it did shit on them, but there's clearly a quality difference anyway.
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Agree Agree x 3 (list)

  23. Post #23
    The Cold Wind Of France
    Dennab
    November 2008
    18,691 Posts
    Excuse me if I'm being ignorant, but isn't youtube just gonna shit all over the quality once you upload it to them anyways? I can see if you were hosting the video yourself, or someplace decent, but youtube always seems to take a fair amount out of the video quality even at the best of situations.
    I think YouTube has really improved the quality since the dawn of the service

    Back then it was really hard to get a video that didn't look all fuzzy. Now it's hard to get one that is... :p
    Reply With Quote Edit / Delete Reply Windows 7 France Show Events Agree Agree x 1 (list)

  24. Post #24
    Gold Member
    JoshuaC's Avatar
    February 2005
    897 Posts
    I think YouTube has really improved the quality since the dawn of the service

    Back then it was really hard to get a video that didn't look all fuzzy. Now it's hard to get one that is... :p
    It'll still butcher quality like no other. At least from what I've seen.

    If I don't export directly from the SFM, I usually just export via .wmv in vegas, and it's never really given me anything I'd consider to be unacceptable when it comes to quality.


    This one I exported as a still image sequence from the SFM, and then as a .wmv from vegas. Youtube takes it's toll on the quality, but still, it's very acceptable for my standards. The original video looks nearly flawless on my PC

  25. Post #25
    It'll still butcher quality like no other. At least from what I've seen.

    If I don't export directly from the SFM, I usually just export via .wmv in vegas, and it's never really given me anything I'd consider to be unacceptable when it comes to quality.


    This one I exported as a still image sequence from the SFM, and then as a .wmv from vegas. Youtube takes it's toll on the quality, but still, it's very acceptable for my standards. The original video looks nearly flawless on my PC
    From my experience (Which Max has a ton more of) I'd say they usually look about the same when rendered at the same Bitrate and such, but MP4 is about 2x faster (Which as mentioned before, is a big thing with me)

  26. Post #26
    Gold Member
    Secrios's Avatar
    March 2011
    1,040 Posts
    My rendering keeps stopping half way through.

  27. Post #27
    The Cold Wind Of France
    Dennab
    November 2008
    18,691 Posts
    My rendering keeps stopping half way through.
    are you sure you've selected "entire sequence" instead of "selected shots" ?

  28. Post #28
    Gold Member
    Secrios's Avatar
    March 2011
    1,040 Posts
    are you sure you've selected "entire sequence" instead of "selected shots" ?
    I'm referring to the bit where you take the AVI and turn it in to an mp4. Can you help?

  29. Post #29
    Facepunch's Local Lycanthrope
    Contron's Avatar
    December 2008
    1,787 Posts
    i don't know why you just don't use FFMPEG to convert the AVI to MPG with the -sameq parameter
    Reply With Quote Edit / Delete Reply Windows 7 Jersey Show Events Disagree Disagree x 1 (list)

  30. Post #30
    Gold Member
    Secrios's Avatar
    March 2011
    1,040 Posts

    I need a little help.

  31. Post #31
    Apple extraordinaire~ ♥
    eddy-tt-'s Avatar
    April 2006
    5,505 Posts
    i don't know why you just don't use FFMPEG to convert the AVI to MPG with the -sameq parameter
    Because its a terrible method and you should never suggest it.
    The filesize difference between your method and transcoding to h264 is huge and its the same with quality.
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Agree Agree x 2 (list)

  32. Post #32
    The Cold Wind Of France
    Dennab
    November 2008
    18,691 Posts

    I need a little help.
    Do you have a multicore CPU? What are your specs?

  33. Post #33
    Gold Member
    Secrios's Avatar
    March 2011
    1,040 Posts
    Do you have a multicore CPU? What are your specs?
    Intel core i7 cpu x990 / GTX 590 / 24GB RAM And yes it is a multi core. Do you have any answers?

  34. Post #34
    Facepunch's Local Lycanthrope
    Contron's Avatar
    December 2008
    1,787 Posts
    Because its a terrible method and you should never suggest it.
    The filesize difference between your method and transcoding to h264 is huge and its the same with quality.
    well thank you for at least telling me rather than just rating dumb, thanks!
    Reply With Quote Edit / Delete Reply Windows 7 Jersey Show Events Friendly Friendly x 4 (list)

  35. Post #35
    Gold Member
    Secrios's Avatar
    March 2011
    1,040 Posts
    Max when you render on Sony Vegas, do you have the OpenDML checked on your AVI settings?
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Agree Agree x 1 (list)

  36. Post #36
    The Cold Wind Of France
    Dennab
    November 2008
    18,691 Posts
    Max when you render on Sony Vegas, do you have the OpenDML checked on your AVI settings?
    yeah, OpenDML is important, that's what allows you to have AVIs that go past 2 or 4GB (i can never remember if it's 2 or 4 haha)
    Reply With Quote Edit / Delete Reply Windows 7 France Show Events Agree Agree x 1 (list)

  37. Post #37
    Gold Member
    Secrios's Avatar
    March 2011
    1,040 Posts
    yeah, OpenDML is important, that's what allows you to have AVIs that go past 2 or 4GB (i can never remember if it's 2 or 4 haha)
    It's 1.99gb limit. Do you render your AVI as an ulrg or uncompressed codec?

  38. Post #38
    The Cold Wind Of France
    Dennab
    November 2008
    18,691 Posts
    It's 1.99gb limit. Do you render your AVI as an ulrg or uncompressed codec?


    choose this in Vegas.

  39. Post #39
    Gold Member
    Secrios's Avatar
    March 2011
    1,040 Posts


    choose this in Vegas.
    Mine says x64 instead of x86. Will that cause a problem?
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Funny Funny x 2Disagree Disagree x 1 (list)

  40. Post #40
    The Cold Wind Of France
    Dennab
    November 2008
    18,691 Posts
    Mine says x64 instead of x86. Will that cause a problem?
    no
    Reply With Quote Edit / Delete Reply Windows 7 France Show Events Agree Agree x 1Funny Funny x 1 (list)