Author Topic: Dave could inprove the quailty of videos downloads and save money.  (Read 2443 times)

0 Members and 1 Guest are viewing this topic.

Offline MatthewMorganTopic starter

  • Regular Contributor
  • *
  • Posts: 71
  • Country: gb
A few minutes ago I downloaded the 7 component tester video and noticed two things straight away;
1. The video is encoded in H254, even tho he could get better quality videos at the same bandwidth by using VP9.
2. He is using Amazon AWS to serve up the video who charge nearly 1 cent per GB of data which is almost laughable as You can get a VPS with 100Mbps unmeated for less than $10 per month.

I am currently doing some test with handbrake using the 1.4Mbps 1080p Youtube file to see how much better compression I can get at or below 558Kbps using consistent quality at 720P downsampled from 1080p.
 

Offline chriswebb

  • Supporter
  • ****
  • Posts: 143
  • Country: us
Re: Dave could inprove the quailty of videos downloads and save money.
« Reply #1 on: December 02, 2017, 07:55:15 pm »
You are basing your research on a lot of assumptions.

1. https://en.wikipedia.org/wiki/VP9#Browser_support or https://caniuse.com/#search=VP9 - H.264 is supported on more platforms. (https://caniuse.com/#search=H.264)

2. Yes, dollar for dollar unmanaged solutions will always be cheaper than managed ones, but there are lot more considerations than just how much raw money a service costs. Are you sure Dave even spends more than $10.00 a month on S3? Because I doubt it. Then there is the cost of time it takes to keep the server managed and free from compromise. Also S3 gives dave the ability to use a cdn like cloudfront which is vastly more powerful than a VPS will ever be.

3. Make sure for the VP9 tests that you compare rendering times between that codec and H.264, because if VP9 takes longer then theres another mark against it.

Always learning. The greatest part of life is that there will always be more to learn.
 

Offline MatthewMorganTopic starter

  • Regular Contributor
  • *
  • Posts: 71
  • Country: gb
Re: Dave could inprove the quailty of videos downloads and save money.
« Reply #2 on: December 03, 2017, 02:08:08 pm »
1. The main browser incompatibility is due to apple wanting to push H.265.

2. For the 85MB H.264 video it is around $1 per 115 downloads of that video.

3. The newer the codec the longer it takes to render, if you want all out speed you would be using H.263 like in 2000's. (Using consistent quality would have been a lot quicker but I wanted to match closely the bitrate and I would have had to do some more tests to know what consistent quality would give a bitrate close to the target of 560Kbps).

I have attached some screenshots of the VP9 and H.264 at the same video bitrate.
 

Offline Nerull

  • Frequent Contributor
  • **
  • Posts: 694
Re: Dave could inprove the quailty of videos downloads and save money.
« Reply #3 on: December 04, 2017, 07:42:20 pm »
100Mbps for a file hosting server :-DD
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5137
  • Country: ro
  • .
Re: Dave could inprove the quailty of videos downloads and save money.
« Reply #4 on: December 04, 2017, 08:41:44 pm »
A few minutes ago I downloaded the 7 component tester video and noticed two things straight away;
1. The video is encoded in H254, even tho he could get better quality videos at the same bandwidth by using VP9.
2. He is using Amazon AWS to serve up the video who charge nearly 1 cent per GB of data which is almost laughable as You can get a VPS with 100Mbps unmeated for less than $10 per month.

I am currently doing some test with handbrake using the 1.4Mbps 1080p Youtube file to see how much better compression I can get at or below 558Kbps using consistent quality at 720P downsampled from 1080p.

H264 is supported by pretty much all browsers. VP9 and H265 / HEVC have less support. 

H264 have very wide support for HARDWARE DECODING in video cards (very good for laptops, saving your battery).
HEVC is also hardware decoded by the latest video cards (Pascal and Polaris and Vega and Intel integrated video cards). VP9 support is not as good, AMD cards only offer hybrid (partial) hardware decoding.
   
I'm not up to date with VP9 encoders but as far as I know, VP9 encoders are much slower than h264 (x264) or even HEVC encoders (x265).

All the latest video cards (Pascal and Polaris and Vega) have HARDWARE ENCODING support for H264 and HEVC.  H264 hardware encoding is supported by even older video cards. 

My RX 470 can do 4K 30fps HEVC 10bit encoding with no problems at all, and with decent bitrate, it's looking very good.  No hardware VP9 encoding.


Not sure what video you're talking about, but if the video was something that was also uploaded to Youtube, then it would make sense for Dave to encode it with h264 at a high bitrate because it's going the be recompressed by Youtube in their own formats anyway.

Anyway, tldr is H264 for higher compatibility , HEVC would work great for file downloads, VP9 pretty much only for html5 video playback in browser in Chrome and Firefox maybe. 


