使用 FFMPEG 显示视频内视觉进度条? [英] Showing in-video visual progress bar with FFMPEG?
问题描述
由于 OBS Studio 缺乏视觉指示器来显示视频的进度(以及何时需要前进到下一个场景),我想知道是否有命令行选项(或解决方案)可以让 FFMPEG重新编码视频并在视频底部显示一个进度条,显示到目前为止视频已经播放了多长时间.
有这样的功能吗?
这是一个简单的 3 秒示例,使用动画
ffmpeg -i input.mp4 -filter_complex "color=c=red:s=1280x10[bar];[0][bar]overlay=-w+(w/10)*t:Hh:shortest=1"-c:a 复制 output.mp4
你必须改变的:
在颜色过滤器中,我以
1280
为例来匹配input.mp4
的宽度.您可以使用ffprobe
来获取宽度 或 scale2ref 过滤器调整大小以匹配input.mp4
.在覆盖过滤器中,我使用
10
作为input.mp4
的总持续时间(以秒为单位)的示例.您可以使用ffprobe
获取持续时间.
As OBS Studio lacks a visual indicator to show how far a video has progressed (and when you need to advance to the next scene), I was wondering if there is a command-line option (or solution) to get FFMPEG to re-encode the video and show a progress bar at the bottom of the video that shows how long the video has been playing so far.
Is there such a feature?
Here's a simple 3 second example using an animated overlay:
ffmpeg -i input.mp4 -filter_complex "color=c=red:s=1280x10[bar];[0][bar]overlay=-w+(w/10)*t:H-h:shortest=1" -c:a copy output.mp4
What you will have to change:
In the color filter I used
1280
as an example to match the width ofinput.mp4
. You can useffprobe
to get the width or the scale2ref filter to resize to matchinput.mp4
.In the overlay filter I used
10
as an example for the total duration in seconds ofinput.mp4
. You can useffprobe
to get the duration.
这篇关于使用 FFMPEG 显示视频内视觉进度条?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!