简介主要特性硬件平台LindSDK架构图目录结构总体目录framework/avavwrappercomponentlindplayerlindnetlindtunnelmpp_sourceframework/basesamplesample/lindcamerasample/lindplayersample/lindesplayersample/lindjpgsample_midisample_adevsample_ffdemuxsample_lindzcfgsample_ldt_cli/sample_ldt_devsample_ldt_ioctrlsample_lindnetsample_lindsink_rtp/sample_lindsource_rtpsample_mppsrc_2_lindsinksample_mppsrc_2_ffsinksample_mppsrc_2_livesink使用方式编译LindSDK打包固件配置文件lindsdk.inisection:debugsection:lindmpplindproplindmix.ini典型应用场景播放器录像机流媒体服务器IPCamera婴儿监护仪Windows桌面同屏器
LindSDK是珠海六点智能科技有限公司开发的一套基于嵌入式平台(ARM/RISC-V Linux/RTOS)的视频编码、解码及传输的产品开发工具集。
目前支持硬件平台:
LindSDK架构图如下所示,从下往上分为OS层、Depends(3rd Library)层、Framework层、APP层。

.├── build├── depends├── framework│ ├── av│ └── base├── Makefile -> build/Makefile├── out│ ├── v833-lindenis│ └── v536-Lindenis_SBC├── sample└── toolchainsbuild
LindSDK的编译脚本.
depends
LindSDK的二进制库文件.
framework/av
LindSDK关于媒体操作包括音频、视频、传输协议等的接口定义
详细信息见: framework/av
framework/base
LindSDK常用组件的接口定义.
详细信息见: framework/base
sample
这是LindSDK的一组示例代码.
详细信息见: sample
toolchains
这是LindSDK依赖的交叉编译工具链.
out
这里保存编译后生成的二进制文件.
xxxxxxxxxx├── framework│ ├── av│ │ ├── avwrapper│ │ ├── component│ │ ├── lindnet│ │ ├── lindplayer│ │ ├── lindtunnel│ │ ├── mpp_source│ │ ├── Makefile│ │ └── readme.md这里是音频、视频及显示图层相关硬件操作的APIs。
| 头文件 | 说明 |
|---|---|
| adev_wrapper.h | 音频输入输出的APIs. |
| disp_wrapper.h | 硬件显示图层的APIs. |
| g2d_wrapper.h | 2D图像的硬件操作APIs,支持YUV图像的拷贝和旋转. |
| palloc_wrapper.h | 物理内存管理的APIs. |
| vdec_wrapper.h | 视频硬件解码的APIs. |
这是媒体相关操作的软件接口定义.
| 头文件 | 说明 |
|---|---|
| lindcomponent.h | LindSDK媒体常用的数据结构定义. |
| ffcodec.h | 基于ffmpeg的媒体编解码的APIs,目前仅支持音频的编解码. |
| ffdemux.h | 基于ffmpeg的媒体解析的APIs. |
| ffsink.h | 基于ffmpeg的媒体封装的APIs. |
| livesink.h | 基于live555的RTSP服务器的APIs. |
| lindsink.h | Lindeni统一媒体封装(文件或者流化)接口 是对ffsink、livesink和lindrtpsink的封装. |
| lindsource.h | Lindeni统一媒体源接口, 当前仅支持lindrtpsource. |
| lindapm.h | 回声消除Acoustic Echo Cancelling(AEC)/降噪Noise Suppression(NS)的APIs. |
| mididec.h | MIDI音频解码的APIs. |
lindplayer提供了一套媒体播放的接口,支持本地视频、音频、JPG图片、流媒体或视频裸码流的播放.
播放器的参考实现见: lindplayer, lindesplayer, lindjpg
| 头文件 | 说明 |
|---|---|
| lindplayer.h | 媒体播放器的APIs 支持场景的媒体文件(mp4,ts...) 和流媒体(rtsp,hls,http...)等. |
| lindesplayer.h | H264/H265裸码流的播放APIs. |
| lindjpeg.h | JPG图片解码或播放的APIs. |
lindnet是对一些常用的socket编程操作的封装.
支持TCP/UDP/RDT传输协议,其中RDT是一种基于UDP的可靠数据传输协议,是lindtunnel的基础传输协议之一.
lindtunnel实现了一套简单的局域网内多设备通信的接口,它由三种角色组成:服务器、设备端和APP客户端。
其特性如下:

