如何在视频中添加黑色边框 [英] How to add black borders to video

查看:207
本文介绍了如何在视频中添加黑色边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我使用ffmpeg将视频转换为1920 * 1080像素,我发现了两种方法,第一种是将视频拉伸至1920 * 1080,但是看起来有点拉伸。我为此使用了以下命令:

So I'm using ffmpeg to convert a video to 1920*1080 px, I found two ways to do so, the first one would be to stretch the video to 1920*1080, but then it looks kinda stretched. I used this command for this:

./ffmpeg_darwin -i SRC -vf scale=1920:1080,setdar=16:9 DEST

另一个选项与没有setdar的选项相同,但这只是将分辨率调整为从(1728 * 1080)。

The other option is the same without setdar but this just adapts the resolution to the one it started from (1728*1080).

我想用黑色边框填充宽度的192个像素。有某种选择吗?还是有另一个命令行可以实现这一目标?

I would like to fill the 192 pixels of the width with a black border. Is there some kind of option to do so? Or is there maybe another command line that could achieve this?

感谢您的帮助:)

推荐答案

使用

-vf "scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2,setsar=1"

缩放比例将确保其输出适合1920x1080。然后,便笺簿将其填满。

The scale will ensure that its output fits within 1920x1080. The pad then fills that out.

这篇关于如何在视频中添加黑色边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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