AWS is a CDN, it caches the video and copies it close to users so that the video will be streamed at fast speeds and you can play it directly in your browser.  Your 10$ VPS won't allow 10-20 people watch the video at the same time on a 100 mbps internet connection.

Your VPS is cheap because you share the resources of a dedicated server with several other VPSes, so your hard drive's IO will suck. It's pointless to have 100mbps - if 10 people start downloading the video from the VPS, you won't have 10 mbps per user.

You can rent dedicated servers with 100 mbps unmetered for 50$ or less these days, or 1 gbps unmetered for less than 100$ but again, if you want consistent download speeds or streaming anywhere without interruptions you want to go with CDN.

 

Offline MatthewMorganTopic starter

  • Regular Contributor
  • *
  • Posts: 71
  • Country: gb
Re: Dave could inprove the quailty of videos downloads and save money.
« Reply #5 on: December 05, 2017, 05:02:49 am »
Lets go over your points:

Your comment: H264 is supported by pretty much all browsers. VP9 and H265 / HEVC have less support.
My response: That is a issue of browsers for not keeping up.

Your comment: H264 have very wide support for HARDWARE DECODING in video cards (very good for laptops, saving your battery).
My response: Do you expect YouTube to support H.264 forever?

Your comment: HEVC is also hardware decoded by the latest video cards (Pascal and Polaris and Vega and Intel integrated video cards). VP9 support is not as good, AMD cards only offer hybrid (partial) hardware decoding.
My response: H.265 licensing is too expensive. That is why the codec never really took off.

Your comment: I'm not up to date with VP9 encoders but as far as I know, VP9 encoders are much slower than h264 (x264) or even HEVC encoders (x265).
My response: VP9 is faster to encode on CPU than H.265, Dave is doing low bitrate for his downloads aka GPU's would ruin the quality of the video.

Your comment: All the latest video cards (Pascal and Polaris and Vega) have HARDWARE ENCODING support for H264 and HEVC.  H264 hardware encoding is supported by even older video cards. 
My response: As I said Dave uses low bitrates, as such hardware rendering would ruin their quality.

Your comment: My RX 470 can do 4K 30fps HEVC 10bit encoding with no problems at all, and with decent bitrate, it's looking very good.  No hardware VP9 encoding.
My response: Third time, hardware rendering is useless for low bitrate renders.

Your comment: Not sure what video you're talking about, but if the video was something that was also uploaded to Youtube, then it would make sense for Dave to encode it with h264 at a high bitrate because it's going the be recompressed by Youtube in their own formats anyway.
My response: This is for this websites downloads. Not YouTube

Your comment: Anyway, tldr is H264 for higher compatibility , HEVC would work great for file downloads, VP9 pretty much only for html5 video playback in browser in Chrome and Firefox maybe. 
My response: H.264 is old and outdated. H.265 is too expensive

Your comment: AWS is a CDN, it caches the video and copies it close to users so that the video will be streamed at fast speeds and you can play it directly in your browser.  Your 10$ VPS won't allow 10-20 people watch the video at the same time on a 100 mbps internet connection.
My response:You said that Amazon AWS is a CDN. this is not true at all as Cloudfront is Amazons' CDN network, S3 is just a normal VPS. Lastly, More like 100 people as his bitrate is way below 1Mbps.


Your comment: Your VPS is cheap because you share the resources of a dedicated server with several other VPSes, so your hard drive's IO will suck. It's pointless to have 100mbps - if 10 people start downloading the video from the VPS, you won't have 10 mbps per user.
My response: SSD's are pretty normal for VPS's nowadays and they are only getting files.


Your comment:You can rent dedicated servers with 100 mbps unmetered for 50$ or less these days, or 1 gbps unmetered for less than 100$ but again, if you want consistent download speeds or streaming anywhere without interruptions you want to go with CDN.
My response: As I said before AWS is not a CDN, Cloudfront is.


Hopefully, I have gone though all of you points to point out how terrible your points are.
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5137
  • Country: ro
  • .
Re: Dave could inprove the quailty of videos downloads and save money.
« Reply #6 on: December 05, 2017, 05:43:45 am »

Your comment: H264 is supported by pretty much all browsers. VP9 and H265 / HEVC have less support.
My response: That is a issue of browsers for not keeping up.

No, it's because HEVC has complicated licensing and browsers may have to pay fees to decode HEVC encoded videos.  HEVC is supported in Edge because Windows itself has a plugin.
For a long time, Firefox did not support H264 because of licensing costs and complications. Cisco basically released a free decoder and they pay some yearly licensing fee and that's how everybody gets H264 decoding in Firefox and potentially other browsers.

