Click here to Skip to main content
15,885,365 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I've been studying UPnP/DLNA media servers and have written my own media server from the ground up

My reasons for this is speed, my server has over 50,000 files on it and all commercial upnp applications use internal databases that are quite frankly "slow" so mine uses Microsoft SQL server for its database storage

As a comparison, When doing a search, tvMobili takes 9 seconds to return 1000 results, mine takes less than a second and overall works a lot faster with media players

So far Audio is working perfectly and streams very nicely, but im having problems with video, avi's just refuse to stream and players try to download the entire file before playing anything

I've read on a few forums that there are issues when streaming avi files, i must admit i should know more than i currently do (partly why i'm here)

But before anybody tells me that it "cant" be done, please take this into account tvMobili CAN do it, i just want to know how....

One thing i've noticed is that Windows media player makes 2 requests when starting a file (audio or video)

The first request is for the file eg. /stream/12345.mp3
The second request is a little different eg. /stream/12345.smi

I think the .smi extension holds the key, internet searches tell me its a subtitle file, but i think UPnP servers use it differently

Has anyone heard of this extension or is able to give me any clues to its format?

Here are the the 2 sets of headers that media player sends when opening an mp3 file

GET /stream/27776.mp3 HTTP/1.1
GetContentFeatures.DLNA.ORG: 1
Cache-Control: no-cache
Connection: Keep-Alive
Pragma: getIfoFileURI.dlna.org
Accept: */*
Host: 10.20.0.1:4447
User-Agent: NSPlayer/12.00.7601.17514 WMFSDK/12.00.7601.17514


GET /stream/27776.smi HTTP/1.1
Connection: Keep-Alive
Accept: */*
Accept-Encoding: gzip, deflate
Host: 10.20.0.1:4447
User-Agent: Windows-Media-Player/12.0.7601.17514


Can anyone shed any light?

Thanks in advance

Chris
Posted

WMP is trying to load a subtitle file, you should answer the request with a content-type smi/caption or something like that and obviously attach the smi on the response body. Samsung TV's uses a different approach with srt files sending to the server a HEAD request with a header getCaptionInfo.sec:. For further information about SMI files take a look at http://msdn.microsoft.com/en-us/library/ms971327.aspx[]
 
Share this answer
 
Hi thanks for the reply, id forgotten all about this thread

I did eventually find the answer and its down to the accept-range header
I believe that in avi the codec info is stored in the last frame,
So instead of having to download the entire file, it can just grab the last frame and get the info it needs to stream the file

Chris
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900