Log in

View Full Version : Play a video over a WLAN


Luxman
4th December 2007, 10:58
Hello everybody :)

I have made some attempts to watch a video file stored on my Desktop from a Laptop over a WLAN, but the video often freezes.
Some info: the network strength is very good (802.11g); I'm running Ubuntu 7.10 on my Desktop and Windows XP on the laptop; I opened the video file with VLC; the video and audio properties are the following:

VIDEO: [XVID] 640x272 12bpp 23.976 fps 1093.3 kbps (133.5 kbyte/s)
AUDIO: 48000 Hz, 2 ch, s16le, 448.0 kbit/29.17% (ratio: 56000->192000)

Question is: is there a way to speed up the video access process? Maybe streaming the video file from the Desktop? In this case what tool should I use?

:thanks: Have a nice day ;)

nm
5th December 2007, 11:37
Maybe the WLAN hardware or driver in either end is having problems transferring the data at a constant speed. Can you try the same thing on some other client computer, or using another computer as a server?

Using some other file transfer or streaming protocol could also help. When streaming, the client will know that buffering is useful, so that would probably work if the freezes are recoverable. However, setting up a special streaming server might be painful. I'd suggest trying a HTTP server first.

Luxman
5th December 2007, 12:32
Hello nm :)
Thanks for your hints! The WiFi AP is the one embedded in Philips SNV6520 Router. The WiFi adaptor integrated in the laptop is an Intel ipw2200bg. I got another laptop with the same pci wi-fi adaptor and the results are similar.

I read some docs regarding audio/video streaming via Vlc, although my first attempts have been unsuccessful, mainly because of a vlc segfault on the linux/server side. I'll see what I can do following this way.
Setting up an HTTP server kinda scares me... I am very new to that field :)

nm
5th December 2007, 13:11
I read some docs regarding audio/video streaming via Vlc, although my first attempts have been unsuccessful, mainly because of a vlc segfault on the linux/server side. I'll see what I can do following this way.
Setting up an HTTP server kinda scares me... I am very new to that field :)
Yes, you could use VLC for streaming, but it will only stream what you set it to stream. There is no client-side control, so selecting a file to play won't work without some serious scripting (or logging on to the server and starting VLC manually).

Have you tried simply copying the file across? Does that work without freezing?

Luxman
5th December 2007, 14:59
Yes, you could use VLC for streaming, but it will only stream what you set it to stream. There is no client-side control, so selecting a file to play won't work without some serious scripting (or logging on to the server and starting VLC manually).

You are right, the drawback is that I can't control what I want to play with vlc remotely. I guess that one way of overcome this issue would be using a ssh session and a shell script. Anyway for my actual needs the vlc built-in streaming option is fine.

Have you tried simply copying the file across? Does that work without freezing?

Well, that would definetely address the issue but it won't provide the flexibility I'm looking for...

Hellworm
5th December 2007, 23:24
I once used vlc to do what you did over 802.11b. You have to change the cache in vlc (somwhere in settings->input->access I believe) from the default 300ms to somthing like 10000ms or even higher. That'll work if your overall network bandwidth is enough (better test it by copying some file) and if the bitrate in the video is equally enough distributed.

Luxman
6th December 2007, 01:30
I once used vlc to do what you did over 802.11b. You have to change the cache in vlc (somwhere in settings->input->access I believe) from the default 300ms to somthing like 10000ms or even higher. That'll work if your overall network bandwidth is enough (better test it by copying some file) and if the bitrate in the video is equally enough distributed.

Hi :)

I noticed that cache setting and I was exactly looking for some guideline to set that value. I will make some empirical tests to see if I can get better performance out of it ;)
Vlc is really stunning: the more I know it the more I love it. I read in the documentation that among other features there is also a Video On Demand one :cool:

