Log in

View Full Version : Youtube's encoder sucks!


Atak_Snajpera
28th February 2015, 14:47
Does anybody know why youtube's encoder can't correctly encode simple mkv or mp4? Encoded file is stuttering like hell. At the beginning I thought it was a problem with my browser so I decided to download youtube's mp4 to see if problem appears in MPC-HC. Yep the same stuttering.

My file
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.0
Format settings, CABAC : Yes
Format settings, ReFrames : 3 frames
Codec ID : V_MPEG4/ISO/AVC
Duration : 3mn 15s
Bit rate mode : Variable
Maximum bit rate : 25.0 Mbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 29.970 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Writing library : x264 core 142 r2479 dd79a61
Encoding settings : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 /
mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 /
threads=24 / lookahead_threads=4 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 /
b_pyramid=0 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=300 / keyint_min=30 / scenecut=40 /
intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=16.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=25000 /
vbv_bufsize=25000 / crf_max=0.0 / nal_hrd=vbr / filler=0 / ip_ratio=1.40 / aq=1:1.00
Default : Yes
Forced : No

Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : A_AAC
Duration : 3mn 15s
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Compression mode : Lossy
Default : Yes
Forced : No



Youtube
https://www.youtube.com/watch?v=vNykPHV8qe4

Vimeo
https://vimeo.com/120876893

Somehow vimeo's encoder encoded my file correctly. By the way. That occasional stuttering in vimeo's encode is also present in my source FRAPS footage. Besicaly my gpu was not fast enough to maintain constant 30 fps while capturing in few scenes.

Sparktank
7th March 2015, 06:41
I've always used AVI or MP4 for uploading to youtube.

their list of supported formats doesn't indicate MKV, so I've never risked it.
https://support.google.com/youtube/troubleshooter/2888402?hl=en&ref_topic=2888648

Don't know how much their recommended encoding settings affect their internal conversion.
https://support.google.com/youtube/answer/1722171

Atak_Snajpera
7th March 2015, 11:44
The same problem with mp4. I've already tried that. This is ridiculous that in 2015 the most popular website can't correctly encode avc in mkv/mp4. What shitty encoder do they use then? The funny thing is that they didn't have problems with my older uploads. I always used mkv.

raffriff42
7th March 2015, 22:21
I feel I get better results on YouTube by optimizing my uploads for the lowest possible decoding requirements: ref<=2, bframes<=2 etc; in short, preset="veryfast." Why this is, I don't know, but I suspect the re-encoding machines are heavily optimized for speed over quality.

Regarding containers, people have encountered audio sync problems on long uploads in AVI, so I use MP4 or MOV. I like MOV with x264+PCM audio when audio is important - it avoids a lossy generation.

TheSkiller
8th March 2015, 01:08
I feel I get better results on YouTube by optimizing my uploads for the lowest possible decoding requirements:So you're basically saying if they need to spend less CPU time decoding the source file they spend more time encoding their format, thus providing better quality?


Personally I never had problems with AVC (x264) + AAC audio in an MP4 container, as long as --b-pyramid none is used.

manono
8th March 2015, 01:26
The same problem with mp4. I've already tried that. This is ridiculous that in 2015 the most popular website can't correctly encode avc in mkv/mp4.
Like the others, I've had no problems at all. And I use RipBot64 at the default '[HIGH 4.0] FHD . Progressive' setting to create MP4s. It uses '--b-pyramid none' as The Skiller suggested. Maybe you should try it. :)

Sparktank
8th March 2015, 02:25
I'm trying to remember, but I think I uploaded a video UT Video Codec once just to see if they liked it.
I cant' remember if the last video I uploaded was in UT or encoded with x264 using presets.
Once I uploaded the video, I deleted the sources.

I do remember I was trying out youtube's 60fps.
But it ended up as 30fps.

Redownloading the last video, doesn't show any of the encode settings.
A lot of Quicktime tags, though.

General
Complete name : G:\Transfer\JDownloads\60fps Minecraft Party_ Lord of the Rings mod [Fraps]\60fps Minecraft Party_ Lord of the Rings mod [Fraps] (720p).mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42
File size : 104 MiB
Duration : 5mn 7s
Overall bit rate mode : Variable
Overall bit rate : 2 833 Kbps
Encoded date : UTC 2014-08-23 14:54:48
Tagged date : UTC 2014-08-23 14:54:48
gsst : 0
gstd : 307431
gssd : B4A7DD488HH1425750731829541
gshh : r8---sn-jc47eu76.googlevideo.com

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3.1
Format settings, CABAC : Yes
Format settings, ReFrames : 1 frame
Format settings, GOP : M=1, N=60
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 5mn 7s
Bit rate : 2 638 Kbps
Maximum bit rate : 5 128 Kbps
Width : 960 pixels
Height : 720 pixels
Display aspect ratio : 4:3
Frame rate mode : Constant
Frame rate : 30.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.127
Stream size : 96.7 MiB (93%)
Tagged date : UTC 2014-08-23 14:54:58

Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 5mn 7s
Bit rate mode : Variable
Bit rate : 192 Kbps
Maximum bit rate : 203 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 44.1 KHz
Compression mode : Lossy
Stream size : 7.04 MiB (7%)
Title : IsoMedia File Produced by Google, 5-11-2011
Encoded date : UTC 2014-08-23 14:54:51
Tagged date : UTC 2014-08-23 14:54:58

