Skip to content

Why FFMPEGFrameGrabber doesn't correctly process the previous frame on some videos? #1849

@DeNRuDi

Description

@DeNRuDi

Hello! Sorry for my bad English, i am from Ukraine🙂
I am facing a problem on android when i want to get the previous frame. On some videos, the previous frame is set correctly, but on some it happens that instead of rewinding 1 frame, the grabber rewinds ~ 10-30 frames (most often equal to the number of fps). This only happens when rewinding of back, when I get the next frame - I always get the correct frame. My guess is that this problem is due to the closest frame capture (like as in MediaMetadataRetriever OPTION_CLOSEST_SYNC). Here is the most simplified code that can cause this problem:

grabber.getFrameNumber(); // for example, 300
grabber.setFrameNumber(grabber.getFrameNumber() - 1);
grabber.grabImage(); // 270, although 299 is expected

How can it be solved? Maybe I missed something in the documentation? Noticed this on mp4 video format.
Thank you.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions