mplayer mkv matroska slow playback audio/video desync

Everything about X, Gnome, KDE, ... and everything running on it

mplayer mkv matroska slow playback audio/video desync

Postby lotr » 2008-08-06 11:11

I'm using mplayer to play 1080 HD mkv h264 files and it's very slow. audio is fine, but video is laggy. 101% CPU USAGE
(I have no idea how it is even possible). Laptop is always gettting very hot at it.
what the heck is wrong with mplayer?
I got a Core 2 Duo laptop, 2 gig mem, dri is working fine.
lotr
 
Posts: 50
Joined: 2008-03-01 12:15

Postby BioTube » 2008-08-06 13:45

I don't know what's wrong, but 101% CPU usage seems to imply that the processor's had its clock bumped up by the system. Does VLC give the same problems?
Image
Ludwig von Mises wrote:The elite should be supreme by virtue of persuasion, not by the assistance of firing squads.
User avatar
BioTube
 
Posts: 7551
Joined: 2007-06-01 04:34

Postby lotr » 2008-08-06 14:07

yup,
kmplayer plays the file just a little bit faster and it's watchable, but cpu usage 96-100%
lotr
 
Posts: 50
Joined: 2008-03-01 12:15

Re: mplayer mkv matroska slow playback audio/video desync

Postby garrincha » 2008-08-06 15:11

lotr wrote:I'm using mplayer to play 1080 HD mkv h264 files and it's very slow. audio is fine, but video is laggy. 101% CPU USAGE
(I have no idea how it is even possible). Laptop is always gettting very hot at it.
what the heck is wrong with mplayer?
I got a Core 2 Duo laptop, 2 gig mem, dri is working fine.


I'll try to help, but heck I don't know much about using mplayer for playing HD video. Please post the output from mplayer, e.g.,
Code: Select all
~$ mplayer -v your_video.mkv
Maurice Green on Usain Bolt's 9.58: "The Earth stopped for a second, and he went to Mars."
User avatar
garrincha
 
Posts: 2341
Joined: 2006-06-02 16:38

Postby seanc » 2008-08-06 15:49

What I do on my system is set mplayer to drop frames. It doesn't drop many because it's not noticeable in the video quality. Especially since it actually plays the video well and it's in sync with the audio.
AMD Phenom Q9500 Quad-Core 2.2ghz / Asus M3A78-EMH HDMI / 4GB PC667 RAM / 320GB SATA II
Debian Squeeze AMD64 version
User avatar
seanc
 
Posts: 42
Joined: 2008-02-25 23:13
Location: Toronto, Canada

Postby garrincha » 2008-08-06 15:59

Usually when the PC is too slow you could set mplayer to drop frame as seanc mentioned, but your PC should be able to handle the video. Try this in any case e.g.,
Code: Select all
~$ mplayer -framedrop your_video.mkv

or try,
Code: Select all
~$ mplayer  -autosync 30 your_video.mkv

Check the detailed manual page:
Code: Select all
~$ man mplayer


Edit:
Btw, what video card are you using? Which video output (xv, xvmc/xxmc, opengl, etc) is used by mplayer?

As far as I understand, if the video is 1080i or 720p MPEG, graphic card like nvidia geforce mx 440 (like mine) or newer and xvmc output should play fine. If you only have xv, the CPU may be a bit slow for playback.

I think that for h264 video even for a Core 2duo, it is not sufficiently fast to decode a 1080i video. But I could be wrong though.
Maurice Green on Usain Bolt's 9.58: "The Earth stopped for a second, and he went to Mars."
User avatar
garrincha
 
Posts: 2341
Joined: 2006-06-02 16:38

Postby lotr » 2008-08-06 16:44

Intel Core 2 Duo T7100 / 1.8 GHz
Intel GMA X3100

I tried -vo xv x11 gl2
-ao alsa oss
mplayer options -framedrop skiploopfilter=all
and still getting desync and slow video

well, it seems that I need more powerfull laptop. or maybe it will be smooth on windows(I heard about lack of h264 support on Linux). but honestly I don't think so, and I don't have any machine runnig windows.
is there any RFC or any other documentation about requirments for 1080 HD playback

by the way playback of 720 HD is fine.
lotr
 
Posts: 50
Joined: 2008-03-01 12:15

Postby garrincha » 2008-08-06 17:32

lotr wrote:Intel Core 2 Duo T7100 / 1.8 GHz
Intel GMA X3100


I suspected that it was mostly a video card problem, as it's usually in 99.9% of case with problems like yours.

A quick google revealed that The GMA X3100 doesn't seems to have h264 acceleration and thus playback with 1080i video may be problematic.

http://en.wikipedia.org/wiki/Intel_GMA#GMA_X3100

No mention about GMA 3100 having good support for HD playback, but the newer version like GMA 4500HD etc does have it:
The difference between the GMA X4500 and the GMA X4500HD is that the GMA X4500HD is capable of "full 1080p high-definition video playback, including Blu-ray disc movies"[20], the GMA X4500 however does not have that capability.[21] The G43 and the G45 chipsets are manufactured with 65nm technology[22].

