3

I'm trying to stream a video from my PC to another I started with a basic example, this one https://stackoverflow.com/a/51543002/9492711 I configured the udpsink host properly to map to my pc, but I'm getting this message constantly

VideoCapture or VideoWriter not opened

VideoCapture not opened

I have MacOS and I installed openCV 4.1.0 and gstreamer 1.16.0 with Python3.

Opencv 4.1.0 and gstreamer1.16.0 are installed using brew, and also I installed the the package file (1.16.0 runtime instller) from this link https://gstreamer.freedesktop.org/download/

The problem is that gstreamer is not properly built with opencv and I'm new to this dev. env and I need some guidance.

Here is what I'm getting when I run print(cv2.getBuildInformation()) Gstreamer support in OpenCV

I tried to uninstall opencv and gstreamer and reinstalling them, but this did not work at all and still getting the same result

Gstreamer: NO

I also have the following configs. and info:

Platform:
Timestamp:                   2019-04-11T22:18:08Z
Host:                        Darwin 16.7.0 x86_64
CMake:                       3.9.4
CMake generator:             Unix Makefiles
CMake build tool:            /usr/bin/make
Configuration:               Release

I'm using Mac OS Mojave version 10.14.4 and trying to run the code using VSCode. Any guidance or help how to make OpenCV recognize Gstreamer?

Community
  • 1
  • 1
basel.ai
  • 127
  • 8

2 Answers2

0

I have the same issue. I ended up switching to ubuntu. I think brew won't install opencv plugin. So you might need to build from source, which I am not a fan of.

0

Previous answer is correct that you need to build from source, however, if you do decide to do that it only takes about 1-2hrs (and 1hr is just compile time during which you can walk away and do other stuff). Here is a guide for that: https://medium.com/@galaktyk01/how-to-build-opencv-with-gstreamer-b11668fa09c

These are steps for Ubuntu but they should work on Macs (also, even with Ubuntu you may still need to build from source if you want Python to be able to "see" gstreamer).

You can first try: https://medium.com/@satchitananda/setting-up-opencv-for-python-3-on-macos-sierra-with-5-easy-steps-647b64c5e0c9

Which looks less time consuming and easier, but I have not personally confirmed that it works.

selamjie
  • 28
  • 6