twolfe18
29th December 2007, 00:24
in my experience, setting the cache higher doesnt really work. it will allow more of the movie to be buffered at the beginning of the file, but eventually it will catch up and you will drop frames if your bandwidth isnt sufficient. i mean, if you are playing files that are really short (like less than a minute), setting the cache up to 10000ms might help, but you shouldnt rely on it for longer videos. 1500kb/s is on the upper end of what i have gotten to work on my netgear g router, so i would recommend lowering the bitrate if possible.

i would recommend that you first, compress your audio more. it is accounting for 33% of you entire stream, and IMHO 448kb/s for 2ch audio is overkill (unless you have a special interest in the audio being crazy good quality). you can knock that down to like 128kb/s mp3 (you can do this with vlc on the fly in streaming settings under audio) and see if it plays.

also, instead of VOD in vlc, try the http interface option (it is a lot easier to use). it allows you to open a browser on the client side and type in http://<server_ip>:8080 and get a little controller for what is being streamed. if you set up a long playlist of things to stream, it is a nice quick and easy way to get remote access without remote logins.

twolfe18
29th December 2007, 00:41
also, if you want to be sure something else isnt wrong, you can measure the average bandwidth of your wlan by copying a file between your machines and timing it. make sure you do the correct conversion between bytes and bits though. this will tell you AVERAGE bitrate, which is misleading in two ways. first, i am sure vlc has some overhead while streaming video that does not get counted in the video bitrate (and this overhead is probably more than the simple file copy). second, unless your video and audio are CBR, then there will be fluctuations in the bitrate that will from time to time exceed your real bandwidth, and that is when the video will stutter. play the file back locally (server side) and look in the information window (ctr-i i think) for the file you are playing and look for the highest the bitrate goes. if that bitrate is significantly lower than the average bitrate that you worked out from your file copy test, then you likely have another problem.

Luxman
29th December 2007, 01:39
i would recommend that you first, compress your audio more. it is accounting for 33% of you entire stream, and IMHO 448kb/s for 2ch audio is overkill (unless you have a special interest in the audio being crazy good quality). you can knock that down to like 128kb/s mp3 (you can do this with vlc on the fly in streaming settings under audio) and see if it plays.

This is an interesting tweak, thanks for pointing that out ;)

also, instead of VOD in vlc, try the http interface option (it is a lot easier to use). it allows you to open a browser on the client side and type in http://<server_ip>:8080 and get a little controller for what is being streamed. if you set up a long playlist of things to stream, it is a nice quick and easy way to get remote access without remote logins.

Yes, I knew about the web interface, very very useful :D

also, if you want to be sure something else isnt wrong, you can measure the average bandwidth of your wlan by copying a file between your machines and timing it.

Good point. I'll make a check :)

rernst
30th December 2007, 18:42
Have you looked at the Tvix hardware? It is supposed to stream easily the type of content mentioned. There are some issues with HD over Lan but XVid at these rates should be a snap.

The current routers have a very bad design as the amount of information streamed is just too much.

Another device that works is the limHD200i.

The concept of the routers is plain wrong.

NeonMan
4th January 2008, 21:35
I've done this quite a lot of times and the best results I've achieved are using a http server as is described here, I've tested with all of the httpd's listed here since I do this quite regularly

Router -> Cisco linksys WAG200G (wireless b/g supported)
System -> Debian Lenny/sid OR Ubuntu feisty (2 different machines :P)

Install cherokee webserver (don't be scared, it's foolproof) and create a folder on your home called public_html and copy/link your files there.

Using mplayer with the default settings on the client side gives good results for an average dvd-rip Xvid/divx + ac3 file.

mplayer <file-url>

your files on public_html are located at http://<server-IP>/~<user-name>/<file-name>

by default cherokee allows directory listings so you only have to copycat the link

without a http server, (I've not tested this one!) you can start an (s)ftp download, wait for about 10 secs and start playing the file with either VLC/mplayer. (it's like having a huge cahe before start playing the movie)

pd. cherokke httpd is a lightweight remake of Apache, btw any other httpd (ie lighttp, boa httpd ...) would do the job but this one is pretty fast and it isn't resource-hungry.