mpv step forward is fast but step back is slow

Created on 11 Jan 2017  路  7Comments  路  Source: mpv-player/mpv

in mpv keyboard shortcuts:

.      Step forward. Pressing once will pause, every consecutive press will play one frame and then go into pause mode again.
,        Step backward. Pressing once will pause, every consecutive press will play one frame in reverse and then go into pause mode again.

Step forward is faster but step backward is slow. Because i am using some lua scripts to trim video.

how to make both work easily.

If i re encode the video to mjpeg format then it its vert smooth

wontfix

Most helpful comment

mpv could probably bother to cache some frames, but in general this can't be fixed.

All 7 comments

That鈥檚 because MJPEG is an intra-only codec. Most common video codecs (H.264 etc.) can only be decoded efficiently in forward direction. Without keeping all frames since the last keyframe in memory (which is an indefinite number), you cannot framestep backward smoothly.

mpv could probably bother to cache some frames, but in general this can't be fixed.

Playing back prores (all I-frame) shows the same behaviour.

Because it doesn't special-case it. It will still seek somewhat before the frame, and then decode/skip all frames until the target. If behavior of other demuxers/codecs weren't potentially so broken, this could actually be made pretty fast.

Djvview has the option of caching decoded frames in memory, is this possible with mpv? Maybe with a user specifiable RAM cache, like djvview? I use mpv for previewing renders and so on, the ability to smoothly play backwards would be really useful.

http://djv.sourceforge.net/

In theory yes. But there are other issues like demuxer state, audio playback, and filtering, which make this more complicated. I don't really have time to work on such things.

Anyone who needs this can also just try very small precise seeks. These don't guarantee as much that the frame steps back correctly, but it should still work pretty well.

Something like:

<key> seek -0.05 exact

in input.conf. The seek distance should be larger than a frame duration, but smaller than two.

Was this page helpful?
0 / 5 - 0 ratings