dji-sdk / RoboMaster-SDK

DJI RoboMaster Python SDK and Sample Code for RoboMaster EP.
Apache License 2.0
328 stars 150 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 2 years 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.

whydahuzi commented 2 months ago

\lib\site-packages\robomaster\media.py", line 32, in init self._video_decoder = libmedia_codec.H264Decoder() AttributeError: module 'libmedia_codec' has no attribute 'H264Decoder'

hahasa11 commented 3 days ago

C:\Users\hahyu\RoboMaster-SDK>python test_robo_connection.py Traceback (most recent call last): File "C:\Users\hahyu\RoboMaster-SDK\test_robo_connection.py", line 1, in from robomaster import robot File "C:\Users\hahyu\AppData\Local\Programs\Python\Python310\lib\site-packages\robomaster\robot.py", line 31, in from . import camera File "C:\Users\hahyu\AppData\Local\Programs\Python\Python310\lib\site-packages\robomaster\camera.py", line 25, in from . import media File "C:\Users\hahyu\AppData\Local\Programs\Python\Python310\lib\site-packages\robomaster\media.py", line 21, in import libmedia_codec ImportError: DLL load failed while importing libmedia_codec: 지정된 모듈을 찾을 수 없습니다.

C:\Users\hahyu\RoboMaster-SDK> I buid it succesfully without error code but it didn't make "libmedia_codec.dll" Chatgpt says thats the problem that i can't control robomaster, is it right? than how to get libmedia_codec.dll.