Limit video resolutions on player (or during transcoding)

Hi,
we have installed an instance (https://video.motoreitaliacarlonegri.it/).
Once we started a production we realized that the bandwidth used is very high (about 200mb constant average), forcing us to have very high server costs.

Our instance has only one video channel and I have already asked our video creator to limit the resolution of the videos on his smartphone to 720p.

But is there a way to limit old videos to 720p maximum, forcing re-encoding or forcing options on the player?

What options can I change on the instance?

I have already set HLS to resolutions up to 720p but videos already uploaded in 1080p continue to be in that resolution.

Thanks

Not that I know of. Maybe that’s a good idea for an issue @Chocobozzz?

In any case, you might want to further reduce the value of rate limiting imposed on serving videos. It is editable in your reverse proxy configuration there: ~~PeerTube/support/nginx/peertube at develop · Chocobozzz/PeerTube · GitHub

EDIT: PeerTube/support/nginx/peertube at 8872828d59a5152e27734711ae30ebe86e84f570 · Chocobozzz/PeerTube · GitHub

1 « J'aime »

There is an issue for this use case: https://github.com/Chocobozzz/PeerTube/issues/1030

Reading the issue… but there is a solution ? Cannot understand…

We have HLS enabled.

So do i change the lines you reported
(https://github.com/Chocobozzz/PeerTube/blob/8872828d59a5152e27734711ae30ebe86e84f570/support/nginx/peertube#L118-L130)

or the following too ? https://github.com/Chocobozzz/PeerTube/blob/8872828d59a5152e27734711ae30ebe86e84f570/support/nginx/peertube#L131-L140

Sorry, my link was wrong. https://github.com/Chocobozzz/PeerTube/blob/8872828d59a5152e27734711ae30ebe86e84f570/support/nginx/peertube#L131-L140 is the good one.

I’ve changed to this:

Bypass PeerTube for performance reasons. Could be removed

location ~ ^/static/(webseed|redundancy|streaming-playlists)/ {
# Clients usually have 4 simultaneous webseed connections, so the real limit is 3MB/s per client
#set $peertube_limit_rate 800k;
set $peertube_limit_rate 500k;

# Increase rate limit in HLS mode, because we don't have multiple simultaneous connections
if ($request_uri ~ -fragmented.mp4$) {
  #set $peertube_limit_rate 5000k;
  set $peertube_limit_rate 2000k;
}

# Use this with nginx >= 1.17.0
# limit_rate $peertube_limit_rate;
# Or this if your nginx < 1.17.0
set $limit_rate $peertube_limit_rate;
#limit_rate_after 5000k;
limit_rate_after 2000k;

Anyway seems badnwith for each connection still the same. What i’m wrong on ?

image

What command did you run to get that screenshot?

sudo iftop