使用Python从原始帧创建MPEG4视频文件 [英] Creating MPEG4 video file with Python from raw frames

查看:383
本文介绍了使用Python从原始帧创建MPEG4视频文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个可以在Python中访问的原始视频帧源。我想用MP3背景音乐创建一个MPEG4视频。



Python中有哪些工具和库可用于这样的任务?最好我想有一个API,我可以输入文件名,然后单独的帧作为24位原始图像。

解决方案

使用OpenCV和相应的Python绑定,您可以使用类似函数 cv.WriteFrame 的功能。您也可以使用pyffmpeg,但这更适合于从视频文件访问单个帧。


I have a raw video frame source which I can access in Python. I'd like to create a MPEG4 video out of this, with MP3 background music.

What kind of tools and libraries are available in Python for such a task? Preferably I'd like to have an API for which I can feed output filename and then individual frames as 24 bit raw images.

解决方案

With OpenCV and the corresponding Python binding, you could use something like the function cv.WriteFrame. You could also use pyffmpeg, but that is geared more towards accessing individual frames from a video file.

这篇关于使用Python从原始帧创建MPEG4视频文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