Never really got around to recording any more gaming.

Atak_Snajpera
8th March 2015, 14:58
Like the others, I've had no problems at all. And I use RipBot64 at the default '[HIGH 4.0] FHD . Progressive' setting to create MP4s. It uses '--b-pyramid none' as The Skiller suggested. Maybe you should try it. :)

Encoding settings : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 /
mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 /
threads=24 / lookahead_threads=4 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 /
b_pyramid=0 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=300 / keyint_min=30 / scenecut=40 /
intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=16.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=25000 /
vbv_bufsize=25000 / crf_max=0.0 / nal_hrd=vbr / filler=0 / ip_ratio=1.40 / aq=1:1.00

manono
8th March 2015, 20:39
Okay, then try a basic settings encode using your own program to see if you get the same problems. Maybe there's something else at work in the settings that's causing the problem. As I said, I use the same preset all the time and have for hundreds of YouTube uploads and have never seen the jerkiness you have with your video.

Atak_Snajpera
8th March 2015, 23:44
Maybe youtube is just trolling me? Oh look his ip is from eastern europe so assign the bugiest encoder we have available.

TheSkiller
9th March 2015, 02:20
I did some tests today and uploaded some very high quality and hard to encode 720p video. Result: I could not find any significant difference between a "slow" and a "veryfast" encode. Downloaded file sizes were almost exactly equal and looking at the two videos frame by frame in VirtualDub revealed the compression artefacts are slightly different but neither looks better.

raffriff42
9th March 2015, 03:44
Maybe things have changed since I did my tests, it was a while ago (before 4K and 60fps).

pandy
9th March 2015, 10:38
All video on YT are re-encoded (older no B frames - newer - not sure) - i don't understand people (i mean i do understand if they have 200Mbps download and 10Mbps upload but...) using anything slower than 'fast' and 'fastdecode' to create video file to be uploaded on YT.

Don't waste your time to squeeze quality for video being uploaded to YT.

TheSkiller
9th March 2015, 13:39
Don't waste your time to squeeze quality for video being uploaded to YT.But time has proven YouTube's video quality increases once in a while. They always keep the source file you upload so even if you upload at a quality level where the current benefit may be small or not worth it, it may be different in a few years (that is if you think your videos will still be relevant in a few years).

Until about 2011 I actually made the mistake to upload only at the highest resolution that YouTube offered at that time, and at rather low bitrates too. Because of that my old videos are all only 360p, whereas I would upload the same video in 720p at a high bitrate and slow encoding settings nowadays and it would look so much better.

feisty2
9th March 2015, 14:07
They always keep the source file you upload

u sure?... I mean like, how much storage would they need to store all those huge source files uploaded by users :scared:

poisondeathray
9th March 2015, 16:02
u sure?... I mean like, how much storage would they need to store all those huge source files uploaded by users :scared:

Yes. It's not user friendly to use (you download an archive, you don't pick individual files) . Probably to discourage using them as a free storage service

http://dataliberation.blogspot.ca/2012/09/your-youtube-original-videos-now.html

https://www.google.com/settings/takeout




@Atak -

If you download both vimeo and YT versions, they have the same frames (in terms of number), but the vimeo version has more blended frames, especially during rotational movements. That might give the perception of smoother playback. I don't know if that is more accurate (ie. if your original didn't have those blends, the YT version is actually more accurate)

Atak_Snajpera
9th March 2015, 16:58
Just for comparison here is my original file -> http://www.mediafire.com/watch/ah05t5zs9iyzmi1/promo-2997fps.mkv

pandy
10th March 2015, 11:21
But time has proven YouTube's video quality increases once in a while. They always keep the source file you upload so even if you upload at a quality level where the current benefit may be small or not worth it, it may be different in a few years (that is if you think your videos will still be relevant in a few years).

Until about 2011 I actually made the mistake to upload only at the highest resolution that YouTube offered at that time, and at rather low bitrates too. Because of that my old videos are all only 360p, whereas I would upload the same video in 720p at a high bitrate and slow encoding settings nowadays and it would look so much better.

That's why it is recommended to upsize video uploaded to YT and going for preset fast/veryfast and tune fastdecode doesn't sacrifice video quality (use crf) - it will increase filesize for sure and that's why upload may be slow for people using highly asymmetric connection (like cable where DL is 200Mbps and UL is 15Mbps) - but i think that it is fair to spend less time on encoding and more on uploading. Average bitrate for 1080p30 on YT is 5.5Mbps without B frames - don't expect to much...

ChiDragon
10th March 2015, 18:35
They do use B-frames for 1080p and 1440p now (2 ReFrames).

pandy
11th March 2015, 10:58
They do use B-frames for 1080p and 1440p now (2 ReFrames).

Ahh, yes - i've checked relatively fresh YT video and seems that they finally using B frames. Good to know, Thx!

SeeMoreDigital
21st March 2015, 11:47
Have you tried setting 'weighted prediction for p-frames' to zero?