Creating MPEG4 video file with Python from raw fra

2019-04-11 17:22发布

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.

3条回答
狗以群分
2楼-- · 2019-04-11 17:42
一纸荒年 Trace。
3楼-- · 2019-04-11 17:45

Because this question still shows up pretty high in relevant Google searches, here's the library I'm using now:

https://pypi.python.org/pypi/ffmpy/0.0.4

It is lightweight and still works.

Per Neal, OpenCV has the best libraries for editing, but does not (AFAIK) support MPEG.

查看更多
老娘就宠你
4楼-- · 2019-04-11 17:52

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.

查看更多
登录 后发表回答