Learn about Centmin Mod LEMP Stack today
Become a Member

Sysadmin Help with a solution for video streaming :(

Discussion in 'System Administration' started by KinderOvO, Sep 1, 2018.

  1. eva2000

    eva2000 Administrator Staff Member

    36,054
    7,910
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,192
    Local Time:
    8:21 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    This thread has renewed my interestlearning for video encoding/streaming again - it's not something I dabble in much due to how expensive it can get at scale though. Just updated Centmin Mod 123.09beta01's addons/ffmpeg.sh installer with optional AV1 encoder support too Beta Branch - update addons/ffmpeg.sh add AV1 support. From what i read much slower encoding speeds than VP9 webm and H.264/265 but much smaller file sizes due to better compression etc. Some results on AV1 site AV1 Test Results.

    AV1 beats x264 and libvpx-vp9 in practical use case

    So if you're currently streaming H.264 mp4 videos, AV1 encoded could reduce size by upto 50% !

    Enjoy!
     
    • Like Like x 2
  2. gabel

    gabel Premium Member Premium Member

    32
    17
    8
    Jan 7, 2016
    Ratings:
    +28
    Local Time:
    11:21 AM
    1.9.9
    MariaDB 10
    kvs makes use of limit_rate_after , here's a post where they explain how this can be done using their script (could be applied to other scripts as well )

    Code:
    https://www.kernel-video-sharing.com/forum/forum/educational-support/educational-series/34-how-to-save-bandwidth-with-kvs-tube-script
     
    Last edited: Sep 4, 2018
    • Informative Informative x 1
  3. eva2000

    eva2000 Administrator Staff Member

    36,054
    7,910
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,192
    Local Time:
    8:21 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    Thanks @gabel definitely interesting and smart approach :)

    Module ngx_http_core_module

     
  4. KinderOvO

    KinderOvO Member

    65
    1
    8
    Jan 13, 2015
    Ratings:
    +1
    Local Time:
    8:21 PM
    1.4
    10
    Total DISK READ : 474.02 M/s | Total DISK WRITE : 3.3 M/s
    Actual DISK READ: 477.67 M/s | Actual DISK WRITE: 1.15 M/s

    Is my iotop result

    Thanks all for attention to help-me

    I am currently using 6 gbps full

    I plan to upgrade to 20gbps.

    Being that I disc rate are already high, all my discs are ssds which generates a very high cost.

    I need a lot of space, because I use videos in 3 formats, 720p, 480p and 360p

    because many visitors use 3G and a slow connection.

    What would be the best solution, since nginx is not caching the videos.

    Is there any way to cache the videos and decrease disk usage.

    I currently use 4 x 2TB SSD
    all the disks are already with 70% of use, already I am thinking how I will do to 20gbps, since with 6gbps the reading rate is very high.
     
  5. eva2000

    eva2000 Administrator Staff Member

    36,054
    7,910
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,192
    Local Time:
    8:21 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    Already mentioned in this thread with links to using nginx sliced byte range caching to cache videos :) For disk space usage, re-encode videos for smaller size I guess
     
  6. KinderOvO

    KinderOvO Member

    65
    1
    8
    Jan 13, 2015
    Ratings:
    +1
    Local Time:
    8:21 PM
    1.4
    10
    Do I need to format my current server and reinstall centmin? Could you share your vhost? and config for mp4 / webm files.
     
  7. eva2000

    eva2000 Administrator Staff Member

    36,054
    7,910
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,192
    Local Time:
    8:21 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    • Like Like x 1
  8. KinderOvO

    KinderOvO Member

    65
    1
    8
    Jan 13, 2015
    Ratings:
    +1
    Local Time:
    8:21 PM
    1.4
    10
    Got it, have you ever used HLS? would it have an advantage? because I currently have to generate 3 videos, 720p, 480p, 320p - because I have a lot of visitors from areas with slower internet.

    It would be the same process, I looked into generating videos with codec AV1 for hls, but I did not find anything of the type.
     
..