dji-sdk / RoboMaster-SDK

DJI RoboMaster Python SDK and Sample Code for RoboMaster EP.
Apache License 2.0
311 stars 141 forks source link

libmedia_codec not installing #46

Open MrCampbellDuchess opened 3 years ago

MrCampbellDuchess commented 3 years ago

As the title suggests when attempt to use the sdk like this:

from robomaster import robot

I get this: Traceback (most recent call last): File "/home/admin/bottest.py", line 1, in from robomaster import robot File "/home/admin/.local/lib/python3.7/site-packages/robomaster/robot.py", line 31, in from . import camera File "/home/admin/.local/lib/python3.7/site-packages/robomaster/camera.py", line 25, in from . import media File "/home/admin/.local/lib/python3.7/site-packages/robomaster/media.py", line 21, in import libmedia_codec ModuleNotFoundError: No module named 'libmedia_codec'

I can see it's in the SDK download here on github but I can't get it to work.

Python 3.7.3 on rpi and openCV is installed.

JohnieBraaf commented 3 years ago

You need do do pip install robomaster or build the codec whl file yourself, see my open pull request.

-- https://github.com/dji-sdk/RoboMaster-SDK/pull/49 -- https://github.com/JohnieBraaf/RoboMaster-SDK

Moku151 commented 2 years ago

Hi! I do have the same problem and unfortunately this Pull Request is not merged yet. Can I Download this Code and the SDK will work or do i have to setup something? Thank you for your answer!

JohnieBraaf commented 2 years ago

Yes, you can use https://github.com/JohnieBraaf/RoboMaster-SDK for now, I have merged the latest upstream commits

aftersomemath commented 1 year ago

On Ubuntu linux you can can install libmedia-codec using what is currently on the master branch of this repository. A from scratch installation of the SDK can be done using the following commands:

cd RoboMaster-SDK
pip install .
cd lib/libmedia_codec
pip install .

I had to install the libopus header's to get the libmedia_codec package to compile on Ubuntu, sudo apt install libopus-dev.

Getting a windows build to work should be possible as well.