| View previous topic :: View next topic |
| Author |
Message |
vbwrong
Joined: 28 Jun 2006 Posts: 20
|
Posted: Thu Jul 06, 2006 2:36 am Post subject: File Streaming |
|
|
Hello Karl
Thanks for your help earlier, but I have a few more questions regarding Icecast and streaming.
I wanted to stream some files - on-demand or just repeat them (doesn't matter). They are about 2 hours in length. I had earlier tried with NSV GUI but it buffers a lot for some reason - despite all the settings I tried. So I was wondering is there a way in Icecast you can do file streaming directly? Without using nsvgui or something?
Thanks,
vbwrong |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Thu Jul 06, 2006 2:23 pm Post subject: |
|
|
icecast does allow the downloading of files from webroot but there is no special processing of those as that requires codec knowledge, but some use that for on-demand streaming.
karl. |
|
| Back to top |
|
 |
vbwrong
Joined: 28 Jun 2006 Posts: 20
|
Posted: Thu Jul 06, 2006 3:08 pm Post subject: |
|
|
Oh I see. Could someone (or you Karl when you have time) guide me step by step on that and how I would do that? Do I place the nsv files in /web folder? And how would I configure Icecast so it knows I'm doing file/on-demand streaming
Thanks, vbwrong |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
|
| Back to top |
|
 |
vbwrong
Joined: 28 Jun 2006 Posts: 20
|
Posted: Thu Jul 06, 2006 8:39 pm Post subject: |
|
|
| Okay I'm totally confused. Sorry I know this is frustrating but I'm a complete noob at this. What do you mean by webroot in the first place? And can I add authentication to this link somehow? Also, what will my config file in Icecast have for this? Thanks |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Thu Jul 06, 2006 8:41 pm Post subject: |
|
|
webroot is a setting in your icecast xml config. You can add authentication to webroot files, just add a <mount> with the mount name of the file in question eg /myfile.nsv
karl. |
|
| Back to top |
|
 |
Anonymous Guest
|
Posted: Thu Jul 06, 2006 10:00 pm Post subject: |
|
|
I wrote some scripts in ASP.Net to do on demand streaming. This fills for void for me; when it comes to the on demand stuff.
Take a look at:
http://www.wmph.org/OnDemand/SinglesEvents.aspx
for a working example. This page enumerates a directory on the webserver (reads the ID3's out of the files), and streams them as requested by the user.
If you want the code, look at the projects section of my site:
http://www.barnyardbbs.com
Hope this helps.
-Ben |
|
| Back to top |
|
 |
vbwrong
Joined: 28 Jun 2006 Posts: 20
|
Posted: Fri Jul 07, 2006 5:23 am Post subject: |
|
|
Hey
Thanks a lot for your help beervamint and Karl. I placed the file in webroot and it is working fine now. The only thing I need (and I promise, it's the last question!) to know is this:
I basically have the users in my site input their username and password, and when they click "Watch" , it opens winamp with the stream. But with this webroot method, when they click "Watch", it says "Source does not exist". Now I believe it is because since this is on-demand, it doesn't find the stream online at the moment and says that?
This is the HTML code I use (for users to input user/pass and click watch to open winamp):
| Code: |
</form>
<table border="0"><form action="http://72.232.213.202:8020/admin/buildm3u" method="get"><tbody><tr><td>[B]Username:[/B] <input name="username">
</td><td>[B]Password:[/B] <input name="password" type="password">
</td><td><input value="Watch!" type="submit">
</td></tr></tbody></table></center><input value="/stream.nsv" name="mount" type="hidden"></form> |
The port of the icecast running this is 8020 and the file name is stream.nsv
I tried playing it directly on winamp and it works fine - I just need a way to put it on my site so when users enter user/pass and click watch, it opens winamp with this link:
http://user:pass@72.232.213.202:8020/stream.nsv (it does this for all my other streams that I stream using NSV CAPTURE, but since this is a file streaming it's not working.)
Could someone help as to what HTML I should edit to make it open the link in winamp with their user/pass they input.
Thanks |
|
| Back to top |
|
 |
Anonymous Guest
|
Posted: Fri Jul 07, 2006 1:45 pm Post subject: |
|
|
I'm not an expert on buildm3u; but I think that's your problem. I don't think it works with http-served files.
You could always throw together a quick script for it. On my sites, I don't use m3u's; but I've got dynamic scripts for asx's and pls's. (ASP.Net). |
|
| Back to top |
|
 |
vbwrong
Joined: 28 Jun 2006 Posts: 20
|
Posted: Fri Jul 07, 2006 2:56 pm Post subject: |
|
|
Oh I see. Thing is I'm not an expert with scripts I try to keep it simple and just use HTML mostly lol. So it is because when they click watch, there is no stream there (as of yet) and so it says "Source Not found". I'll see and try to make it so it allows them to input user/pass and just opens winamp with that link - and not try to connect to the source first. Lets see how it goes...I'm a little confused with this.
Thanks for your help though
vbwrong |
|
| Back to top |
|
 |
Anonymous Guest
|
Posted: Fri Jul 07, 2006 4:14 pm Post subject: |
|
|
It shouldn't be hard to make a short script that will give you an m3u (or other playlist type).
The script just takes some parameters (such as user and pass), and returns a special text file (m3u, pls, and asx are just text really).
What type of host are you using? What scripting language is supported? PHP? Perl? Asp? Asp.Net?
I'm no PHP guy; but I'm pretty certain I could make what you need in short order. |
|
| Back to top |
|
 |
vbwrong
Joined: 28 Jun 2006 Posts: 20
|
Posted: Fri Jul 07, 2006 9:07 pm Post subject: |
|
|
Hello
I'm using Trancehosting and I believe all scripts are supported - php , perl asp, asp.net, java, javascript, html. The thing is that this will be a 'post' in my vbulletin, so it will allow scripts right? I would really appreciate it if you could help me with this script as I have no knowledge of scripts really.
Thanks |
|
| Back to top |
|
 |
Anonymous Guest
|
Posted: Sat Jul 08, 2006 2:31 am Post subject: |
|
|
If your host supports scripting, then you're in business. Here's how it will work:
Your existing form will "Post" (or pass information, such as the name and password) to the script. The script will return a playlist to the client. I usually do ASX for Windows Media Player, and PLS for Winamp / Other. No reason you couldn't do M3U.
I'll throw together a sample. |
|
| Back to top |
|
 |
vbwrong
Joined: 28 Jun 2006 Posts: 20
|
Posted: Sat Jul 08, 2006 3:36 am Post subject: |
|
|
Oo nice Yup my hosting supports scripting
I am eagerly waiting for your sample as I don't have much knowledge in scripting.
Thanks a bunch
I hope I can get this to work.
vbwrong |
|
| Back to top |
|
 |
Anonymous Guest
|
Posted: Sun Jul 09, 2006 9:05 pm Post subject: |
|
|
Here's a little script that will create a PLS for you. It can easily be adapted for M3U or ASX, if you want them.
Sorry for the delay. I'm not a PHP guy. I had to install it before I could test-compile the script. I looked at your hosting company, and PHP was the only language supported.
Here's the script. You should have your name/password entry target this script. It will provide the playlist for the user's media player.
<?php
/* Set the content type, and make it force a download */
header("Content-type: audio/x-scpls");
header("Content-Disposition: attachment; filename=dynamic.pls");
/* Change this to the location of your stream. */
$StreamLocation = "www.wmph.org/OnDemand/OnDemand.aspx?Target=Club91764k";
$ResultString .= "[playlist]\n" . "File1=http://" . $_POST["username"] . ":" . $_POST["password"] . "@" . $StreamLocation . "\nLength=-1\nNumberOfEntries=1\nVersion=2";
print $ResultString;
?>
I put a sample URL in place, just to get it going. It's ready to work with the username/password; but it will also work without them.
Hope this helps. |
|
| Back to top |
|
 |
|