ffmpeg-python
ffmpeg-python copied to clipboard
How to get frames & their timestamps - frame-pts option?
Hi everyone, I am experimenting with different ways to sample a fixed number of frames from a video. At the same time, I would also need to get the timestamps of the extracted frames so as to save them in a dataframe.
What's the best way to achieve this? Right now, the only way I found is to use the showinfo filter and parse the output string (as shown here).
According to ffmpeg docs a frame_pts option should also be available that would use timestamps in the saved frame filenames (which would not be ideal either, as I would still have to parse filenames to get them, but it's an alternative), but I don't seem to get it to work in ffmpeg-python. Can someone suggest the right syntax per this option?
In general, if you can suggest how to get selected frames and their timestamps in one pass that'd be really appreciated 🙏
Have you solved this problem yet? I'm interesting of the answer too!
Hi, I'm interesting of the answer to. Do you have any progress? Thanks
Right now, the only way I found is to use the
showinfofilter and parse the output string (as shown here).
I could not find any other way than this one.