segator / proxylive

This application allow you to transcode and broadcast on demand a http mpeg ts to transcoded mpegts/hls
MIT License
59 stars 21 forks source link

Feature Request Adaptive streaming #21

Open alturismo opened 4 years ago

alturismo commented 4 years ago

Hi, so, after some testings and so on (high cpu usage) may a request about hls streaming

to get some benfit from hls it would be nice to implement adaptive streaming, so running as sample

360 and 480 transcode and build the m3u8 with both streams ... so HLS could play its benefit ;)

segator commented 4 years ago

Hls it was an experiment its not stable, probsbly needs to be rebuilded from scratch, Im afraid i dont have time for this :( feel free to make PR and I happily will review it

alturismo commented 4 years ago

cant make any pr on java at all

as note about abr with vaapi, sample here running smooth and stable

`ffmpeg -hwaccel v....

but this requires then to serve the master.m3u8 only ...

so i can of course get the ffmpeg line into your application.aml, but i dont get the webserver part to serve the master.m3u8 instead ...

EDIT

made myself now a php solution with hls and dash, sorry, but java really aint my world ;)

so can be closed

mme89 commented 3 years ago

@alturismo , would you share your php solution?

alturismo commented 3 years ago

hmm, when i find some time i can do so, currently theres nothing documentated yet, builded it into another docker of mine locally here, i ll look into it and drop a comment here when i find some time.

segator commented 3 years ago

I'm considering to build from scratch the HLS/Dash adapter any tought?

alturismo commented 3 years ago

@segator yes ;) the majot goal in my case was ABR (adaptive streaming rates) so it really makes use of HLS/DASH

in my usecase i have it currently as config part like this, input m3u, 3 bitrates which are then used by connection quality, a fixed resolution die i didnt wanted to add also dynamic resolutions depending on bitrate ;) specially depending on players this can cause issues.

`<?php // streamlink, sample https://yourdomain.com/?streamtype=hls&streamlink=123456789abc

// fetch args from link local or remote if ($_GET) { $streamtype = $_GET['streamtype']; $streamlink = $_GET['streamlink']; } else { $streamtype = $argv[1]; $streamlink = $argv[2]; }

// setup inputstream $inputline = "http://localhost:34400/stream/$streamlink"; // format inputline // $bitratelow = "400k"; // lowwest bitrate $bitratemed = "750k"; // medium bitrate $bitratehigh = "1100k"; // highest bitrate // $resolution = "854"; // resolution width, Aspect ratio is kept

// end config here` ...

which ends up in some bigger ffmpeg strings ...

image

and this only makes sense with hw accel ffmpeg transcoding, in software its just too much to handle

in case i can help out a bit ...