开发者

Creating a video file from a group of PGM files in python

开发者 https://www.devze.com 2022-12-18 19:28 出处:网络
My python program generates a collection of binary files. I create pgm (portable bitmap f开发者_开发知识库iles) using this binary data. I would like to create a video using each of the pgm files as a

My python program generates a collection of binary files. I create pgm (portable bitmap f开发者_开发知识库iles) using this binary data. I would like to create a video using each of the pgm files as a frame in my video.

I have had a look an mencoder but I dont think it supports pgm files

Can anyone offer any advice.


If "PGM" is identical with "Portable GrayMap Files", cross-browser command line video processing tool ffmpeg can decode them: List of FFMPeg Codecs on Wikipedia

Check out the FFMPEG FAQ: 3.2 How do I encode single pictures into movies?

On how to use FFMpeg with Python, check this SO question. There is a wrapper for Python, but I can't find any statements on how good it is.

If in doubt, just call it from the command line.

0

精彩评论

暂无评论...
验证码 换一张
取 消