| 头文件 | 说明 |
|---|---|
| lindtunnel.h | lindtunnel的APIs. |
| ldt_ioctrl_def.h | 一组IPCamera的指令定义. |
| ldt_error.h | 错误码定义. |
sample_ldt_dev和sample_ldt_cli是基于‘ldt_ioctrl_def’这组指令实现的一个简单的IPCamera示例。
mpp_source是对音/视频采集、编码和录像等功能的框架层接口。
Camera的参考实现见: lindcamera
| 头文件 | 说明 |
|---|---|
| mpp_camera.h | 摄像头的采集、预览、编码、录像、拍照、OSD等功能的APIs. |
| mpp_audio.h | 音频采集和编码的APIs. |
| mpp_thumb.h | 生成视频缩略图的APIs. |
xxxxxxxxxx├── framework│ └── base│ ├── lindgpio│ ├── lindinputevent│ ├── lindirtx│ ├── lindmix│ ├── lindmodbus│ ├── lindmotor│ ├── lindpcmdsp│ ├── lindrpc│ ├── lindutils│ ├── lindzcfg│ ├── Makefile│ ├── misc│ └── readme.md这里是lindsdk一下基础组件的接口定义.
| Header Files | Instruction |
|---|---|
| lindgpio | GPIO操作的接口。 |
| lindinputevent | 按键事件的接口,支持短按、长按事件。 |
| lindirtx | 基于PWM实现的NEC红外遥控器发送接口。 |
| lindmix | 音频通路配置的接口。 |
| lindmodbus | RS485-modbus的接口。 |
| lindmotor | 马达运动控制的接口。 |
| lindpcmdsp | 声音检测和一些音频特征提取的APIs。 |
| lindrpc | 一套临时的远程过程调用库。 |
| lindutils | 一些常用的基础库。 |
| lindzcfg | 自定义的一套简单的零配置通信协议,支持在同一个网段内的设备注册、查询,支持热插拔。 |
| misc | 其他一些常用的功能封装,例如磁盘管理、夜视检测(IR-CUT)、图像运动检测、马达控制、内核事件、WiFi操作等。 |
xxxxxxxxxx├── sample│ ├── lindcamera│ ├── lindesplayer│ ├── lindjpg│ ├── lindplayer│ ├── sample_midi│ ├── sample_adev│ ├── sample_ffdemux│ ├── sample_lindzcfg│ ├── sample_ldt_cli│ ├── sample_ldt_dev│ ├── sample_ldt_ioctrl│ ├── sample_lindnet│ ├── sample_lindsink_rtp│ ├── sample_lindsource_rtp│ └── sample_mppsrc_2_lindsinklindcamera是一个相机应用的参考实现。
| 功能 | 详细说明 |
|---|---|
| 采集和预览 | 支持打开、关闭,支持采集分辨率和帧率设置 |
| 录像 | 支持单文件录像和分片连续录像,支持最大录像文件时长或大小设置 |
| 拍照 | 支持抓拍,录像中抓拍,支持照片分辨率设置 |
| 缩略图 | 录像完成后自动生成jpg缩略图 |
| OSD | 支持文字、BMP水印 |
| 推流 | 支持RTSP服务器推流 |
命令行参数说明如下:
xxxxxxxxxxUsage: lindcamera <options>other options parameters: -id [camera_id] : set the camera id to be opened -path [save_path] : set the path to save picture or video file, default '/mnt/UDISK' -s | -cap_size [w h] : set video capture size, default 1920x1080 -ss | -cap_size_sub [w h] : set sub video capture size, default 1280x720 -f | -framerate [framerate] : set video framerate, default 30fps -vt | -venc_type [h264/h265] : set video encode type, default h.264 -vs | -venc_size [w h] : set video encode size, default 1920x1080 -vb | -bitrate [bitrate] : set video encode bitrate in unit bps, default 5*1024*1024bps or 5Mbps -ts | -thumb_size [w h] : set video thumbnail size, default 480x272 -ps | -pic_size [w h] : set picture size, default 1920x1080 -dp | -disp_pos [x y w h] : set the video display position on the screen -dr | -disp_rotate [rotate] : set the video display rotate degree, '0, 90, 180, 270' -ar | -sample_rate [rate] : set the audio capture sample rate -mt | -mux_type [mp4/ts] : set video recorder muxer type, default 'mp4' -md | -max_duration [time_ms]: set max file duration of a single video recording file, unit: ms, default: 4hr -ms | -max_size [bytes] : set max file size of a single video recording file, unit: byte, default: 8GB -ml | -mux_loop : enable loop recording, default: disable such as: lindcamera or: lindcamera -id 0 -path /tmp -s 3840 2160 -f 30 -ss 1920 1080 -vt h264 -vs 1920 1080 -vb 5000000 -ar 16000 -mt ts -md 300000 -ms 256000000 -ml -ts 480 272 -ps 3840 2160 -dp 0 0 1280 720 -dr 90 After lindcamera is running, there are some useful command: 'q' or 'Q': exit this app 'r' or 'R': start or stop recording 'p' or 'P': taking picture 'z' or 'Z': zoom out/in 'v' or 'V': callback video es 'y' or 'Y': callback yuv frame 'a' or 'A': callback audio es 'm' : callback pcm frame 'M' : set audio encode mute or not 's' or 'S': start a rtsp serverlindplayer是一个媒体播放器的参考实现,支持本地音频、视频、流媒体等的播放。
命令行参数说明如下:
xxxxxxxxxxusage: lindplayer <url> <options> url : 'url' is the media file/stream to playback. : If 'url' is set to '-zcfg', the player will try to get a lindeni rtsp server url by 'lindzcfg'. : Of course the lindeni rtsp server should run first. other options parameters: -p [x y w h] : set the playback display position on the screen. -r [rotate] : set the display rotate degree, '0, 90, 180, 270'. -live : indicate this is a live stream. -tcp : rtsp stream use tcp transport, if this is not set default use udp. -an : playback ignore audio stream. -vn : playback ignore video stream. such as: lindplayer movie.ts -r 90 as: lindplayer -zcfg or: lindplayer http://192.168.1.102/test or: lindplayer rtsp://192.168.1.102/test -live使用“-zcfg”参数进行播放时,无需手动输入url。 但请先运行支持lindzcfg的RTSP流媒体服务器,例如:lindcamera或sample_mppsrc_2_livesink
lindesplayer是一个H264/H265的裸码流播放器。
命令行参数说明如下:
xxxxxxxxxxUsage: lindesplayer [es_file] <options> other options parameters: -h [help] : print this usage -s [screen_w, h] : screen width & height, default '1280 720' -m [multi_player] : number of player instance, '1, 2, 3, 4', default: 1 -r [rotate] : video rotation degree, '0, 90, 180, 270', default 0 -f [fps] : video frame rate, default 60 -c [codec] : video codec type, 'h264' or 'h265', default 'h264' such as: lindesplayer /mnt/extsd/1.h264 or: lindesplayer /mnt/extsd/1.h264 -m 4 -r 90 -f 30 -s 480 854lindjpg是一个jpg图片浏览器,支持单张显示和幻灯片模式显示。
命令行参数说明如下:
xxxxxxxxxxUsage: lindjpg [jpg_file]other options parameters: -h [help] : print this usage -s [screen_w h] : screen width & height, default '1280 720' -m [multi_player] : number of player instance, '1, 2, 3, 4', default: 1 -r [rotate] : video rotation degree, '0, 90, 180, 270', default: 0 -t [tm_ms] : duration of each picture, default: 5000 -max [max_w, h] : max output size -slide : slide mode to play all jpg in 'argv[1]' such as: lindjpg /mnt/extsd/1.jpg or: lindjpg /mnt/extsd/1.jpg -m 4 -r 90 or: lindjpg /mnt/extsd/ -slide -t 1000 -r 90sample_midi是一个midi音乐播放器。
命令行参数说明如下:
xxxxxxxxxxUsage: sample_midi [midi_file] <options> [midi_file] : the midi file path.options can be this: -l [loop_count] : loop playback for aging test. -d [device] : audio output device, 0: codec, 1: hdmi, default: 1. -c [channel] : channels for audio output. -r [rate] : sample rate for audio output. -v [volume] : volume range: [0, 100].such as: sample_midi /tmp/1.midi -d 0 -c 1 -r 16000sample_adev是一个音频采集+播放loopback的示例。
默认参数运行后,会将从MIC录音,然后再将其从Line-out输出。
命令行参数说明如下:
xxxxxxxxxxUsage: sample_adev <options> options parameters: -i [adev_in] : audio input device id, 0: codec, 1: hdmi, default '0' -o [adev_out] : audio output device id, 0: codec, 1: hdmi, default '0' -c [channels] : audio capture/output channels, default '1' -r [sample_rate]: audio capture/output sample rate, default '48000' -t [time_s] : test duration in seconds, default '5' such as: sample_adev or: sample_adev -i 0 -o 1 -c 2 -r 16000sample_ffdemux是一个媒体文件解析的示例。
示例可以解析常见的mp4、ts、MP3等媒体文件或流媒体,得到音视频的裸码流,示例可以通过参数配置直接播放一个MP3音乐文件。
命令行参数说明如下:
xxxxxxxxxxUsage: sample_ffdemux [media_file] <options>options can be this: -an : disable audio stream. -vn : disable video stream. -l [loop_count] : loop playback for aging test. -d [device] : audio output device, 0: codec, 1: hdmi, default: 0. -c [channel] : channels for audio output. -r [rate] : sample rate for audio output.such as: sample_ffdemux /mnt/extsd/1.mp3 -d 0 -c 1 -r 16000lindzcfg是我司自定义的一套简单的零配置通信协议,支持在同一个网段内的设备注册、查询,支持热插拔。
编译后会生成sample_lindzcfg_cli和sample_lindzcfg_srv两个应用。
sample_lindzcfg_srv是服务提供者,启动时会向网段内注册服务(告知其能提供何种服务器),其他设备(client)可以收到一个相应的消息,得知有一个新的服务提供者已经准备好了,如有需要可以与其连接进行通信。
sample_lindzcfg_cli是服务的使用者或客户端,除了被动接收服务注册消息外,还可以主动查询网段内是否有相应的服务提供者。
这一对sample演示了server提供者如果注册服务,client端如果接收和查询服务。
sample_lindzcfg_srv命令行参数说明如下:
xxxxxxxxxxUsage: sample_lindzcfg_srv without any argvsAfter sample_lindzcfg_srv is running, there are some useful command: 'q' or 'Q': exit this app 'r' or 'R': register a 'ZCFG_SRV_RTSP_URL' serversample_lindzcfg_cli命令行参数说明如下:
xxxxxxxxxxUsage: sample_lindzcfg_cli without any argvsAfter sample_lindzcfg_cli is running, there are some useful command: 'q' or 'Q': exit this app 'f' : query a 'ZCFG_SRV_RTSP_URL' server 'F' : query a 'ZCFG_SRV_DHCP' server这是一组基于lindtunnel实现的LAN IPCamera示例,sample_ldt_dev是IPCamera端的参考实现,sample_ldt_cli是远程监控端APP的参考实现。
sample_ldt_dev命令行参数说明如下:
xxxxxxxxxxUsage: sample_ldt_dev -u [uid] -p [password] -u [uid] : the uid of this device, defaut: '0001' -p [password] : the password of this device, defaut: '666666' : 'ldt_client' can connect this device by 'uid' & 'password' such as: sample_ldt_dev -u 0001 -p 666666sample_ldt_cli命令行参数说明如下:
xUsage: sample_ldt_cli -u [uid] -p [password] -u [uid] : the uid of ldt_device, defaut: '0001' -p [password] : the password of ldt_device, defaut: '666666' such as: sample_ldt_cli -u 0001 -p 666666
After sample_ldt_cli is running, there are some useful command: 'q' or 'Q': exit this app 'f' or 'F': find ldt_devices 'c' : connect the ldt_dev by 'uid' 'C' : disconnect the ldt_dev 'g' : create a channel group 'G' : destory the channel group 'v' : request a remote video stream 'V' : stop the remote video stream 'a' : request a remote audio stream 'A' : stop the remote audio streamClient实现对Device的控制,需要将ldt_server运行起来!
编译后生成sample_ldt_ioctrl_dev和sample_ldt_ioctrl_cli,这是一组基于lindtunnel实现的自定义指令使用的示例,可用于跨进程通信。
sample_lindnet是基于lindnet的一个示例代码,实现一对一的server端和client消息发送,client端给server端发送消息,server端将收到的消息loopback发回给client。
命令行参数说明如下:
xxxxxxxxxxUsage: sample_lindnet -s/-c -i [ip] -p [port] -udp/-tcp/-rdt. -s : run as a server -c : run as a client -i [ip] : the server ip -p [port] : the server port -udp : use udp protocol -tcp : use tcp protocol -rdt : use rdt protocol such as: sample_lindnet -s -i 192.168.1.2 -p 9980 -udp : sample_lindnet -c -i 192.168.1.2 -p 9980 -rdt
First launch the server, then run a client to connect the server.Then you can send msgs from client to the server.
- 支持UDP、TCP和RDT传输协议,server端和client端必须采用相同的协议;
- 如采用TCP或RDT,需要先启动server端;
这两个sample基于lindsink和lindsource实现了rtp推流和接收的示例:
sample_lindsink_rtp:“camera采集 -> 视频编码 -> rtp发送”
sample_lindsource_rtp:“rtp接收 -> 视频解码 -> 显示输出”
sample_lindsink_rtp命令行参数说明如下:
xxxxxxxxxxUsage: sample_lindsink_rtp <options>. -i [ip] : the ip addr of the rtp stream receiver -p [port] : the port of the rtp stream receiver, default '9980' -pt [payload] : payload type, default '96' -udp/-rdt : use udp or rdt protocol, default 'udp' : If use 'rdt' protocol, should run 'sample_lindsource' before 'sample_lindsink'. -h264/-h265 : video encode type, default 'h264' -br [bitrate] : video encode bitrate, default '2000000' -s [w h] : video capture size, default '1920 1080' -vs [w h] : video encode size, default '1920 1080' such as: sample_lindsink_rtp -i 192.168.1.2 -p 9980 -rdtsample_lindsource_rtp命令行参数说明如下:
xxxxxxxxxxUsage: sample_lindsource_rtp <options> -i [ip] : the ip addr of the rtp stream receiver -p [port] : the port of the rtp stream receiver, default '9980' -pt [payload] : payload type, default '96' -udp/-rdt : use udp or rdt protocol, default 'udp' : If use 'rdt' protocol, should run 'sample_lindsource' before 'sample_lindsink'. -h264/-h265 : video encode type, default 'h264' such as: sample_lindsource_rtp -i 192.168.1.2 -p 9980 -rdt如采用RDT,需要先启动lindsource端;
编译后会生成sample_mppsrc_2_ffsink和sample_mppsrc_2_livesink两个应用。从camera采集音视频编码后,前者通过ffmpeg的muxer进行流媒体推送或者保存文件;后者通过live555生成rtsp服务器。
采集音视频进行编码后,通过ffmpeg的muxer进行流媒体推送或者保存文件,其命令行参数说明如下:
xxxxxxxxxxUsage: sample_mppsrc_2_ffsink <options>options can be this: -i [ip] : the ip address of rtsp server, default getting from the eth0 or wlan0. -p [port] : the port of rtsp server, default '8554'. -n [name] : the name rtsp server, default 'live'. -s [w h] : video capture size, default '1920 1080' -f [fps] : video capture and encoder framerate, default '30' -vs [w h] : video encoding size, default '1920 1080' -vt [h264/h265] : video encoding type, default 'h264' -vb [bitrate] : video encoding bitrate in unit bps, default 2*1024*1024bps -disable_preview : default enable preview -dr [rotate] : display rotate degree -pos [x y w h] : capture preview position on the screen, default full screen -t [type] : the sink type, can be 'mpegts/mp4/rtp/rtp_mpegts/rtsp/rtmp'such as: sample_mppsrc_2_ffsink -t rtp_mpegts -i 192.168.3.118 -p 12345 sample_mppsrc_2_ffsink -t rtp -i 192.168.3.118 -p 12342 -n test sample_mppsrc_2_ffsink -t mp4 -n /tmp/out.mp4 sample_mppsrc_2_ffsink -t mpegts -n /tmp/out.ts使用ffsink的rtp推流(非rtp_mpegts)需要注意以下几点:
- 接收端需要使用sdp进行播放;
- 只能推送音频或者视频,一个端口不可以同时payload音视频;
- 端口号需设置为偶数;
sample_mppsrc_2_ffsink运行后在日志中可以看到SDP的内容如下,将其保存为后缀为sdp的文件,即可用VLC等播放器进行播放。
xxxxxxxxxxv=0o=- 0 0 IN IP4 127.0.0.1s=No Namec=IN IP4 0.0.0.0t=0 0a=tool:libavformat 58.12.100m=video 8554 RTP/AVP 96a=rtpmap:96 H264/90000a=fmtp:96 packetization-mode=1m=audio 6668 RTP/AVP 97使用rtp_mpegts推流,在播放器中可以直接用url(rtp://ip:port/name)进行播放
采集音视频进行编码后,通过live555创建rtsp服务器,其命令行参数说明如下:
xxxxxxxxxxUsage: sample_mppsrc_2_livesink <options>options can be this: -i [ip] : the ip address of rtsp server, default getting from the eth0 or wlan0. -p [port] : the port of rtsp server, default '8554'. -n [name] : the name rtsp server, default 'live'. -s [w h] : video capture size, default '1920 1080' -f [fps] : video capture and encoder framerate, default '30' -vs [w h] : video encoding size, default '1920 1080' -vt [h264/h265] : video encoding type, default 'h264' -vb [bitrate] : video encoding bitrate in unit bps, default 2*1024*1024bps -disable_preview : default enable preview -dr [rotate] : display rotate degree -pos [x y w h] : capture preview position on the screen, default full screenThe rtsp server url is: rtsp://[ip]:[port]/[name]You can also find the server url in the log. such as: rtsp url: rtsp://192.168.3.168:8554/liveThen, you can playback the url by streaming player such as 'vlc'.sample_mppsrc_2_livesink运行后,在播放器中可以直接用url(rtsp://ip:port/name)进行播放
xxxxxxxxxxrepo init -u https://gitee.com/lindenis/manifest.git -b lindsdk -m lindsdk.xmlrepo syncxxxxxxxxxxsource build/envsetup.sh
xxxxxxxxxxmake
脚本位于build/configs/config_XXX.sh
通过make_release_rootfs指令,将lindsdk生成的二进制文件拷贝到linux SDK的rootfs中,再通过linux SDK的打包工具打包到固件中。
xxxxxxxxxxmake_release_rootfs [path] // 指定rootfs的绝对路径
// 例如:make_release_rootfs /home/workspace/v833-tina/target/allwinner/v833-lindenis/prebuiltslindsdk采用ini格式配置文件,路径位于:
xxxxxxxxxxv536: depends/v536-Lindenis_SBC/etc/lindsdk.iniv833: depends/v833-lindenis/etc/lindsdk.inilindsdk.ini定义了device、lindsdk、debug、lindmpp等sections。
| sections | 说明 |
|---|---|
| device | 定义设备商、产品名称、型号、版本等信息 |
| lindsdk | 定义用户数据分区(可写)、日志等级、日志保存路径等信息 |
| debug | 定义常用的调试开关 |
| lindmpp | 定义mpp的通道 |
| app_xxx | 用户自定义section,用于用户扩展配置信息 |
例如,在debug section中定义了如下调试开关:
xxxxxxxxxx;; define a writable directory to save dbg data;dir_dgb_data = "/tmp";; save video/audio raw/es to file; used in such as: lindipcam, sample_xxx; 0: disable, 1: enable;dbg_save_video_es = 0dbg_save_audio_es = 0dbg_save_video_yuv = 0dbg_save_audio_pcm = 0
可在源码中(参考lindcamera)通过如下方式获取配置:
xxxxxxxxxx/** * get dbg flag from "/etc/lindsdk.ini" */p_ctx->i_dbg_save_aenc = ldprop_get_boolean(SECTION_DEBUG, "dbg_save_audio_es", 0);p_ctx->i_dbg_save_pcm = ldprop_get_boolean(SECTION_DEBUG, "dbg_save_audio_pcm", 0);if (p_ctx->i_dbg_save_aenc){ char file_path[256] = {0}; for (i = 0; i < MULTI_AENC_CNT; i++) { sprintf(file_path, "%s/audio%d.es", ldprop_get_string(SECTION_DEBUG, "dir_dgb_data", "/tmp"), i); p_ctx->fd_dbg_aenc[i] = fopen(file_path, "wb"); if (NULL == p_ctx->fd_dbg_aenc[i]) { loge("Open %s file error", file_path); return -1; } }}if (p_ctx->i_dbg_save_pcm){ char file_path[256] = {0}; sprintf(file_path, "%s/audio.pcm", ldprop_get_string(SECTION_DEBUG, "dir_dgb_data", "/tmp")); p_ctx->fd_dbg_pcm = fopen(file_path, "wb"); if (NULL == p_ctx->fd_dbg_pcm) { loge("Open %s file error", file_path); return -1; }}源码中使用时依赖头文件:osal_prop.h,库:libldutils.so
| 键(key) | 值(value) | 说明 |
|---|---|---|
| version | 0x01000000 | 版本号 |
| camera0 | 0: disable, 1: enable | 使能标记;当有多个video设备时,可以增加camera1、camera2、...配置 |
| camera0_dev_main | 0: /dev/video0, 1: /dev/video1, ... | 主通道的video设备节点ID |
| camera0_dev_sub | 0: /dev/video0, 1: /dev/video1, ... | 子通道的video设备节点ID;使用ISP的video设备会有子通道 |
| camera0_dev_isp | 0: ISP0, 1: ISP1 | 指定使用哪一路ISP,V5有2个ISP,V536/V833有1路ISP;如果不通过ISP的video设备(比如HDMI in)配置-1 |
| camera0_tunnel_record | 格式: [vi_dev,vi_chn,venc_chn,ai_dev,ai_chn,aenc_chn] | 录像通道定义 |
| camera0_tunnel_picture | 格式: [vi_dev,vi_chn,venc_chn] | 拍照通道定义 |
| camera0_tunnel_vencN | 格式: [vi_dev,vi_chn,venc_chn] | 编码数据通路定义,最多3路 |
| camera0_tunnel_yuvN | 格式: [vi_dev,vi_chn] | YUV数据通路定义,最多2路 |
| camera0_tunnel_preview | 格式: [vi_dev,vi_chn,vo_dev,vo_chn] | 预览通路定义 |
| camera0_tunnel_osdN | 格式: [mod_id,dev_id,chn_id] | OSD通路定义,最多8路 |
- 一个摄像头可以对应一组上述配置,打开摄像头时根据指定的camera id采用对应的参数;
- 对使用主控ISP的摄像头,可以产生2个video节点,分别对应主设备(camera0_dev_main)和子设备(camera0_dev_sub),这两个设备可以独立使用;
- 对不通过ISP的video设备(例如:hdmi in),只会有一个主video设备;
- 不需要的通路可以赋值-1;
- camera0的使用请参考lindcamera的源码。
xxxxxxxxxxversion = 0x01000000 ; v1.0.0.0camera0 = 1 ; 0: disable, 1: enablecamera0_dev_main = 0 ; video devices id, 0: /dev/video0, 1: /dev/video1, ...camera0_dev_sub = 1 ; video devices id, 0: /dev/video0, 1: /dev/video1, ...camera0_dev_isp = 0 ; isp devices idcamera0_tunnel_record = 0,0,0,0,0,0 ; record tunnel, format: [vi_dev,vi_chn,venc_chn,ai_dev,ai_chn,aenc_chn]camera0_tunnel_picture = 0,1,1 ; picture tunnel, format: [vi_dev,vi_chn,venc_chn]camera0_tunnel_venc0 = 0,2,2 ; video encode tunnel, format: [vi_dev,vi_chn,venc_chn]camera0_tunnel_venc1 = 0,3,3 ; video encode tunnel, format: [vi_dev,vi_chn,venc_chn]camera0_tunnel_venc2 = 1,2,4 ; video encode tunnel, format: [vi_dev,vi_chn,venc_chn]camera0_tunnel_yuv0 = -1,-1 ; yuv tunnel, format: [vi_dev,vi_chn]camera0_tunnel_yuv1 = 1,3 ; yuv tunnel, format: [vi_dev,vi_chn]camera0_tunnel_preview = 1,0,2,0 ; preview tunnel, format: [vi_dev,vi_chn,vo_dev,vo_chn]camera0_tunnel_osd0 = 16,1,-1 ; osd tunnel, format: [mod_id,dev_id,chn_id], mod_id(16: vi, 8: venc)camera0_tunnel_osd1 = 16,1,-1 ; osd tunnel, format: [mod_id,dev_id,chn_id], mod_id(16: vi, 8: venc)camera0_tunnel_osd2 = 8,0,0 ; osd tunnel, format: [mod_id,dev_id,chn_id], mod_id(16: vi, 8: venc)
camera1 = 0 ; 0: disable, 1: enablecamera1_dev_main = 2 ; video devices id, 0: /dev/video0, 1: /dev/video1, ...camera1_tunnel_record = 2,0,5,0,1,1 ; record tunnel, format: [vi_dev,vi_chn,venc_chn,ai_dev,ai_chn,aenc_chn]camera1_tunnel_picture = 2,1,6 ; picture tunnel, format: [vi_dev,vi_chn,venc_chn]camera1_tunnel_venc0 = 2,2,7 ; video encode tunnel, format: [vi_dev,vi_chn,venc_chn]camera1_tunnel_preview = 2,0,2,0 ; preview tunnel, format: [vi_dev,vi_chn,vo_dev,vo_chn]camera1_tunnel_osd0 = 16,2,-1 ; osd tunnel, format: [mod_id,dev_id,chn_id], mod_id(16: vi, 8: venc)camera1_tunnel_osd1 = 8,2,0 ; osd tunnel, format: [mod_id,dev_id,chn_id], mod_id(16: vi, 8: venc)lindsdk附带的工具可以查看或修改lindsdk.ini配置文件,使用方法如下:
xxxxxxxxxxUsage: lindprop lindprop get [section:key] lindprop set [section:key] [value]such as: lindprop get lindsdk:log_level lindprop set lindsdk:log_level 3这是音频通路配置文件,可以通过lindmix.h的接口来配置音频输入输出通路。

