Discussions
12 Next
Downloading the streaming file
roncli


Member since:
Jun 17, 2007
Country:
United States
Posts: 2294
Posted on Aug 15 2008
With this URL:

http://www.traxinspace.com/stream/35944,121896,32d02b994b8e0253de681cfdc349c72a.m4a

I can put it in the IE browser window and the file downloads as expected.

However, if I go into Winamp, right click the "open" button, select "open URL", and put the URL into that window, Winamp refuses to play it.

Can anyone tell me why? I haven't a clue what's wrong.
____________
-roncli
"I thought that when you created a program, or anything in general, you opened yourself up to all sorts of criticism." -TwiTerror
"Maybe I'm just retarded (;" -Also TwiTerror
bvanoudtshoorn


Member since:
Aug 31, 2007
Country:
Australia
Posts: 737
Posted on Aug 16 2008
Something to do with cookies, perhaps?
____________
barryvan.com.au - design and music
the barryvan compo - inspiration-based compo
barryvan @ last.fm
--
roncli


Member since:
Jun 17, 2007
Country:
United States
Posts: 2294
Posted on Aug 19 2008
Well, I'm kinda hoping someone who with experience in this area could help me out... I've looked at this from a lot of angles and haven't been able to get this to work.

So, /bump.
____________
-roncli
"I thought that when you created a program, or anything in general, you opened yourself up to all sorts of criticism." -TwiTerror
"Maybe I'm just retarded (;" -Also TwiTerror
allenone


Member since:
Jun 26, 2007
Country:
United States
Posts: 600
Posted on Aug 19 2008
Absolutely. I can answer that for you.
The URL window ("Play URL", "Open URL" etc. depending on if its winamp wmp realplayer and so on) is for playing LIVE streaming, not On-Demand.

People always confuse the two. The formats are actually slightly different. If you want to read the technical aspects of it there are papers

In technical terms. On-Demand sends you a download file. The file is usually cashed so it can start playing it for you even though it's still downloading. HOWEVER, this is a non-loss transmission to you, of a file that is resident (even if its just in temp) on your pc. If the download gets interfered with, it will pause and sit there after the cache is expended, wait for more, then continue.

LIVE, on the other hand, loads the packets as they come... buffers just a little to compensate for roughness of i/o in the computer, then plays it and it is GONE. Packets get thrown out to modulate your speakers in realtime, as they come in, with no file, record, whatsoever. If a LIVE broadcast has a few seconds of interruption, those packets never make it to your computer, and you dont get the content. It will break up, pause, or skip and then continue with whatever packets keep coming in.

Media players' URL windows are for Live streams, not on-demand.

Now the trick that you may have seen us discussing the sixty-one, which is on-demand, is this: On-Demand usually is started by a player on the client end. When you click the link, the download ensues as fast as your pc can download it, and it starts playing as mentioned. Thing is, what if you don't want that bizarre encryptic filename? or not sure where your temp files are going? or not interested in playing it through the client's player but you just want to get the file to your hard drive as fast as possible and then play it with winamp or whatnot? Pushing the link in advance is how you do that.

Now at this point you're probably wandering "why can't winamp point at the link then as I asked?" Answer: header information. Winamp won't play it as a file until it looks like a file. It isn't a file until it hits your hardrive, and is completed. Otherwise, you're basically asking Winamp to be a download module, which it isn't designed to do....yet.

AL
---------------------------------------
roncli said:

Well, I'm kinda hoping someone who with experience in this area could help me out... I've looked at this from a lot of angles and haven't been able to get this to work.

So, /bump.
____________
-roncli
"I thought that when you created a program, or anything in general, you opened yourself up to all sorts of criticism." -TwiTerror
"Maybe I'm just retarded (;" -Also TwiTerror

____________

Internet Radio featuring music from The Tracker Community, Second Life Artists, & Independent Musicians
allenone


Member since:
Jun 26, 2007
Country:
United States
Posts: 600
Posted on Aug 19 2008
OH ps. When I said "Pushing the link in advance" I meant that if you take the link and put it into the webbrowser or a download manager module your webbrowser has, it will download it.

