Page 1 of 1

Streaming with a Linux Server

Posted: Tue Feb 21, 2006 11:03 am
by makle
Hi,

I have installed a test environment in VMware.

Operating System: Debian 3.1_r1 as Webserver
Packages: mysql-server-4.1
php4-gd2
php4-mysql
lame-3.97

I have the following entries in the config.inc.php file:

$cfg['decode_stdout']['mp3'] = '/usr/local/bin/lame --decode --silent %source -';


$cfg['stream_extension'][] = 'mp3';
$cfg['stream_name'][] = 'MP3 @ 64 kbps';
$cfg['stream_encode'][] = '/usr/local/bin/lame --abr 64 --id3v2-only --ta %artist --tt %title --tc %comment --noreplaygain -t --silent - -';
$cfg['stream_max_channels'][] = 2;
$cfg['stream_transcode_treshold'][] = 65000;

$cfg['stream_extension'][] = 'mp3';
$cfg['stream_name'][] = 'MP3 @ Portable';
$cfg['stream_encode'][] = '/usr/local/bin/lame -V5 --vbr-new --id3v2-only --ta %artist --tt %title --tc %comment --noreplaygain -t --silent - -';
$cfg['stream_max_channels'][] = 2;
$cfg['stream_transcode_treshold'][] = 130000;

$cfg['stream_extension'][] = 'mp3';
$cfg['stream_name'][] = 'MP3 @ High quality';
$cfg['stream_encode'][] = '/usr/local/bin/lame -V2 --vbr-new --id3v2-only --ta %artist --tt %title --tc %comment --noreplaygain -t --silent - -';
$cfg['stream_max_channels'][] = 2;
$cfg['stream_transcode_treshold'][] = 250000;


Now when I test the installation from a Windows Machine I can´t play the music with the Windows Media Player.

Can you help me?

Posted: Tue Feb 21, 2006 11:28 am
by wbartels
Do you use Windows 2000 for streaming?
The default "Windows Media Player" from Windows 2000 doesn't work.
If you use Windows 2000 update the Media Player or better install Winamp.

Posted: Tue Feb 21, 2006 4:38 pm
by makle
I use Windows XP with Media Player 10.00.00.3990.

Posted: Wed Feb 22, 2006 8:38 am
by lylos
My installation is running on a purely linux build (Ubuntu Breezy). You can take a look at it, http://klimatixweb.zapto.org/nj/.

Here, I'll post my config file.

Code: Select all

//  +---------------------------------------------------------------------------+
//  | Decode to stdout (for streaming & recording)                              |
//  |                                                                           |
//  | Known Musepack pipe problem: (mppdec.exe version 1.95z6)                  |
//  | When skipping from Musepack files cmd.exe and mppdec.exe are not closed.  |
//  |                                                                           |
//  | Monkey's Audio doesn't support pipe. (mac.exe version 3.99)               |
//  | A special Monkey's Audio compile from the shnutils website supports pipe: |
//  | http://www.etree.org/shnutils/shntool/                                    |
//  +---------------------------------------------------------------------------+
$cfg['decode_stdout']['ape']        = 'D:\Console\Codec\MACpipe.exe %source - -d';
$cfg['decode_stdout']['flac']       = 'flac --decode --silent --stdout %source';
$cfg['decode_stdout']['mp3']        = 'lame --decode --silent %source -';
$cfg['decode_stdout']['mpc']        = 'D:\Console\Codec\mppdec.exe --silent %source -';
$cfg['decode_stdout']['ofr']            = 'D:\Console\Codec\ofr.exe --decode --silent %source --output -';
$cfg['decode_stdout']['ofs']            = 'D:\Console\Codec\ofs.exe --decode --silent %source --output -';
$cfg['decode_stdout']['ogg']        = 'oggdec --quiet %source --output -';
$cfg['decode_stdout']['wma']        = 'D:\Console\Codec\wmadec.exe -w %source';
$cfg['decode_stdout']['wv']         = 'D:\Console\Codec\wvunpack.exe -q %source -';

...

$cfg['stream_extension'][]          = 'mp3';
$cfg['stream_name'][]               = 'MP3 @ 64 kbps';
$cfg['stream_encode'][]             = 'lame --preset 64 --id3v2-only --ta %artist --tt %title --tc %comment --noreplaygain -t --silent - -';
$cfg['stream_max_channels'][]       = 2;
$cfg['stream_transcode_treshold'][] = 65000;

