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.
精彩评论