Log in

View Full Version : x264 good encoding settings for youtube?


apasher17
13th May 2010, 00:34
im trying to figure out what bitrate should i use for a 720x480 video to upload on youtube using x264

at first, i used 5000kbps, and the resolution was 640x480 that time. it looked good on my computer, but when i uploaded the video on youtube, it didnt look as good as the original did (found out it was too high)

then i tried lowering the bitrate to 2500kbps, and it was the same thing, except the bitrate was too low instead of too high (thought it was too high at first)

in my next video, i lowered it more to 1250kbps, and the quality just sucked because it was too low (used 720x480 that time)

so what is a good bitrate to use for a 720x480 video?


thanks

dilpill
13th May 2010, 00:44
Just use CRF 18 or don't transcode at all because YouTube recompresses everything anyway.

Keep in mind that you can "cheat" to get higher quality by upscaling the video to its appropriate 720p or 1080p resolution. Normally this is a big no-no because it's pointless, but on YouTube they give higher resolution videos more bitrate.

apasher17
13th May 2010, 00:50
Just use CRF 18 or don't transcode at all because YouTube recompresses everything anyway.

Keep in mind that you can "cheat" to get higher quality by upscaling the video to its appropriate 720p or 1080p resolution. Normally this is a big no-no because it's pointless, but on YouTube they give higher resolution videos more bitrate.

i didnt transcode
the container was .avi all the way through

Inspector.Gadget
13th May 2010, 00:56
That's not transcoding, apasher, you're thinking of transmuxing. You did transcode because you re-encoded the video. By the way, AVI is a silly container for H.264 - for Youtube, use MP4 instead (MP4 can also contain AAC, which is more efficient than anything you can put in an AVI container without hacks). Also, 720x480 is not, with square pixels, a common resolution. Are you preserving anamorphism in your encode? Does Youtube follow anamorphic flags? If the answer to either of these questions is "No", then you must resize to the correct dimensions given square pixels.

apasher17
13th May 2010, 01:02
That's not transcoding, apasher, you're thinking of transmuxing. You did transcode because you re-encoded the video. By the way, AVI is a silly container for H.264 - for Youtube, use MP4 instead (MP4 can also contain AAC, which is more efficient than anything you can put in an AVI container without hacks). Also, 720x480 is not, with square pixels, a common resolution. Are you preserving anamorphism in your encode? Does Youtube follow anamorphic flags? If the answer to either of these questions is "No", then you must resize to the correct dimensions given square pixels.

i cant use MP4 because the capture file for my vids is avi, and i rather not transcode the raw file, i rather keep the format the same. i also cant find any capturing software that captures as MP4

Inspector.Gadget
13th May 2010, 01:12
You're misreading my post. When you re-encode with x264, you can make the container MP4 and if necessary can transcode the audio to AAC. This is regardless of what your camera does, because it all has to pass through Avisynth or at least FFMS anyway.

apasher17
13th May 2010, 01:20
You're misreading my post. When you re-encode with x264, you can make the container MP4 and if necessary can transcode the audio to AAC. This is regardless of what your camera does, because it all has to pass through Avisynth or at least FFMS anyway.

oh thanks for the info, but i was just asking what bitrate should i use

Inspector.Gadget
13th May 2010, 01:44
Go right up to whatever the filesize limit on Youtube is. MeGUI's bitrate calculator will tell you what bitrate to use in 2-pass mode to achieve the desired filesize. I believe that stereo audio sources other than some music are almost always transparent at 96kbps with a good AAC encoder (e.g., Nero) in LC mode. So that will save you some bits for the video.

video_magic
13th May 2010, 01:49
Using X264, for my 720x576 25FPS video (which was sourced from VHS video captures) I am happy with a bitrate of 1200 for the video. I capture the audio as CD quality wave and then encode that to 112kb/s (average) AAC , or 140kb/s (average) MP3.

This is very dependant on the settings chosen for x264, I've tried quite a few different settings and bitrates in the past, before arriving at the above which looks accurate compared to the original capture AVI while giving a relatively very small filesize.

As has been advised to you, I think Youtube 're-encodes' whatever you give it... I think you should search more on this site and the internet for more help.

apasher17
15th May 2010, 00:12
here is my settup for my videos:
Capture Device: EasyCap USB 2.0 Capture Card
Capture Software: AMcap
Software used to edit/compress: VirtualDub
Codec: x264

laurentje
21st July 2010, 16:26
In the past (2008) I encoded my dv-avi-files with VirtualDub ans with x264vfw-encoder in avi-container. No problem - 100% were encoded by YT.

Because a lot of people on this forum say: we have to use mp4- container, I encode now with Megui and x264 into MP4-files.
I use standard standard parameters for x264. The settings are:
program --tune film --pass 2 --bitrate 3000 --stats ".stats" --output "output" "input"

On the YouTube-site for nearly 90% of my filess all went well in the encoding. But for 10% of my files I get "Failed (unable to convert video file)"

I have done several tests and the results are:
- it is related with specific clips;
- not related with bitrate, framesize, audio
- the specific clips get encoded by YouTube if I use NO-BFRAMES; so I used the following settings in Megui:
program --tune film --pass 2 --bitrate 3000 --stats ".stats" --bframes 0 --output "output" "input"

