Stream 'engine'..

Announcements and description of general changes in kPlaylist

Stream 'engine'..

Postby aba » Sat May 03, 2003 7:07 pm

It's been built a streaming engine into kPlaylist. It's currently only working properly with UNIX systems. (The engine uses 'usleep()', but this function does not seem to work in win32 environments as it just returns and does not.. sleep (making the CPU load excessive).

The trouble

The streaming support today consists of a client (the mp3 player) limiting the speed. Some clients such as Windows Media Player doesen't have full streaming capabilities and downloads any streaming in full flank speed. This mean that if you have a limited network capacity, all resources will be put into one or few sessions.

The solution

The new streaming support consists of a small controller just sending enough data in resolution of a second. It has also 'prebuffer' support and 'buffer' support such that client can play off music fast when seeking and starting a media, and doesen't need to rebuffer in case of a sudden lack of network capacity (download?)

This streaming support is disabled by default. You can enable it by
setting
Code: Select all
$streamengine = 1;
in the top of the script. (It's only available in kPlaylist build 258 and newer.)

Also, the streaming support can at the time only read mp3 files which is not variabled bit rated.

You also have a small array of configuration for the stream engine:

Code: Select all
$streamsettings =
array(
   'preload'      => 175,
   'buffer'      => 100,
   'sleep'         => 0.999,
   'bitrates'      => array(96,128,160,192,256),
   'defaultrate'   => 256
);


preload => The amount of data in precent will be output during new streams or seeking in existing streams. Set this to zero if you don't want prebuffer.

buffer => Percent of data per sleep. Optimal value is 100% (exact datarate.).

sleep => If the streaming engine fails to give exact datarate, you may tune this.

bitrates => List of supported bitrates. (This list is given mainly because we have no detection of VBR.)

defaultrate => is the bitrate we will use if the array of bitrates does not match the tune in question. The default rate should of course be high enough to serve all streams.

NB! The code is under development and may not work properly for you, in which case you should let us know.

Åge
aba
Site Admin
 
Posts: 2325
Joined: Wed May 08, 2002 9:19 am

Postby buteskin » Sun May 28, 2006 12:52 am

Hi Åge,

I thought that usleep() was fixed in PHP5.

And i tried your $streamengine = 1; but i don't think it works. In mediaplayer the file are prebuffered in full speed, and take up all the bandwidth. I haven't gone in really deep, maybe you know how to get the streamengine to work.

I really like your project by the way!

Bart
buteskin
 
Posts: 8
Joined: Tue May 23, 2006 9:14 am

Postby aba » Sun May 28, 2006 1:01 am

buteskin wrote:Hi Åge,

I thought that usleep() was fixed in PHP5.

And i tried your $streamengine = 1; but i don't think it works. In mediaplayer the file are prebuffered in full speed, and take up all the bandwidth. I haven't gone in really deep, maybe you know how to get the streamengine to work.

I really like your project by the way!

Bart


You have to enable the engine from Settings->Filehandling, but, before doing this, you need to uncheck 'Windows' in Settings->General. Keep this unchecked during testing.
aba
Site Admin
 
Posts: 2325
Joined: Wed May 08, 2002 9:19 am

Postby buteskin » Sun May 28, 2006 3:51 pm

You have to enable the engine from Settings->Filehandling, but, before doing this, you need to uncheck 'Windows' in Settings->General. Keep this unchecked during testing.


Thanks, it's working now!

I did this test, save the m3u file and downloaded that url.
25kB/sec (with streamengine)
213kB/sec (without stream engine)

I also tried some wma's, but had some problems with that.
But the mp3 streaming is great, the files are served at their bitrate speed. Very good job!

:)
buteskin
 
Posts: 8
Joined: Tue May 23, 2006 9:14 am

Postby aba » Sun May 28, 2006 5:55 pm

buteskin wrote:
You have to enable the engine from Settings->Filehandling, but, before doing this, you need to uncheck 'Windows' in Settings->General. Keep this unchecked during testing.


Thanks, it's working now!

I did this test, save the m3u file and downloaded that url.
25kB/sec (with streamengine)
213kB/sec (without stream engine)

I also tried some wma's, but had some problems with that.
But the mp3 streaming is great, the files are served at their bitrate speed. Very good job!

:)


You need getid3 to be able to determine the bitrates of WMA. Not knowing the right bitrate will have a impact on the speed. (defaulttrate is then used)
aba
Site Admin
 
Posts: 2325
Joined: Wed May 08, 2002 9:19 am

Postby buteskin » Mon May 29, 2006 12:25 am

You need getid3 to be able to determine the bitrates of WMA


Done.

The wma streaming works better now, but some notes.

Mediaplayer is saying, example;
" playing: downloaded 16%"
and it is downloading a little bit more than it needs to stream

When playing a wma file in Winamp it plays fine, but when seek in the file Winamp hangs/crashes

/* bart
buteskin
 
Posts: 8
Joined: Tue May 23, 2006 9:14 am

getting streaming engine to work in windows

Postby richyta » Fri Sep 29, 2006 1:09 am

Is there a way to get the streaming engine to work in windows? I see the option but it faded out.
richyta
 
Posts: 5
Joined: Fri Sep 29, 2006 1:06 am

Re: getting streaming engine to work in windows

Postby aba » Fri Sep 29, 2006 8:32 am

richyta wrote:Is there a way to get the streaming engine to work in windows? I see the option but it faded out.


Build 432 should detect PHP5 in Windows and make it enable as normal...
aba
Site Admin
 
Posts: 2325
Joined: Wed May 08, 2002 9:19 am

Post subject: Re: getting streaming engine to work in win

Postby richyta » Fri Sep 29, 2006 5:14 pm

I have php5 installed and have the lastest version of Kplaylist which I think is build 432 but doesn't seem to allow me to check the stream engine box when I logon to the page with admin rights.
richyta
 
Posts: 5
Joined: Fri Sep 29, 2006 1:06 am

Postby richyta » Fri Sep 29, 2006 7:25 pm

Where do I get the kplaylist build 432?
richyta
 
Posts: 5
Joined: Fri Sep 29, 2006 1:06 am

Postby richyta » Fri Sep 29, 2006 9:53 pm

Ok I upgraded to build 432 and it does allow me to check the streamengine box but when I go to save it and close out of the settings screen and go back into it clears out the check box.
richyta
 
Posts: 5
Joined: Fri Sep 29, 2006 1:06 am

Postby squashpile » Mon Oct 02, 2006 2:35 am

Uncheck "A Windows system" under general and try to check it again. I seem to have this working with PHP 5 / Windows Media Player.

CPU usage is very low with this on from what I can tell. Unchecking that same setting with PHP 4 and stream engine would kill CPU, now I can't even tell. This is working VERY well :D

richyta wrote:Ok I upgraded to build 432 and it does allow me to check the streamengine box but when I go to save it and close out of the settings
screen and go back into it clears out the check box.
squashpile
 
Posts: 4
Joined: Tue Sep 26, 2006 9:18 pm

Postby aba » Mon Oct 02, 2006 5:20 pm

richyta wrote:Ok I upgraded to build 432 and it does allow me to check the streamengine box but when I go to save it and close out of the settings screen and go back into it clears out the check box.


Is a bug, will be fixed in the next build. For now, just use uncheck 'Windows' solution previously posted.
aba
Site Admin
 
Posts: 2325
Joined: Wed May 08, 2002 9:19 am

streamengine

Postby richyta » Mon Oct 02, 2006 7:33 pm

squashpile,

Thanks, that did the trick.
richyta
 
Posts: 5
Joined: Fri Sep 29, 2006 1:06 am

stream

Postby threespeed » Fri May 16, 2008 6:51 am

Hi, i have a windows server en i an using the streamengin

but the songs stop playing by 1 minut 15 sec

what went wrong?
threespeed
 
Posts: 6
Joined: Thu Apr 17, 2008 6:14 pm

Next

Return to Announcement



cron