OpenCV OSX Mavericks video codec issue - opencv

Firstly, I've installed ffmpeg using
sudo port install ffmpeg
on my Macbook OSX 10.9 and XCode 5.1. I've done the same for OpenCV
sudo port install opencv
and I got face detect working using this SO answer. However, when trying to open a video file in the source code folder using VideoCapture I get the error "WARNING: Couldn't read movie file Alireza_Day1_001.avi". Has anyone faced the same issue? (FYI VideoCapture from my webcam is working fine, but tried opening a .mov and .avi file without luck) Any help is much appreciated!

Related

Unable to run cameras under Opencv 4.1.2 and MacOS Catalina

I am unable to open a camera on the network using Catalina, Python 3.7 and OpenCV 4.1.2.
I am running an IP Webcam app on a phone that exposes an endpoint as: http://192.168.87.26:8080/video. The following command fails:
import cv2
cap = cv2.VideoCapture('http://192.168.87.26:8080/video')
and the error message is:
OpenCV: Couldn't read video stream from file "http://192.168.87.26:8080/video"
At the same time, a video mp4 file works well. I have added permissions in MacOS such that the default webcam also works.
I have tried with both the pip install opencv-python as well as built an opencv from source, but the error for the video stream does not go away.
FFMPEG is installed in the system. FFPLAY on this URL http://192.168.87.26:8080/video works very well.
$ brew info ffmpeg
ffmpeg: stable 4.2.1 (bottled), HEAD
Play, record, convert, and stream audio and video
https://ffmpeg.org/
/usr/local/Cellar/ffmpeg/4.2.1_2 (287 files, 56.6MB) *
What I am missing?
After some more digging around, I was able to make it work. Looks like I had an old version of Intel OpenVINO around from Mojave days that was interfering with any local version of OpenCV that I would install.
During the exercise, I also figured that building OpenCV from scratch is far better than installing it from pip.

Does paperclip need FFMPEG to upload videos?

I'm using this gem right now:
Do i need to install FFMPEG like i did for uploading images (imagemagick)?
If I do, i can't seem to figure out how to install FFMPEG since I'm using Nitrous.io, which is a cloud based IDE.
I found out how to install Image magick from a line of code on nitrous.io, but i see nothing for FFMPEG.
So far I have tried googling quite a lot for an alternative encoder that's compatible with nitrous.
Depends on the system you are running and the configuration you need. if on MacOS i suggest using Homebrew.
https://ffmpeg.org/download.html

OpenCV on Raspbery pi error: HIGHGUI ERROR: v4l/v4l2: VIDIOC_CROPCAP

I have started to work on Rpi. I have worked on opencv on windows and ubuntu. Now I want to do Image porcessing on Rpi. I have installed latest version 2.4.8 on my Rpi. And I am able to open and display an image. However when I am trying to open webcam and display, it gives me error: HIGHGUI ERROR: v4l/v4l2: VIDIOC_CROPCAP.
Can anyone tell whats the problem ?
I haved the some error when trying to execute a code that does facedetection , i solved it by adding the files needed in my working folder (source folder).
you can show us the code to find out what exactly you need
If you are using prebuilt binaries, they may be built without v4l support. Try to build your own OpenCV with v4l checked. And of course before that install v4l with development files. You can follow this tutorial with how to install required dependicies explanied.

BeagleBone, OpenCV and webcam issue

I've been trying to get BeagleBone work with OpenCV and a capture camera, but I couldn't manage to do it so far. I use Logitech C270 webcam. Here is what I did so far:
I installed OpenCV binaries and tried my camera. Capture didn't work. I downloaded the latest version from Git and compiled it. Then it worked on my desktop.
Since Ångström have pre-installed OpenCV, I directly tried to connect the webcam. But I had "select timeout" errors and when I saved the captured image, it was all black.
I deleted OpenCV from Ångström (opkg remove opencv and opencv-dev). It said it worked, but libraries were still in /usr. So I deleted them manually and copied libraries that I cross-compiled in my host. But now, I cannot even connect to camera. Capture returns null again.
I checked opkg list-installed, still OpenCV 2.4 is listed there. However, libraries in /usr/lib and include are the ones that I copied. How can I fix this problem?
Note: Webcam is recognized by Ångström, and dmesg shows successful connection to the webcam.
It seems something was wrong on installation of Linux itself. I re-compiled the latest Ångström and installed it to BeagleBone. Everything worked fine as it should. It seems sometimes it's better to take the hard way.

Compile OpenCV with ffMpeg support

I'm having problems compiling OpenCV with ffMpeg support under Debian.
I downloaded new ffMpeg and installed it, downloaded opencv-1.1pre1.tar.gz and unpacked it.
then
./configure --enable-apps --enable-shared --with-ffmpeg --with-gnu-ld --without-quicktime CFLAGS=-I/usr/local/include CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib
ffMpeg checked yes and finally when I make it says
../../../otherlibs/highgui/.libs/libhighgui.so: undefined reference to `img_convert'
Now I've been around the forums and tried various stuff but nothing worked.
Can anybody help me get this thing installed?
OpenCV and FFmpeg evolved very much in last months and nowadays its possible to make OpenCV 2.1 work with FFmpeg without much suffering.
There were some changes in FFmpeg API after OpenCV 1.1pre1 was released, so OpenCV might not work properly with new FFMPEG. I'd suggest trying older versions. I was using FFMPEG trunk snapshot of 07/2008 without problems.

Resources