Skip to content

Commit

Permalink
fix(cv demo): fix README bug
Browse files Browse the repository at this point in the history
Change-Id: I6a9ec90e24a4b6d03bdd3d6ff374bce998d32c46
  • Loading branch information
yuchuan.he committed Sep 12, 2024
1 parent 56bddfc commit a769d83
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 19 deletions.
5 changes: 3 additions & 2 deletions element/multimedia/decode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
sophon-stream decode element是sophon-stream框架中的一个插件,用于图片、视频、RTSP/RTMP/GB28181视频流解码,以供后续的分析和处理使用。

## 1. 特性
* 支持多种输入格式,如RTSP、RTMP、GB28181、本地视频、图片文件、BASE64等
* 支持多种输入格式,如RTSP、RTMP、GB28181、本地视频、图片文件、BASE64、CAMERA等
* 支持RTSP/RTMP/GB28181视频流断开重连。
* 支持本地视频与图片文件配置循环。
* 支持多路视频流高性能解码,支持硬件加速。
Expand Down Expand Up @@ -81,7 +81,7 @@ sophon-stream解码器插件具有一些可配置的参数,可以根据需求
|:-------------:| :-------: | :------------------:| :------------------------:|
| channel_id | 整数 || 输入数据通道编号 |
| url | 字符串 || 输入数据路径,包括本地视频、图片、视频流和base64对应url后缀 |
|source_type | 字符串 || 输入数据类型,"RTSP"代表RTSP视频流,“RTMP”代表RTMP视频流,“GB28181”代表GB28181视频流,“VIDEO”代表本地视频,“IMG_DIR”代表图片文件夹, “BASE64”代表base64数据 |
|source_type | 字符串 || 输入数据类型,"RTSP"代表RTSP视频流,“RTMP”代表RTMP视频流,“GB28181”代表GB28181视频流,“VIDEO”代表本地视频,“IMG_DIR”代表图片文件夹, “BASE64”代表base64数据 , “CAMERA”摄像头或者其他类型的视频输入设备|
|sample_interval | 整数 | 1 |抽帧数,如设置为5,表示每5帧有1帧会被后续处理,即为ObjectMata mFilter字段为false|
|loop_num | 整数 | 1 | 循环次数,仅适用于source_type为"VIDEO"和“IMG_DIR”,值为0时无限循环|
|fps | 浮点数 | 30 | 用于控制视频流的fps,fps=-1表示不控制fps;其它情况下,source_type为"IMG_DIR"或"BASE64"时由设置的值决定,其他source_type从视频流读取fps,设置的值不生效|
Expand Down Expand Up @@ -110,3 +110,4 @@ IMG_DIR/
>2. 输入RTMP数据流的URL须以`rtmp://`开头
>3. 假设输入BASE64的URL为`/base64`,则http请求的格式需为「POST」(http://{host_ip}:{base64_port}/base64),request body的data字段存储base64数据,如{"data": "{base64 string,不含头部(data:image/xxx;base64,)}"}
>4. 输入GB28181数据流的URL须以`gb28181://`开头
>5. 输入CAMERA数据流的URL须以`/dev/video`开头
6 changes: 3 additions & 3 deletions element/multimedia/decode/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ English | [简体中文](README.md)
The sophon-stream decode element is a plugin within the sophon-stream framework, used for decoding images, videos, RTSP/RTMP video streams for subsequent analysis and processing purposes.

## 1. feature
* Supports various input formats, including RTSP, RTMP, local videos, image files, BASE64, etc.
* Supports various input formats, including RTSP, RTMP, local videos, image files, BASE64, CAMERA ,etc.
* Supports reconnection for interrupted RTSP/RTMP video streams.
* Allows configuration for looping local videos and image files.
* High-performance decoding for multiple video streams with hardware acceleration.
Expand Down Expand Up @@ -81,7 +81,7 @@ Additionally, attention should be paid to the setting of the input data channels
|:-------------:| :-------: | :------------------:| :------------------------:|
| channel_id | int | \ | Input data channel number |
| url | string | \ | Input data path, including local videos, images, video streams, and base64-encoded URLs. |
|source_type | string | \ | Input data types: "RTSP" represents an RTSP video stream, “RTMP” represents an RTMP video stream, “VIDEO” represents local videos, “IMG_DIR” represents image folders, and “BASE64” represents base64-encoded data. |
|source_type | string | \ | Input data types: "RTSP" represents an RTSP video stream, “RTMP” represents an RTMP video stream, “VIDEO” represents local videos, “IMG_DIR” represents image folders, “BASE64” represents base64-encoded data, and “CAMERA” camera or other type of video input device. |
|sample_interval | int | 1 |Frame extraction rate. Setting it to 5 implies that for every 5 frames, 1 frame will be processed subsequently, which means the ObjectMata mFilter field is set to false.|
|loop_num | int | 1 | Loop count. Only applicable when the source_type is set to "VIDEO" and "IMG_DIR". A value of 0 indicates an infinite loop.|
|fps | float | 30 | Used to control the frames per second (fps) of the video stream. Fps=-1 means no control over fps. In other cases, when source_type is set to "IMG_DIR" or "BASE64", it's determined by the set value. For other source_types, fps is read from the video stream, and the set value does not take effect.|
Expand Down Expand Up @@ -110,4 +110,4 @@ IMG_DIR/
>2. The URL for inputting RTMP data stream must begin with `rtmp://`.
>3. If the input BASE64 URL is `/base64`, the HTTP request format should be a POST request to "http://{host_ip}:{base64_port}/base64". The request body's data field stores the base64 data, such as {"data": "{base64 string, excluding the header (data:image/xxx;base64,)}"}.
>4. The URL for inputting GB28181 data stream must start with `gb28181://`.
>5. The URL for inputting CAMERA data stream must start with `/dev/video`.
5 changes: 3 additions & 2 deletions element/tools/dwa/src/dwa.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ common::ErrorCode Dwa::initInternal(const std::string& json) {

dst_h = configure.find(CONFIG_INTERNAL_DST_H_FILED)->get<int>();
dst_w = configure.find(CONFIG_INTERNAL_DST_W_FILED)->get<int>();
resize_h = configure.find(CONFIG_INTERNAL_RESIZE_H_FILED)->get<int>();
resize_w = configure.find(CONFIG_INTERNAL_RESIZE_W_FILED)->get<int>();

auto dwa_mode_str =
configure.find(CONFIG_INTERNAL_DWA_MODE_FILED)->get<std::string>();
dwa_mode = dwa_mode_map[dwa_mode_str];
Expand Down Expand Up @@ -111,6 +110,8 @@ common::ErrorCode Dwa::initInternal(const std::string& json) {

} else if (dwa_mode ==
DWA_FISHEYE_MODE) { // 用于04e10 blend 2240x2240 不需要resize
resize_h = configure.find(CONFIG_INTERNAL_RESIZE_H_FILED)->get<int>();
resize_w = configure.find(CONFIG_INTERNAL_RESIZE_W_FILED)->get<int>();
fisheye_attr = {0};
// set_fish_default_param(&fisheye_attr);
rot_mode = BMCV_ROTATION_180;
Expand Down
4 changes: 2 additions & 2 deletions samples/bird_dwa_blend_encode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ chmod -R +x scripts/
```

脚本执行完毕后,会在当前目录下生成`data`目录,其中包含`models``videos`两个子目录。

```bash
.
├── gridinfo
│ ├── 0grid_info_bev_60_60_2920_60_60_dst_1920x1920_src_1920x1080.dat
Expand Down Expand Up @@ -105,7 +105,7 @@ chmod -R +x scripts/
├── c01_alpha_444p_m2__0_3072x32.bin
├── c01_beta_444p_m2__0_2240x32.bin
└── c01_beta_444p_m2__0_3072x32.bin

```

## 4. 环境准备

Expand Down
9 changes: 5 additions & 4 deletions samples/dwa_blend_encode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@

本例程用于说明如何使用sophon-stream快速构建深度估计应用。

本例程中,鱼眼拼接算法的鱼眼展开、鱼眼拼接分别在两个element上进行运算,element内部可以开启多个线程,保证了一定的运行效率。
本例程中,鱼眼拼接算法的鱼眼展开、鱼眼拼接分别在两个element上进行运算,element内部可以开启多个线程,保证了一定的运行效率。下图是广角拼接应用的流程图:
![dwa_pipeline](pic/image.jpg)

## 2. 特性

Expand All @@ -43,13 +44,13 @@ chmod -R +x scripts/
```

脚本执行完毕后,会在当前目录下生成`data`目录,其中包含`models``videos`两个子目录。

```bash
.
├── gridinfo # 用于dwa模块的参数文件
├── images # 测试图片
├── wgt # 用于拼接的权重文件
└── videos # 测试视频

```

## 4. 环境准备

Expand All @@ -68,7 +69,7 @@ insmod v4l2_os04e10.ko
```bash
sudo -s
mkdir -p /mnt/cfg/param
cp data/param/cvi_sdr_bin /mnt/cfg/param
cp data/cvi_sdr_bin /mnt/cfg/param
```


Expand Down
Binary file added samples/dwa_blend_encode/pic/image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion samples/dwa_dpu_encode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ chmod -R +x scripts/
```bash
sudo -s
cd /mnt/system/ko/
insmod v4l2_os04a10.ko
insmod v4l2_os04a10_sync.ko
```

(2)isp参数文件配置
Expand Down
10 changes: 5 additions & 5 deletions samples/gdwa_blend_encode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
本例程用于说明如何使用sophon-stream快速构建深度估计应用。

本例程中,广角拼接算法的广角展开、广角拼接分别在两个element上进行运算,element内部可以开启多个线程,保证了一定的运行效率。下图是广角拼接应用的流程图:
![gdwa_pipeline](pic/image.png)
![gdwa_pipeline](pic/image.jpg)
## 2. 特性

* 支持BM1688(SoC)
Expand All @@ -43,13 +43,13 @@ chmod -R +x scripts/
```

脚本执行完毕后,会在当前目录下生成`data`目录,其中包含`models``videos`两个子目录。

```bash
.
├── gridinfo # 用于dwa模块的参数文件
├── images # 测试图片
├── wgt # 用于拼接的权重文件
└── videos # 测试视频

```

## 4. 环境准备

Expand All @@ -61,14 +61,14 @@ chmod -R +x scripts/
```bash
sudo -s
cd /mnt/system/ko/
insmod v4l2_os04a10.ko
insmod v4l2_os04a10_sync.ko
```
(2)isp参数文件配置

```bash
sudo -s
mkdir -p /mnt/cfg/param
cp data/param/cvi_sdr_bin /mnt/cfg/param
cp data/cvi_sdr_bin /mnt/cfg/param
```


Expand Down

0 comments on commit a769d83

Please sign in to comment.