带时间戳的视频到带时间戳的图像 [英] Time stamped video to time stamped images

查看:153
本文介绍了带时间戳的视频到带时间戳的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带时间戳的AVI视频文件.

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.

我可以使用以下方法通过FFmpeg从视频创建图像:

I can create images from the video through FFmpeg using:

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

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?

我的最终目标是将时间戳记与GPS轨道同步以对图像(从视频帧中进行地理标记)

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

推荐答案

Stackoverflow与编程有关-这个问题更适合于超级用户.

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.

如果相反,您尝试生成相对于PTS的自己的屏幕上文本,请尝试:

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

x=0y=0处的值更改为希望文本出现的像素坐标.还要更改fontsize=之后的值以更改文本的大小.

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.

.....对上述ffmpeg命令中的任何尴尬格式表示抱歉.我自己还是很习惯.

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

这篇关于带时间戳的视频到带时间戳的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