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

查看:102
本文介绍了使用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:复制输出.mp4 

您将需要更改的内容:

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