Sign in to follow this  
martinuk

multimedia on demand?

Recommended Posts

i know its not the relevant topic for "multiplayer networking", just think you guys may have similar experiences. Trying to create a client-sever based on demand system (linux platform) and it will be used in a local area network,So band width should not be a issue. I have two designs, which will be better? the simple one: create a share folder on server, which contains all the media files,i.e. sound track, movies. On each client, mount the server side share folder and then access all media files in that mounted folder. This is a simple solution but i don't how good is it in both performance and security when there are hundreds clients connected to the server and watch the same video file. the second one is bit complicated, create a Database, put all data file on server and write a script to feed different segments of the media file to the client who has asked for, and re-assembly the segments on client side to play video or sound. which one is better?

Share this post


Link to post
Share on other sites
These are separate questions, one is about storage, the other about content delivery.

Quote:
create a share folder on server
This can be done trivially using Apache (or similar) server capable of serving static content. If hosted on Linux, basic security is relatively trivial to set up. For larger number of users, different authentication might need to be used since Linux FS permissions get unwieldy.

Quote:
to feed different segments of the media file
This is unrelated to database, and can be implemented trivially using plain file system. To accomplish this you need a method of streaming the contents. For popular formats, dedicated servers and APIs exist. But they deal only with streaming, storage will likely still be your concern.

This also implies that client's browser is capable of handling streaming data - if content is served as regular files, then client can save them to disk and play them back using their own means.

Quote:
on demand system
There are other consideration. Total number of users, bandwidth throttling and QoS, potential use of multicasting.

Quote:
when there are hundreds clients connected to the server and watch the same video file.
This only matters if they are interested into watching same stream. So if someone connects late, they will be unable to watch from beginning.

Since multicast may not be supported, there are perhaps no benefits at all in attempting to do this. Another problem are bit rates. An MPEG-1 compliant stream has bitrate of 1.5 Mbit/s. This means that a 100Mbit network will only be able to serve 65 streams under ideal conditions. On gigabit networks, disk will become your bottleneck, which means that adequate hardware needs to be put in place, RAID might help.

For higher resolution streams you will hit these barriers much sooner. Just MPEG-2 allows up to 80 MBits/second (around 10 for DVD) . Bluray/HDTV standard bitrate is 40Mbps.

Share this post


Link to post
Share on other sites
For a "shared folder," if you use Samba, you'll probably have performance problems, because it doesn't stream very well. You'd have to have an asynchronous pre-fetching thread in each client that reads ahead by a large amount (several seconds) to make it glitch-free.

For content delivery, I second the recommendation for Apache. If you need something more advanced (which is unlikely), then you could look at the QuickTime streaming server or the Windows Media Server.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this