(of course, that's redundant here at TIS since you have an accompanying archive, but for places where on-demand is the only thing offered, people will do that...like me )
____________

Internet Radio featuring music from The Tracker Community, Second Life Artists, & Independent Musicians
roncli


Member since:
Jun 17, 2007
Country:
United States
Posts: 2294
Posted on Aug 19 2008
I hate to counter such a well thought out explanation... but plug this into WinAMP's Open URL:

http://www.traxinspace.com/35944,121896,32d02b994b8e0253de681cfdc349c72a.m4a

Same file as in the original post, and it works.

Difference? Delivery method. The first is a PHP script that redirects the file, the second is a direct link to the file.

What I want to know is why this one works, but the original one does not. It delivers the same file.
____________
-roncli
"I thought that when you created a program, or anything in general, you opened yourself up to all sorts of criticism." -TwiTerror
"Maybe I'm just retarded (;" -Also TwiTerror
allenone


Member since:
Jun 26, 2007
Country:
United States
Posts: 600
Posted on Aug 20 2008
Hm. I see things have changed a little since I last upgraded my winamp client.

Good ole AOL. Wonder what else they changed since they bought them out.

I had the same results after updating to 5.541 as you did. I suspect they added on-demand because AOL now has its radio stations in the searchable media libray of freebees. God only knows what plans they'll be using (I notice that some of the aol stations do not display their ip address when you do a view info. That's a nice attempt for the layman, but netstat is your friend. How dare they bounce something off my PC and try to hide themselves...isn't that anti-internet security behavior?)

Anyway, maybe there's more than 1 on-demand standard I don't know. Someday when I'm not programming for the Man I'll have to sit down and write a program to tear open the headers (oh the good old days of midi sysex-style file analysis ew yuck).

Give me details on both delivery methods, Roncli, and I'll post the question in some audio forums I have paid access to and see if I can get an answer.

The redirect shouldn't bother it because I use registered redirects via DynDNS all the time. http://kfos-is-with-theband.com is really a redirection to http://s2.secondstreams.com:5208 and http://kfosaac-is-with-theband.com redirects to http://s4.secondstreams.com:5420

So Hm.

AL

____________
allenone


Member since:
Jun 26, 2007
Country:
United States
Posts: 600
Posted on Aug 20 2008
Yea this one is kinda irritating. I think maybe winamp just can't handle client side redirections, whereas I'm actually using an external DNS lookup for my station identifiers.. If that's the case, then that...well hell yea that makes sense. The links you get presented with at the sixty one site are all redirects... You can't use any of those. You have to examine the page itself with a source viewer to see what the link will actually request so you can then put the direct file link in the download manager, or, as you discovered, in the winamp url window itself.

Nice to know...

"You have become better at breaking media players (10)"
____________
clones


Member since:
Nov 05, 2007
Country:
Bouvet Island
Posts: 3614
Posted on Aug 20 2008
What is the deal with embedded players that use XML lists?

Is it all flash at the end of the day?
____________
Sharing - it's a scene thing.
SoOn net label
roncli


Member since:
Jun 17, 2007
Country:
United States
Posts: 2294
Posted on Aug 20 2008
The 2nd example is just a straight download... the file is in the root directory.

The first example is more complex, it's done in PHP. Here's some pseudo code, where $f is the filename and $size is the size of the file:

ob_end_clean();
...
if(ini_get('zlib.output_compression')) ini_set('zlib.output_compression', 'Off');
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Type: audio/mp4");
header("Content-Disposition: attachment; filename=\"" . $f . "\"");
header("Content-Transfer-Encoding: binary");
header("Content-Length: " . $size);
$fp = fopen($file, 'rb');
$served = fpassthru($fp);
____________
-roncli
"I thought that when you created a program, or anything in general, you opened yourself up to all sorts of criticism." -TwiTerror
"Maybe I'm just retarded (;" -Also TwiTerror
allenone


Member since:
Jun 26, 2007
Country:
United States
Posts: 600
Posted on Aug 20 2008
Ok. I sit across the room from an experienced php person who also used to set up the a/v stuff for professional porn sites. Maybe he might spot something in that code that players don't like.
roncli


Member since:
Jun 17, 2007
Country:
United States
Posts: 2294
Posted on Aug 20 2008
Sweet. I played around with the headers for about an hour and couldn't get it to take.
____________
-roncli
"I thought that when you created a program, or anything in general, you opened yourself up to all sorts of criticism." -TwiTerror
"Maybe I'm just retarded (;" -Also TwiTerror
allenone


Member since:
Jun 26, 2007
Country:
United States
Posts: 600
Posted on Aug 20 2008
Ok SeaShanty,

My friend and I looked at it. We have an educated guess. The content-disposition being set to attachment might be confusing the player into trying to open up the dialog box. Maybe trying inline will help.

We're speculating that the player works for the direct link because it may automatically assume any properties or values if not specified in header information, but if header information does exist, then it reacts to it, and if the settings you chose to push it are not proper or some are missing, it chokes (which is ground you've already played with.

Try the disposition change and see what kind of luck you have.

AL
____________
roncli


Member since:
Jun 17, 2007
Country:
United States
Posts: 2294
Posted on Aug 20 2008
No dice.

For reference, here's the headers that's being returned for each.

For the first, the redirection:

HTTP/1.1 200 OK
Date: Wed, 20 Aug 2008 20:31:01 GMT
Server: Apache/2.2.2 (Fedora)
X-Powered-By: PHP/5.1.6
Expires: Wed, 03, Sep 2008 20:16:19 GMT
Cache-Control: max-age=1209600
Pragma: no-cache
Accept-Ranges: bytes
Content-Length: 950897
Connection: close
Content-Type: text/plain

For the second, the direct download:

HTTP/1.1 200 OK
Date: Wed, 20 Aug 2008 20:31:14 GMT
Server: Apache/2.2.2 (Fedora)
Last-Modified: Tue, 19 Aug 2008 22:42:15 GMT
Accept-Ranges: bytes
Content-Length: 950897
Cache-Control: max-age=1209600
Expires: Wed, 03 Sep 2008 20:31:14 GMT
Connection: close
Content-Type: text/plain
____________
-roncli
"I thought that when you created a program, or anything in general, you opened yourself up to all sorts of criticism." -TwiTerror
"Maybe I'm just retarded (;" -Also TwiTerror
roncli


Member since:
Jun 17, 2007
Country:
United States
Posts: 2294
Posted on Aug 20 2008
(Note that I edited the above about 14 minutes after posting)
____________
-roncli
"I thought that when you created a program, or anything in general, you opened yourself up to all sorts of criticism." -TwiTerror
"Maybe I'm just retarded (;" -Also TwiTerror
allenone


Member since:
Jun 26, 2007
Country:
United States
Posts: 600
Posted on Aug 20 2008
Hm. Well nothing particulary jumps out at either of us. Sorry.
The next logical step would be to view header information from other sites trying similar models if you can find them.
____________
Spectra


Member since:
Aug 17, 2007
Country:
United States
Posts: 1197
Posted on Aug 20 2008
Ron, remember how we did all that work finding an encoder that would create an mp4-compatible container for the AAC-Plus files?

My guess is this wrapper is confusing winamp, which likely expects a file WITHOUT a container.

One easy way to test this is to see if winamp will play the downloaded/saved aac file from a local/already-downloaded copy. If it won't, that means the problem most likely lies with the actual file format/container, rather than the way it is transferred to winamp.

Hope this helps...
roncli


Member since:
Jun 17, 2007
Country:
United States
Posts: 2294
Posted on Aug 20 2008
Yah, that's what the second file is. To review:

The first file is the file that is currently unable to be played in Winamp, and is being fetched via the PHP script you see above.

http://www.traxinspace.com/stream/35944,121896,32d02b994b8e0253de681cfdc349c72a.m4a

The second file is in the root directory of traxinspace.com, works in WinAMP, and is a direct download.

http://www.traxinspace.com/35944,121896,32d02b994b8e0253de681cfdc349c72a.m4a
____________
-roncli
"I thought that when you created a program, or anything in general, you opened yourself up to all sorts of criticism." -TwiTerror
"Maybe I'm just retarded (;" -Also TwiTerror
roncli


Member since:
Jun 17, 2007
Country:
United States
Posts: 2294
Posted on Aug 20 2008
Allen,

I have determined it is not a header issue. I have milked the headers until they are almost exactly the same, only difference bgeing the time of the request. Still, the first example does not play in winamp while the second example does.

First:

HTTP/1.1 200 OK
Date: Wed, 20 Aug 2008 22:53:52 GMT
Server: Apache/2.2.2 (Fedora)
Last-Modified: Tue, 19 Aug 2008 22:42:15 GMT
Accept-Ranges: bytes
Content-Length: 950897
Cache-Control: max-age=1209600
Expires: Wed, 03 Sep 2008 22:53:52 GMT
Keep-Alive: timeout=2, max=100
Connection: Keep-Alive
Content-Type: text/plain

Second:

HTTP/1.1 200 OK
Date: Wed, 20 Aug 2008 22:54:06 GMT
Server: Apache/2.2.2 (Fedora)
Last-Modified: Tue, 19 Aug 2008 22:42:15 GMT
Accept-Ranges: bytes
Content-Length: 950897
Cache-Control: max-age=1209600
Expires: Wed, 03 Sep 2008 22:54:06 GMT
Keep-Alive: timeout=2, max=100
Connection: Keep-Alive
Content-Type: text/plain
____________
-roncli
"I thought that when you created a program, or anything in general, you opened yourself up to all sorts of criticism." -TwiTerror
"Maybe I'm just retarded (;" -Also TwiTerror
roncli


Member since:
Jun 17, 2007
Country:
United States
Posts: 2294
Posted on Aug 20 2008
Alright, I got it working. The problem was in the PHP file, not the headers.

Tomorrow's task: being able to view song title instead of the ugly filename.
____________
-roncli
"I thought that when you created a program, or anything in general, you opened yourself up to all sorts of criticism." -TwiTerror
"Maybe I'm just retarded (;" -Also TwiTerror
12 Next