Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Mac OS lib media codec issue - symbol not found in flat namespace '_avcodec_decode_video2' #95

Open
vertex-motion opened this issue May 14, 2023 · 0 comments

Comments

@vertex-motion
Copy link

I am trying to set up Robomaster SDK on Mac OS (13.3.1 (a)).

I followed the following chain of commands.

cd /Users/UserName/Robomaster
git clone https://github.com/dji-sdk/RoboMaster-SDK.git

#Add Python 3.8 and FFMPEG 4.4 to your PATH, this could be a part of the azhrc file
echo 'export PATH="/opt/homebrew/opt/python@3.8/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="/opt/homebrew/Cellar/ffmpeg@4/4.4.4/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

#creation of the virtual environment to run robomaster installation with python3.8 and ffmpeg4.4
cd Robomaster
python3.8 -m virtualenv robomaster_env_38
#Activate the virtual environment:
source robomaster_env_38/bin/activate

#install libmedia codes

brew install opus
brew install ffmpeg

cd /Users/UserName/Robomaster/RoboMaster-SDK/lib/libmedia_codec
export C_INCLUDE_PATH=/opt/homebrew/Cellar/ffmpeg@4/4.4.4/include:/opt/homebrew/Cellar/opus/1.3.1/include/
export CPLUS_INCLUDE_PATH=/opt/homebrew/Cellar/ffmpeg@4/4.4.4/include:/opt/homebrew/Cellar/opus/1.3.1/include/
export LIBRARY_PATH=$LIBRARY_PATH:/opt/homebrew/Cellar/opus/1.3.1/include/:/opt/homebrew/lib
pip install .

#install Robomaster
cd /Users/UserName/Robomaster/RoboMaster-SDK
pip install .

After I run the simplest program, I have the following error.
from robomaster import robot

def main():
# Replace '192.168.1.10' with the IP address of your Robomaster robot
my_robot = robot.Robot("192.168.1.1")
my_robot.initialize()

# Your code to control the robot goes here

my_robot.close()

if name == 'main':
main()

Error:
(robomaster_env_38) UserName Robomaster % /Users/UserName/Robomaster/robomaster_env_38/bin/python "/Users/UserName/Robomaster/01 Connect robot.py"
Traceback (most recent call last):
File "/Users/UserName/Robomaster/01 Connect robot.py", line 1, in
from robomaster import robot
File "/Users/UserName/Robomaster/robomaster_env_38/lib/python3.8/site-packages/robomaster/robot.py", line 31, in
from . import camera
File "/Users/UserName/Robomaster/robomaster_env_38/lib/python3.8/site-packages/robomaster/camera.py", line 25, in
from . import media
File "/Users/UserName/Robomaster/robomaster_env_38/lib/python3.8/site-packages/robomaster/media.py", line 21, in
import libmedia_codec
ImportError: dlopen(/Users/UserName/Robomaster/robomaster_env_38/lib/python3.8/site-packages/libmedia_codec.cpython-38-darwin.so, 0x0002): symbol not found in flat namespace '_avcodec_decode_video2'

I would appreciate advice or guidance in remediating the issue. Resolution even better:) Thank you.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant