ffmpeg可以烧时代码吗? [英] Can ffmpeg burn in time code?

查看:179
本文介绍了ffmpeg可以烧时代码吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有必要在视频中刻录时间代码,想知道这是否是ffmpeg能够实现的?

I have a need to burn in a time code to a video and am wondering if this is something that ffmpeg is capable of?

推荐答案

简答案,否。

但是没有使用单独的库来创建具有渲染时间码的帧,透明度填充了其余帧,然后使用FFmpeg在现有视频上叠加帧。在我的头顶,我不知道该怎么做,但我相信,如果你有创意,你可以弄清楚。

Long answer, yes, but not without using a separate library to create the frames with the rendered time code on them, with transparency filling the rest of the frame, then using FFmpeg to overlay the frames on the existing video. Off the top of my head I don't know how to do this, but I'm sure if you're creative you can figure it out.

编辑:我一直在处理这个问题,因为这是一个有趣的问题/项目。通过撰写一个Perl脚本,将会产生一个 .srt 文件,其中嵌入了时间码,为任何给定的视频文件,FFmpeg配置为能够读取元数据。它使用 视频:: FFmpeg 库读取持续时间并将副标题文件保存为 $ {video} .srt 。这将使它在Mplayer中自动呈现,如果在〜/ .mplayer / config 中插入以下行:

I've been working on this problem because it is an interesting question/project for me. I have come a little further in the solution by writing a Perl script that will generate a .srt file with the time code embedded in it for any given video file from which FFmpeg is configured to be able to read the metadata. It uses the Video::FFmpeg library to read the duration and saves a subtitle file as ${video}.srt. This will make it so it will render automatically in Mplayer if you insert the following lines in your ~/.mplayer/config:

# select subtitle files automatically in the current directory, all files
# matching the basename of the current playing file
sub-fuzziness=1

仍然致力于如何在一个视频上定位和叠加渲染的字幕,并以相同的格式进行重新编码。我会更新这篇文章。

Still working on how to position and overlay the rendered subtitles on a video and re-encode in the same format. I'll update this post as I know more.

这篇关于ffmpeg可以烧时代码吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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