qctools icon indicating copy to clipboard operation
qctools copied to clipboard

Rewind not working as expected

Open pjotrek-b opened this issue 8 years ago • 5 comments

  1. When playing a lossy-encoded H.264 video backwards (-0.5x, -1x, -2x), only the keyframes are displayed.
  2. When stepping back and forth frame by frame, the displayed video image stays frozen until the next previous keyframe is encountered.

The expected behavior would be to see each frame, rendered as it would look like in forward playback. I know that playing digital lossy files in reverse is "special"...

pjotrek-b avatar Apr 24 '16 21:04 pjotrek-b

I suspect that the player upgrade to mpv will address this. cc @richardpl Initial work: https://github.com/richardpl/qctools/tree/mpv

dericed avatar May 12 '16 02:05 dericed

Well mpv doesn't ave -0.5x, -1x, -2x backward it only have single frame backward, which is slow in most cases as it needs to decode packets again.

richardpl avatar May 12 '16 13:05 richardpl

@richardpl Dropping backwards playback may be fine to get the other benefits of mpv (audio playback, accurate playback fps, etc).

dericed avatar May 12 '16 13:05 dericed

Usually GOP is 12-15 frames so less of 0.5 seconds of playback (so of decoding), waiting a bit for single frame backward may be acceptable (better than not having the feature). We could maybe add some frame buffering later (i.e. mpv decodes all other frames, we buffer some of them in order to decode again only every few frames backward instead of every single frame backward)

JeromeMartinez avatar May 12 '16 13:05 JeromeMartinez

In git-master I used a lossy file with large gop size with ffmpeg -f lavfi -i testsrc2 -c:v libx264 -g 300 -t 300 -c:v libx264 -pix_fmt yuv420p -s 1080x720 test3.mkv. When I playback at -1 speed, it is sluggish for reason that Jerome notes, but it does work as Peter expected in the original post. @pjotrek-b please review.

dericed avatar Apr 12 '17 21:04 dericed