ffmpeg 可以刻录时间码吗? [英] Can ffmpeg burn in time code?

查看:24
本文介绍了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 配置为能够从中读取元数据.它使用 Video::FFmpeg 库读取持续时间并将字幕文件保存为 ${video}.srt.如果您在 ~/.mplayer/config 中插入以下几行,这将使它在 Mplayer 中自动呈现:

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天全站免登陆