0

I am trying to use the Opencv VideoWriter object with the mpeg-1 encoding to create videos, I am aiming at writing only two images on that video, using mpeg-1 encoding, I would like to know how much the first image that I wrote first helps in compressing the second image. In other words find the file size before writing the 2nd image and after. My questions are:

Is there any way to perform this process using Opencv?

Is there a way to avoid writing on disks and just have the information of the size of the compreesed video( after adding the second image)?

Is there any other good alternatives reach my goals?

JustInTime
  • 2,716
  • 5
  • 22
  • 25

1 Answers1

1

I suggest you learn GStreamer framework which has Python bindings available.

http://gstreamer.freedesktop.org/modules/gst-python.html

It works best on Linux platforms, some OSX support is available.

GStreamer provides "sane", but very powerful and very complex, APIs for procedural video and audio generation.

See also:

GStreamer: status of Python bindings and encoding video with mixed audio

Alternative you can write out frames to raw image images files and parse them to a video using ffmpeg command. Might work on Microsoft Windows platforms too.

Community
  • 1
  • 1
Mikko Ohtamaa
  • 82,057
  • 50
  • 264
  • 435