Oh, VP9 also requires processors with SSE2 to decode content or some other newer cpu instructions, while I could still watch h264 encoded videos on Youtube on my IBM T40 laptop with a single core Intel Centrino 1.5 ghz processor.  That's not possible with VP9, even if the video would be low bitrate and low resolution.

Your comment: H264 have very wide support for HARDWARE DECODING in video cards (very good for laptops, saving your battery).
My response: Do you expect YouTube to support H.264 forever?

H264 is one of the codecs in the HTML5 video specification, so it should be supported for a long time. See https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats 
Browsers still support MP3 and that one was around the MPEG-2 times , and now all the patents for MP3 expired so it's free to use.

H264 is also used in Blurays and HEVC is used in 4K blurays ...  Apple is also pushing for HEVC (H265) with their HEIF image format (basically intraframe HEVC) to replace JPG and PNG images so HEVC support will be inside the phone processors and supported for a long time. See https://en.wikipedia.org/wiki/High_Efficiency_Image_File_Format

Other than Youtube saving money on bandwidth and licensing by going with VP9, there's not much reason to use VP9


Your comment: I'm not up to date with VP9 encoders but as far as I know, VP9 encoders are much slower than h264 (x264) or even HEVC encoders (x265).
My response: VP9 is faster to encode on CPU than H.265, Dave is doing low bitrate for his downloads aka GPU's would ruin the quality of the video.

I guess it depends how you tweak the encoder. At least both x264 and x265 have presets from ultrafast to veryslow and placebo, while last time I checked VP9 encoders have fewer configuration options and they're more inflexible.

Your comment: All the latest video cards (Pascal and Polaris and Vega) have HARDWARE ENCODING support for H264 and HEVC.  H264 hardware encoding is supported by even older video cards. 
My response: As I said Dave uses low bitrates, as such hardware rendering would ruin their quality.

It's debatable. In fact, for videos like the one Dave makes (talking heads and closeup of circuit boards so mostly static stuff) hardware encoding would produce quite decent results.


Your comment: Anyway, tldr is H264 for higher compatibility , HEVC would work great for file downloads, VP9 pretty much only for html5 video playback in browser in Chrome and Firefox maybe. 
My response: H.264 is old and outdated. H.265 is too expensive


