18

I try to record a Video with the OpenCV Framework an would like to save that into an Matroska(mkv) Container together with some additional data streams.

First I thought using FFmpeg is the way that. But while looking into the OpenCV Sourcecode and searching in the web I found GStreamer.

Because the documentation in GStreamer is much better than the FFmpeg documentation I would prefer using this Framework.

In my understanding GStreamer is primarily used for Streaming, but could also rncode and mux video data.

Is there any disadvantage when using GStreamer instead of FFmpeg?

Thanks in advance Horst

user1129474
  • 189
  • 1
  • 1
  • 3

2 Answers2

18

I try to record a Video with the OpenCV Framework an would like to save that into an Matroska(mkv)

I don't think OpenCV can store video as MKV,

together with some additional data streams.

OpenCV doesn't provide features for this operation.

An easy workaround is to simply call ffmpeg's or gstreamer's cmd-line application to do the conversion for you.

GStreamer has indeed a decent documentation and it can also do the job. The obvious disadvantage is that if you know how to work with FFmpeg, changing to GStreamer will require some extra time to understand how it works since both have completely different APIs: GStreamer architecture was inspired by DirectShow and Quicktime.

The advantage is that GStreamer (besides being cross-platform as well) is used on several big projects and getting to know GStreamer will certainly add a great skill to your programming arsenal.

karlphillip
  • 87,606
  • 33
  • 227
  • 395
  • OpenCV builds its data output storing on the concept and pattern of proxies. You can use a Ffmpeg proxy, a Gstreamer proxy, or even an _images proxy_, sort of a zero proxy that works with (possibly among others) JPEG images. Look it at [this paste](http://paste.frubar.net/16334) of [the cvCreateVideoWriter function](https://github.com/Itseez/opencv/blob/master/modules/highgui/src/cap.cpp). For instance me use to configure a vanilla OpenCV without big deal of a configuration with many proxies, and just work with images and do the video multiplexing and demultiplexing invoking Ffmpeg externally. – 1737973 May 20 '14 at 14:09
0

I see no disadvantage using gstreamer. In fact the way I see is gstreamer is a framework not just as a tool or a single purpose library. You can use it to develop your own plugins that can seamlessly hook into gstreamer pipeline.