$cfg['stream_extension'][]          = 'mp3';
$cfg['stream_name'][]               = 'MP3 @ 128 kbps';
$cfg['stream_encode'][]             = 'lame --preset 128 --id3v2-only --ta %artist --tt %title --tc %comment --noreplaygain -t --silent - -';
$cfg['stream_max_channels'][]       = 2;
$cfg['stream_transcode_treshold'][] = 130000;

$cfg['stream_extension'][]          = 'mp3';
$cfg['stream_name'][]               = 'MP3 @ extreme';
$cfg['stream_encode'][]             = 'lame --preset extreme --id3v2-only --ta %artist --tt %title --tc %comment --noreplaygain -t --silent - -';
$cfg['stream_max_channels'][]       = 2;
$cfg['stream_transcode_treshold'][] = 275000;

Posted: Wed Feb 22, 2006 8:15 pm
by makle
I have changed the entries from your script in my script but the Media Player don´t play the music.

Need I open ports for straming?

while httoQ is also not running!!!

Posted: Fri Mar 03, 2006 8:44 am
by Shizzle
Hey Lylos, I like the "Last 5 Albums" that you have on you NJB would you be willing to share the code? I have been trying to do that as well, plus maybe a "most popular" right below that... perhaps you could help me with that? :lol: I also dig the request an album feature that you have incorporated into it.

Posted: Wed Mar 08, 2006 10:31 am
by Shizzle
Actually Lylos I figured it out for the most part... I sorta cheated though :P
What I did is take the code from the favorites.php file and incorporated it into the browse.php file but I am not sure how you got it to display a specified amount and with the images. Now the way it looks on mine is just the new and popular lists from the favorites tabs in on the browse page too. I probably went about it the wrong way.

here it is on my test server:

http://71.193.172.93/njb/

log in with anonymous is fine

As you can see it takes a little bit to completely load up :(

Posted: Wed Mar 08, 2006 11:06 am
by lylos
Oh wow, so you took the entire list and just included it... I'm sorry about not getting around to answering this for you but I was working on the displaying a text file while a song is playing...

Anyway, this code I used to show my last 5 added was quite simple:

Code: Select all

<h3><p align=center>Last 5 Albums</h3>
<table width="80%">
  <tr>
<?php
$last5 = mysql_query('SELECT album_id FROM album ORDER BY album_add_time DESC LIMIT 0,5');
while ($album_id = mysql_fetch_array($last5)){
echo "<td align=center width=150>";
echo "<a href=browse.php?command=view3&album_id=" . $album_id[0] . "><img src=image.php?album_id=" . $album_id[0] .
"&size=100 border=0></a>";
echo "</td>";
}
?>
  </tr>
  <tr>
<?php
$last5 = mysql_query('SELECT album_id FROM album ORDER BY album_add_time DESC LIMIT 0,5');
while ($album_id = mysql_fetch_array($last5)){
$artist = mysql_query('SELECT artist FROM album WHERE album_id = "' .
mysql_real_escape_string($album_id[0]) . '"');
$album = mysql_query('SELECT album FROM album WHERE album_id = "' .
mysql_real_escape_string($album_id[0]) . '"');
$album2 = mysql_fetch_array($album);
$artist2 = mysql_fetch_array($artist);
echo "<td align=center width=150 valign=top>";
echo "<b>" . $artist2[0] . "</b>";
echo "<br><i>" . $album2[0] . "</i>";
echo "</td>";
}
?>
</tr>
</table>
</p>

Posted: Wed Mar 08, 2006 12:00 pm
by Shizzle
Yeah, I was trying to figure it out, I tried... LOL... thanks for the code though I have been trying to get that to work for a long time so that there is more stuff on the browse page.

I lost my code that I made for the .txt in the other post, and I was trying to remember it but since you beat me to it thats cool though.

Thanks again.

Posted: Tue Mar 14, 2006 7:43 am
by Shizzle

Code: Select all

mysql_query('SELECT artist, artist_alphabetic, album, counter, counter_update_time, album_id FROM album WHERE 1 ORDER BY counter DESC, counter_update_time DESC');
could I change the sql query to that to pull the most played/popular as well? or is it more to it then that. I was just thinking of changing the line

from:

Code: Select all

$last5 = mysql_query('SELECT album_id FROM album ORDER BY album_add_time DESC LIMIT 0,5');
to:

Code: Select all

$pop5 = mysql_query('SELECT artist, artist_alphabetic, album, counter, counter_update_time, album_id FROM album WHERE 1 ORDER BY counter DESC, counter_update_time DESC LIMIT 0,5');
but I am not completely sure if I am on the right track or not.

Any help or suggestions would be great.