1

I am looking for a way to take accurate screenshots from a video. Accurate to the milliseconds. I have tried using ffmpeg using the following command:

ffmepg.exe -ss position-in-hours-minutes-milliseconds -i videoPath -y -f image2 \ -vcodec mjpeg -vframes 1 screenshot-path

but the result is not accurate. It does not respect the milliseconds. I need a means of taking a screenshot from a video respecting milliseconds.

Thanks.

1
  • Videos don't use milliseconds, they use frames.
    – Tetsujin
    Commented Jul 9, 2023 at 18:08

2 Answers 2

1

I suspect the previous response is misunderstanding your comment regarding millisecond accuracy. If you want an accurate method of extracting the currently displayed frame, Avidemux can be installed as a portable version and is straight forward to use. Just navigate to your desired frame, then File/Save As Image.

If you want to use ffmpeg, the code below should suffice.

ffmpeg -i input.mp4 -ss 00:00:00.000 -update 1 -frames:v 1 out.bmp

You can change the output to most common image formats.

2
  • Thank you, but same issue. Not milliseconds accurate.
    – jamana
    Commented Jul 11, 2023 at 19:17
  • Just to clarify. Is the problem that ffmpeg selects the nearest pts frame. So, if each frame is 40ms in duration (25fps), a 30ms time setting will select frame two, not frame one. You want all time settings from 0ms to 39ms to select frame one ?
    – Sark
    Commented Jul 12, 2023 at 10:04
0

Though it's like using a cannon (not Canon) to shoot a flea, both Shotcut and OpenShot show time wih a resolution of 1/100 second, i.e., ten milliseconds, which is not quite what you ask for... but one could interpolate by noting the points where the lowest decimal place ticks over, and stretch the timeline so that one could measure along it in ms.

Caveat: This is only of use in a video with sufficient information. One recorded at any speed less than 100 frames per second does not have any changes on the ms level, and if a video format using temporal compression is used, only the difference between frames is recorded, making it very difficult, if not impossible, to extract information at the level of a single "frame", i.e., delta between full frames.

If you have a true high speed camera with a stand-alone video recorder not using compression, then you can see whole frames in less than ms resolution... and likely have the specialized software to do so.

1
  • Thank you, but I am looking for automation that is why I asked for a command line tool. Regards.
    – jamana
    Commented Jul 11, 2023 at 19:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .