How can I get the frame number closest to a given time (relative to the start of the video) using ffmpeg? The video has variable frame rate. I do not need any other metadata or the actual frame (image) itself. Speed is more important than precision (unless the possible error is more than a couple of seconds).
Example:
Input
- video.mp4 (assuming ideal constant 30 fps for simplicity)
- 00:00:05 (HH:MM:SS)
Output
- 150