有没有 gstreamer 插件可以扩展视频流?
我的 gstreamer 版本是 0.10,我想通过在顶部和底部插入空白将 16:9 视频扩展为 4:3。
我用 gst-inspect 搜索了插件列表。有“videoscale”和“videocrop”,但没有“videoexpand”。
有没有直接完成这项工作的插件?
编辑:问题已经解决。 “videobox”过滤器正好满足我的需求。
My gstreamer version is 0.10 and I want to expand a 16:9 video to 4:3 by inserting blanks at top and bottom.
I searched the plugin list with gst-inspect. There're "videoscale" and "videocrop", but no "videoexpand".
Are there any plugins that directly do the job?
Edit: The problem has been solved. The "videobox" filter just fit my demand.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
查看
videobox
过滤器。它可以生成任何宽高比的信箱视频。通过添加透明边框以匹配较大视频的大小,将较小的视频合成在较大的视频之上也很有用(请参阅 http://www.oz9aec.net/index.php/gstreamer/347-more-gstreamer-tips-picture-in-picture-合成)。Check out the
videobox
filter. It can produce letterboxed video for any aspect ratio. It's also useful for compositing a smaller video on top of a larger one by adding a transparent border to match the larger video's size (see http://www.oz9aec.net/index.php/gstreamer/347-more-gstreamer-tips-picture-in-picture-compositing).由于我是 stackoverflow 的新手,因此不允许我发布两个链接。您可能还想检查此。
Since I am new to stackoverflow, I wasn't allowed to post two links. You might like to check this as well.
我将在这里放下我的两分钱,因为这篇文章引导我找到了我认为相关问题的解决方案(将不确定分辨率和宽高比的输入视频缩放到具有固定分辨率的显示器):
添加< code>add-borders=true 添加到
videoscale
元素将通过根据需要填充字母/支柱框来保留宽高比。对我来说有一个小警告,因为我的项目是使用静态定义 AR 会出现问题的动态输入,确保在我的管道中包含包含
pixel-aspect-ratio=1/1
的 caps 过滤器,以定义输出 AR(与 < code>height 和width
参数与pixel-aspect-ratio
一起指定)。** 尽管即使不缩放,您仍然可以从
add-borders
中受益,但文档指出“将此元素插入管道中是安全的 [...],无需任何成本如果不需要缩放。”I'll drop my two cents here as this post lead me to the solution for what I think is a related problem (scaling** input video of indeterminate resolution and aspect ratio to a display with a fixed resolution):
Adding
add-borders=true
to thevideoscale
element will preserve aspect ratio by padding letter/pillar -boxes as necessary.One minor caveat for me, as my project was working with dynamic input for which statically defining AR would be problematic, was ensuring a caps filter containing
pixel-aspect-ratio=1/1
was in my pipeline, to define the output AR (in concert theheight
andwidth
params specified alongsidepixel-aspect-ratio
).** Though you can still benefit from
add-borders
even when not scaling—the documentation calls out that it is "safe to insert this element in a pipeline [...] without any cost if no scaling is needed."我认为你应该使用 ffmpeg 。
检查下面的链接
http://www.ffmpeg.org/ffmpeg-doc.html
I think you should use ffmpeg for that.
Check below link
http://www.ffmpeg.org/ffmpeg-doc.html