LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 04-19-2010, 10:48 AM   #1
posix_memalign
Member
 
Registered: Aug 2008
Posts: 81

Rep: Reputation: 15
MPlayer lags, unable to play properly


I have issues with using MPlayer, it lags and cannot properly play certain video files.

In particular files of this type "ISO Media, MPEG v4 system, version 1", with the extension "MKV", the files that are hard to play are around 2 GiB in size.

The system is a Core i7 at around 4.12 GHz, with 6 GiB RAM and a Nvidia GTX295 graphics card; the file is stored locally, not remotely on the network.

MPlayer even gives me the typical:

Code:
           ************************************************
           **** Your system is too SLOW to play this!  ****
           ************************************************
Any ideas?
 
Old 04-19-2010, 12:06 PM   #2
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
-lavdopts skiploopfilter=all

I've run into something similar. The odd part being that it says that even when the cpu meter isn't maxed. ffplay seems to hang with them. Which might imply that ffmpeg could convert them to something less quirky. Or maybe you just need to upgrade to the latest and greatest versions. ffplay is part of ffmpeg, but requires certain libsdl components to compile. It's one of the few that I've found that does multithreading okay for those formats that support it.

HTH
 
Old 04-19-2010, 12:06 PM   #3
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
What drivers are you using ? Let's assume you are using the latest proprietary drivers, because that would be the best.

What exactly lags ? audio or video ? both ?

What is the CPU usage at the time ?

What filesystem do you use ? These movies are on a regular HDD ? Is it new ? SATA/IDE ?

P.S.
I have a much weaker system than yours Core2 Quad Q9300 and GeForce 8800 GTS 512, and very large videos at 720p play just fine, with very little CPU usage and no lag, videos can be up to 6GB in size or more, and they run fine.

Also, "ISO Media, MPEG v4 system, version 1", with the extension "MKV" does not make sense. The former implies .mp4 container, while the latter implies .mkv. Can you run
Code:
ffmpeg -i movie.mkv
on the file and post output ? or just the mplayer output.

Also what is the mplayer version ? Try to get the newest version from svn or cvs, because only newer ones have vdpau.

Last edited by H_TeXMeX_H; 04-19-2010 at 12:18 PM.
 
Old 04-20-2010, 12:39 PM   #4
the dsc
Member
 
Registered: May 2009
Distribution: Debian
Posts: 175
Blog Entries: 243

Rep: Reputation: 47
For me the best drivers are usually xv and x11, as far as I can remember. I always set to skip frames (soft), just in case. But I guess I have never dealt with a file of this size.

I'm only making a wild guess, but I think a file of this size could have some extra trouble due to fragmentation, if smaller files play OK. Do you play it from the hdd, or from a DVD?
 
Old 04-21-2010, 08:39 AM   #5
posix_memalign
Member
 
Registered: Aug 2008
Posts: 81

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by H_TeXMeX_H View Post
What drivers are you using ? Let's assume you are using the latest proprietary drivers, because that would be the best.

What exactly lags ? audio or video ? both ?

What is the CPU usage at the time ?

What filesystem do you use ? These movies are on a regular HDD ? Is it new ? SATA/IDE ?

P.S.
I have a much weaker system than yours Core2 Quad Q9300 and GeForce 8800 GTS 512, and very large videos at 720p play just fine, with very little CPU usage and no lag, videos can be up to 6GB in size or more, and they run fine.

Also, "ISO Media, MPEG v4 system, version 1", with the extension "MKV" does not make sense. The former implies .mp4 container, while the latter implies .mkv. Can you run
Code:
ffmpeg -i movie.mkv
on the file and post output ? or just the mplayer output.

Also what is the mplayer version ? Try to get the newest version from svn or cvs, because only newer ones have vdpau.
I'm using the latest proprietary NVIDIA drivers, yes.

Only the video lags, not the audio.
Pause also takes several seconds to respond, which is highly unusual on my system; and once pause has been initiated the image will often remain in place and shake back and forth between two frames without ever completely stopping -- although sometimes it only remains like this for a few seconds before it completely freezes.

CPU usage is 100% on one core and 25% on another core, no other program at the time uses any noteworthy amount of CPU -- i.e. it would be ~0% on all cores if MPlayer had not been running.

