Coder Social home page Coder Social logo

Build using FFMPEG about opencv-python HOT 7 CLOSED

kartikarora avatar kartikarora commented on July 19, 2024
Build using FFMPEG

from opencv-python.

Comments (7)

kartikarora avatar kartikarora commented on July 19, 2024 1

@skvark This didn't work. My wheel contained an empty cv2 package, with an empty __init.py__.

I solved this issue by moving to docker from cloud foundry and building everything from source. It seems to be working now.

Thanks for the advice!

from opencv-python.

skvark avatar skvark commented on July 19, 2024

The current build setup in this repository uses special CentOS 5 Docker containers. Installing latest FFmpeg on them might be a bit complicated.

I'm not familiar with Cloud Foundry, but I think that the easiest way for your use case is to build OpenCV manually and copy the OpenCV binary to your Trusty environment.

from opencv-python.

kartikarora avatar kartikarora commented on July 19, 2024

@skvark I did try to build OpenCV manually, and the python bindings for it using anaconda. It failed everytime.

I have a deb python-opencv which works perfectly on my local machine, but cloud foundry doesn't allow installation of deb files or anything using apt-get for that matter. I'm trying to figure out a way to make my custom buildpack, but in the meantime, is there any way in which I could package an already compiled and working cv2.so and cv.py files extracted from that deb so that I can install it using pip?

from opencv-python.

skvark avatar skvark commented on July 19, 2024

How the OpenCV was compiled? If I understand you correctly, it depends on FFmpeg, and it means that the FFmpeg binaries must be also in the Trusty machine. If they are not there/can't be installed there, you have to first copy all the precompiled binaries to the cv2 folder along with the OpenCV binary or binaries.

After that clean the setup.py script and then run python setup.py bdist_wheel. All the other files/folders in this repo are irrelevant in your case. I'm not sure if this works. If you end up packaging the FFmpeg binaries to the same package, cv2/__init__.py might need some additional logic to add the binary folder path to LD_LIBRARY_PATH (I'm just guessing, I have never tried this).

from opencv-python.

kartikarora avatar kartikarora commented on July 19, 2024

There is no setup.py file. The .deb file has the precompiled cv2.so file.

As far as my compilation of OpenCV is concerned, I do have FFmpeg binaries and all the dependencies installed.

Just to re iterate the query I have right now, given that I have the .so file needed by python, it there a way to make a package install-able by pip?

from opencv-python.

skvark avatar skvark commented on July 19, 2024

Sorry, I wasn't clear enough. My previous post was a guide how to adapt the files in this repo to construct a a wheel package to be installed with pip. So, in short:

  1. Take the setup.py file and cv2 folder from this repo
  2. Follow the instructions in my previous comment
  3. You will end up with a wheel package. This package must be installed manually: pip install wheel_package_name.whl

from opencv-python.

kartikarora avatar kartikarora commented on July 19, 2024

Gotcha. I'll try this and get back to you.

from opencv-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.