In the end, bandwidth is cheap. I'd rather upload 1.1 GB h264 with same quality as 1 GB VP9 encoded content but encode the video ten times faster using x264. 
Unless you really have to achieve the best quality possible within a bitrate (let's say you want 300 kbps vbr and max 1mbps peak over a 5s time period or something like that)  there's probably little reason to work several times for so little benefit.

Not to mention that if you don't care about hardware decoding, you could also encode with h264 10bit mode and that will bring the quality even closer to vp9
 

Offline MatthewMorganTopic starter

  • Regular Contributor
  • *
  • Posts: 71
  • Country: gb
Re: Dave could inprove the quailty of videos downloads and save money.
« Reply #7 on: December 05, 2017, 06:09:25 am »
With hardware encoding at low bitrates, if Dave moves his hands the video will become a blockey mess.

The difference in Bandwidth is alot more than 10%, especially on videos will alot of still sections (30% to 50% for his type of video can be expected). But to be honest if I did what dave does I would not be using variable bitrate I would use consistent quality as that would better compress videos with loads of still scenes while being able to use the saved bandwidth to make movement look alot clearer.

10bit only applies for colors, which only really helps with avoiding color banding.
 

Offline mariush

  • Super Contributor
  • ***
  • Posts: 5137
  • Country: ro
  • .
Re: Dave could inprove the quailty of videos downloads and save money.
« Reply #8 on: December 05, 2017, 07:17:30 am »
I downloaded the 1080p version of EEVBlog 1034 from Youtube (563 MB without audio) and i used the hardware encoder on my video card to compress it to HEVC

Code: [Select]
VCEEncC64.exe --codec hevc --quality slow --cqp 28:31:33  --ref 3 --level 5.1 --tier high --output-res 1280x720 -i "d:\Downloads\EEVblog -1034 - Mailbag - DASH.mp4" -o "c:\temp\eevblog2.hevc"
VCEEnc 3.06 (x64) / Windows 7 (x64)
CPU:           AMD FX(tm)-8320 Eight-Core Processor  (4C/8T)
GPU:           Radeon  RX 470 [Ellesmere 1226MHz (2442.8), AMF 1.4]
Input Info:    avvce: H.264/AVC, 1920x1080, 30000/1001 fps
Output:        H.265/HEVC  main @ Level 5.1 (high tier)
               1280x720p 1:1 29.970fps (30000/1001fps)
Quality:       slow
CQP:           I:28, P:31
VBV Bufsize:   20000 kbps
Bframes:       0 frames
Ref frames:    3 frames
LTR frames:    0 frames
Motion Est:    Q-pel
Slices:        1
GOP Len:       300 frames
Others:        deblock

encoded 75618 frames, 220.27 fps, 922.13 kbps, 277.36 MB
encode time 0:05:43, CPULoad: 1.23%


Aimed on purpose to match the file size of the download on the website so i got a 277 MB file, which I then muxed with the AAC audio from youtube which is 38 MB for a total of 315 MB... see the link below to compare with the version on Dave's website.

And just for fun i did my own encoding of the same clip to h264 10bit

Code: [Select]
x264-10b-r2851-ba24899.exe --profile high10 --preset veryslow --tune film --crf 26 --ref 10 --bframes 6 --video-filter resize:1280,720,,,,lanczos  --frames 5600 -o c:\temp\eevblog3.mkv "d:\Downloads\EEVblog -1034 - Mailbag - DASH.mp4"
lavf [info]: 1920x1080p 1:1 @ 30000/1001 fps (vfr)
resize [info]: resizing to 1280x720
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX XOP FMA3 BMI1
x264 [info]: profile High 10, level 5.0, 4:2:0 10-bit
x264 [info]: frame I:25    Avg QP:34.99  size: 49583
x264 [info]: frame P:1760  Avg QP:38.86  size: 10726
x264 [info]: frame B:3815  Avg QP:40.36  size:  2334
x264 [info]: consecutive B-frames:  8.1%  9.3% 14.0% 29.9% 16.0% 21.0%  1.6%
[..]
x264 [info]: kb/s:1242.62

encoded 5600 frames, 10.26 fps, 1242.65 kb/s

Up to you to decide if you want to encode at 220fps or at 10 fps , if you'd rather give the codec 10-20% more bits or try to spend more time encoding to fit more quality in less disk space.

HEVC version : http://www.savedonthe.net/a/eevblog_hevc.mkv

H264 version (first ~ 3 minutes) : http://www.savedonthe.net/a/eevblog_h264.mkv

You can download from here and compare : https://www.eevblog.com/2017/11/01/eevblog-1034-mailbag/

note: Hardware encoding suffers a bit because the HEVC encoder on the Polaris cards does not support bframes. Hardware h264 encoder may actually produce better quality with these types of videos. Still, for 1 mbps it's quite decent quality considering the encoding speed (~8x real time speed) and it looks to me like better quality than Dave's upload.

The quality would also be way better if you'd encode from original 25-50 mbps sources, not from a 500 MB file from Youtube which is already full of compression artifacts.

Anyway, my h264 encoding is much better than the one on the website... that's using some fast preset to encode the video, probably some handbrake template.


later edit:

H264 hardware : http://savedonthe.net/a/eevblog_h264_hw.mkv

Code: [Select]
VCEEncC64.exe  --quality slow --cqp 28:31:33  --ref 3 --bframes 3 --level 4.1 --output-res 1280x720 -i "d:\Downloads\EEVblog -1034 - Mailbag - DASH.mp4" -o "c:\temp\eevblog4.mp4"
VCEEnc 3.04 (x64) / Windows 7 (x64)
CPU:           AMD FX(tm)-8320 Eight-Core Processor  (4C/8T)
GPU:           Radeon  RX 470 Graphics [Ellesmere 1226MHz (2442.8), AMF 1.4]
Input Info:    avvce: H.264/AVC, 1920x1080, 30000/1001 fps
Output:        H.264/AVC  High @ Level 4.1
               1280x720p 0:0 29.970fps (30000/1001fps)
               avwriter: h264 => mp4
Quality:       slow
CQP:           I:28, P:31
VBV Bufsize:   78125 kbps
Bframes:       0 frames
Ref frames:    3 frames
LTR frames:    0 frames
Motion Est:    Q-pel
Slices:        1
GOP Len:       300 frames
Others:        deblock hrd

encoded 75618 frames, 128.95 fps, 1064.66 kbps, 320.23 MB
encode time 0:09:46, CPULoad: 1.02%
frame type IDR   253
frame type I     253,  total size    8.98 MB
frame type P   75365,  total size  311.25 MB
« Last Edit: December 05, 2017, 07:36:05 am by mariush »
 

Offline MatthewMorganTopic starter

  • Regular Contributor
  • *
  • Posts: 71
  • Country: gb
Re: Dave could inprove the quailty of videos downloads and save money.
« Reply #9 on: December 05, 2017, 07:43:55 am »
Thank You.

This is the video I am using

I am still doing some more rendering test to try to match the around 560Kbps with consistent quality (720P 25FPS to match website).

Also, I used the VP9 file from YouTube as its much better due to both being a high bitrate combined with a being a better codec (Using 3D YouTube Downloader in advanced mode).

I do plan on testing with a 10 Bit VP9 encoder in the next few days.

AV1 is coming out soon to fix this all.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf