如何以编程方式创建视频?
是否有免费的库可以根据图像序列创建 MPEG(或任何其他简单的视频格式)?
它也必须在 Linux 上运行,并且最好具有 Python 绑定。
Is there a freely available library to create a MPEG (or any other simple video format) out of an image sequence ?
It must run on Linux too, and ideally have Python bindings.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
在 c++ OpenCV(来自英特尔的开源计算机视觉库)中,您可以创建一个 AVI 文件,然后将帧推入其中......
但这就像用大炮射击苍蝇一样。
in c++ OpenCV (open source Computer Vision library from Intel) let you create an AVI file and just push frames inside...
but it's like shooting with a cannon to a fly.
mplayer 不是一个库,但它能够将 JPEG 序列编码为任何类型的格式。 它运行在Linux、Windows、BSD等平台上,如果你想和python一起使用,你可以编写一个python脚本。
Not a library, but mplayer has the ability to encode JPEG sequences to any kind of format. It runs on Linux, Windows, BSD and other platforms and you can write a python script if you want to use it with python.
ffmpeg 有一个 API,还有 python 绑定,似乎是可行的方法!
谢谢
ffmpeg has an API and also python bindings, seems to be the way to go !
Thanks
ffmpeg最小可运行C示例
我在以下位置提供了完整的可运行示例:如何使用ffmpeg的sws_scale()调整图片大小?
ffmpeg minimal runnable C example
I have provided a full runnable example at: How to resize a picture using ffmpeg's sws_scale()?
ffmpeg 是一个很棒的(开源)程序,用于构建各种视频并转换一种类型将视频(在本例中为图像序列)转换为其他类型的视频。
通常它是从命令行使用的,但这实际上只是其内部库的包装。 它明确可以在另一个程序中使用。
还有包装 c api 的 python 绑定,尽管这个特定项目似乎没有获得最好的支持(可能还有其他项目在做同样的事情)。
还有此链接,有人使用 ffmpeg 做了与您类似的事情寻找。
ffmpeg is a great (open source) program for building all kinds of video, and converting one type of video (a sequence of images in this case) into other types of video.
Usually it is utilized from the command line, but that is really just a wrapper around its internal libraries. It is expressly available to be used from within another program.
There are also python bindings that wrap the c api, though this particular project doesn't seem to be getting the best support (there are probably other projects out there doing the same thing).
There's also this link where someone has used ffmpeg to do something similar to what you're looking for.
GStreamer 是一个流行的选择。 它是一个完整的多媒体框架,很像 DirectShow 或 QuickTime,具有拥有合法许可的编解码器的优点,并且具有出色的 Python 绑定。
GStreamer is a popular choice. It's a full multimedia framework much like DirectShow or QuickTime, has the advantage of having legally licensed codecs available, and has excellent Python bindings.
我知道有 mencoder (mplayer 项目的一部分)和 ffmpeg,两者都可以做到这一点。
I know there's mencoder (part of the mplayer project), and ffmpeg, which both can do this.