Skip to content

Commit

Permalink
add rtsp stream video test program
Browse files Browse the repository at this point in the history
  • Loading branch information
carbonfix committed Dec 22, 2023
1 parent 417deac commit e675cf6
Show file tree
Hide file tree
Showing 226 changed files with 1,894 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
mnt/system/
mnt/cfg/
mnt/data/
usr/bin
usr/share
3 changes: 3 additions & 0 deletions buildroot-2021.05/board/milkv/milkv-duo/overlay/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
mnt/system/
mnt/cfg/
mnt/data/
usr/bin
usr/share
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
mnt/system/
mnt/cfg/
mnt/data/
usr/bin
usr/share
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
mnt/system/
mnt/cfg/
mnt/data/
usr/bin
usr/share
1 change: 1 addition & 0 deletions device/milkv-duo/overlay/mnt/cfg/param/cvi_sdr_bin
Binary file not shown.
Binary file not shown.
107 changes: 107 additions & 0 deletions device/milkv-duo/overlay/mnt/data/install/CviIspTool.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
#!/bin/sh

# Camera I2C init
/usr/bin/cvi_pinmux -w PAD_MIPIRX1P/IIC1_SDA
/usr/bin/cvi_pinmux -w PAD_MIPIRX0N/IIC1_SCL

sleep 1

#DEFAULT_HOST="192.168.1.3"

echo 16777216 > /proc/sys/net/core/wmem_max
echo "4096 873800 16777216" > /proc/sys/net/ipv4/tcp_wmem
echo "3073344 4097792 16777216" > /proc/sys/net/ipv4/tcp_mem

if [ "$1" == "64M" ]; then
CFG_JSON_FILE="./cfg_64M.json"
elif [ "$1" == "128M" ]; then
CFG_JSON_FILE="./cfg_128M.json"
else
echo "Please input size of RAM!"
echo "e.g. ./CviIspTool.sh 64M"
exit 0
fi

if [ -z "$CVI_RTSP_JSON" ]; then
export CVI_RTSP_JSON=$CFG_JSON_FILE
fi

getopts_get_optional_argument() {
eval next_token=\${$OPTIND}
if [[ -n $next_token && $next_token != -* ]]; then
OPTIND=$((OPTIND + 1))
OPTARG=$next_token
else
OPTARG=""
fi
}

# $1 is used, $2 shift to $1
shift

sed -i 's/"dev-num": 2/"dev-num": 1/g' $CFG_JSON_FILE
while getopts "hgmi" OPTION; do
case $OPTION in
i)
getopts_get_optional_argument $@
if [ -z "$OPTARG" ]; then
HOST=${DEFAULT_HOST}
else
HOST=$OPTARG
fi
echo "set the IP address $HOST to network interface"
;;
g)
GIGABIT="true"
echo "use gigabit ethernet"
;;
m)
if [ -z "$CVI_RTSP_MODE" ]; then
export CVI_RTSP_MODE=1
fi
echo "use multi rtsp server"
sed -i 's/"dev-num": 1/"dev-num": 2/g' $CFG_JSON_FILE
;;
h)
echo "Usage:"
echo " -i set the IP address to network interface"
echo " -g use gigabit ethernet"
echo " -m use multi rtsp server"
echo " -h help (this output)"
exit 0
;;
esac
done

# disable vcodec debug message to minize latency
if [ -d "/sys/module/cv181x_vcodec/" ];then
echo 0x20001 > /sys/module/cv181x_vcodec/parameters/vcodec_mask
elif [ -d "/sys/module/cv180x_vcodec/" ];then
echo 0x20001 > /sys/module/cv180x_vcodec/parameters/vcodec_mask
fi
# enable remap
echo 1 > /sys/module/cvi_vc_driver/parameters/addrRemapEn
echo 256 > /sys/module/cvi_vc_driver/parameters/ARExtraLine

#if [ "$HOST" ]; then
# if [ "$GIGABIT" == "true" ]; then
# # enable gigabit ethernet (=eth1)
# ifconfig eth0 down
# ifconfig eth1 up
# ifconfig eth1 $HOST netmask 255.255.255.0
# #udhcpc -b -i eth1 -R & # unmakr this line to use DHCP
# else
# ifconfig eth1 down
# ifconfig eth0 up
# ifconfig eth0 $HOST netmask 255.255.255.0
# #udhcpc -b -i eth1 -R & # unmark this line to use DHCP
# fi
#fi

# for eaier debugging, add $PWD to LD_LIBRARY_PATH and PATH
SCRIPT_SELF=$(cd "$(dirname "$0")"; pwd)
export LD_LIBRARY_PATH=${SCRIPT_SELF}/lib:${SCRIPT_SELF}/lib/ai:${LD_LIBRARY_PATH}:/mnt/system/usr/lib:/mnt/system/usr/lib/3rd:/lib/3rd

PATH=${SCRIPT_SELF}:/mnt/system/usr/bin:$PATH
cd ${SCRIPT_SELF}
isp_tool_daemon
49 changes: 49 additions & 0 deletions device/milkv-duo/overlay/mnt/data/install/cfg_128M.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"//": "-----------------------------------------------------------------------------------------------------------------------------------------------------",
"//": "more option please refer https://cvitekcn-my.sharepoint.com/:x:/g/personal/tjyoung_cvitek_com/EavTSnA63CNAl2ZXmKwZnaoBK45WzoKdsrEQ7gwXNxKOpQ?e=l3hgB8",
"//": "-----------------------------------------------------------------------------------------------------------------------------------------------------",
"//": "compress-mode none,tile,line,frame",
"//": "if run AI(face ae) function, make buf1-blk-cnt 4 please!",
"//": "we set venc-bind-vpss=1 can cost down vb blk",
"//": "bitstream-buf-size can set venc buffer size",
"//": "vi-vpss-mode 0.VI_OFFLINE_VPSS_OFFLINE 1.VI_OFFLINE_VPSS_ONLINE",
"//": "vi-vpss-mode 2.VI_ONLINE_VPSS_OFFLINE 3.VI_ONLINE_VPSS_ONLINE",
"//": "when it is wdr mode or dual sensor, we cant't set VI_ONLINE_VPSS_OFFLINE/VI_ONLINE_VPSS_ONLINE",
"//": "devNum decides whether to run oneRtspServer or dualRtspServer",
"//": "devNum=1 dualSensor use the same video-src-info chn0 settings",
"//": "if run sbm mode, set vi-vpss-mode 1 set venc-bind-vpss true",
"dev-num": 1,
"rtsp-port": 8554,
"buf1-blk-cnt": 0,
"vi-vpss-mode": 1,
"model": "./cvi_models/retinaface_mnet0.25_342_608.cvimodel",
"sbm": 0,
"sbm-buf-line": 64,
"sbm-buf-size": 16,
"video-src-info": [
{
"chn": 0,
"buf-blk-cnt": 2,
"venc-bind-vpss": false,
"enable-isp-info-osd": false,
"enable-retinaface": false,
"venc_json": "./vc_param_128M.json",
"codec": "265",
"gop": 50,
"bitrate": 5000,
"compress-mode": "tile"
},
{
"chn": 1,
"buf-blk-cnt": 5,
"venc-bind-vpss": false,
"enable-isp-info-osd": false,
"enable-retinaface": false,
"venc_json": "/mnt/data/vc_param.json",
"codec": "265",
"gop": 50,
"bitrate": 5000,
"compress-mode": "tile"
}
]
}
51 changes: 51 additions & 0 deletions device/milkv-duo/overlay/mnt/data/install/cfg_64M.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"//": "-----------------------------------------------------------------------------------------------------------------------------------------------------",
"//": "more option please refer https://cvitekcn-my.sharepoint.com/:x:/g/personal/tjyoung_cvitek_com/EavTSnA63CNAl2ZXmKwZnaoBK45WzoKdsrEQ7gwXNxKOpQ?e=l3hgB8",
"//": "-----------------------------------------------------------------------------------------------------------------------------------------------------",
"//": "compress-mode none,tile,line,frame",
"//": "if run AI(face ae) function, make buf1-blk-cnt 4 please!",
"//": "we set venc-bind-vpss=1 can cost down vb blk",
"//": "bitstream-buf-size can set venc buffer size",
"//": "vi-vpss-mode 0.VI_OFFLINE_VPSS_OFFLINE 1.VI_OFFLINE_VPSS_ONLINE",
"//": "vi-vpss-mode 2.VI_ONLINE_VPSS_OFFLINE 3.VI_ONLINE_VPSS_ONLINE",
"//": "when it is wdr mode or dual sensor, we cant't set VI_ONLINE_VPSS_OFFLINE/VI_ONLINE_VPSS_ONLINE",
"//": "devNum decides whether to run oneRtspServer or dualRtspServer",
"//": "devNum=1 dualSensor use the same video-src-info chn0 settings",
"//": "if run sbm mode, set vi-vpss-mode 1 set venc-bind-vpss true",
"dev-num": 1,
"rtsp-port": 8554,
"buf1-blk-cnt": 0,
"vi-vpss-mode": 1,
"model": "./cvi_models/retinaface_mnet0.25_342_608.cvimodel",
"sbm": 0,
"sbm-buf-line": 64,
"sbm-buf-size": 16,
"video-src-info": [
{
"chn": 0,
"buf-blk-cnt": 5,
"venc-bind-vpss": false,
"enable-isp-info-osd": false,
"enable-retinaface": false,
"venc_json": "./vc_param_64M.json",
"codec": "265",
"gop": 50,
"bitrate": 2000,
"compress-mode": "tile",
"rc-mode": 0,
"bitstream-buf-size": 524288
},
{
"chn": 1,
"buf-blk-cnt": 5,
"venc-bind-vpss": false,
"enable-isp-info-osd": false,
"enable-retinaface": false,
"venc_json": "/mnt/data/vc_param.json",
"codec": "265",
"gop": 50,
"bitrate": 5000,
"compress-mode": "tile"
}
]
}
8 changes: 8 additions & 0 deletions device/milkv-duo/overlay/mnt/data/install/config.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[LOG]
level = 3
[PQBIN]
isEnableSetPQBin = 1
SDR_PQBinName = /mnt/data/bin/cvi_sdr_bin
WDR_PQBinName = /mnt/data/bin/cvi_wdr_bin
isEnableSetSnsCfgPath = 1
SnsCfgPath = ./sensor_cfg.ini
Binary file not shown.
2 changes: 2 additions & 0 deletions device/milkv-duo/overlay/mnt/data/install/cvi_models/version
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[2022-06-13]
retinaface_mnet0.25_342_608.cvimodel
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions device/milkv-duo/overlay/mnt/data/install/lib/ai/libssl.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions device/milkv-duo/overlay/mnt/data/install/lib/ai/libuv.so
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions device/milkv-duo/overlay/mnt/data/install/lib/ai/libz.so
1 change: 1 addition & 0 deletions device/milkv-duo/overlay/mnt/data/install/lib/ai/libz.so.1
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions device/milkv-duo/overlay/mnt/data/install/test/empty.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
5 changes: 5 additions & 0 deletions device/milkv-duo/overlay/mnt/data/install/test/h264.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"video-src-info": [{
"codec": "264"
}]
}
5 changes: 5 additions & 0 deletions device/milkv-duo/overlay/mnt/data/install/test/h265.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"video-src-info": [{
"codec": "265"
}]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"model": "../cvi_models/retinaface_mnet0.25_342_608.cvimodel",
"video-src-info": [{
"chn": 0,
"venc-bind-vpss": false,
"enable-retinaface": true
}]
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit e675cf6

Please sign in to comment.