使用 FFMPEG 显示视频内视觉进度条? [英] Showing in-video visual progress bar with FFMPEG?

查看:26
本文介绍了使用 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 of input.mp4. You can use ffprobe to get the width or the scale2ref filter to resize to match input.mp4.

  • In the overlay filter I used 10 as an example for the total duration in seconds of input.mp4. You can use ffprobe to get the duration.

这篇关于使用 FFMPEG 显示视频内视觉进度条?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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