Forum Archive

Extract frames from video for processing in PIL

Webmaster4o

Can I process video frame-by frame in PIL? I want to take a video, perform different operations on the video, then reform it into a video.

Webmaster4o

I'm thinking of using workflow to get a video, then convert it to GIF, then pass that to pythonista. I can find pure-Python libraries for working with GIFs. images2gif works well. I can process frames in Python, then make a gif of that which is sent back to workflow for conversion to video and saving.

In other words:

  1. Pythonista launches workflow using URL scheme
  2. Workflow gets latest video
  3. Workflow converts it to GIF
  4. Workflow passes GIF to to pythonista
  5. Pythonista extracts frames from GIF
  6. Pythonista processes frames with PIL
  7. Pythonista reforms frames into gif
  8. Pythonista passes GIF to workflow
  9. Workflow makes video from gif.

This seems horribly arduous for video processing.