bavc / qctools

QCTools (Quality Control Tools for Video Preservation) is a free and open source software tool that helps users analyze and understand their digitized video files through use of audiovisual analytics and filtering. QCTools is funded by the National Endowment for the Humanities and the Knight Foundation, and is developed by the Bay Area Video Coalition.
http://www.bavc.org/qctools
Other
319 stars 41 forks source link

Rewind not working as expected #153

Open pjotrek-b opened 8 years ago

pjotrek-b commented 8 years ago
  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"...

dericed commented 8 years ago

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

richardpl commented 8 years ago

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.

dericed commented 8 years ago

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

JeromeMartinez commented 8 years ago

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)

dericed commented 7 years ago

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.