mikip
mikip

Reputation: 1727

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

My python program generates a collection of binary files. I create pgm (portable bitmap files) 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.

Upvotes: 0

Views: 1273

Answers (1)

Pekka
Pekka

Reputation: 449703

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.

Upvotes: 1

Related Questions