

Here is the github repo with the example. It is fairly easy to have crashes and memory leaks that are extremely time consuming to discover and fix.Īfter spending some time walking through the FFmpeg code, docs and examples, I decided to implement a little example with basic rtmp streaming functionality and share it in the hope it can save some pain to people wanting to implement streaming from OpenCV based applications. Using libavcodec libavformat libavutil libswscale libavfilter and libavdevice is not straightforward. When googling for examples of streaming, the option of using ffmpeg libraries becomes appealing but…įFmpeg examples are mostly about using the FFmpeg command line tool to produce a stream from a video file, while you want to stream on the fly the cv::Mat frames produced by your code. For example to a VM in the cloud with a web server that can push the stream to a browser. Last edited by jlb222 June 23rd, 2017 at 04:45 PM.Do you have a project using OpenCV to process video?Īt some point, after your proof-of-concept works, you want to send the result of the processing in real time to some other device. for example cv2.imshow() will not work (not compiled with GTK+ 2.x or Carbon support).video related functionality is not supported (not compiled with FFmpeg).MacOS and Linux wheels have currently some limitations: Successfully uninstalled opencv-python-3.2.0.7Īs you probably know (but I didn’t) opencv-python is a lightweight package with a partial opencv functionality that can be used INSTEAD of the original libraries as stated in the documentation ( ): Successfully installed opencv-python-3.2.0.7 Installing collected packages: opencv-python hyper tough ht200 code reader manual Docker Python Opencv Ffmpeg 55. TOTAL_FRAMES_FLAG = cv2.CAP_PROP_FRAME_COUNTĪnd this is what happens in my ubuntu environment: ADVERTISEMENT sudo apt update sudo apt install ffmpeg Once the packages. Here is an example, this is my test.py file:Ĭap = cv2.VideoCapture("/home/envac/Documentos/GOPR0043.MP4") When I uninstalled it from my system, I was finally able to handle video files. However, my problem was that I was pip installing the opencv-python package on top pf the OpenCV installation from source and this blocked acces to the real libraries. FFMPEG did not work because I had deleted the references to opencv_core that are required this was not fixed by uninstalling and reinstalling FFMPEG and was solved after Ubuntu was reinstalled.


In the end, I had several problems in my project. Thanks SeijiSensei and monkeybrain, but my problem was somewhere else.
