关于过滤器的ffmpeg文档在drawtext的剪切矩形上没有任何内容。 我希望在视频过滤器之前可以设置一个设置来设置剪辑矩形,未记录的功能或巧妙的解决方法,以便您只能在输出视频的某个边界框内绘制文本。
我试图通过滴答作响的时钟视频覆盖电影标题。 这些可能很长,我不希望它们溢出到时钟的一部分。 我知道如何叠加文字。 我目前正在通过使用较短版本的标题来解决这个问题。
这是需要过滤器图形或中间视频文件的东西还是可以通过简单的视频过滤器完成?
The ffmpeg documentation on filters doesn't have anything on a clipping rectangle for drawtext. I'm hoping there might be a setting I can put before a video filter to set a clip rect, an undocumented feature or a clever workaround so that you can draw the text only within a certain bounding box on the output video.
I'm trying to overlay movie titles over a ticking clock video. These might be long and I don't want them to spill over onto part of the clock. I know how to overlay text already. I am currently working around this by using a shorter version of the title.
Is this something that requires filter graphs or intermediate video files or can it be done with a simple video filter?
最满意答案
方法1:字幕过滤器
假设你想要简单的剪辑,而不是有限的自动换行,你可以使用ASS字幕。 请参阅视觉排版 - Aegisub 。
一旦你创建了字幕文件, ffmpeg命令很简单:
ffmpeg -i input -filter_complex "subtitles=subs.ass" output如果你想避免使用Aegisub,你可以手动制作简单的SRT样式子,然后使用force_style选项设置剪辑坐标。 请参阅字幕过滤器文档 。
方法2:作物
另一种方法是使用裁剪,drawtext和overlay过滤器。 您可以在Blur特定区域(不带遮罩)中调整示例。
Method 1: subtitles filter
Assuming you want simple clipping, and not bounded word wrapping, you can use ASS subtitles. See Visual Typesetting - Aegisub.
Once you make your subtitles file the ffmpeg command is simple:
ffmpeg -i input -filter_complex "subtitles=subs.ass" outputIf you want to avoid using Aegisub you can manually make simple SRT style subs and then use the force_style option to set the clipping co-ordinates. See the subtitles filter documentation.
Method 2: crop
Another method would be to use crop, drawtext, and overlay filters. You can adapt the example in Blur specific area (without a mask).
更多推荐
发布评论