如何使用 AviSynth 调整视频区域的大小

发布于 2024-09-08 15:47:45 字数 169 浏览 1 评论 0原文

我有一个视频文件,其中视频文件的部分已设置为错误的宽高比(“部分”是指视频的特定矩形区域,而不是特定的时间跨度)。是否可以使用 AviSynth 来调整视频的该区域的大小?

我熟悉 avisynth 的概念和一些非常基本的脚本,但不确定这样的事情是否可能。

谢谢, 亚历克斯

I have a video file in which part of the video file has been set to the wrong aspect ratio (by "part" I mean a particular rectangular area of the video, NOT a particular timespan). Is it possible to use AviSynth to resize just this area of the video?

I'm familiar with the concept of avisynth and some very basic scripting, but am unsure if something like this is possible.

Thanks,
Alex

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

单身狗的梦 2024-09-15 15:47:45

首先使用一些“裁剪”命令将其分成大小正确和大小不正确的片段。

然后使用“BicubicResize”(或者任何您想要的调整大小方法)来修复您感兴趣的部分的宽高比。

最后,使用“StackHorizo​​ntal”和“StackVertical”将您裁剪的部分

例如,如果原始来源是 100x100 像素,左上角的 50x50 像素实际上被压缩为 25x50 像素,你可以这样做:

A = AviSource("MyVideo.av")
TopLeft = A.Crop(0,0,24,49)  ## This is the region that should take up 50x50 pixels
TopRight = A.Crop(50,0,99,49)
Bottom = A.Crop(0,50,99,99)

TopLeft = TopLeft.BicubicResize(50,50) ## Resize to the correct size

Top = StackHorizontal(TopLeft, TopRight)
Final = StackVertical(Top, Bottom)

Final

First use a few "Crop" commands to break it into the pieces that are correctly sized and incorrectly sized.

Then use "BicubicResize" (Or really whatever resize method you want) to fix the aspect ratio of the piece you are interested in.

Finally, put the pieces you cropped apart using "StackHorizontal" and "StackVertical"

For example, if the original source is 100x100 pixels, and the top left 50x50 pixels is actually squished into 25x50 pixels, you could do:

A = AviSource("MyVideo.av")
TopLeft = A.Crop(0,0,24,49)  ## This is the region that should take up 50x50 pixels
TopRight = A.Crop(50,0,99,49)
Bottom = A.Crop(0,50,99,99)

TopLeft = TopLeft.BicubicResize(50,50) ## Resize to the correct size

Top = StackHorizontal(TopLeft, TopRight)
Final = StackVertical(Top, Bottom)

Final
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文