Intel® Distribution of OpenVINO™ Toolkit
Community support and discussions about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all things computer vision-related on Intel® platforms.
5541 Discussions

OpenVino Linux Gstreamer vs Ffmpeg in Docker image

Zvi
Novice
597 Views

I am using the multi_camera_multi_target python demo based on a the docker image

openvino/ubuntu18_runtime:2021.1

The GStreamer opencv backend is used (contrary to using the toolbox in Windows where the ffmpeg was used). Is it possible to set the opencv backend to ffmpeg when using the docker image (I would like to understand if there are differences in performance)? I tried cap = cv.VideoCapture(video_path, cv.CAP_FFMPEG)  but this didn't work. Is the GStreamer backend recommended? Is there a performance comparison? 

0 Kudos
1 Solution
Maksim_S_Intel
Employee
587 Views

This container does not have FFmpeg libraries preinstalled. It has only GStreamer as part of OpenVINO (DL Streamer). You can install FFmpeg in your container, add the following line to your Dockerfile: "RUN apt update && apt install -y ffmpeg".

View solution in original post

10 Replies
Maksim_S_Intel
Employee
588 Views

This container does not have FFmpeg libraries preinstalled. It has only GStreamer as part of OpenVINO (DL Streamer). You can install FFmpeg in your container, add the following line to your Dockerfile: "RUN apt update && apt install -y ffmpeg".

View solution in original post

Rizal_Intel
Moderator
563 Views

Hi Zvi,


Are you able to run using Maksim suggestion?

There were some benchmark in this video capture and write benchmark.


Regards,

Rizal


Zvi
Novice
558 Views

Yes- excellent response. The default is ffmpeg so once I added this to the docker my solution used ffmpeg (seems faster)

Rizal_Intel
Moderator
546 Views

Hi Zvi,


Intel will no longer monitor this thread since this issue has been resolved. If you need any additional information from Intel, please submit a new question.


Regards,

Rizal


Zvi
Novice
525 Views

Just another question - why do we need to install ffmpeg if it is part of the installation (we see it is compiled in OpenCV)?

Maksim_S_Intel
Employee
512 Views

FFmpeg is not part of the installation, OpenCV is built with FFmpeg support - it has ability to read and write videos with the help of this library. 

Zvi
Novice
506 Views

I am still missing something. When I use a compiled OpenCV version in Windows that has ffmpeg, I don't need to install ffmpeg itself (there is a ffmpeg dll), why is this different using Linux? Another question is if the version that OpenCV is built with (here from opencv)  avcodec: YES (57.107.100),avformat: YES (57.83.100),avutil: YES (55.78.100),swscale: YES (4.8.100),avresample: YES (3.7.0)

How can I ensure that the ffmpeg via the apt install will be the matching version? 

Maksim_S_Intel
Employee
498 Views

When you build OpenCV on Windows the configuration script will automatically download a plugin with FFmpeg. As I understand, this was made to simplify build process due to complexity of building and using FFmpeg on Windows.

On Linux systems FFmpeg packages from official repositories can be used. OpenVINO installer contains OpenCV binaries compatible with Ubuntu 18 and 20.

Zvi
Novice
481 Views

Thanks - I am just looking from a production perspective . "OpenVINO installer contains OpenCV binaries compatible with Ubuntu 18 and 20" - "On Linux systems FFmpeg packages from official repositories can be used. " how can we be sure these will be the same version? The apt install -y ffmpeg takes the latest version. 

Maksim_S_Intel
Employee
476 Views

@Zvi wrote:

The apt install -y ffmpeg takes the latest version. 


Not actually so. Stable Debian and Ubuntu releases have fixed versions of packages and can only add security patches or minor fixes to them (see [3]). This is true unless you have 3rdparty repositories added to your apt config.

What you mentioned can be met in rolling releases (or distributions, see [1] and [2]), To use OpenVINO in these you might need to build some components from sources for your specific configuration and be careful when upgrading packages.

Some links:

  1. https://en.wikipedia.org/wiki/Rolling_release
  2. https://en.wikipedia.org/wiki/Category:Rolling_Release_Linux_distributions
  3. https://packages.ubuntu.com/focal/ffmpeg
Reply