You are not logged in.

#1 2014-03-29 12:22:37

genghizkhan91
Member
From: Kyoto, Japan
Registered: 2013-03-26
Posts: 32
Website

[Solved] mpv drops frames intermittently

I'm using openbox with compton as my compositor. My graphics card is an ATI 5450M and I use it with the open source driver. I seem to be having a very weird problem in which mpv (or mplayer, for that matter) skips frames while playing. It's not a whole lot of frames, usually something like ~4-8 frames in a minute. Sometimes it's more, sometimes it's less. The interval at which it happens is not particularly consistent either, but it happens for every video (HD or not doesn't make a difference). The video plays smoothly, and then all of a sudden, it drops 4 frames. It's very grating on the eyes when this happens.

It doesn't happen in vlc. I know that the easiest thing to do is to use vlc instead of mpv, but I like mpv a lot and would like to use it. It doesn't matter what output type I set. vdpau, opengl, opengl-hq all cause frame drops.

My compton conf is here (https://github.com/genghizkhan91/dotfil … omptonconf). Another point is to be noted that tinkering with the compton conf didn't change much. This conf led to the smallest number of frames being droppped.

Any ideas?

Last edited by genghizkhan91 (2014-03-30 23:58:22)


Dotfiles | Blog
ArchLinux 64 - Dell Studio 1458, Intel Nehalem i5 460M 2.54 GHz, 4GB RAM, ATI Radeon 5450

Offline

#2 2014-03-29 14:49:28

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: [Solved] mpv drops frames intermittently

As with games, Con Kolivas' scheduler is smoother.

Run mpv using nice and ionice - see info in my sig.

Offline

#3 2014-03-29 14:50:20

genghizkhan91
Member
From: Kyoto, Japan
Registered: 2013-03-26
Posts: 32
Website

Re: [Solved] mpv drops frames intermittently

Are you sure it's a scheduler problem? I don't have any problems with vlc.

Edit: Nope, your post doesn't seem to help. And it does seem weird. How could this possibly be related to scheduler inefficiencies?

Last edited by genghizkhan91 (2014-03-29 19:15:17)


Dotfiles | Blog
ArchLinux 64 - Dell Studio 1458, Intel Nehalem i5 460M 2.54 GHz, 4GB RAM, ATI Radeon 5450

Offline

#4 2014-03-29 20:54:45

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [Solved] mpv drops frames intermittently

brebs wrote:

As with games, Con Kolivas' scheduler is smoother.

Run mpv using nice and ionice - see info in my sig.

I saw you've recently edited your post from 2011. Wouldn't it be better to make it into a user page in Arch wiki?
Are we still using /etc/sysctl.conf for these settings? https://www.archlinux.org/news/deprecat … ysctlconf/

Offline

#5 2014-03-29 20:57:54

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: [Solved] mpv drops frames intermittently

Does the frame dropping occur at the same place in the video each time you observe it or is it more or less random?  No idea about your specific hardware (Intel based video stuff here).

Offline

#6 2014-03-29 22:14:29

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: [Solved] mpv drops frames intermittently

genghizkhan91 wrote:

How could this possibly be related to scheduler inefficiencies?

Because the kernel's default scheduler (CFS) is slightly better for throughput, but noticeably worse for responsiveness. Yes, noticeably, as in I can see it with my own eyes, in a game which is trying to render 60fps, i.e. 1 frame every 16 milliseconds.

Come on, do a bit of research, before dismissing this. I'm not saying it's definitely the issue, but it's certainly a potential.

Offline

#7 2014-03-30 06:50:44

Next7
Member
Registered: 2011-12-07
Posts: 44

Re: [Solved] mpv drops frames intermittently

I've encountered the same issue with mpv when using hw-decoding via vdpau of mp4/h264 files on Nvidia card. I switched back to Mplayer - no problems now.

Offline

#8 2014-03-30 08:07:54

genghizkhan91
Member
From: Kyoto, Japan
Registered: 2013-03-26
Posts: 32
Website

Re: [Solved] mpv drops frames intermittently

@brebs - Sorry, I didn't mean to be confrontational there. smile I asked someone who is well versed with schedulers (works on sched_deadline) and I was told that if the scheduler were the case, then vlc would probably be having the same problems. Also, installing the linux-ck-nehalem package from graysky's repo did not help me at all. I tried your solution before dismissing it.

@graysky - It's more or less random. However, another thing I noticed was that if I play a video for the first time, then mpv drops frames. Playing it a second time, though, caused it to play smoothly.

@Next7 - I have the same problems with mplayer as well. I've tried installing the git version of mpv, and I still get the same problems.


Dotfiles | Blog
ArchLinux 64 - Dell Studio 1458, Intel Nehalem i5 460M 2.54 GHz, 4GB RAM, ATI Radeon 5450

Offline

#9 2014-03-30 11:34:49

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,481

Re: [Solved] mpv drops frames intermittently

* Do you already tried to disable compton?

* Maybe your screen refresh rate is close to the video one? (24hz - 24p content?)

* Did you tried to increase the video player cache to (say) 4MB?

* Any info in the mpv console output when the frames are being dropped?

* Does mpv uses frameskip by default (in mplayer the -frameskip option is... optional)? maybe you can invert that...

Last edited by kokoko3k (2014-03-30 11:38:43)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#10 2014-03-30 11:46:06

genghizkhan91
Member
From: Kyoto, Japan
Registered: 2013-03-26
Posts: 32
Website

Re: [Solved] mpv drops frames intermittently

kokoko3k wrote:

* Do you already tried to disable compton?

* Maybe your screen refresh rate is close to the video one? (24hz - 24p content?)

* Did you tried to increase the video player cache to (say) 4MB?

* Any info in the mpv console output when the frames are being dropped?

* Does mpv uses frameskip by default (in mplayer the -frameskip option is... optional)? maybe you can invert that...

Tackling your points one by one smile

  • I've tried disabling compton, but it gives me slightly more frame drops as a result.

  • My screen refresh rate is 60 Hz.

  • I've increased the cache to 4 MB, and it doesn't seem to help either

  • An example of the console output whenever I play something (Notice the "Late" in the second last line):

    Playing: 'Nadia' - Shankar Tucker ft. Jaunita John.mp4
    Detected file format: QuickTime / MOV (libavformat)
    Clip info:
     major_brand: mp42
     minor_version: 0
     compatible_brands: isommp42
     creation_time: 2013-09-17 15:16:24
    [stream] Video (+) --vid=1 (*) (h264)
    [stream] Audio (+) --aid=1 --alang=und (*) (aac)
    Selected video codec: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 [lavc:h264]
    Selected audio codec: AAC (Advanced Audio Coding) [lavc:aac]
    AO: [alsa] 48000Hz stereo 2ch floatp
    VO: [vdpau] 1280x720 => 1280x720 420p
    [vo/vdpau] Compositing window manager detected. Assuming timing info is inaccurate.
    AV: 00:00:10 / 00:03:30 (4%) A-V:  0.000 Late: 3
    
    
    Exiting... (Quit)
  • I've tried disabling frameskip, but to no avail

Last edited by genghizkhan91 (2014-03-30 11:47:09)


Dotfiles | Blog
ArchLinux 64 - Dell Studio 1458, Intel Nehalem i5 460M 2.54 GHz, 4GB RAM, ATI Radeon 5450

Offline

#11 2014-03-30 14:24:02

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: [Solved] mpv drops frames intermittently

Some useful tidbits in my ~/.mpv/config:

# vdpau only works on 50% of files, then falls back to tearing. Simpler to set all to opengl-hq
vo=opengl-hq

# For non-jerky DVD playback
cache=16384
cache-min=8

Offline

#12 2014-03-30 18:49:14

Next7
Member
Registered: 2011-12-07
Posts: 44

Re: [Solved] mpv drops frames intermittently

Another tip to try is to set the following option in config file:

really-quiet=yes

Offline

#13 2014-03-30 23:57:44

genghizkhan91
Member
From: Kyoto, Japan
Registered: 2013-03-26
Posts: 32
Website

Re: [Solved] mpv drops frames intermittently

@Brebs - I love you, man. That worked pretty well. I'll keep testing it on a few different videos for a while, but I think that was the catch. On another note, are your dotfiles available publicly? I'd love to have a look if possible.

@Next7 - Thanks a lot for your help. I really appreciate it. I think I should have forced the cache the way brebs does instead of just specifying a default size for your previous suggestion. Making me feel like a bit of a fool now. smile

Thank you, everyone, for your comments and help. I'm marking the issue as solved.

Last edited by genghizkhan91 (2014-03-31 09:34:01)


Dotfiles | Blog
ArchLinux 64 - Dell Studio 1458, Intel Nehalem i5 460M 2.54 GHz, 4GB RAM, ATI Radeon 5450

Offline

#14 2014-03-31 09:15:27

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,481

Re: [Solved] mpv drops frames intermittently

I'm a bit confused:

genghizkhan91 wrote:

I've increased the cache to 4 MB, and it doesn't seem to help either

...

genghizkhan91 wrote:

but I think that was the cach.

Given the fact you said that it doesn't matter if the video is HD or not, i refuse to think that increasing the cache from 4MB to 16MB could give any advantage.
So, was it the -cache-min?
mplayer defaults to 25% so giving it 8 (assuming mpv does the same), you're actually reducing it (?)

Last edited by kokoko3k (2014-03-31 09:19:11)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#15 2014-03-31 09:39:18

genghizkhan91
Member
From: Kyoto, Japan
Registered: 2013-03-26
Posts: 32
Website

Re: [Solved] mpv drops frames intermittently

kokoko3k wrote:

Given the fact you said that it doesn't matter if the video is HD or not, i refuse to think that increasing the cache from 4MB to 16MB could give any advantage.
So, was it the -cache-min?
mplayer defaults to 25% so giving it 8 (assuming mpv does the same), you're actually reducing it (?)

No, no. I was setting a default cache size, not knowing that I had to force it. I set "cache-default", thinking that it was all that was needed. I didn't realize that I would need to force the cache using the "cache" option. You're right, it makes no difference, actually, but I didn't realize that mpv does not use the cache by default on local files.


Dotfiles | Blog
ArchLinux 64 - Dell Studio 1458, Intel Nehalem i5 460M 2.54 GHz, 4GB RAM, ATI Radeon 5450

Offline

Board footer

Powered by FluxBB