Like the X3500, X4500 supports DirectX 10 and Shader Model 4.0 features. Intel designed the GMA X4500 to be 200% faster than the GMA 3100 (G33 chipset) in 3DMark06 performance[23] and 70% faster than the GMA X3500 (G35 chipset).[24]
Maurice Green on Usain Bolt's 9.58: "The Earth stopped for a second, and he went to Mars."
User avatar
garrincha
 
Posts: 2341
Joined: 2006-06-02 16:38

Postby lotr » 2008-08-06 18:31

got it. cpu is 100percent loaded because of doing videocard's job. thanks everybody :D
lotr
 
Posts: 50
Joined: 2008-03-01 12:15

Postby vlad59 » 2008-08-07 03:53

Just to clarify, there is no current way to have h264 acceleration working with Linux (at least to my knowledge, I'd like to be wrong) with normal graphic card even if it works with Windows.
Pinky and the brain forever. Howtos about Lenny, XFCE, ...
vlad59
 
Posts: 93
Joined: 2008-08-04 06:38

Re: mplayer mkv matroska slow playback audio/video desync

Postby markotitel » 2010-04-17 16:02

Sorry from bringing this topic up from the grave, but is there solution for HD video today? In debain lenny I can wath HD movie but from time to time picture will freeze for a few seconds, I have nvidia geforce 6150se and installed drivers for it.

This card has support for HD video decoding, but in linux it just wont work. CPU is 100% all the time.
markotitel
 
Posts: 26
Joined: 2010-04-07 13:02

Re: mplayer mkv matroska slow playback audio/video desync

Postby stevepusser » 2010-04-18 06:56

If you have a desktop, an inexpensive newer Nvidia card that supports the vdpau output driver would be the way to go. (and have an mplayer build that was built against libvdpau-dev to support it) The vdpau driver is the only one currently in Linux that supports hardware h.264 and VC1 decoding...perhaps the new Intel gma500 on netbooks with the 2.11 Intel driver, too. If you have a multicore processor, you can get about 1.6 times the framerate by using mplayer-mt...I posted a couple of Lenny compatible builds of mplayer-mt here a month or two ago, if you can't find them, let me know. Mplayer-mt supports multiple threads for h.264, VC1, and mpeg2 playback, so can use more than one core to decode video, unlike the standard mplayer. It also helps a little bit for hyperthreaded CPUs like the Atom or P4.
stevepusser
 
Posts: 4371
Joined: 2009-10-06 05:53

Re: mplayer mkv matroska slow playback audio/video desync

Postby gradinaruvasile » 2010-04-18 11:17

VDPAU works with nvidia 8 series cards and upwards (some higher end cards with the GTX/GTS prefix support only basic VDPAU - se A and some like 8800 GTX doesnt support it at all).
Integrated IGPs like 8200/8300 and low end 8400/GF 210 cards do a very good job in playing HD movies. The GT 220+ series also support VDPAU fully (set C).
But quite interestingly the high end spectrum 8/9 series GT/GTX and 200+ GTX only supports A set - resulting in many non playable videos with VDPAU. Some cards like the 8800GTX doesnt even support VDPAu.
Its really amazing stuff, all 3 computers i use have cards that support VDPAU - 1080p movies play on the nvidia GT 210 i have at ~5-10% CPU usage - 720p at 1-2% (core2duo@2.33 GHz).
On 8200 integrated supporting set B (on Asus M3N78-VM mobo) and athlon 3200+ single core 1080p is ~15-25% smooth playback.
I use Debian Squeeze with the multimedia repository and the latest nvidia drivers from their site.

List of supported GPUs can be found here:

http://en.wikipedia.org/wiki/Nvidia_PureVideo

On other cards (including older nvidias) mplayer-mt seems to do the job just fine (if you have at least 2 cores with a reasonable CPU of course). I only tested it on higher end CPUs (core2Du0) - the difference is that there are very few (in some cases when there are sudden CPU spikes in some scenes) dropped frames and the audio stays in sync.

With the single threaded mplayer, there were quite a few dropped frames/audio desync (although the more recent codecs seem to have alleviated these problems).
Best is to use smplayer. But for testing mplayer/mplayer-mt from command-line is the best (mplayer -vo vdpau -vc ffh264vdpau moviename).

If you need a card for HD play (no games or hi-res compiz), currently the best bet is GF 210, preferably with passive cooling (no fan) - i have one with fan and the fan is a bit noisy. It does play lower end games (urban terror/smokin guns/team combat elite and the like) perfectly well. But for higher-end bames and VDPAU a 220/240+ card is preferable.
User avatar
gradinaruvasile
 
Posts: 713
Joined: 2010-01-31 22:03
Location: Cluj, Romania


Return to Desktop & Multimedia

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable