Click here to Skip to main content
11,583,865 members (65,221 online)
Rate this: bad
good
Please Sign up or sign in to vote.
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:35pm
Anetics329
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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
0 OriginalGriff 430
1 Dave Kreskowiak 230
2 Richard Deeming 220
3 Sergey Alexandrovich Kryukov 220
4 virusstorm 203
0 OriginalGriff 1,523
1 Sergey Alexandrovich Kryukov 995
2 Abhinav S 696
3 Dave Kreskowiak 621
4 Suvendu Shekhar Giri 568


Advertise | Privacy | Mobile
Web03 | 2.8.150603.1 | Last Updated 13 Apr 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100