I am using this library to use FFmpeg with my Android application. I am extracting frames from a video and then adding them to a crop viewer. So each frame needs to represent some time frame within the video. Here is my current ffmpeg code to extract the frames:
ffmpeg -i inputFile -f image2 -ss mySS -r myR frame-%05d.png
When using the above command how would I add a timestamp to each frame? So i know for example frame 5 is at 9s within the video.
I dont know if the ffmpeg lib I am using has ffprobe from this link. I have also looked at other links on stackoverflow
any help is appreciated
frame_pts
option is your friend... set it to true and ffmpeg will output the frame's presentation timestamp as your filename.
ffmpeg -skip_frame nokey -i file -vsync 0 -frame_pts true out%d.png
Credits goes to this superuser answer.. more explanation of mixing framerate -r
option with frame_pts