ffmpeg output:
Code:
FFmpeg version 0.5, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: 
  libavutil     49.15. 0 / 49.15. 0
  libavcodec    52.20. 0 / 52.20. 0
  libavformat   52.31. 0 / 52.31. 0
  libavdevice   52. 1. 0 / 52. 1. 0
  built on Jul 12 2009 15:11:19, gcc: 4.2.4

Seems stream 0 codec frame rate differs from container frame rate: 119.88 (120000/1001) -> 59.94 (60000/1001)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'National.Geographic.Ultimate.Factories.Porsche.911GT3.720p.HDTV.x264.mkv':
  Duration: 00:45:45.00, start: 0.000000, bitrate: 6201 kb/s
    Stream #0.0(und): Video: h264, yuv420p, 1280x720, 59.94 tbr, 59.94 tbn, 119.88 tbc
    Stream #0.1(und): Audio: aac, 48000 Hz, stereo, s16
MPlayer version:
Code:
MPlayer dev-SVN-r28162-4.2.4
 
Old 04-21-2010, 12:19 PM   #6
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Well for sure it shouldn't be using that much CPU usage, and your mplayer version seems new enough, try running this from the command line:

Code:
mplayer -vo vdpau movie.mkv
or

Code:
mplayer -vo gl movie.mkv
Also take note that the file is NOT an mkv, an mkv says something like:

Code:
Seems stream 0 codec frame rate differs from container frame rate: 47.95 (20000000/417083) -> 23.98 (24000/1001)
Input #0, matroska, from 'Leon.mkv':
  Duration: 02:12:51.37, start: 0.000000, bitrate: N/A
    Stream #0.0(eng): Video: h264, yuv420p, 1280x544, PAR 1:1 DAR 40:17, 24.39 fps, 23.98 tbr, 1k tbn, 47.95 tbc
    Stream #0.1(eng): Audio: dca, 48000 Hz, 6 channels, s16
At least one output file must be specified
notice 'matroska'.

An mp4 will say:

Code:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'GreenLantern.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isom
  Duration: 01:17:37.02, start: 0.000000, bitrate: 2586 kb/s
    Stream #0.0(und): Video: h264, yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 2280 kb/s, 47.95 fps, 23.98 tbr, 66893 tbn, 47.95 tbc
    Stream #0.1(und): Audio: aac, 48000 Hz, 5.1, s16, 302 kb/s
At least one output file must be specified
Notice the mov,mp4,m4a,3gp,3g2,mj2.

Also, are you playing this from a HDD ? If so what filesystem ? If not, maybe you should copy it to disk.

Another thing, did you compile mplayer after installing nvidia drivers or before ? You should compile it after.
 
Old 04-21-2010, 07:20 PM   #7
posix_memalign
Member
 
Registered: Aug 2008
Posts: 81

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by H_TeXMeX_H View Post
Well for sure it shouldn't be using that much CPU usage, and your mplayer version seems new enough, try running this from the command line:

Code:
mplayer -vo vdpau movie.mkv
or

Code:
mplayer -vo gl movie.mkv
Also take note that the file is NOT an mkv, an mkv says something like:

Code:
Seems stream 0 codec frame rate differs from container frame rate: 47.95 (20000000/417083) -> 23.98 (24000/1001)
Input #0, matroska, from 'Leon.mkv':
  Duration: 02:12:51.37, start: 0.000000, bitrate: N/A
    Stream #0.0(eng): Video: h264, yuv420p, 1280x544, PAR 1:1 DAR 40:17, 24.39 fps, 23.98 tbr, 1k tbn, 47.95 tbc
    Stream #0.1(eng): Audio: dca, 48000 Hz, 6 channels, s16
At least one output file must be specified
notice 'matroska'.

An mp4 will say:

Code:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'GreenLantern.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isom
  Duration: 01:17:37.02, start: 0.000000, bitrate: 2586 kb/s
    Stream #0.0(und): Video: h264, yuv420p, 1280x720 [PAR 1:1 DAR 16:9], 2280 kb/s, 47.95 fps, 23.98 tbr, 66893 tbn, 47.95 tbc
    Stream #0.1(und): Audio: aac, 48000 Hz, 5.1, s16, 302 kb/s
At least one output file must be specified
Notice the mov,mp4,m4a,3gp,3g2,mj2.

Also, are you playing this from a HDD ? If so what filesystem ? If not, maybe you should copy it to disk.

