Log in

View Full Version : [GUIDE] Best Encoding Settings for YouTube Upload w/ Sony Vegas


NyaR
18th September 2015, 05:29
Hello folks,

I do not post much here but I have been a member for some time and have used the information in this forum to create this guide for achieving the best quality possible on YouTube.

The premise is that by rendering a video specifically in accordance with the encoding settings suggested by YouTube (https://support.google.com/youtube/answer/1722171?hl=en) you get the best quality possible.

Here is an example of difference in quality between my settings and the default Sony Vegas renderer (my settings are hej):

http://i.imgur.com/qtih9eR.png

To achieve this one must use the Debugmode Frameserver (http://www.debugmode.com/frameserver/), MeGUI, AviSynth (http://sourceforge.net/projects/megui/), and the Nero AAC codec (http://www.free-codecs.com/download/Nero_AAC_Codec.htm) with the following command line: --keyint 30 --bframes 2 --b-adapt 0 --b-pyramid none --weightp 0 --me umh --direct none --no-fast-pskip --scenecut 0

Anyway, the tutorial is in video format and you may find it here if interested:

https://www.youtube.com/watch?v=DWt11kY5fpE

I also have it on a webpage here: http://www.hejyhej.com/render-settings-vegas-youtube/

Additionally I've made comparisons in quality between this method and others so that you may verify that this, indeed, looks better:

http://www.hejyhej.com/youtube-quality-comparison/

Sp00kyFox
20th September 2015, 17:34
there was a time when youtube wouldn't reencode if the video was encoded with specific settings but this isn't the case anymore. every uploaded clip will be reencoded period. so don't bother with that and just upload it in the best quality you can manage regarding bandwith and encoding time, the rest is up to youtube.

SeeMoreDigital
22nd September 2015, 07:51
there was a time when youtube wouldn't reencode if the video was encoded with specific settings but this isn't the case anymore. every uploaded clip will be reencoded period. so don't bother with that and just upload it in the best quality you can manage regarding bandwith and encoding time, the rest is up to youtube.Bummer... When did this happen?

Sparktank
22nd September 2015, 08:26
I think they'll accept UT Video Codec. If you got the time and speeds, ofc.

manono
22nd September 2015, 08:36
Bummer... When did this happen?
It's been several years now. 5, maybe? Just a guess.

My question is, "Why use Sony Vegas at all?" I'm not a gamer but get perfectly good videos using AviSynth and RipBot to create MP4s for upload to YouTube.

And I'm naturally suspicious of anything claiming to be the best.

Warperus
22nd September 2015, 13:17
It's been several years now. 5, maybe? I think it's more like 10 years.

"Why use Sony Vegas at all?" I'm not a gamer but get perfectly good videos using AviSynth and RipBot to create MP4s for upload to YouTube.
Most importantly - gamers are not programmers. They don't write their own scripts. They don't know anything about avisynth.
They don't know RipBot/MeGUI/Handbrake up to the point someone advertises it in their "best settings guide".
But that's not all. Vegas is very easy to start with.
Even though sony creative software is gonna stop its development (http://www.sonycreativesoftware.com/forums/showmessage.asp?messageid=931815), userbase praises this composer:
What I like most about Vegas is its ease of use. I work at a community college and regularly deal with students who have never used an NLE in their life. An hour or less with Vegas Pro and they're editing on their own. To the best of my knowledge you can't do that with any other editor.

Basically, it's visual editor with most important features already on board. It's like comparing 3D editor to scripting of 3D image generation. You can make anything with scripts, but it's much easier to do the job in visual editor and see what you get (more or less).

And I'm naturally suspicious of anything claiming to be the best.I'm suspicious too.
In this particular case NyaR:
* uses questionable capture technique (RGB lossless with 1700 Mbps - performance and intermediate file size are far from ideal for regular gamer)
* mentions no video levels issue
* uses 1-pass ABR rendering in x264 with some custom settings (I don't buy --scenecut 0 and --direct none)
* mentions no compatibility issues for different vegas and debugmode frame server
* uses "render loop region only", but doesn't mention it (and doesn't explain loop region thing)
* uses 32-bit project with video levels (it's slower than 8-bit)

Also mediainfo in this youtube explanation has different gop settings (N=72 doesn't correspond to --keyint 30).
Also if you use shadowplay capture or similar TV levels source, it's possible you'll still need to correct levels in vegas.

SeeMoreDigital
22nd September 2015, 14:54
It's been several years now. 5, maybe? Just a guess.
How odd... I'm sure I recently downloaded a YouTube mp4 contained file and when I ran it through MediaInfo all the x264 meta-data was present. Which would not have been the case if it had been re-encoded :scared:

poisondeathray
22nd September 2015, 16:28
How odd... I'm sure I recently downloaded a YouTube mp4 contained file and when I ran it through MediaInfo all the x264 meta-data was present. Which would not have been the case if it had been re-encoded :scared:

They use modified x264 library to re-encode

raffriff42
23rd September 2015, 04:00
+1 @Warperus

The only one of OP's points that I agree with is, higher bitrate is good. Encoding artifacts don't re-encode well, so it behooves you to upload a video with as few artifacts as possible.

For a guide that does address the points you mentioned, a group of videographers at the Sony Vegas forum have come up with an excellent guide, (4 years old now) called Sony Vegas to Youtube Tutorial - A Better Method (https://www.youtube.com/watch?v=rWMX5lSvEgY), with "good," "better," and (forgive me) "best" recomendations, depending on your level of interest and commitment.

Also, use 30 or 60 fps where possible (http://forum.doom9.org/showthread.php?p=1739209#post1739209).

pandy
23rd September 2015, 16:13
For extremely difficult content (CGI) it may be necessary to sacrifice quality before uploading to YT - i.e. compress in similar way as YT doing so more or less YT encoder accepting outcome.
Going for insane, long time compression setting is pure waste of time and electricity - unless you can gain some time (your upload speed is slower than encoding speed).

I recommend to read this thread: http://forum.videohelp.com/threads/371494-Youtube-videos-pixelated-every-5-seconds

User/uploader is not capable to control YT encoder settings.

bxyhxyh
13th October 2015, 10:33
Does youtube convert all videos to YV12?
I'm planning to upload YV24 gameplay footage to Youtube.

Warperus
13th October 2015, 13:13
Does youtube convert all videos to YV12?
yes

I'm planning to upload YV24 gameplay footage to Youtube.
It's not a problem unless you concentrate on pixel-size lines like small characters in chat, but chat has to be enlarged anyway if you want it to be readable in realtime.

bxyhxyh
15th October 2015, 18:47
Thank you

NyaR
16th October 2015, 11:53
every uploaded clip will be reencoded period. so don't bother with that

This is true, every clip gets re-encoded. However, when rendered with h264 rather than AVC the clip gets processed by YouTube very quickly. A 2 minute video will be finished encoding and available in 1080p in 2 minutes.

Why use Sony Vegas at all?

I tend to do videos, frag films mostly, that have heavy editing and match frags up with music. Or stuff with commentary.

And I'm naturally suspicious of anything claiming to be the best.

Well, so am I... When I started using Sony Vegas after Blender my video quality went way down and my colors were messed up. I watched a bunch of "best" videos and they were all absolute BS. So I did a lot of research and I came up with my own solution, then after a year of back and forth with people I finalized that solution into what you see here. And if there is a way to improve this even further I am absolutely eager to hear it.

I think it's more like 10 years.
* uses questionable capture technique (RGB lossless with 1700 Mbps - performance and intermediate file size are far from ideal for regular gamer)

I actually use lossy h264 AMD APP hardware accelerated encoding with Action! and Bandicam for my gameplay captures. However there are visible artifacts in those recording without any re-encoding. For testing purposes only I used RGB lossless, so that I could see specifically the difference in encoding techniques. That is the only time I used RGB lossless.



* mentions no compatibility issues for different vegas and debugmode frame server
I do not know of any compatibility issues. Care to enlighten?



* mentions no video levels issue
I don't understand what you mean. Are you talking about the video colors? I've found that the colors with this method are much more true than any other I've tried.


I don't buy --scenecut 0 and --direct none)

As I understand --scenecut 0 is required if I want the renderer to respect a custom keyint value, otherwise it will change it if a scene change dictates so. As I want the video to match YouTube's stuff I do not want scene changes dictating things. Learned in this thread: http://forum.doom9.org/showthread.php?t=167216

--direct none disables b-frame prediction, it is set in MeGUI under MV Prediction Mod under Analysis tab.


* uses "render loop region only", but doesn't mention it (and doesn't explain loop region thing)
This is a tutorial for render settings, not a tutorial for Sony Vegas basics, so I must stay on point to keep it concise rather than explaining what every function does.



* uses 32-bit project with video levels (it's slower than 8-bit)
My previous settings, 1 year ago, used 8bit and had some messed up video colors. By switching to 32bit video levels that was fixed. The output file, after megui process, is 8bit but with colors that look like the original video.



Also mediainfo in this youtube explanation has different gop settings (N=72 doesn't correspond to --keyint 30).
Ah, damn :(. Do you know a way I can force the keyint to be 30? That is why I set scenecut and direct none. I really would like to know how to make it do what I want, then I could put out a quick update to fix it.

Thank you for your replies. I hope I have addressed your concerns regarding this method. Perhaps --scenecut and --direct none are unnecessary as the video output is not respecting the bframes I have set anyway :( Can anyone suggest an alternate solution to force the output to respect the bframes set? Thank you once again.

NyaR
16th October 2015, 12:35
Hah! I figured it out!

GOP Calculation has to be set to Fixed rather than FPS Based (frame-type tab) for keyint to stick.

What a silly oversight.

Unfortunately I do not know how to verify this as mediainfo does not give an N= value with the new setting. The presets have been updated.

Warperus
19th October 2015, 11:38
I actually use lossy h264 AMD APP hardware accelerated encoding with Action! and Bandicam for my gameplay captures. However there are visible artifacts in those recording without any re-encoding. For testing purposes only I used RGB lossless, so that I could see specifically the difference in encoding techniques. That is the only time I used RGB lossless.
...
I don't understand what you mean. Are you talking about the video colors? I've found that the colors with this method are much more true than any other I've tried.

Unfortunately, Vegas can handle different input sources differently. Vegas uses 8-bit or 32-bit sRGB for internal processing (studio levels or computer levels), so every YUV input is converted by Vegas and/or vfw filters.
It is important to stick to some input source variant or take a look at different options (and tweak guide accordingly).
From what I know, avi/lossless RGB uses vfw direct conversion and mp4/h264 uses vegas-integrated mainconcept avc decoder.
And it can become BT.601/BT.709 mess for avi/h264 sources (depends on OS, installed filters, capture software etc.).
Please take a look at this paper and make some further experiments:
http://www.glennchan.info/articles/vegas/v8color/vegas-9-levels.htm


I do not know of any compatibility issues. Care to enlighten?In short, it's written in frameserver page.
http://www.debugmode.com/frameserver/
If you use Vegas Pro 13+: Get Frameserver 2.15.
Everyone else : Get Frameserver 2.14.
As far as I remember, you recommended one version in your guide.

This is a tutorial for render settings, not a tutorial for Sony Vegas basics, so I must stay on point to keep it concise rather than explaining what every function does.As far as this checkbox is promptly shown in guide video, people can follow this video directly, and not knowing loop region but setting the checkbox they will step into the trap "my video is empty"
http://www.tomsguide.com/answers/id-2050534/sony-vegas-pro-render-videos.html

Do you know a way I can force the keyint to be 30? That is why I set scenecut and direct none. I really would like to know how to make it do what I want, then I could put out a quick update to fix it.As far as I know, min-keyint + keyint are more than enough for every purpose. Besides, I strongly belive that scenecut is here for the purpose and we should not disable it. Youtube will not follow scenecut settings anyway, all we can do is deliver good enough quality.

Speaking of wich, I use 8-bit projects, load ShadowPlay FullHD@60p captures directly into Vegas, disable resample and render in Mainconcept AVC Internet HD 1080p with tweaked bitrate (20M average, 30M max) and fps (double NTSC) using CPU only render. Works ok for me. Processing times can be not perfect, but it works for me.

bxyhxyh
12th March 2016, 08:53
Why youtube resizes the videos vertically?
I've uploaded 832x720 60 Hz clip, but youtube resized it to 822x720 60 Hz.
This one. https://www.youtube.com/watch?v=mAEk1K23eog

NyaR
3rd April 2016, 23:53
Why youtube resizes the videos vertically?
I've uploaded 832x720 60 Hz clip, but youtube resized it to 822x720 60 Hz.
This one. https://www.youtube.com/watch?v=mAEk1K23eog

You should resize it to a 16:9 resolution.

https://support.google.com/youtube/answer/1722171

look at the bottom resolutions dropdown

bxyhxyh
4th April 2016, 17:41
It says this. If you're uploading a non-16:9 file, it will be processed and displayed correctly as well, with pillar boxes
880x720 works ok, 832x720 is resized.
It seems youtube is doing something different from just re-encoding and playing it in the center of player.

NyaR
9th April 2016, 12:35
It says this.
880x720 works ok, 832x720 is resized.
It seems youtube is doing something different from just re-encoding and playing it in the center of player.

those aren't 16:9 resolutions..

16/9 = 1.777777777777778
1920/1080 = 1.777777777777778

880/720 = 1.222222222222222
832/720 = 1.155555555555556


I again advise that you render in a 16:9 resolution.

bxyhxyh
9th April 2016, 19:45
I thought they don't resize the maximum resolution one (if height is 720p 1080p or 2160p) and resize others.
AR doesn't matter at all actually as in Youtube page you posted.
Anyway if it really must be 16:9 it wouldn't resize to 822x720 (1.141667)

Edit: 848x720 works ok