Any other experience? Other idea?

Boogerlad
23rd July 2010, 00:09
h264 in avi is hacky and doesn't work with all players. That's why you might as well convert to h264+aac in mp4 container, cause that's what yt likes.

AlekseiV
23rd July 2010, 02:17
Any other experience? Other idea?Manually set Level 4.1 @ High with 3 ref and 3 bframes and see if they get encoded.

nm
23rd July 2010, 08:34
On the YouTube-site for nearly 90% of my filess all went well in the encoding. But for 10% of my files I get "Failed (unable to convert video file)"

I have done several tests and the results are:
- it is related with specific clips;
- not related with bitrate, framesize, audio
- the specific clips get encoded by YouTube if I use NO-BFRAMES; so I used the following settings in Megui:
program --tune film --pass 2 --bitrate 3000 --stats ".stats" --bframes 0 --output "output" "input"

It seems that there are currently some issues with x264 and the GPAC MP4 muxer:

http://forum.doom9.org/showthread.php?t=155705
http://forum.doom9.org/showthread.php?t=155797

Things to try:
- Get an x264 build that uses the L-SMASH MP4 muxer (http://forum.doom9.org/showthread.php?p=1418958#post1418958)
- Output to MKV instead of MP4.
- Output to raw .264 and mux later with a separate tool.
- Use a slightly older x264 build. r1659 was working for Lyle_JP's baseline encodes (http://forum.doom9.org/showthread.php?p=1418567#post1418567).

Warperus
23rd July 2010, 12:53
Why do you want to encode something in such a harsh way, i.e. low bitrate and playing with quality lowering settings?
General rule for uploading to youtube is simple: keep maximum quality in 2Gb- file size. In other words, use up to 25Mbps encoding without hesitations.
If it is not derivative work just upload your piece without reencoding. If it is result of your edit it might be useful to encode clip directly in NLE to its favorite format wich might be not x264.

laurentje
23rd July 2010, 15:37
Warperus:

My raw video is SD dv-avi (720x576 - pal). It is interlaced and 16:9. Is this ok for uploading to YT?
Moreover my uploadspeed is only 40 kB/s, so it takes hours to upload my clips.
3000kbps is not a low bitrate imho for SD and mp4.

nm
23rd July 2010, 15:45
My raw video is SD dv-avi (720x576 - pal). It is interlaced and 16:9. Is this ok for uploading to YT?

Well, I'd deinterlace it properly first, at least. Encoding with x264 and using a medium bitrate is a good idea when you're bandwidth-impaired.

Atak_Snajpera
23rd July 2010, 16:14
1) Open your avi in Ripbot264
2) select CRF@18
3) select .mkv
4) go to properties and deinterlace BFF -> 25 FPS (youtube doesn't support anything above 30 fps)
5) optionally resize to 720x480 (I haven't seen 576p option on youtube yet)

laurentje
23rd July 2010, 16:16
Manually set Level 4.1 @ High with 3 ref and 3 bframes and see if they get encoded.
Done this and uploaded. Same result: YT refuse to transcode: "Failed (unable to convert video file)".
Anyway thanks for your suggestion.

Katie Boundary
23rd May 2020, 06:31
h264 in avi is hacky

I've seen claims like this occasionally, or that x264 is "not well supported" by AVI, or whatever, but I've never seen anyone go into detail. Can anyone explain? I thought the whole idea with container formats was that you could put whatever codecs you wanted in them.

tebasuna51
23rd May 2020, 12:03
I've seen claims like this occasionally, or that x264 is "not well supported" by AVI, or whatever, but I've never seen anyone go into detail. Can anyone explain?

See Limitations here (https://en.wikipedia.org/wiki/Audio_Video_Interleave)

Katie Boundary
26th May 2020, 06:53
I don't see anything in there about x264.

nevcairiel
26th May 2020, 10:36
This part is really key in the AVI Limitations for H.264 content, unless you want to encode without B-Frames, but then.. why?


AVI was not intended to contain video using any compression technique that requires access to future video frame data beyond the current frame (B-frame).


The consequence of that is that AVI does not like frames to be in a different order then the display order, but for bi-directional prediction (B-Frames), this is required. So if you try to do that with AVI, it screws up your timestamps.

benwaggoner
26th May 2020, 22:42
AVI is such a deprecated format! OpenDML, which was the last offical spec update IIRC, was from 1996. It doesn't support B-frames because they weren't invented yet. Video for Windows itself was supplanted by ActiveMovie back in 1996, which added support for B-frames along with MPEG-1.

I've not had much of a reason to use an AVI file myself for some years.

De-M-oN
10th August 2020, 17:20
Just use CRF 18 or don't transcode at all because YouTube recompresses everything anyway.

Keep in mind that you can "cheat" to get higher quality by upscaling the video to its appropriate 720p or 1080p resolution. Normally this is a big no-no because it's pointless, but on YouTube they give higher resolution videos more bitrate.

1080p is still garbage bitrate and on smaller channels only transcoded to h.264

Upscale to 3200x1800 and you get VP9 and 15 mbit bitrate by youtube.

edit: oh the thread is 10 years old. But the 3200x1800 info will be still useful ;D