10

When using mpv to step through frames (. for stepping forward and , for stepping backward), the forward stepping rate is much faster than the backward stepping rate. The forward rate is about the same as the video frame rate (60fps for the video in question, which is an mp4 file prepared from a set of png images using ffmpeg with libx264 encoding) whereas the reverse stepping rate is about 1fps. Is there any way to control the stepping rates? Why would the forward/backward rates be so asymmetric? If an alternative video player is available for linux systems that supports variable (or at least equally fast) video frame stepping, please advise (mplayer is not better than mpv in this regard).

user001
  • 3,598
  • 5
  • 39
  • 54

2 Answers2

6

That seems to be a codec problem. From https://github.com/mpv-player/mpv/issues/4019:

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.

According to that bug-report choosing the mjpeg codec should be faster, but I cannot confirm this.

student
  • 17,875
  • 31
  • 103
  • 169
  • That's true about mjpeg, but if you have the luxury of choice there are better intra-only codecs if you want fast frame stepping. This is the reason why codecs like ProRes exist, but if you want something more free and open, h.264 can be made to be intra-only by setting it as an encoding setting or using an intra profile, making it more suitable as an intermediate format for editing. Won't be efficient for distribution though - gaining efficiency means losing fast framestepping. – trr Nov 05 '21 at 04:12
  • Thanks. Maybe you could convert this comment to another answer. If you want, it would be great if you could include an example of how to convert a video using ffmpeg to h.264 with intra-only setting. – student Nov 08 '21 at 20:56
-3

I used to use the software named MP4 Compressor to control the Frame Rate of my gaming video. 60fps 30 to or 30fps to 60, you can try it out to see whether you can boost backward frame rate.