Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The program mplayer lags when playing high quality media over the network. This is not an issue when playing locally, but it becomes an issue when playing large (>= 1 GiB) Matroska video files over the network.
By "lag" I mean that the animation freezes at a fixed frequency, every five second or so the animation will halt for a fraction of a second, which is very annoying.
The network is a 100 Mbit switched ethernet network, I typically get around 10 MiB per second in actual flow rate and there is no noteworthy traffic on the network that degrades the performance. The lag is there regardless of traffic.
If I have a file at 1.4 GiB which is 60 minutes long, shouldn't that equal < 0.4 MiB/sec in required flow rate? I.e. I should be able to play this file over a 10 Mbit network. Yet, even on a 100 Mbit network this doesn't work.
The computer I use to play this media is a 4.12 GHz Core i7 with 6 GiB RAM and a GTX480 graphics card.
I have the latest graphics drivers.
I use Slackware 13.1.0.
I use a custom, small and highly optimized kernel (although the same issue is there with the standard kernel).
My version of mplayer is MPlayer SVN-r31498-snapshot-4.4.4.
The network protocol used is SMB, i.e. I play from a mounted SMB resource.
I have tried to host the file on different computers, both are dedicated file servers, one is a Pentium 4 3.0 GHz with 2 GiB RAM with no load other than hosting files, the other being almost equivalent except with a 2.8 GHz CPU.
Watching the system load on the machines yield nothing of interest, sending a mere ~0.5 MiB per second is nothing for a computer like that, even though a P4 is not exactly new anymore.
What is interesting though is that if I use the "-vo gl" argument to mplayer, the performance is greatly improved, there is very rarely any lag.
Now correct me if I'm wrong, but why on earth would the video output driver chosen affect the performance on a machine that has a 4.12 GHz Core i7 CPU, plenty of RAM, a very fast graphics card, and nothing else to do? I.e. no load at all?
When I use the standard output driver, there is almost no load at all on the system. So what the heck is this?
Well, first thing I would try is the '-cache' option for mplayer.
Also, any errors or warning from mplayer while playing the file ? (on the CLI)
Are you getting this 10 MB/sec while playing the movie or when loading other files ?
No, I don't get any errors or warnings from the console when playing media.
Caching is another approach that solves the problem, but my question is not how to solve this, but why it needs to be solved in the first place.
I.e. why do I need to increase the cache size when the network doesn't use more than 1/20 of its bandwidth? Please also keep in mind that the latency is between 100 and 200 microseconds to this server as there are no additional hops to reach it.
And at least equally strange: Why does it matter what output driver I use?
10 MiB/sec is the flow rate I get when I do something that requests maximum performance, such as copy a file. This is also over SMB, and from the same server which I play media from.
I think it is a buffering / cache issue. The movie is not stored anywhere when you are reading it, watch the transfer rate while playing the movie. I'm betting it is not being read at 10 MB/s, but rather it is read as needed, but mplayer miscalculates and there is a buffer underrun, and so the movie stutters or freezes from time to time. Telling mplayer to use a bigger cache is one solution. Another is to use an intermediate buffer program and pipe this to mplayer.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.