Time stamped video to time stamped images

旧巷老猫 提交于 2019-12-31 07:31:36

问题


I have a time stamped AVI video file.

I want to create images from the frames of the video but I need them to also have a time associated with them as well.

I can create images from the video through FFmpeg using:

ffmpeg -i video.avi -r 0.1 image_%05.jpeg

However this images do not have a time embedded. Is it possible to also take the time associated with each frame in the video?

My end goal is to sync the time stamp with a GPS track to geotag the images (from the video frames.)


回答1:


Stackoverflow is related to programming - this question is more suited to superuser.

To answer you question though, if you are trying to include a timestamp overlay that is present in the original video files, then you can call that stream and maintain the overlay on your output files.

If instead you are trying to generate your own onscreen text relative to the PTS, try:

ffmpeg -i video.avi -vf "drawtext=fontfile='c\:\\windows\\fonts\\arialbd.ttf':'%{pts\:hms}':x=0:y=0:fontcolor=white:fontsize=10:box=1:boxcolor=black" /
-f image2 image_%05d.bmp

Chang the values at x=0 and y=0 to the pixel coordinates where you want the text to being. Also cahnge the value after fontsize= to change the size of the text.

.... sorry for any awkward formating in the ffmpeg command above. I'm still getting used to this myself.



来源:https://stackoverflow.com/questions/30227019/time-stamped-video-to-time-stamped-images

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!