Another thing, did you compile mplayer after installing nvidia drivers or before ? You should compile it after.
The GL output driver made it work, CPU usage is now around 25%, still a bit slow, but possible to watch without major issues -- I still get the "Your system is too slow" when I scroll back and forth intentionally attempting to provoke it to lag; although like I mentioned, perfectly watchable.

As an aside, I'm playing it from a HDD now but I've also tested a fast SSD; filesystem ext3.

I installed MPlayer after I installed the NVIDIA drivers; however I have changed the drivers a few times since then.
 
Old 04-22-2010, 09:27 AM   #8
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
So the vdpau one doesn't work then ? If it doesn't you could try compiling a newer mplayer version. Either way the 'gl' driver should run almost as good as 'vdpau', at least from my tests, so you can just use that.

I asked about filesystem and media it was on, because this can one of the performance choke-points. If you're going to store and play large video files I'd recommend XFS or JFS, so does mythtv. In your case however, it seems that the driver mplayer was using was the major issue. One other thing you can try is using a larger mplayer cache option:

Code:
mplayer -cache 8912 -cache-min 4 movie.mkv
http://everydaylht.com/howtos/multimedia/mplayer/

This is used to workaround slow media read rate.
 
Old 04-26-2010, 10:14 AM   #9
posix_memalign
Member
 
Registered: Aug 2008
Posts: 81

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by H_TeXMeX_H View Post
So the vdpau one doesn't work then ? If it doesn't you could try compiling a newer mplayer version. Either way the 'gl' driver should run almost as good as 'vdpau', at least from my tests, so you can just use that.

I asked about filesystem and media it was on, because this can one of the performance choke-points. If you're going to store and play large video files I'd recommend XFS or JFS, so does mythtv. In your case however, it seems that the driver mplayer was using was the major issue. One other thing you can try is using a larger mplayer cache option:

Code:
mplayer -cache 8912 -cache-min 4 movie.mkv
http://everydaylht.com/howtos/multimedia/mplayer/

This is used to workaround slow media read rate.
Thanks for the tip on using a larger cache.

The file system is EXT3 on a standard 7200 RPM HDD which gives me around 85 MiB/sec on unbuffered reading.

The issue is not the filesystem nor the HDD though, as when I use the GL output I can easily keep the file on a remote computer (yes, I tested this) and stream it over a slow 100 Mbit LAN, the performance is excellent -- not as good as when I play other files remotely though, there is some lag if I swiftly jump back and forth in the video file, but continuous playing does not lag.
 
Old 04-26-2010, 12:39 PM   #10
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Alright, then it's probably just the driver that it uses by default, so just use 'gl'.
 
Old 04-26-2010, 07:15 PM   #11
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874
I just installed Debian 5.0 and my lag issue went away. I've even compiled from sources mplayer and ffmpeg and the not a problem anymore persisted. Not sure how that helps you, but something you might consider is a newer install. Maybe there's too many files or other filesystem issues that's proving problematic to performance.

Beyond that I would try a few mplayer options. xv generally has the better performance when DRI is YES. Although it depends on if any scaling is being done. Sometimes x11 proves less problematic.

-vo xv

-cache 8192
-nocache (varies between content as to whether they improve or digress with cache)

-idx
-forceidx
-noidx (depends on what you're doing with the content. but generating an index on a 2GB file that's incomplete takes a while to create)

-lavdopts skiploopfilter=all

You might also check /etc/mplayer/mplayer.conf you might have options in there that you might not be expecting. # should disable them if you edit the file.

I suppose I should add that I'm using a distro supplied kernel, where I typically custom compile one. I couldn't get my custom kernel to boot. Even though I copied the .config directly from the previous running version. Tried for a bit and gave up in favor of a functioning system.

HTH

Last edited by Shadow_7; 04-26-2010 at 07:20 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to play AVI movie in MPlayer tron_thomas Linux - Software 10 12-31-2006 03:35 PM
unable to play certain mp3 using mplayer sirpelidor Linux - Software 2 10-25-2005 09:50 PM
Unable to play VCDs with Xine. Where can I get mplayer for Debian? vharishankar Debian 5 02-14-2005 12:09 PM
Mplayer unable to play 'wmv' format harsha_vardhan Linux - Software 1 02-02-2004 01:30 PM
Mplayer does not play dvd properly! tolis Linux - Software 3 12-15-2003 07:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration