Skip to content

Commit ae16c77

Browse files
committed
Modularize the script to single script which works for all the Decoders and encoders
Add Support Video Decode Testcases for H265 Add Support Video Decode Testcases for VP9 Add Support Video Encode Testcases for H265 Signed-off-by: Abhishek Bajaj <[email protected]>
1 parent b7f6809 commit ae16c77

File tree

9 files changed

+657
-147
lines changed

9 files changed

+657
-147
lines changed

Runner/suites/Multimedia/Video/README_Video.md

Lines changed: 88 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,28 @@ Video scripts automates the validation of video encoding and decoding capabiliti
1010
## Features
1111

1212
- V4L2 driver level test
13-
- Encoding YUV to H264 bitstream
14-
- Decoding H264 bitstream to YUV
13+
- Encoding YUV to H264/H265 bitstream
14+
- Decoding H264/H265/VP9 bitstream to YUV
1515
- Compatible with Yocto-based root filesystem
16+
- Supports both encode and decode test modes.
17+
- Parses and runs multiple JSON config files.
18+
- Automatically fetches missing input clips from a predefined URL.
19+
- Supports timeout, repeat, dry-run, and JUnit XML output.
20+
- Performs dmesg scanning for kernel errors.
21+
- Generates summary reports.
1622

1723
## Prerequisites
1824

1925
Ensure the following components are present in the target Yocto build:
2026

2127
- `iris_v4l2_test` (available in /usr/bin/) - this test app can be compiled from https://github.com/quic/v4l-video-test-app
22-
- input json file for iris_v4l2_test app
28+
- input json config files for encode/decode tests
2329
- input bitstream for decode script
2430
- input YUV for encode script
2531
- Write access to root filesystem (for environment setup)
32+
- POSIX shell utilities: grep, sed, awk, find, sort
33+
- Optional: run_with_timeout function from functestlib.sh
34+
- Internet access (for fetching missing clips)
2635

2736
## Directory Structure
2837

@@ -31,12 +40,14 @@ Runner/
3140
├── suites/
3241
│ ├── Multimedia/
3342
│ │ ├── Video/
34-
│ │ │ ├── iris_v4l2_video_encode/
35-
│ │ │ │ ├── H264Encoder.json
43+
│ │ │ ├── Video_V4L2_Runner/
44+
│ │ │ │ ├── h264Decoder.json
45+
│ │ │ │ ├── h265Decoder.json
46+
│ │ │ │ ├── vp9Decoder.json
47+
│ │ │ │ ├── h264Encoder.json
48+
│ │ │ │ ├── h265Encoder.json
3649
│ │ │ │ ├── run.sh
37-
│ │ │ ├── iris_v4l2_video_decode/
38-
│ │ │ │ ├── H264Decoder.json
39-
│ │ │ │ ├── run.sh
50+
│ │ │ ├── README_Video.md
4051
```
4152

4253
## Usage
@@ -49,30 +60,85 @@ Runner/
4960

5061
Run a specific test using:
5162
---
52-
Quick Example
63+
Quick Example:
5364
```
5465
git clone <this-repo>
5566
cd <this-repo>
5667
scp -r Runner user@target_device_ip:<Path in device>
5768
ssh user@target_device_ip
58-
cd <Path in device>/Runner && ./run-test.sh iris_v4l2_video_encode
69+
cd <Path in device>/Runner && ./run-test.sh Video_V4L2_Runner
5970
```
6071
Sample output:
6172
```
62-
sh-5.2# cd <Path in device>/Runner && ./run-test.sh iris_v4l2_video_encode
63-
[Executing test case: <Path in device>/Runner/suites/Multimedia/Video/iris_v4l2_video_encode] 1980-01-08 22:22:15 -
64-
[INFO] 1980-01-08 22:22:15 - -----------------------------------------------------------------------------------------
65-
[INFO] 1980-01-08 22:22:15 - -------------------Starting iris_v4l2_video_encode Testcase----------------------------
66-
[INFO] 1980-01-08 22:22:15 - Checking if dependency binary is available
67-
[PASS] 1980-01-08 22:22:15 - Test related dependencies are present.
68-
...
69-
[PASS] 1980-01-08 22:22:17 - iris_v4l2_video_encode : Test Passed
70-
[INFO] 1980-01-08 22:22:17 - -------------------Completed iris_v4l2_video_encode Testcase----------------------------
73+
sh-5.2# ./run-test.sh Video_V4L2_Runner
74+
[Executing test case: Video_V4L2_Runner] 2025-09-02 05:08:36 -
75+
[INFO] 2025-09-02 05:08:36 - ----------------------------------------------------------------------
76+
[INFO] 2025-09-02 05:08:36 - ------------------ Starting Video_V4L2_Runner (generic runner) ----------------
77+
[INFO] 2025-09-02 05:08:36 - === Initialization ===
78+
[INFO] 2025-09-02 05:08:36 - TIMEOUT=60s STRICT=0 DMESG_SCAN=1 SUCCESS_RE=SUCCESS
79+
[INFO] 2025-09-02 05:08:36 - LOGLEVEL=15
80+
[INFO] 2025-09-02 05:08:36 - REPEAT=1 REPEAT_DELAY=0s REPEAT_POLICY=all
81+
[INFO] 2025-09-02 05:08:36 - No config argument passed, searching for JSON files in /var/Runner/suites/Multimedia/Video/
82+
[INFO] 2025-09-02 05:08:36 - Configs to run:
83+
- /var/Runner/suites/Multimedia/Video/Video_V4L2_H264_Decode/h264Decoder.json
84+
- /var/Runner/suites/Multimedia/Video/Video_V4L2_H264_Encode/h264Encoder.json
85+
- /var/Runner/suites/Multimedia/Video/Video_V4L2_H265_Decode/h265Decoder.json
86+
- /var/Runner/suites/Multimedia/Video/Video_V4L2_H265_Encode/h265Encoder.json
87+
- /var/Runner/suites/Multimedia/Video/Video_V4L2_VP9_Decode/vp9Decoder.json
88+
[INFO] 2025-09-02 05:08:37 - No relevant, non-benign errors for modules [oom|memory|BUG|hung task|soft lockup|hard lockup|rcu|page allocation failure|I/O error] in recent dmesg.
89+
[PASS] 2025-09-02 05:08:37 - [Decode1] PASS (1/1 ok)
90+
[INFO] 2025-09-02 05:08:39 - No relevant, non-benign errors for modules [oom|memory|BUG|hung task|soft lockup|hard lockup|rcu|page allocation failure|I/O error] in recent dmesg.
91+
[PASS] 2025-09-02 05:08:39 - [Encode1] PASS (1/1 ok)
92+
[INFO] 2025-09-02 05:08:55 - No relevant, non-benign errors for modules [oom|memory|BUG|hung task|soft lockup|hard lockup|rcu|page allocation failure|I/O error] in recent dmesg.
93+
[PASS] 2025-09-02 05:08:55 - [Decode2] PASS (1/1 ok)
94+
[INFO] 2025-09-02 05:08:57 - No relevant, non-benign errors for modules [oom|memory|BUG|hung task|soft lockup|hard lockup|rcu|page allocation failure|I/O error] in recent dmesg.
95+
[PASS] 2025-09-02 05:08:57 - [Encode2] PASS (1/1 ok)
96+
[INFO] 2025-09-02 05:09:01 - No relevant, non-benign errors for modules [oom|memory|BUG|hung task|soft lockup|hard lockup|rcu|page allocation failure|I/O error] in recent dmesg.
97+
[PASS] 2025-09-02 05:09:01 - [Decode3] PASS (1/1 ok)
98+
[INFO] 2025-09-02 05:09:01 - Summary: total=5 pass=5 fail=0 skip=0
99+
[PASS] 2025-09-02 05:09:01 - Video_V4L2_Runner: PASS
100+
[PASS] 2025-09-02 05:09:01 - Video_V4L2_Runner passed
101+
102+
[INFO] 2025-09-02 05:09:01 - ========== Test Summary ==========
103+
PASSED:
104+
Video_V4L2_Runner
105+
106+
FAILED:
107+
None
108+
109+
SKIPPED:
110+
None
111+
[INFO] 2025-09-02 05:09:01 - ==================================
71112
```
72-
3. Results will be available in the `Runner/suites/Multimedia/Video/` directory under each usecase folder.
113+
114+
4. Results will be available in the `Runner/suites/Multimedia/Video/Video_V4L2_Runner` directory.
115+
116+
## Common Options
117+
118+
- Below options are currently supported if you run video test script `Runner/suites/Multimedia/Video/Video_V4L2_Runner/run.sh`
119+
120+
| Option | Description |
121+
|---|---|
122+
| `--config path.json` | Run a specific config file |
123+
| `--dir DIR` | Directory to search for configs |
124+
| `--pattern GLOB` | Filter configs by glob pattern |
125+
| `--timeout S` | Timeout per test (default: 60s) |
126+
| `--strict` | Fail on critical dmesg errors |
127+
| `--no-dmesg` | Disable dmesg scanning |
128+
| `--max N` | Run at most N tests |
129+
| `--stop-on-fail` | Stop on first failure |
130+
| `--loglevel N` | Set log level for `iris_v4l2_test` |
131+
| `--repeat N` | Repeat each test N times |
132+
| `--repeat-delay S` | Delay between repeats |
133+
| `--repeat-policy | all or any |
134+
| `--junit FILE` | Output JUnit XML to file |
135+
| `--dry-run` | Show commands without executing |
136+
73137

74138
## Notes
75139

76-
- The script does not take any arguments.
140+
- The script auto-detects encode/decode mode based on config filename.
77141
- It validates the presence of required libraries before executing tests.
78-
- If any critical tool is missing, the script exits with an error message.
142+
- If any critical tool is missing, the script exits with an error message.
143+
- Missing input clips are fetched from:
144+
https://github.com/qualcomm-linux/qcom-linux-testkit/releases/download/IRIS-Video-Files-v1.0/video_clips_iris.tar.gz

Runner/suites/Multimedia/Video/iris_v4l2_video_decode/h264Decoder.json renamed to Runner/suites/Multimedia/Video/Video_V4L2_Runner/h264Decoder.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
"ExecutionMode": "Sequential",
33
"TestCases": [
44
{
5-
"Name" : "Decoder Testcase",
5+
"Name" : "H264 Decoder Testcase",
66
"TestConfigs" : {
77
"Domain": "Decoder",
8-
"InputPath": "./simple_AVC_720p_10fps_90frames.264",
8+
"InputPath": "./720p_AVC.h264",
99
"NumFrames": -1,
1010
"CodecName": "AVC",
1111
"PixelFormat": "NV12",
1212
"Width": 1280,
1313
"Height": 720,
14-
"Outputpath": "./output_simple_nv12_720p_90frms.yuv",
14+
"Outputpath": "./720p_AVC.yuv",
1515
"InputBufferCount": 16,
1616
"OutputBufferCount": 16
1717
}

Runner/suites/Multimedia/Video/iris_v4l2_video_encode/h264Encoder.json renamed to Runner/suites/Multimedia/Video/Video_V4L2_Runner/h264Encoder.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
"Name" : "Encoder Testcase",
66
"TestConfigs" : {
77
"Domain": "Encoder",
8-
"InputPath": "./simple_nv12_720p_90frms.yuv",
8+
"InputPath": "./90frames_yuv.yuv",
99
"NumFrames": -1,
1010
"CodecName": "AVC",
1111
"PixelFormat": "NV12",
1212
"Width": 1280,
1313
"Height": 720,
14-
"Outputpath": "./output_simple_AVC_720p_10fps.h264",
14+
"Outputpath": "./Enc_AVC_720p.h264",
1515
"InputBufferCount": 32,
1616
"OutputBufferCount": 32,
1717
"OperatingRate": 10,
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"ExecutionMode": "Sequential",
3+
"TestCases": [
4+
{
5+
"Name": "HEVC Decoder TestCase",
6+
"TestConfigs": {
7+
"Domain": "Decoder",
8+
"InputPath": "./720x1280_hevc.h265",
9+
"NumFrames": -1,
10+
"CodecName": "HEVC",
11+
"PixelFormat": "NV12",
12+
"Width": 1280,
13+
"Height": 720,
14+
"Outputpath": "./720x1280_hevc.yuv",
15+
"InputBufferCount": 16,
16+
"OutputBufferCount": 16,
17+
"UseMinBufferCtrl": false
18+
}
19+
}
20+
]
21+
}
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
{
2+
"ExecutionMode": "Sequential",
3+
"TestCases": [
4+
{
5+
"Name": "HEVC Encode TestCase",
6+
"TestConfigs": {
7+
"VideoDevice": "/dev/video1",
8+
"Domain": "Encoder",
9+
"InputPath": "./60frames_yuv.yuv",
10+
"NumFrames": 60,
11+
"CodecName": "HEVC",
12+
"PixelFormat": "NV12",
13+
"Width": 1280,
14+
"Height": 720,
15+
"Outputpath": "./Enc_HEVC__Main_1280_720.265",
16+
"UseMinBufferCtrl": false,
17+
"InputBufferCount": 32,
18+
"OutputBufferCount": 32,
19+
"OperatingRate": 30,
20+
"FrameRate": 30,
21+
"StaticControls": [
22+
{
23+
"Id": "Profile",
24+
"Vtype": "String",
25+
"Value": "MAIN"
26+
},
27+
{
28+
"Id": "Level",
29+
"Vtype": "String",
30+
"Value": "5.0"
31+
},
32+
{
33+
"Id": "FrameRC",
34+
"Vtype": "Int",
35+
"Value": 1
36+
},
37+
{
38+
"Id": "BitRate",
39+
"Vtype": "Int",
40+
"Value": 3662400
41+
},
42+
{
43+
"Id": "BitRateMode",
44+
"Vtype": "String",
45+
"Value": "VBR"
46+
},
47+
{
48+
"Id": "PrefixHeaderMode",
49+
"Vtype": "String",
50+
"Value": "JOINED"
51+
},
52+
{
53+
"Id": "Tier",
54+
"Vtype": "String",
55+
"Value": "HIGH"
56+
},
57+
{
58+
"Id": "GOPSize",
59+
"Vtype": "Int",
60+
"Value": 59
61+
},
62+
{
63+
"Id": "MultiSliceMode",
64+
"Vtype": "String",
65+
"Value": "SINGLE"
66+
},
67+
{
68+
"Id": "MinIQP",
69+
"Vtype": "Int",
70+
"Value": 10
71+
},
72+
{
73+
"Id": "MinPQP",
74+
"Vtype": "Int",
75+
"Value": 10
76+
},
77+
{
78+
"Id": "MinBQP",
79+
"Vtype": "Int",
80+
"Value": 10
81+
},
82+
{
83+
"Id": "MaxIQP",
84+
"Vtype": "Int",
85+
"Value": 51
86+
},
87+
{
88+
"Id": "MaxPQP",
89+
"Vtype": "Int",
90+
"Value": 51
91+
},
92+
{
93+
"Id": "MaxBQP",
94+
"Vtype": "Int",
95+
"Value": 51
96+
}
97+
],
98+
"DynamicControls": []
99+
}
100+
}
101+
]
102+
}

0 commit comments

Comments
 (0)