Brief introductionLindSDK featuresHardware platformLindSDK structureDirectory structureTop Structureframework/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_livesinkHow to use?Build LindSDKPackage firmwareConfiguration fileslindsdk.inisection:debugsection:lindmpplindproplindmix.iniTypical application scenariosPlayerRecorderStreamerIPCameraBabymonitor
Lindsdk is a product development tool set for video encoding, decoding and transmission based on embedded platform (ARM/RISC-V Linux/RTOS) developed by Zhuhai Lindenis Technology Co., Ltd(珠海六点智能科技有限公司).
At present, the supported hardware platforms are as follows.
The architecture diagram of lindsdk is as follows, which is divided into OS layer, dependencies (3rd Library) layer, framework layer and app layer from bottom to top.
.
├── build
├── depends
├── framework
│ ├── av
│ └── base
├── Makefile -> build/Makefile
├── out
│ ├── v833-lindenis
│ └── v536-Lindenis_SBC
├── sample
└── toolchains
build
These are the lindsdk build scripts.
depends
These are the libriaris of lindsdk.
framework/av
These are the media(audio/video/transport) related APIs(Header file).
See more details in chapter: framework/av
framework/base
These are the other useful APIs(Header file).
See more details in chapter: framework/base
sample
These are the samples of lindsdk.
See more details in chapter: sample
toolchains
These are the cross compile tool chains.
out
Save the target binaries.
xxxxxxxxxx
├── framework
│ ├── av
│ │ ├── avwrapper
│ │ ├── component
│ │ ├── lindnet
│ │ ├── lindplayer
│ │ ├── lindtunnel
│ │ ├── mpp_source
│ │ ├── Makefile
│ │ └── readme.md
These are APIs for the audio/video hardware device.
Header Files | Instruction |
---|---|
adev_wrapper.h | APIs for Audio input/output. |
disp_wrapper.h | APIs for display layer controls, used for video output. |
g2d_wrapper.h | APIs for graphic 2D controls, now support YUV copy/rotate. |
palloc_wrapper.h | APIs for physical memory management. |
vdec_wrapper.h | APIs for hardware video decoder. |
These are APIs for the media process.
Header Files | Instruction |
---|---|
lindcomponent.h | The common structure define of LindSDK. |
ffcodec.h | Audio encode & decode APIs based ffmpeg. |
ffdemux.h | Media parser APIs based ffmpeg. |
ffsink.h | Media muxer APIs based ffmpeg. |
livesink.h | RTSP server APIs based Live555. |
lindsink.h | Unified media sink(stream/file) APIs, It is the wrappers of ffsink & livesink & lindrtpsink. |
lindsource.h | Unified media source APIs, now only support lindrtpsource. |
lindapm.h | APIs for Acoustic Echo Cancelling(AEC)/Noise Suppression(NS). |
mididec.h | APIs for MIDI audio decode. |
These are APIs for media playback.
Reference application in sample: lindplayer, lindesplayer, lindjpg
Header Files | Instruction |
---|---|
lindplayer.h | Media player APIs, support common media file(mp4,ts...) and stream video(rtsp,hls,http...). |
lindesplayer.h | APIs for H264/H265 element stream playback. |
lindjpeg.h | APIs for jpg picture decode/playback. |
These are the wrappers for the most commonly used socket APIs.
Lindnet supports TCP/UDP/RDT protocols. RDT is as a basic communication protocol for 'lindtunnel'.
'lindtunnel' is an easy LAN communication library for multi-devices.
It consists of three roles: the server, the devices and the clients.
It's original requirements are below:(LAN IPcamera)
Header Files | Instruction |
---|---|
lindtunnel.h | The main APIs of tunnel. |
ldt_ioctrl_def.h | A set of command define for IP cameras. 'sample_ldt_dev' & 'sample_ldt_cli' are demos of a simple IP camera. |
ldt_error.h | The error code define. |
These are the wrappers for the audio/video capturing & encoding.
Reference application in sample: lindcamera
Header Files | Instruction |
---|---|
mpp_camera.h | APIs for camera capture/preview. APIs of video recorde/encode. APIs of taking pitcute. APIs of video OSD. |
mpp_audio.h | APIs for video capture and encode. |
mpp_thumb.h | APIs for video thumbnail retriever. |
xxxxxxxxxx
├── framework
│ └── base
│ ├── lindgpio
│ ├── lindinputevent
│ ├── lindirtx
│ ├── lindmix
│ ├── lindmodbus
│ ├── lindmotor
│ ├── lindpcmdsp
│ ├── lindrpc
│ ├── lindutils
│ ├── lindzcfg
│ ├── Makefile
│ ├── misc
│ └── readme.md
These are basic APIs of lindsdk.
Header Files | Instruction |
---|---|
lindgpio | APIs for GPIO controls. |
lindinputevent | APIs for the key event. Support key event of short press and long press. |
lindirtx | APIs for NEC code encode by PWM and do infrared emission. |
lindmix | APIs for audio mixer configuation. |
lindmodbus | APIs for RS485-modbus. |
lindmotor | APIs for the motion control of motors. |
lindpcmdsp | APIs for a simple audio detector and the sound feature extraction. |
lindrpc | APIs for a temporary Remote Procedure Call Protocol(RPC). |
lindutils | APIs for the most frequently used functions. |
lindzcfg | APIs for a basic zero-config libriary. |
misc | APIs for other useful functions. |
xxxxxxxxxx
├── sample
│ ├── lindcamera
│ ├── lindesplayer
│ ├── lindjpg
│ ├── lindplayer
│ ├── Makefile
│ ├── sample_adev
│ ├── sample_ffdemux
│ ├── sample_ldt_cli
│ ├── sample_ldt_dev
│ ├── sample_ldt_ioctrl
│ ├── sample_lindnet
│ ├── sample_lindsink_rtp
│ ├── sample_lindsource_rtp
│ ├── sample_lindzcfg
│ ├── sample_midi
│ └── sample_mppsrc_2_lindsink
Lindcamera is a reference implementation of camera application.
functions | description |
---|---|
Acquisition & Preview | Support the opening and closing of the camera, and settings of resolution and frame rate. |
Record | Support single file recording and continuous loop recording, and support the setting of maximum recording file length or size. |
Take picture | Support capture, capture in video, and support photo resolution setting. |
Thumbnail | Automatically generate JPG thumbnails after recording. |
OSD | Support text and BMP watermark. |
Streaming | Support RTSP/FFmpeg server streaming. |
The command line parameters are described below:
xxxxxxxxxx
Usage:
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 server
Lindplayer is a reference implementation of media player, which supports the playback of local audio, video and streaming media.
The command line parameters are described below:
xxxxxxxxxx
usage:
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
When running with the "-zcfg" parameter, you do not need to enter the URL manually. However, please run the RTSP streaming media server that supports lindzcfg first, such as 'lindcamera' or 'sample_ mppsrc_ 2_ livesink'.
Lindesplayer is a H264/h265 element stream player.
The command line parameters are described below:
xxxxxxxxxx
Usage:
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 854
Lindjpg is a JPG picture browser, which supports single sheet display and slide mode display.
The command line parameters are described below:
xxxxxxxxxx
Usage:
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 90
This is a MIDI music player。
The command line parameters are described below:
xxxxxxxxxx
Usage:
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 16000
This is an example of audio acquisition and loopback ouput.
Run with the default parameters, it will collect PCM data from mic and then output it from line out.
The command line parameters are described below:
xxxxxxxxxx
Usage:
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 16000
This is an example of media file parsing.
The example can analyze common media files or streaming media such as MP4, TS and MP3 to obtain the element stream of audio and video.
The example can directly play an MP3 music file through parameter configuration.
The command line parameters are described below:
xxxxxxxxxx
Usage:
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 16000
Lindzcfg is a set of simple zero configuration communication protocol defined by our company. It supports device registration and query in the LAN and hot plug.
It will generate two applications('sample_lindzcfg_cli' and 'sample_lindzcfg_srv').
sample_lindzcfg_srv is a service provider. When starting, it will register the service in the LAN (broadcast what server it can provide). Other devices (clients) can receive a corresponding message that a new service provider is ready and can communicate with it if necessary.
sample_lindzcfg_cli is a sample client. In addition to passively receiving the service registration message, it can also actively query whether there is a service provider in the LAN.
This pair of samples demonstrates how the server provider registers the service, and the client receives and queries the service.
The command line parameters of 'sample_lindzcfg_srv' are described below:
xxxxxxxxxx
Usage:
sample_lindzcfg_srv without any argvs
After 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' server
The command line parameters of 'sample_lindzcfg_cli' are described below:
xxxxxxxxxx
Usage:
sample_lindzcfg_cli without any argvs
After 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
This is a set of LAN IPcamera examples based on lindtunnel. 'sample_ldt_dev' is the reference implementation of IPcamera, 'sample_ldt_cli' is the reference implementation of remote monitoring app.
The command line parameters of 'sample_ldt_dev' are described below:
xxxxxxxxxx
Usage:
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 666666
The command line parameters of 'sample_ldt_cli' are described below:
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 stream
To control the device by the client, you need to run the 'ldt_server'!
It will generate two applications('sample_ldt_ioctrl_dev' and 'sample_ldt_ioctrl_cli'), which are examples of custom instructions based on lindtunnel. It can also be used for cross process communication.
This is an example based on lindnet, which realizes one-to-one message sending. The client sends messages to the server, and the server loopback the received message to the client.
The command line parameters are described below:
xxxxxxxxxx
Usage:
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.
- Support UDP, TCP and RDT transmission protocols. The server and client must adopt the same protocol;
- If TCP or RDT is adopted, the server side needs to be started first;
These two samples implement RTP streaming and receiving examples based on lindsink and lindsource:
sample_lindsink_rtp:"Camera acquisition -> video encoding -> RTP sending"
sample_lindsource_rtp:"RTP reception -> video decoding -> display output"
The command line parameters of 'sample_lindsink_rtp' are described below:
xxxxxxxxxx
Usage:
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 -rdt
The command line parameters of 'sample_lindsource_rtp' are described below:
xxxxxxxxxx
Usage:
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
If RDT is adopted, the lindsource end needs to be started first;
编译后会生成sample_mppsrc_2_ffsink和sample_mppsrc_2_livesink两个应用。从camera采集音视频编码后,前者通过ffmpeg的muxer进行流媒体推送或者保存文件;后者通过live555生成rtsp服务器。
It will generate two applications('sample_mppsrc_2_ffsink' and 'sample_mppsrc_2_livesink').
This sample collects video frame from the camera and audio PCM from audio codec, and encoding them, then push the streaming media or save the file through the Muxer of ffmpeg.
The command line parameters are described below:
xxxxxxxxxx
Usage:
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
RTP streaming (non rtp_mpegts) using ffsink should pay attention to the following points:
- The receiver(player) needs to use SDP to play;
- Only audio or video can be pushed, and one port cannot simultaneously payload audio and video;
- The port number should be set to an even number;
After this sample runs, you can see the contents of SDP in the log as follows. Save them as a file with the suffix SDP. Then it can be played by players such as VLC.
xxxxxxxxxx
v=0
o=- 0 0 IN IP4 127.0.0.1
s=No Name
c=IN IP4 0.0.0.0
t=0 0
a=tool:libavformat 58.12.100
m=video 8554 RTP/AVP 96
a=rtpmap:96 H264/90000
a=fmtp:96 packetization-mode=1
m=audio 6668 RTP/AVP 97
For 'rtp_mpegts' streaming, you can play it by URL like this: rtp://ip:port/name
This sample show collecting audio and video for encoding, and creatint a RTSP server based live555.
The command line parameters are described as follows:
xxxxxxxxxx
Usage:
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 screen
The 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/live
Then, you can playback the url by streaming player such as 'vlc'.
After sample_mppsrc_2_livesink starts, you can play it by URL like this: rtsp://ip:port/name
xxxxxxxxxx
repo init -u ssh://XXX/manifest.git -b lindsdk
repo sync
xxxxxxxxxx
source build/envsetup.sh
xxxxxxxxxx
make
The packaging script is located in 'build/configs/config_XXX.sh'.
Through make_release_rootfs command copies the binary files generated by lindsdk into rootfs of the Linux SDK, and then packs them into firmware through the packaging tool of the Linux SDK.
xxxxxxxxxx
make_release_rootfs [path] // Specifies the absolute path of rootfs
// for example:
make_release_rootfs /home/workspace/v833-tina/target/allwinner/v833-lindenis/prebuilts
Lindsdk adopts ini format configuration file, and the path is:
xxxxxxxxxx
v536: depends/v536-Lindenis_SBC/etc/lindsdk.ini
v833: depends/v833-lindenis/etc/lindsdk.ini
lindsdk.ini defines sections such as device, lindsdk, debug, lindmpp, etc.
sections | description |
---|---|
device | Define the equipment manufacturer, product name, model, version and other information |
lindsdk | Define the writable user data partition, log level, log saving path and other information |
debug | Define common debugging switches |
lindmpp | Define the channel of MPP |
app_xxx | Customer section, which is used to extend the configuration information |
For example, the debug section defines the following debug switches:
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 = 0
dbg_save_audio_es = 0
dbg_save_video_yuv = 0
dbg_save_audio_pcm = 0
The configuration can be obtained in the source code (refer to lindcamera) in the following ways:
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;
}
}
It depends on the header file of 'osal_prop.h' and the library 'libldutils.so'
键(key) | 值(value) | 说明 |
---|---|---|
version | 0x01000000 | version |
camera0 | 0: disable, 1: enable | Enable mark; When there are multiple video devices, create another set of configurations of camera1, camera2, ... |
camera0_dev_main | 0: /dev/video0, 1: /dev/video1, ... | Video device node ID of the main channel |
camera0_dev_sub | 0: /dev/video0, 1: /dev/video1, ... | Video device node ID of the subchannel; Video devices using ISPs have subchannels. |
camera0_dev_isp | 0: ISP0, 1: ISP1 | Specify which ISP to use. There are two ISPs in V5 and one ISP in v536/v833; Set '-1' for video device without ISP (such as HDMI in) |
camera0_tunnel_record | format: [vi_dev,vi_chn,venc_chn,ai_dev,ai_chn,aenc_chn] | Video record channel definition |
camera0_tunnel_picture | format: [vi_dev,vi_chn,venc_chn] | Takeing picture channel definition |
camera0_tunnel_vencN | format: [vi_dev,vi_chn,venc_chn] | Encoded channel definition, up to 3 channels |
camera0_tunnel_yuvN | format: [vi_dev,vi_chn] | YUV data channel definition, up to 2 channels |
camera0_tunnel_preview | format: [vi_dev,vi_chn,vo_dev,vo_chn] | Preview channel definition |
camera0_tunnel_osdN | format: [mod_id,dev_id,chn_id] | OSD channel definition, up to 8 channels |
- A camera can correspond to a set of the above configurations. When opening the camera, the corresponding parameters are adopted according to the specified camera ID;
- For the camera using the ISP, two video nodes can be generated, corresponding to the master device (camera0_dev_main) and the sub device (camera0_dev_sub), which can be used independently;
- For video devices that do not use ISP (for example, HDMI in), there will only be a main video device;
- Unnecessary channle can be set '-1';
- Please refer to the source code of lindcamera.
xxxxxxxxxx
version = 0x01000000 ; v1.0.0.0
camera0 = 1 ; 0: disable, 1: enable
camera0_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 id
camera0_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: enable
camera1_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)
The tools attached to lindsdk can view or modify lindsdk.ini configuration file, which can be used as follows:
xxxxxxxxxx
Usage: lindprop
lindprop get [section:key]
lindprop set [section:key] [value]
such as:
lindprop get lindsdk:log_level
lindprop set lindsdk:log_level 3
This is the audio path configuration file. It can be accessed through interface(lindmix.h) to configure the audio input and output path.