rkmedia的描述
rkmedia是RockChip Linux平台的多媒体库,封装了底层媒体模块接口,提供常用多媒体解决方案。
路径:
rk1109_nand_packge/buildroot/output/rockchip_rv1126_rv1109_spi_nand/build/rkmedia/examples
这次我使用的是rkmedia_venc_local_file_test.c,功能主要实现从文件读取nv12格式视频文件编码H264,RTP打包发出
rkmedia的Cmake了解
在路径:
examples/CMakeFiles/rkmedia_venc_local_file_test.dir下,有对rkmedia_venc_local_file_test.c文件编译的依赖描述,编译命令等。
主要说一下我们要改的make文件
flags.make:主要添加头文件路径,以及预编译选项C_FLAGS
build.make:添加要一起编译的.c文件
#External object files for target rkmedia_venc_local_file_test
rkmedia_venc_local_file_test_EXTERNAL_OBJECTS =
examples/rkmedia_venc_local_file_test: examples/CMakeFiles/rkmedia_venc_local_file_test.dir/rkmedia_venc_local_file_test.c.o
+examples/rkmedia_venc_local_file_test: examples/rtsp/ringfifo.c.o
+examples/rkmedia_venc_local_file_test: examples/rtsp/rtputils.c.o
+examples/rkmedia_venc_local_file_test: examples/rtsp/rtspservice.c.o
+examples/rkmedia_venc_local_file_test: examples/rtsp/rtsputils.c.o
//SDK里面其实已经有很多库,也不需要自己编译RTSP,主要看自己喜欢哪种
添加预编译命令
examples/CMakeFiles/rkmedia_venc_local_file_test.dir/rkmedia_venc_local_file_test.c.o: examples/rkmedia_venc_local_file_test.c
@(CMAKE_COMMAND) -E cmake_echo_color --switch=(COLOR) --progress-dir=/home/liu/rk1109_nand_packge/buildroot/output/rockchip_rv1126_rv1109_spi_nand/build/rkmedia/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building C object examples/CMakeFiles/rkmedia_venc_local_file_test.dir/rkmedia_venc_local_file_test.c.o"
cd /home/liu/rk1109_nand_packge/buildroot/output/rockchip_rv1126_rv1109_spi_nand/build/rkmedia/examples && /home/liu/rk1109_nand_packge/buildroot/output/rockchip_rv1126_rv1109_spi_nand/host/bin/arm-linux-gnueabihf-gcc --sysroot=/home/liu/rk1109_nand_packge/buildroot/output/rockchip_rv1126_rv1109_spi_nand/host/arm-buildroot-linux-gnueabihf/sysroot (C_DEFINES) (C_INCLUDES) $(C_FLAGS) -o CMakeFiles/rkmedia_venc_local_file_test.dir/rkmedia_venc_local_file_test.c.o -c /home/liu/rk1109_nand_packge/buildroot/output/rockchip_rv1126_rv1109_spi_nand/build/rkmedia/examples/rkmedia_venc_local_file_test.c
+examples/rtsp/ringfifo.c.o: examples/rtsp/ringfifo.c
@(CMAKE_COMMAND) -E cmake_echo_color --switch=(COLOR) --progress-dir=/home/liu/rk1109_nand_packge/buildroot/output/rockchip_rv1126_rv1109_spi_nand/build/rkmedia/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building C object examples/CMakeFiles/rkmedia_venc_local_file_test.dir/ringfifo.c.o"
cd /home/liu/rk1109_nand_packge/buildroot/output/rockchip_rv1126_rv1109_spi_nand/build/rkmedia/examples && /home/liu/rk1109_nand_packge/buildroot/output/rockchip_rv1126_rv1109_spi_nand/host/bin/arm-linux-gnueabihf-gcc --sysroot=/home/liu/rk1109_nand_packge/buildroot/output/rockchip_rv1126_rv1109_spi_nand/host/arm-buildroot-linux-gnueabihf/sysroot (C_DEFINES) (C_INCLUDES) $(C_FLAGS) -o CMakeFiles/rkmedia_venc_local_file_test.dir/ringfifo.c.o -c /home/liu/rk1109_nand_packge/buildroot/output/rockchip_rv1126_rv1109_spi_nand/build/rkmedia/examples/rtsp/ringfifo.c
+examples/rtsp/rtputils.c.o: examples/rtsp/rtputils.c
@(CMAKE_COMMAND) -E cmake_echo_color --switch=(COLOR) --progress-dir=/home/liu/rk1109_nand_packge/buildroot/output/rockchip_rv1126_rv1109_spi_nand/build/rkmedia/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building C object examples/CMakeFiles/rkmedia_venc_local_file_test.dir/rtputils.c.o"
cd /home/liu/rk1109_nand_packge/buildroot/output/rockchip_rv1126_rv1109_spi_nand/build/rkmedia/examples && /home/liu/rk1109_nand_packge/buildroot/output/rockchip_rv1126_rv1109_spi_nand/host/bin/arm-linux-gnueabihf-gcc --sysroot=/home/liu/rk1109_nand_packge/buildroot/output/rockchip_rv1126_rv1109_spi_nand/host/arm-buildroot-linux-gnueabihf/sysroot (C_DEFINES) (C_INCLUDES) $(C_FLAGS) -o CMakeFiles/rkmedia_venc_local_file_test.dir/rtputils.c.o -c /home/liu/rk1109_nand_packge/buildroot/output/rockchip_rv1126_rv1109_spi_nand/build/rkmedia/examples/rtsp/rtputils.c
+examples/rtsp/rtspservice.c.o: examples/rtsp/rtspservice.c
@(CMAKE_COMMAND) -E cmake_echo_color --switch=(COLOR) --progress-dir=/home/liu/rk1109_nand_packge/buildroot/output/rockchip_rv1126_rv1109_spi_nand/build/rkmedia/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building C object examples/CMakeFiles/rkmedia_venc_local_file_test.dir/rtspservice.c.o"
cd /home/liu/rk1109_nand_packge/buildroot/output/rockchip_rv1126_rv1109_spi_nand/build/rkmedia/examples && /home/liu/rk1109_nand_packge/buildroot/output/rockchip_rv1126_rv1109_spi_nand/host/bin/arm-linux-gnueabihf-gcc --sysroot=/home/liu/rk1109_nand_packge/buildroot/output/rockchip_rv1126_rv1109_spi_nand/host/arm-buildroot-linux-gnueabihf/sysroot (C_DEFINES) (C_INCLUDES) $(C_FLAGS) -o CMakeFiles/rkmedia_venc_local_file_test.dir/rtspservice.c.o -c /home/liu/rk1109_nand_packge/buildroot/output/rockchip_rv1126_rv1109_spi_nand/build/rkmedia/examples/rtsp/rtspservice.c
+examples/rtsp/rtsputils.c.o: examples/rtsp/rtsputils.c
@(CMAKE_COMMAND) -E cmake_echo_color --switch=(COLOR) --progress-dir=/home/liu/rk1109_nand_packge/buildroot/output/rockchip_rv1126_rv1109_spi_nand/build/rkmedia/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building C object examples/CMakeFiles/rkmedia_venc_local_file_test.dir/rtsputils.c.o"
cd /home/liu/rk1109_nand_packge/buildroot/output/rockchip_rv1126_rv1109_spi_nand/build/rkmedia/examples && /home/liu/rk1109_nand_packge/buildroot/output/rockchip_rv1126_rv1109_spi_nand/host/bin/arm-linux-gnueabihf-gcc --sysroot=/home/liu/rk1109_nand_packge/buildroot/output/rockchip_rv1126_rv1109_spi_nand/host/arm-buildroot-linux-gnueabihf/sysroot (C_DEFINES) (C_INCLUDES) $(C_FLAGS) -o CMakeFiles/rkmedia_venc_local_file_test.dir/rtsputils.c.o -c /home/liu/rk1109_nand_packge/buildroot/output/rockchip_rv1126_rv1109_spi_nand/build/rkmedia/examples/rtsp/rtsputils.c
link.txt:里面是编译生成可执行文件的命令
我们把刚刚编译好的rtsp文件添加进去
/home/liu/rk1109_nand_packge/buildroot/output/rockchip_rv1126_rv1109_spi_nand/host/bin/arm-linux-gnueabihf-gcc --sysroot=/home/liu/rk1109_nand_packge/buildroot/output/rockchip_rv1126_rv1109_spi_nand/host/arm-buildroot-linux-gnueabihf/sysroot -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -DNDEBUG -rdynamic CMakeFiles/rkmedia_venc_local_file_test.dir/rkmedia_venc_local_file_test.c.o CMakeFiles/rkmedia_venc_local_file_test.dir/ringfifo.c.o CMakeFiles/rkmedia_venc_local_file_test.dir/rtputils.c.o CMakeFiles/rkmedia_venc_local_file_test.dir/rtspservice.c.o CMakeFiles/rkmedia_venc_local_file_test.dir/rtsputils.c.o -o rkmedia_venc_local_file_test -Wl,-rpath,/home/liu/rk1109_nand_packge/buildroot/output/rockchip_rv1126_rv1109_spi_nand/build/rkmedia/src: ../src/libeasymedia.so.1.0.1 -ldrm -lrockchip_mpp -lavformat -lavcodec -lswresample -lavutil -lliveMedia -lgroupsock -lBasicUsageEnvironment -lUsageEnvironment -lpthread -lasound -lRKAP_AEC -lRKAP_ANR -lRKAP_Common -lv4l2 -lrga -lrknn_runtime -lrknn_api -lrockface -lsqlite3 -lmd_share -lod_share -lrockx /home/liu/rk1109_nand_packge/buildroot/output/rockchip_rv1126_rv1109_spi_nand/host/arm-buildroot-linux-gnueabihf/sysroot/usr/lib/librkaiq.so
然后在examples输入命令sudo make即可编译成功啦~
把执行程序push到板子上运行不了
因为板子上默认没有librockchip_mpp.so.1,librockface.so,librkaiq.so,libeasymedia.so.1.0.1等等的库需要自己在/home/liu/rk1109_nand_packge/buildroot/output/下路径搜索,添加到板子上
原作者:I&You
|