如何在视频中添加黑色边框

编程入门 行业动态 更新时间:2024-10-19 06:16:46
本文介绍了如何在视频中添加黑色边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

因此,我使用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.

更多推荐

如何在视频中添加黑色边框

本文发布于:2023-11-12 04:01:26,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1580463.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:边框   黑色   如何在   视频

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!