Click here to Skip to main content
Sign Up to vote bad
good
See more: VB.NET
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 18 Nov '12 - 13:35
Anetics298


2 solutions

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[]
  Permalink  
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
  Permalink  

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 OriginalGriff 253
1 Rohan Leuva 220
2 Abhinav S 168
3 Mahesh Bailwal 165
4 Ron Beyer 160
0 Sergey Alexandrovich Kryukov 8,528
1 OriginalGriff 6,819
2 CPallini 3,643
3 Rohan Leuva 2,923
4 Maciej Los 2,288


Advertise | Privacy | Mobile
Web04 | 2.6.130516.1 | Last Updated 13 Apr 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid