533 lines
23 KiB
Markdown
533 lines
23 KiB
Markdown
|
---
|
|||
|
title: RT-Media Demo
|
|||
|
subtitle: 使用说明
|
|||
|
author: AWA1908
|
|||
|
changelog:
|
|||
|
- ver: 1.0
|
|||
|
date: 2022.9.16
|
|||
|
author: AWA1908
|
|||
|
desc: |
|
|||
|
初版,RT-Media Demo使用说明。
|
|||
|
- ver: 1.1
|
|||
|
date: 2022.10.11
|
|||
|
author: AWA1771
|
|||
|
desc: |
|
|||
|
整理文档结构和格式,功能、配置、参数说明、测试命令示例、生成文件。
|
|||
|
---
|
|||
|
|
|||
|
# RT-Media Demo使用说明
|
|||
|
|
|||
|
RT-Media主要提供视频类Demo。
|
|||
|
|
|||
|
## demo_video_in
|
|||
|
|
|||
|
功能:视频采集与编码
|
|||
|
|
|||
|
配置:勾选对应配置后,编译时会将其拷贝到/bin目录下。
|
|||
|
|
|||
|
```
|
|||
|
make menuconfig
|
|||
|
Allwinner -> rt_media demo selection -> demo_video_in
|
|||
|
```
|
|||
|
|
|||
|
参数说明:
|
|||
|
|
|||
|
```
|
|||
|
-n 编码帧数,未考虑pts情况下,250帧大约=10s,eg: -n 250
|
|||
|
-f0 channel0 编码格式,0:h264 encoder, 1:jpeg_encoder, 2:h265 encoder,eg: -f0 0
|
|||
|
-f1 channel1 编码格式, eg: -f1 0
|
|||
|
-s0 channel0 输入分辨率 1280x720 1920x1080 2560x1440 etc,eg: -s0 2560x1440
|
|||
|
-ds0 channel0 输出分辨率,如果无输入,即等于输入分辨率 1280x720 1920x1080 2560x1440 etc,eg: -ds0 2560x1440
|
|||
|
-s1 channel1 输入分辨率,eg: -s1 2560x1440
|
|||
|
-b0 chanenl0 码率大小,单位bps, eg: -b0 2097152,表示2M
|
|||
|
-b1 chanen11 码率大小,单位bps, eg: -b1 2097152,表示2M
|
|||
|
-in 编码本地yuv/lbc文件,搭配-local使用,最好设置绝对路径, eg: -in mnt/extsd/yuv/720p.yuv
|
|||
|
-out 输出码流文件路径名,最好设置绝对路径, eg: -out mnt/extsd/test.h264
|
|||
|
-snd 开启channel 1通道,子码流, 0: 关闭, 1:开启,eg: -snd 1
|
|||
|
-trd 开启channel 2通道,主要用于获取csi yuv,和catch jpg, 0: 关闭, 1:开启,eg: -trd 1
|
|||
|
-local 编码本地yuv,0: 关闭, 1:开启,eg: -local 1
|
|||
|
-pf channel0 yuv格式,NV12 = 0, NV21 = 1, YV12 = 2, YV21 = 3, LBC_25X = 4,eg: -pf 1
|
|||
|
-pf1 channel1 yuv格式,NV12 = 0, NV21 = 1, YV12 = 2, YV21 = 3, LBC_25X = 4,eg: -pf1 1
|
|||
|
-pf2 channel2 yuv格式,NV12 = 0, NV21 = 1, YV12 = 2, YV21 = 3, LBC_25X = 4,eg: -pf2 1
|
|||
|
-vn channel0 vipp num选择,eg: -vn 0
|
|||
|
-vn1 channel1 vipp num选择,eg: -vn1 4
|
|||
|
-vn2 channel2 vipp num选择,eg: -vn2 8
|
|||
|
-sp channel0 sharp开关,0: 关闭, 1:开启,打开后内核使用isp sharp参数,仅用户测试可参考接口AWVideoInput_SetSharp eg: -sp 1
|
|||
|
-js channel3 catch jpg size, 1280x720 1920x1080 2560x1440 etc,eg: -js 1920x1080
|
|||
|
-online channel0 online mode开关,0: 关闭, 1:开启, eg: -online 1
|
|||
|
-sbn online mode share buffer num, 1 or 2,eg: -sbn 2
|
|||
|
-crop 用于测试crop功能,eg: -crop 1
|
|||
|
-gray 彩转灰功能,eg: -gray 1
|
|||
|
-wbyuv yuv回写保存,具体参数请查看init_wbyuv_param_info,eg: -wbyuv 1
|
|||
|
-pir P帧帧内刷新功能,eg: -pir 1
|
|||
|
-nr 用于测试2D/3D nr,默认参数请查看init_2d_3d_param,eg: -nr 1
|
|||
|
-aiisp 用于测试AI-ISP,0:关闭;1:开启,默认关闭
|
|||
|
-tdmbuf 用于配置tdm rx buf个数,一般用于AI-ISP测试,默认0,对应驱动会申请5个buf
|
|||
|
-aiispintv 用于配置aiisp switch interval,默认0,表示不切换,设置非0表示间隔多少帧切换AI-ISP开关,单位是帧数
|
|||
|
```
|
|||
|
|
|||
|
测试命令示例:
|
|||
|
|
|||
|
1. 视频采集+编码
|
|||
|
|
|||
|
```
|
|||
|
demo_video_in -n 40 -s0 1920x1088
|
|||
|
```
|
|||
|
|
|||
|
生成文件:/tmp/stream0_xx.h264
|
|||
|
|
|||
|
2. 视频采集+编码,同时包含人形检测、移动侦测
|
|||
|
|
|||
|
```
|
|||
|
demo_video_in -n 40 -s0 1920x1088 -f0 0 -pf 4 -trd 1 -pf2 0
|
|||
|
```
|
|||
|
|
|||
|
生成文件:/tmp/stream0_xx.h264
|
|||
|
|
|||
|
## demo_encoder
|
|||
|
|
|||
|
功能:演示编码功能
|
|||
|
|
|||
|
配置:勾选对应配置后,编译时会将其拷贝到/bin目录下。
|
|||
|
|
|||
|
```
|
|||
|
make menuconfig
|
|||
|
Allwinner-> rt_media demo selection -> demo_encoder
|
|||
|
```
|
|||
|
|
|||
|
参数说明:
|
|||
|
|
|||
|
```
|
|||
|
-n,--encode_frame_num 编码帧数,未考虑pts情况下,250帧大约=10s,eg: -n 250。 param->encoder_num
|
|||
|
-f0,--encode_format0 channel0编码格式,0:h264 encoder, 1:jpeg_encoder, 2:h265 encoder,eg: -f0 0。 param->c0_encoder_format
|
|||
|
-s0,--srcsize channel0编码分辨率 1280x720 1920x1080 2560x1440 etc, eg: -s0 2560x1440。 param->c0_src_size, param->c0_src_w, param->c0_src_h
|
|||
|
-ds0 channel0 channel0输出分辨率,如果未设置,即等于输入分辨率 1280x720 1920x1080 2560x1440 etc,eg: -ds0 2560x1440。 param->c0_dst_size, param->c0_dst_w, param->c0_dst_h
|
|||
|
-vn,--vippnum channel0使用的vipp编号。e.g.: -vn 0。 param->use_vipp_num
|
|||
|
-pf,--pxlformat channel0的vipp的pixel format。1:RT_PIXEL_YVU420SP, 4: RT_PIXEL_LBC_25X, e.g.:-pf 4。 param->pixelformat
|
|||
|
-sp,--sharp channel0是否开启编码锐化。0:不开启,1:开启。e.g.: -sp 0。 param->enable_sharp
|
|||
|
-online,--online_mode channel0是否开启在线编码。 e.g.: -online 0。 param->bonline_channel
|
|||
|
-sbn,--share_buf channel0在线编码的buf数量。e.g.: -sbn 2。param->share_buf_num
|
|||
|
-b0,--bitrate channel0的码率。单位bps。 e.g.: -b0 1500000。 param->c0_bitrate
|
|||
|
-cs,--colorspace isp的颜色空间。取值为7:V4L2_COLORSPACE_JPEG, 3:V4L2_COLORSPACE_REC709, 31:V4L2_COLORSPACE_REC709_PART_RANGE
|
|||
|
-out,--outputfile 输出文件的路径的前缀。e.g.: /mnt/extsd/stream0_encoder。param->OutputFilePath
|
|||
|
注意:
|
|||
|
1. -n参数如果针对jpg编码,1帧编jpg图片,>1帧编mjpg视频
|
|||
|
2. lbc格式scaler range[lbc-format] is 1x-2x
|
|||
|
```
|
|||
|
|
|||
|
测试命令示例:
|
|||
|
|
|||
|
```
|
|||
|
demo_encoder -n 40 -s0 1920x1088 -f0 0
|
|||
|
demo_encoder -n 150 -s0 1920x1088 -f0 0 -vn 0 -pf 4 -sp 1 -b0 1500000 -cs 3 -out /mnt/extsd/demo_encoder_stream0
|
|||
|
demo_encoder -n 150 -s0 1920x1088 -ds0 2560x1440 -f0 0 -vn 0 -pf 1 -sp 1 -b0 2000000 -cs 3 -out /mnt/extsd/demo_encoder_stream0
|
|||
|
```
|
|||
|
|
|||
|
生成文件:
|
|||
|
|
|||
|
```
|
|||
|
H.264:/tmp/stream0_encoder_xx.h264
|
|||
|
H.265:/tmp/stream0_encoder_xx.h265
|
|||
|
JPEG:/tmp/jpg_0.jpg
|
|||
|
MJPEG:/tmp/jpg_0.mjpeg
|
|||
|
```
|
|||
|
|
|||
|
## demo_roi
|
|||
|
|
|||
|
功能:演示编码ROI功能
|
|||
|
|
|||
|
配置:勾选对应配置后,编译时会将其拷贝到/bin目录下。
|
|||
|
|
|||
|
```
|
|||
|
make menuconfig
|
|||
|
Allwinner -> rt_media demo selection -> demo_roi
|
|||
|
```
|
|||
|
|
|||
|
参数说明:
|
|||
|
|
|||
|
```
|
|||
|
-roi,--roi 测试roi的开关,0: 关闭, 1:开启, eg: -roi 1
|
|||
|
-n,--encode_frame_num 编码帧数,未考虑pts情况下,250帧大约=10s,eg: -n 250。 param->encoder_num
|
|||
|
-f0,--encode_format0 channel编码格式,0:h264 encoder, 1:jpeg_encoder, 2:h265 encoder,eg: -f0 0。 param->c0_encoder_format
|
|||
|
-s0,--srcsize channel编码分辨率 1280x720 1920x1080 2560x1440 etc, eg: -s0 2560x1440。 param->c0_src_size, param->c0_src_w, param->c0_src_h
|
|||
|
-vn,--vippnum channel使用的vipp编号,vipp编号就作为channel编号。e.g.: -vn 0。 param->use_vipp_num
|
|||
|
-pf,--pxlformat channel的vipp的pixel format。1:RT_PIXEL_YVU420SP, 4: RT_PIXEL_LBC_25X, e.g.:-pf 4。 param->pixelformat
|
|||
|
-sp,--sharp channel是否开启编码锐化。0:不开启,1:开启。e.g.: -sp 0。 param->enable_sharp
|
|||
|
-online,--online_mode channel是否开启在线编码。 e.g.: -online 0。 param->bonline_channel
|
|||
|
-sbn,--share_buf channel在线编码的buf数量。e.g.: -sbn 2。param->share_buf_num
|
|||
|
-b0,--bitrate channel的码率。单位bps。 e.g.: -b0 1500000。 param->c0_bitrate
|
|||
|
-out,--outputfile 输出文件的路径的前缀。e.g.: /mnt/extsd/demo_roi_stream0。 param->OutputFilePath
|
|||
|
注意:
|
|||
|
1. ROI只在h264/h265编码场景下生效,jpeg编码器不支持ROI。
|
|||
|
```
|
|||
|
|
|||
|
测试命令示例:
|
|||
|
|
|||
|
```
|
|||
|
demo_roi -n 40 -s0 1920x1088 -roi 1
|
|||
|
demo_roi -n 150 -s0 1920x1088 -f0 0 -vn 0 -pf 4 -sp 1 -b0 1500000 -cs 3 -roi 1 -out /mnt/extsd/demo_roi_stream0
|
|||
|
demo_roi -n 150 -s0 1920x1088 -f0 2 -vn 0 -pf 4 -sp 1 -b0 1500000 -cs 3 -roi 1 -out /mnt/extsd/demo_roi_stream0
|
|||
|
```
|
|||
|
|
|||
|
生成文件:/tmp/stream0_roi_xx.h264
|
|||
|
|
|||
|
## demo_force_i_frame
|
|||
|
|
|||
|
功能:演示编码强制出I帧功能
|
|||
|
|
|||
|
配置:勾选对应配置后,编译时会将其拷贝到/bin目录下。
|
|||
|
|
|||
|
```
|
|||
|
make menuconfig
|
|||
|
Allwinner-> rt_media demo selection->demo_force_i_frame
|
|||
|
```
|
|||
|
|
|||
|
参数说明:
|
|||
|
|
|||
|
```
|
|||
|
-fi,--force_i 测试force_i_frame的开关,0: 关闭, 1:开启, eg: -fi 1
|
|||
|
-n,--encode_frame_num 编码帧数,未考虑pts情况下,250帧大约=10s,eg: -n 250。 param->encoder_num
|
|||
|
-f0,--encode_format0 channel0编码格式,0:h264 encoder, 1:jpeg_encoder, 2:h265 encoder,eg: -f0 0。 param->c0_encoder_format
|
|||
|
-s0,--srcsize channel0编码分辨率 1280x720 1920x1080 2560x1440 etc, eg: -s0 2560x1440。 param->c0_src_size, param->c0_src_w, param->c0_src_h
|
|||
|
-vn,--vippnum channel0使用的vipp编号。e.g.: -vn 0。 param->use_vipp_num
|
|||
|
-pf,--pxlformat channel0的vipp的pixel format。1:RT_PIXEL_YVU420SP, 4: RT_PIXEL_LBC_25X, e.g.:-pf 4。 param->pixelformat
|
|||
|
-sp,--sharp channel0是否开启编码锐化。0:不开启,1:开启。e.g.: -sp 0。 param->enable_sharp
|
|||
|
-online,--online_mode channel0是否开启在线编码。 e.g.: -online 0。 param->bonline_channel
|
|||
|
-sbn,--share_buf channel0在线编码的buf数量。e.g.: -sbn 2。param->share_buf_num
|
|||
|
-b0,--bitrate channel0的码率。单位bps。 e.g.: -b0 1500000。 param->c0_bitrate
|
|||
|
-out,--outputfile 输出文件的路径的前缀。e.g.: /mnt/extsd/demo_force_i_stream0。 param->OutputFilePath
|
|||
|
注意:
|
|||
|
1. -fi 1时,第3帧、第11帧时设置强制I帧,设置后,可能下一帧就是I帧,也可能延后1,2帧出I帧。
|
|||
|
```
|
|||
|
|
|||
|
开启后默认配置superframe参数,参数默认如下
|
|||
|
|
|||
|
```
|
|||
|
void init_super_frame_cfg(RTVencSuperFrameConfig *sSuperFrameCfg)
|
|||
|
{
|
|||
|
sSuperFrameCfg->eSuperFrameMode = VENC_SUPERFRAME_NONE;
|
|||
|
sSuperFrameCfg->nMaxIFrameBits = 30000*8;
|
|||
|
sSuperFrameCfg->nMaxPFrameBits = 15000*8;
|
|||
|
}
|
|||
|
```
|
|||
|
|
|||
|
测试命令示例:
|
|||
|
|
|||
|
```
|
|||
|
demo_force_i_frame -n 40 -s0 1920x1088 -fi 1
|
|||
|
demo_force_i_frame -n 150 -s0 1920x1088 -f0 0 -pf 4 -sp 1 -b0 1500000 -fi 1 -out /mnt/extsd/demo_force_i_stream0
|
|||
|
demo_force_i_frame -n 150 -s0 1920x1088 -f0 2 -pf 4 -sp 1 -b0 1500000 -fi 1 -out /mnt/extsd/demo_force_i_stream0
|
|||
|
```
|
|||
|
|
|||
|
生成文件:/tmp/stream0_force_i_xxx.h264
|
|||
|
|
|||
|
## demo_motion_search
|
|||
|
|
|||
|
功能:演示移动侦测功能
|
|||
|
|
|||
|
配置:勾选对应配置后,编译时会将其拷贝到/bin目录下。
|
|||
|
|
|||
|
```
|
|||
|
make menuconfig
|
|||
|
Allwinner -> rt_media demo selection -> demo_motion_search
|
|||
|
```
|
|||
|
|
|||
|
参数说明:
|
|||
|
|
|||
|
```
|
|||
|
-ms,--motion channel的测试移动侦测的开关, 0: 关闭, 1:开启, eg: -ms 1
|
|||
|
-n,--encode_frame_num 编码帧数,未考虑pts情况下,250帧大约=10s,eg: -n 250。 param->encoder_num
|
|||
|
-f0,--encode_format0 channel编码格式,0:h264 encoder, 1:jpeg_encoder, 2:h265 encoder,eg: -f0 0。 param->c0_encoder_format
|
|||
|
-s0,--srcsize channel编码分辨率 1280x720 1920x1080 2560x1440 etc, eg: -s0 2560x1440。 param->c0_src_size, param->c0_src_w, param->c0_src_h
|
|||
|
-vn,--vippnum channel使用的vipp编号,vipp编号就作为channel编号。e.g.: -vn 0。 param->use_vipp_num
|
|||
|
-pf,--pxlformat channel的vipp的pixel format。1:RT_PIXEL_YVU420SP, 4: RT_PIXEL_LBC_25X, e.g.:-pf 4。 param->pixelformat
|
|||
|
-sp,--sharp channel是否开启编码锐化。0:不开启,1:开启。e.g.: -sp 0。 param->enable_sharp
|
|||
|
-online,--online_mode channel是否开启在线编码。 e.g.: -online 0。 param->bonline_channel
|
|||
|
-sbn,--share_buf channel在线编码的buf数量。e.g.: -sbn 2。param->share_buf_num
|
|||
|
-b0,--bitrate channel的码率。单位bps。 e.g.: -b0 1500000。 param->c0_bitrate
|
|||
|
-out,--outputfile 输出文件的路径的前缀。e.g.: /mnt/extsd/demo_reset_size_stream0。 param->OutputFilePath
|
|||
|
注意:
|
|||
|
1. 移动侦测只在h264/h265编码、ipcCase场景下生效。
|
|||
|
```
|
|||
|
|
|||
|
开启后默认参数如下:
|
|||
|
|
|||
|
```
|
|||
|
#define MOTION_SEARCH_HOR_NUM 16
|
|||
|
#define MOTION_SEARCH_VER_NUM 9
|
|||
|
#define MOTION_SEARCH_TOTAL_NUM (MOTION_SEARCH_HOR_NUM * MOTION_SEARCH_VER_NUM)
|
|||
|
|
|||
|
config_0.motion_search_param.en_motion_search = 1;
|
|||
|
config_0.motion_search_param.dis_default_para = 1;
|
|||
|
config_0.motion_search_param.hor_region_num = MOTION_SEARCH_HOR_NUM;
|
|||
|
config_0.motion_search_param.ver_region_num = MOTION_SEARCH_VER_NUM;
|
|||
|
config_0.motion_search_param.large_mv_th = 20;
|
|||
|
config_0.motion_search_param.large_mv_ratio_th = 12.0f;
|
|||
|
config_0.motion_search_param.non_zero_mv_ratio_th = 20.0f;
|
|||
|
config_0.motion_search_param.large_sad_ratio_th = 30.0f;
|
|||
|
```
|
|||
|
|
|||
|
测试命令示例:
|
|||
|
|
|||
|
```
|
|||
|
demo_motion_search -n 40 -s0 1920x1088 -ms 1
|
|||
|
demo_motion_search -n 150 -s0 1920x1088 -f0 0 -vn 0 -pf 4 -sp 1 -b0 1500000 -cs 3 -ms 1 -out /mnt/extsd/demo_motion_search_stream0
|
|||
|
demo_motion_search -n 150 -s0 1920x1088 -f0 2 -vn 0 -pf 4 -sp 1 -b0 1500000 -cs 3 -ms 1 -out /mnt/extsd/demo_motion_search_stream0
|
|||
|
```
|
|||
|
|
|||
|
生成文件:/tmp/stream0_motion_xx.h264
|
|||
|
|
|||
|
## demo_get_yuv
|
|||
|
|
|||
|
功能:演示获取YUV功能
|
|||
|
|
|||
|
配置:勾选对应配置后,编译时会将其拷贝到/bin目录下。
|
|||
|
|
|||
|
```
|
|||
|
make menuconfig
|
|||
|
Allwinner -> rt_media demo selection -> demo_get_yuv
|
|||
|
```
|
|||
|
|
|||
|
参数说明:
|
|||
|
|
|||
|
```
|
|||
|
-n 需要获取的yuv帧数,eg: -n 5
|
|||
|
-s0 yuv分辨率 1280x720 1920x1080 2560x1440 etc, eg: -s0 1280x720
|
|||
|
-pf yuv格式,NV12 = 0, NV21 = 1, YV12 = 2, YV21 = 3,eg: -pf 1
|
|||
|
|
|||
|
-n,--encode_frame_num channel0需要获取的帧数,未考虑pts情况下,250帧大约=10s,eg: -n 250。 param->encoder_num
|
|||
|
-s0,--srcsize channel0编码分辨率 1280x720 1920x1080 2560x1440 etc, eg: -s0 2560x1440。 param->c0_src_size, param->c0_src_w, param->c0_src_h
|
|||
|
-pf,--pxlformat channel0的vipp的pixel format。1:RT_PIXEL_YVU420SP, 4: RT_PIXEL_LBC_25X, e.g.:-pf 4。 param->pixelformat
|
|||
|
-cs,--colorspace isp的颜色空间。取值为7:V4L2_COLORSPACE_JPEG, 3:V4L2_COLORSPACE_REC709, 31:V4L2_COLORSPACE_REC709_PART_RANGE
|
|||
|
-out,--outputfile 保存输出文件的目录名。e.g.: /mnt/extsd。param->OutputFilePath
|
|||
|
```
|
|||
|
|
|||
|
测试命令示例:
|
|||
|
|
|||
|
```
|
|||
|
demo_get_yuv -n 5 -s0 1280x720 -pf 1
|
|||
|
demo_get_yuv -n 30 -s0 1920x1088 -pf 1 -cs 3 -out /mnt/extsd
|
|||
|
```
|
|||
|
|
|||
|
生成文件:/mnt/extsd/1280x720.yuv
|
|||
|
|
|||
|
## demo_osd
|
|||
|
|
|||
|
功能:演示编码OSD功能
|
|||
|
|
|||
|
配置:勾选对应配置后,编译时会将其拷贝到/bin目录下。
|
|||
|
|
|||
|
```
|
|||
|
make menuconfig
|
|||
|
Allwinner -> rt_media demo selection -> demo_osd
|
|||
|
```
|
|||
|
|
|||
|
参数说明:
|
|||
|
|
|||
|
```
|
|||
|
-osd osd, 0: 关闭, 1:开启, eg: -osd 1
|
|||
|
```
|
|||
|
|
|||
|
```
|
|||
|
-osd,--osd channel0的osd开关, 0: 关闭, 1:开启, eg: -osd 1
|
|||
|
-n,--encode_frame_num 编码帧数,未考虑pts情况下,250帧大约=10s,eg: -n 250。 param->encoder_num
|
|||
|
-vn,--vippnum channel0使用的vipp编号。e.g.: -vn 0。 param->use_vipp_num
|
|||
|
-pf,--pxlformat channel0的vipp的pixel format。1:RT_PIXEL_YVU420SP, 4: RT_PIXEL_LBC_25X, e.g.:-pf 4。 param->pixelformat
|
|||
|
-sp,--sharp channel0是否开启编码锐化。0:不开启,1:开启。e.g.: -sp 0。 param->enable_sharp
|
|||
|
-online,--online_mode channel0是否开启在线编码。 e.g.: -online 0。 param->bonline_channel
|
|||
|
-sbn,--share_buf channel0在线编码的buf数量。e.g.: -sbn 2。param->share_buf_num
|
|||
|
-s0,--srcsize channel0编码分辨率 1280x720 1920x1080 2560x1440 etc, eg: -s0 2560x1440。 param->c0_src_size, param->c0_src_w, param->c0_src_h
|
|||
|
-b0,--bitrate channel0的码率。单位bps。 e.g.: -b0 1500000。 param->c0_bitrate
|
|||
|
-out,--outputfile 输出文件的路径的前缀。e.g.: /mnt/extsd/stream0_encoder。param->OutputFilePath
|
|||
|
|
|||
|
注意:
|
|||
|
1. lbc格式scaler range[lbc-format] is 1x-2x
|
|||
|
2. 只使用h264编码演示
|
|||
|
```
|
|||
|
|
|||
|
overlay文件地址需要自己去配置路径,路径错误会导致失败,默认如下:
|
|||
|
|
|||
|
```
|
|||
|
#define IN_OSD_ARGB_FILE "/mnt/extsd/fs_v853/01_argb_464x32_time.dat"
|
|||
|
|
|||
|
overlay type默认参数:
|
|||
|
OverlayInfo.item_info[index].osd_type = RT_NORMAL_OVERLAY;
|
|||
|
OverlayInfo.item_info[index].start_x = 16;
|
|||
|
OverlayInfo.item_info[index].start_y = 752;
|
|||
|
OverlayInfo.item_info[index].widht = 464;
|
|||
|
OverlayInfo.item_info[index].height = 32;
|
|||
|
|
|||
|
reserve overlay type默认参数:
|
|||
|
OverlayInfo.item_info[index].osd_type = RT_LUMA_REVERSE_OVERLAY;
|
|||
|
OverlayInfo.item_info[index].start_x = 480;
|
|||
|
OverlayInfo.item_info[index].start_y = 752;
|
|||
|
OverlayInfo.item_info[index].widht = 464;
|
|||
|
OverlayInfo.item_info[index].height = 32;
|
|||
|
OverlayInfo.invert_mode = 3;
|
|||
|
OverlayInfo.invert_threshold = 90;
|
|||
|
|
|||
|
cover type默认参数:
|
|||
|
OverlayInfo.item_info[index].osd_type = RT_COVER_OSD;
|
|||
|
OverlayInfo.item_info[index].start_x = 800;
|
|||
|
OverlayInfo.item_info[index].start_y = 192;
|
|||
|
OverlayInfo.item_info[index].widht = 320;
|
|||
|
OverlayInfo.item_info[index].height = 160;
|
|||
|
OverlayInfo.item_info[index].cover_yuv.cover_y = 0;
|
|||
|
OverlayInfo.item_info[index].cover_yuv.cover_u = 0;
|
|||
|
OverlayInfo.item_info[index].cover_yuv.cover_v = 0x64;
|
|||
|
```
|
|||
|
|
|||
|
测试命令示例:
|
|||
|
|
|||
|
```
|
|||
|
demo_osd -n 50 -s0 1920x1088 -osd 1
|
|||
|
demo_osd -n 150 -s0 1920x1088 -osd 1 -b0 1500000 -out /mnt/extsd/demo_osd_stream0
|
|||
|
```
|
|||
|
|
|||
|
生成文件:/tmp/demo_osd_stream0_xx.h264
|
|||
|
|
|||
|
## demo_orl
|
|||
|
|
|||
|
功能:演示ORL功能
|
|||
|
|
|||
|
配置:勾选对应配置后,编译时会将其拷贝到/bin目录下。
|
|||
|
|
|||
|
```
|
|||
|
make menuconfig
|
|||
|
Allwinner -> rt_media demo selection -> demo_orl
|
|||
|
```
|
|||
|
|
|||
|
参数说明:
|
|||
|
|
|||
|
```
|
|||
|
-orl,--orl channel0的orl开关,0: 关闭, 1:开启, eg: -orl 1
|
|||
|
-n,--encode_frame_num 编码帧数,未考虑pts情况下,250帧大约=10s,eg: -n 250。 param->encoder_num
|
|||
|
-vn,--vippnum channel0使用的vipp编号。e.g.: -vn 0。 param->use_vipp_num
|
|||
|
-pf,--pxlformat channel0的vipp的pixel format。1:RT_PIXEL_YVU420SP, 4: RT_PIXEL_LBC_25X, e.g.:-pf 4。 param->pixelformat
|
|||
|
-sp,--sharp channel0是否开启编码锐化。0:不开启,1:开启。e.g.: -sp 0。 param->enable_sharp
|
|||
|
-online,--online_mode channel0是否开启在线编码。 e.g.: -online 0。 param->bonline_channel
|
|||
|
-sbn,--share_buf channel0在线编码的buf数量。e.g.: -sbn 2。param->share_buf_num
|
|||
|
-s0,--srcsize channel0编码分辨率 1280x720 1920x1080 2560x1440 etc, eg: -s0 2560x1440。 param->c0_src_size, param->c0_src_w, param->c0_src_h
|
|||
|
-b0,--bitrate channel0的码率。单位bps。 e.g.: -b0 1500000。 param->c0_bitrate
|
|||
|
-out,--outputfile 输出文件的路径的前缀。e.g.: /mnt/extsd/stream0_encoder。param->OutputFilePath
|
|||
|
|
|||
|
注意:
|
|||
|
1. lbc格式scaler range[lbc-format] is 1x-2x
|
|||
|
2. 只使用h264编码演示
|
|||
|
```
|
|||
|
|
|||
|
测试命令示例:
|
|||
|
|
|||
|
```
|
|||
|
demo_orl -n 40 -s0 1920x1088 -orl 1
|
|||
|
demo_orl -n 300 -s0 1920x1088 -orl 1 -b0 1500000 -out /mnt/extsd/demo_orl_stream0
|
|||
|
```
|
|||
|
|
|||
|
生成文件:/tmp/stream0_orl_xx.h264
|
|||
|
|
|||
|
## demo_reset_size
|
|||
|
|
|||
|
功能:演示编码切换分辨率
|
|||
|
|
|||
|
配置:勾选对应配置后,编译时会将其拷贝到/bin目录下。
|
|||
|
|
|||
|
```
|
|||
|
make menuconfig
|
|||
|
Allwinner -> rt_media demo selection -> demo_reset_size
|
|||
|
```
|
|||
|
|
|||
|
参数说明:
|
|||
|
|
|||
|
```
|
|||
|
-rs,--reset 测试重设编码目标分辨率的开关,0: 关闭, 1:开启, eg: -rs 1
|
|||
|
-n,--encode_frame_num 编码帧数,未考虑pts情况下,250帧大约=10s,eg: -n 250。 param->encoder_num
|
|||
|
-f0,--encode_format0 channel0编码格式,0:h264 encoder, 1:jpeg_encoder, 2:h265 encoder,eg: -f0 0。 param->c0_encoder_format
|
|||
|
-s0,--srcsize channel0编码分辨率 1280x720 1920x1080 2560x1440 etc, eg: -s0 2560x1440。 param->c0_src_size, param->c0_src_w, param->c0_src_h
|
|||
|
-vn,--vippnum channel0使用的vipp编号。e.g.: -vn 0。 param->use_vipp_num
|
|||
|
-pf,--pxlformat channel0的vipp的pixel format。1:RT_PIXEL_YVU420SP, 4: RT_PIXEL_LBC_25X, e.g.:-pf 4。 param->pixelformat
|
|||
|
-sp,--sharp channel0是否开启编码锐化。0:不开启,1:开启。e.g.: -sp 0。 param->enable_sharp
|
|||
|
-online,--online_mode channel0是否开启在线编码。 e.g.: -online 0。 param->bonline_channel
|
|||
|
-sbn,--share_buf channel0在线编码的buf数量。e.g.: -sbn 2。param->share_buf_num
|
|||
|
-b0,--bitrate channel0的码率。单位bps。 e.g.: -b0 1500000。 param->c0_bitrate
|
|||
|
-out,--outputfile 输出文件的路径的前缀。e.g.: /mnt/extsd/demo_reset_size_stream0。 param->OutputFilePath
|
|||
|
```
|
|||
|
|
|||
|
测试命令示例:
|
|||
|
|
|||
|
```
|
|||
|
demo_reset_size -n 200 -s0 1920x1088 -rs 1
|
|||
|
demo_reset_size -n 150 -s0 1920x1088 -f0 0 -pf 4 -sp 1 -b0 1500000 -rs 1 -out /mnt/extsd/demo_reset_size_stream0
|
|||
|
demo_reset_size -n 150 -s0 1920x1088 -f0 2 -pf 4 -sp 1 -b0 1500000 -rs 1 -out /mnt/extsd/demo_reset_size_stream0
|
|||
|
```
|
|||
|
|
|||
|
生成文件:/tmp/stream0_reset_size_xx.h264
|
|||
|
|
|||
|
## demo_gdc
|
|||
|
|
|||
|
功能:演示gdc功能
|
|||
|
|
|||
|
配置:勾选对应配置后,编译时会将其拷贝到/bin目录下。
|
|||
|
|
|||
|
```
|
|||
|
make menuconfig
|
|||
|
Allwinner -> rt_media demo selection -> demo_gdc
|
|||
|
```
|
|||
|
|
|||
|
参数说明:
|
|||
|
|
|||
|
```
|
|||
|
-gdc,--gdc 测试gdc的开关,0: 关闭, 1:开启, eg: -gdc 1
|
|||
|
-n,--encode_frame_num 编码帧数,未考虑pts情况下,250帧大约=10s,eg: -n 250。 param->encoder_num
|
|||
|
-s0,--srcsize channel0编码分辨率 1280x720 1920x1080 2560x1440 etc, eg: -s0 2560x1440。 param->c0_src_size, param->c0_src_w, param->c0_src_h
|
|||
|
-vn,--vippnum channel0使用的vipp编号。e.g.: -vn 0。 param->use_vipp_num
|
|||
|
-pf,--pxlformat channel0的vipp的pixel format。1:RT_PIXEL_YVU420SP, 4: RT_PIXEL_LBC_25X, e.g.:-pf 4。 param->pixelformat
|
|||
|
-sp,--sharp channel0是否开启编码锐化。0:不开启,1:开启。e.g.: -sp 0。 param->enable_sharp
|
|||
|
-online,--online_mode channel0是否开启在线编码。 e.g.: -online 0。 param->bonline_channel
|
|||
|
-sbn,--share_buf channel0在线编码的buf数量。e.g.: -sbn 2。param->share_buf_num
|
|||
|
-b0,--bitrate channel0的码率。单位bps。 e.g.: -b0 1500000。 param->c0_bitrate
|
|||
|
-out,--outputfile 输出文件的路径的前缀。e.g.: /mnt/extsd/demo_reset_size_stream0。 param->OutputFilePath
|
|||
|
注意:
|
|||
|
1. 只使用h264编码演示gdc。
|
|||
|
```
|
|||
|
|
|||
|
测试命令示例:
|
|||
|
|
|||
|
```
|
|||
|
demo_gdc -n 50 -s0 1920x1088 -pf 1 -gdc 1
|
|||
|
demo_gdc -n 150 -s0 1920x1088 -pf 4 -sp 1 -b0 1500000 -gdc 1 -out /mnt/extsd/demo_gdc_stream0
|
|||
|
demo_gdc -n 150 -s0 1920x1088 -pf 1 -sp 1 -b0 1500000 -gdc 1 -out /mnt/extsd/demo_gdc_stream0
|
|||
|
```
|
|||
|
|
|||
|
生成文件:/tmp/stream0_gdc_xx.h264
|
|||
|
|
|||
|
## demo_isp_api
|
|||
|
|
|||
|
功能:演示单/双目切换图像效果
|
|||
|
|
|||
|
配置:勾选对应配置后,编译时会将其拷贝到/bin目录下。
|
|||
|
|
|||
|
```
|
|||
|
make menuconfig
|
|||
|
Allwinner -> rt_media demo isp_api -> demo_isp_api
|
|||
|
```
|
|||
|
|
|||
|
参数说明:
|
|||
|
|
|||
|
```
|
|||
|
-n,--encode_frame_num 编码帧数,未考虑pts情况下,250帧大约=10s,eg: -n 250。 param->encoder_num
|
|||
|
-f0,--encode_format0 channel0编码格式,0:h264 encoder, 1:jpeg_encoder, 2:h265 encoder,eg: -f0 0。 param->c0_encoder_format
|
|||
|
-s0,--srcsize channel0编码分辨率 1280x720 1920x1080 2560x1440 etc, eg: -s0 2560x1440。 param->c0_src_size, param->c0_src_w, param->c0_src_h
|
|||
|
-vn,--vippnum channel0使用的vipp编号。e.g.: -vn 0。 param->use_vipp_num
|
|||
|
-pf,--pxlformat channel0的vipp的pixel format。1:RT_PIXEL_YVU420SP, 4: RT_PIXEL_LBC_25X, e.g.:-pf 4。 param->pixelformat
|
|||
|
-out,--outputfile 输出文件的路径的前缀。e.g.: /mnt/extsd/demo_reset_size_stream0。 param->OutputFilePath
|
|||
|
```
|
|||
|
|
|||
|
测试命令示例:
|
|||
|
|
|||
|
```
|
|||
|
单目:demo_isp_api -n 120 -s0 1920x1088 -f0 0 -pf 4
|
|||
|
双目:demo_isp_api -n 120 -s0 1920x1088 -f0 0 -pf 4 -snd 1 -s1 1920X1088 -f0 0 -pf1 4
|
|||
|
```
|
|||
|
|
|||
|
生成文件:/tmp/stream0_reset_size_xx.h264,可以看到码流彩色图像被切换成黑白图像
|