JetsonNano Multimedia API工程搭建及编译
官方文档:
jetson Nano上Multimedia API位于/usr/src/jetson_multimedia_api
处
编译libagrus
1 2 3 4 5 6 7 8 9 10 11 12
| cd code sudo cp -r /usr/src/jetson_multimedia_api/argus/samples/* ./argus_samples sudo chown -R jetson:jetson ./argus_samples
sudo apt install cmake build-essential pkg-config libx11-dev libgtk-3-dev libexpat1-dev libjpeg-dev libgstreamer1.0-dev
cd ./argus_samples/utils mkdir build && cd build cmake -DCMAKE_MODULE_PATH=/usr/src/jetson_multimedia_api/argus/cmake -DARGUS_INCLUDE_DIR=/usr/src/jetson_multimedia_api/argus/include ../ make -j4
|
之后便可以正常编译所有sample,这里以oneShot为例进行编译:
1 2 3 4 5
| cd code/argus_samples/oneShot mkdir build && cd build
vim ../CMakeLists.txt
|
将 CMakeLists.txt 中的:
${CMAKE_SOURCE_DIR}/samples/utils
修改为${ARGUS_INCLUDE_DIR}/../samples/utils
argussampleutils
修改为${CMAKE_SOURCE_DIR}/../../utils/build/libargussampleutils
即:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| include_directories( ${ARGUS_INCLUDE_DIR} ${ARGUS_INCLUDE_DIR}/../samples/utils )
add_executable(${PROJECT_NAME} ${SOURCES})
target_link_libraries(${PROJECT_NAME} ${ARGUS_LIBRARIES} ${CMAKE_SOURCE_DIR}/../utils/build/libargussampleutils.a )
|
之后正常编译即可:
1 2
| cmake -DCMAKE_MODULE_PATH=/usr/src/jetson_multimedia_api/argus/cmake -DARGUS_INCLUDE_DIR=/usr/src/jetson_multimedia_api/argus/include ../ make -j4
|
1 2 3
| cd code sudo cp -r /usr/src/jetson_multimedia_api/samples/* ./mmapi_samples sudo chown -R jetson:jetson ./mmapi_samples
|
修改mmapi_samples/Rules.mk
文件中的如下内容,更换目录为当前文件夹:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| ...
TOP_DIR := $(shell pwd | awk '{split($$0, f, "/mmapi_samples"); print f[1]}') CLASS_DIR := $(TOP_DIR)/mmapi_samples/common/classes ALGO_CUDA_DIR := $(TOP_DIR)/mmapi_samples/common/algorithm/cuda ALGO_TRT_DIR := $(TOP_DIR)/mmapi_samples/common/algorithm/trt ...
CPPFLAGS += -std=c++11 \ -I/usr/src/jetson_multimedia_api/include \ -I/usr/src/jetson_multimedia_api/include/libjpeg-8b \ -I"$(ALGO_CUDA_DIR)" \ -I"$(ALGO_TRT_DIR)" \ -I"$(TARGET_ROOTFS)/$(CUDA_PATH)/include" \ -I"$(TARGET_ROOTFS)/usr/include/$(TEGRA_ARMABI)" \ -I"$(TARGET_ROOTFS)/usr/include/libdrm" \ -I"$(TARGET_ROOTFS)/usr/include/opencv4" ...
|
之后便可以正常编译所有sample,这里以10_camera_recording为例进行编译:
1
| cd code/mmapi_samples/10_camera_recording
|