mpv icon indicating copy to clipboard operation
mpv copied to clipboard

mpv often skips the last frame in loops.

Open crocket opened this issue 6 years ago • 7 comments

mpv version and platform

Gentoo Linux

> mpv --version
mpv ba370e9 Copyright © 2000-2019 mpv/MPlayer/mplayer2 projects
 built on Sun Nov 17 10:06:50 KST 2019
ffmpeg library versions:
   libavutil       56.22.100
   libavcodec      58.35.100
   libavformat     58.20.100
   libswscale      5.3.100
   libavfilter     7.40.101
   libswresample   3.3.100
ffmpeg version: 4.1.3

Reproduction steps

Loop the webm file from Sample files in mpv.

Expected behavior

The last frame should be displayed for a frame duration. If you loop it in a web browser, the last frame can be seen for a frame duration.

Actual behavior

mpv flashes the last frame or skips it entirely instead of showing it for a frame duration.

Log file

log.txt

Sample files

https://0x0.st/z6ji.webm

crocket avatar Nov 17 '19 07:11 crocket

I think there has been a related commit very recently, could you try with git master?

Hrxn avatar Nov 17 '19 09:11 Hrxn

The related commit fixed my previous issue about skipping the first frame.

crocket avatar Nov 17 '19 10:11 crocket

I tested the latest commit anyway, and the issue still remains.

crocket avatar Nov 17 '19 11:11 crocket

I think this was last explicitly changed to work this way in commit 657dd4b8072934e26b1df1f37daa829fe6b36ede.

ghost avatar Nov 17 '19 12:11 ghost

This basically makes low-framerate loops unwatchable in mpv. Is there no way to fix it without breaking other things?

viliml avatar Jun 08 '23 16:06 viliml

I noticed this as well in a looping video with low framerate, the last frame has a much shorter duration than all the other frames, would be nice if this issue could be fixed.

Drake53 avatar Jun 05 '24 20:06 Drake53

I recall looking at this exact issue few months ago. The root cause for this, is that we send last frame for presentation and at this point playback is considered over. We have a function to check frame timing, but the problem was once everything EOFs there is nothing to wake-up the core and vo to actually end playback after the last frame is displayed fully. IIRC there was not good way to handle it in fact, except busy looping on last frame. I didn't get back on the topic, maybe one day.

kasper93 avatar Jun 05 '24 20:06 kasper93