Page 2 of 2

Posted: Tue Feb 22, 2005 11:09 am
by Superlexx
I tested with WinAmp and Foobar2000

Code: Select all

$pointer = popen($cmd, 'rb'); 
fpassthru($pointer); 
pclose($pointer);
didn't help, I'll try the process stuff later

Posted: Tue Feb 22, 2005 12:42 pm
by wbartels
Superlexx wrote:hm, I had to re-install windows, and now I am running IIS5.1 instead of Apache (had to use IIS anyway because of Phalanger), and both WinAmp and fb2k play the vorbis stream flawlessly. The drawback is that transcoding does not stop before the whole file is done, even if I press "stop" on the media player, any idea what might cause this?
It doesn't depend on the webserver but on the mp3 source:

Code: Select all

apache stream  what happents after stopping Winamp
------------------------------------------------------------------
flac --> mp3    stream stops   
mpc --> mp3     stream stops (known problem: cmd.exe and mppdec.exe aren't closed)
mp3 --> mp3     100% processor utilization until finished
flac --> ogg    stream stops   
mpc --> ogg     stream stops (known problem: cmd.exe and mppdec.exe aren't closed)
mp3 --> ogg     100% processor utilization until finished

IIS 6 stream    what happents after stopping Winamp
------------------------------------------------------------------
flac --> mp3    stream stops   
mpc --> mp3     stream stops (known problem: cmd.exe and mppdec.exe aren't closed)
mp3 --> mp3     100% processor utilization until finished
flac --> ogg    stream stops   
mpc --> ogg     stream stops (known problem: cmd.exe and mppdec.exe aren't closed)
mp3 --> ogg     100% processor utilization until finished

Posted: Wed Feb 23, 2005 12:11 am
by Superlexx
hm, I've just managed the whole streaming stuff to work perfectly :shock: by setting in php.ini:

Code: Select all

output_buffering = 40960
, now everything works as far as I see (cancelling transcoding and streaming with both winamp and foobar).

Btw, I've modified wmadec to output wav-headered PCM steam, see http://www.hydrogenaudio.org/forums/ind ... opic=31574 , the according line in config.inc.php is like

Code: Select all

$cfg['decode_stdout']['wma']= 'D:\bin\codec\wmadec.exe -w %source ';
Now I can use all my WMA lossless music without pre-transcoding it to vorbis first.

Posted: Wed Feb 23, 2005 12:29 am
by wbartels
Superlexx wrote:hm, I've just managed the whole streaming stuff to work perfectly :shock: by setting in php.ini:

Code: Select all

output_buffering = 40960
, now everything works as far as I see (cancelling transcoding and streaming with both winamp and foobar).

Btw, I've modified wmadec to output wav-headered PCM steam, see http://www.hydrogenaudio.org/forums/ind ... opic=31574 , the according line in config.inc.php is like

Code: Select all

$cfg['decode_stdout']['wma']= 'D:\bin\codec\wmadec.exe -w %source ';
Now I can use all my WMA lossless music without pre-transcoding it to vorbis first.
Thanks very much for your help :D
I will add the modified wmadec.exe to the next codec pack and add the line to config.inc.php.

Posted: Thu Feb 24, 2005 12:38 pm
by Superlexx
Hi, you've added sample rate, bits and channels, but you forgot to put them into the vorbis encoding command like this:

Code: Select all

$cfg['stream_encode'] = 'D:\Console\Codec\oggenc.exe --quiet --raw --raw-bits=%bits_per_sample --raw-chan=%channels
--raw-rate=%sample_rate --quality 0 -';
Also, what about letting the user select streaming encoding and bitrate on-the-fly? My suggestion is to integrate the alternative streaming formats and bitrates into the JS tooltips like this:

Code: Select all

MP3     64k  96k  128k
AAC     64k  96k  128k
Vorbis  -1  0  1  2  3
and maybe even add a form field into the tooltip for precise bitrate setting

But well, if you want to take a break from NJB coding, then just forget it :wink:

Posted: Thu Feb 24, 2005 12:57 pm
by wbartels
Superlexx wrote:Hi, you've added sample rate, bits and channels, but you forgot to put them into the vorbis encoding command like this:

Code: Select all

$cfg['stream_encode'] = 'D:\Console\Codec\oggenc.exe --quiet --raw --raw-bits=%bits_per_sample --raw-chan=%channels
--raw-rate=%sample_rate --quality 0 -';
Also, what about letting the user select streaming encoding and bitrate on-the-fly? My suggestion is to integrate the alternative streaming formats and bitrates into the JS tooltips like this:

Code: Select all

MP3     64k  96k  128k
AAC     64k  96k  128k
Vorbis  -1  0  1  2  3
and maybe even add a form field into the tooltip for precise bitrate setting

But well, if you want to take a break from NJB coding, then just forget it :wink:
Yes, I have a break now.
I will put it on my to do list :wink:

Posted: Thu Feb 24, 2005 1:11 pm
by Superlexx
oh, just forgot: here's a code snippet for menu.php:

Code: Select all

if ($menu == 'browse')
	{
	echo '<a href="browse.php?command=view1&filter=symbol&artist=%23" target="main">&nbsp;# </a>' . $seperation;
	for ($letter = 'a'; $letter != 'aa'; $letter++)
	{
		echo '<a href="browse.php?command=view1&filter=start&artist=' . $letter . '" target="main"> ' . $letter . ' </a>' . $seperation;
	}
	echo '<a href="browse.php?command=view1&artist=all&filter=all" target="main"> * </a>' . $seperation .
		 '<a href="browse.php?command=view2&artist=Various&filter=exact&order=album" target="main"> &&nbsp;</a>';
	}
and here is the button from menu_browse_on.gif written in SVG:

Code: Select all

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg viewBox="0 0 90 23" width="90px" height="23px" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
	<defs>
		<linearGradient id="red_black" x1="0%" y1="0%" x2="0%" y2="100%">
			<stop offset="0%" style="stop-color:rgb(198,186,156);stop-opacity:1"/>
			<stop offset="100%" style="stop-color:rgb(147,139,108);stop-opacity:1"/>
		</linearGradient>
		<filter id="DropShadow" filterUnits="userSpaceOnUse" x="0" y="0" width="200" height="120">
			<feGaussianBlur in="SourceAlpha" stdDeviation="4" result="blur"/>
			<feMerge>
				<feMergeNode in="blur"/>
				<feMergeNode in="SourceGraphic"/>
			</feMerge>
		</filter>
	</defs> 
	<a xlink:href="../browse.php">
		<rect x="0" y="0" width="90" height="23" style="fill:url(#red_black)"/>
		<path d="M 0 0 v 23" stroke="rgb(228,223,209)" stroke-width="1px"/>
		<path d="M 0 0 h 90 v 23" fill="none" stroke="black" stroke-width="1px"/>
		<g filter="url(#DropShadow)">
			<text x="20px" y="16" font-family="Verdana" font-size="14" fill="white">browse</text>
		</g>
	</a>
</svg>
, just in case you want to localize NJB one day and don't want to mess around with tons of button bitmaps :D

Posted: Mon Feb 28, 2005 1:08 am
by wbartels
Superlexx wrote:oh, just forgot: here's a code snippet for menu.php:

Code: Select all

if ($menu == 'browse')
	{
	echo '<a href="browse.php?command=view1&filter=symbol&artist=%23" target="main">&nbsp;# </a>' . $seperation;
	for ($letter = 'a'; $letter != 'aa'; $letter++)
	{
		echo '<a href="browse.php?command=view1&filter=start&artist=' . $letter . '" target="main"> ' . $letter . ' </a>' . $seperation;
	}
	echo '<a href="browse.php?command=view1&artist=all&filter=all" target="main"> * </a>' . $seperation .
		 '<a href="browse.php?command=view2&artist=Various&filter=exact&order=album" target="main"> &&nbsp;</a>';
	}
and here is the button from menu_browse_on.gif written in SVG:

Code: Select all

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg viewBox="0 0 90 23" width="90px" height="23px" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
	<defs>
		<linearGradient id="red_black" x1="0%" y1="0%" x2="0%" y2="100%">
			<stop offset="0%" style="stop-color:rgb(198,186,156);stop-opacity:1"/>
			<stop offset="100%" style="stop-color:rgb(147,139,108);stop-opacity:1"/>
		</linearGradient>
		<filter id="DropShadow" filterUnits="userSpaceOnUse" x="0" y="0" width="200" height="120">
			<feGaussianBlur in="SourceAlpha" stdDeviation="4" result="blur"/>
			<feMerge>
				<feMergeNode in="blur"/>
				<feMergeNode in="SourceGraphic"/>
			</feMerge>
		</filter>
	</defs> 
	<a xlink:href="../browse.php">
		<rect x="0" y="0" width="90" height="23" style="fill:url(#red_black)"/>
		<path d="M 0 0 v 23" stroke="rgb(228,223,209)" stroke-width="1px"/>
		<path d="M 0 0 h 90 v 23" fill="none" stroke="black" stroke-width="1px"/>
		<g filter="url(#DropShadow)">
			<text x="20px" y="16" font-family="Verdana" font-size="14" fill="white">browse</text>
		</g>
	</a>
</svg>
, just in case you want to localize NJB one day and don't want to mess around with tons of button bitmaps :D
I didn't know that it was possible to use characters for a loop.
Yes, I will use it for the menu.

No plans yet to localize netjukebox.