Skip to content

Commit 3778df2

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 f4a7965 commit 3778df2

File tree

10 files changed

+1094
-146
lines changed

10 files changed

+1094
-146
lines changed

Runner/suites/Multimedia/Video/README_Video.md

Lines changed: 99 additions & 21 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,16 @@ 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
51+
├── utils/
52+
│ ├── lib_video.sh
4053
```
4154

4255
## Usage
@@ -55,24 +68,89 @@ git clone <this-repo>
5568
cd <this-repo>
5669
scp -r Runner user@target_device_ip:<Path in device>
5770
ssh user@target_device_ip
58-
cd <Path in device>/Runner && ./run-test.sh iris_v4l2_video_encode
71+
cd <Path in device>/Runner && ./run-test.sh Video_V4L2_Runner
5972
```
6073
Sample output:
6174
```
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----------------------------
75+
sh-5.2# ./run-test.sh Video_V4L2_Runner
76+
[Executing test case: Video_V4L2_Runner] 2025-09-02 05:08:36 -
77+
[INFO] 2025-09-02 05:08:36 - ----------------------------------------------------------------------
78+
[INFO] 2025-09-02 05:08:36 - ------------------ Starting Video_V4L2_Runner (generic runner) ----------------
79+
[INFO] 2025-09-02 05:08:36 - === Initialization ===
80+
[INFO] 2025-09-02 05:08:36 - TIMEOUT=60s STRICT=0 DMESG_SCAN=1 SUCCESS_RE=SUCCESS
81+
[INFO] 2025-09-02 05:08:36 - LOGLEVEL=15
82+
[INFO] 2025-09-02 05:08:36 - REPEAT=1 REPEAT_DELAY=0s REPEAT_POLICY=all
83+
[INFO] 2025-09-02 05:08:36 - No config argument passed, searching for JSON files in ./Runner/suites/Multimedia/Video/
84+
[INFO] 2025-09-02 05:08:36 - Configs to run:
85+
- ./Runner/suites/Multimedia/Video/Video_V4L2_Runner/h264Decoder.json
86+
- ./Runner/suites/Multimedia/Video/Video_V4L2_Runner/h264Encoder.json
87+
- ./Runner/suites/Multimedia/Video/Video_V4L2_Runner/h265Decoder.json
88+
- ./Runner/suites/Multimedia/Video/Video_V4L2_Runner/h265Encoder.json
89+
- ./Runner/suites/Multimedia/Video/Video_V4L2_Runner/vp9Decoder.json
90+
[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.
91+
[PASS] 2025-09-02 05:08:37 - [Decode1] PASS (1/1 ok)
92+
[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.
93+
[PASS] 2025-09-02 05:08:39 - [Encode1] PASS (1/1 ok)
94+
[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.
95+
[PASS] 2025-09-02 05:08:55 - [Decode2] PASS (1/1 ok)
96+
[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.
97+
[PASS] 2025-09-02 05:08:57 - [Encode2] PASS (1/1 ok)
98+
[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.
99+
[PASS] 2025-09-02 05:09:01 - [Decode3] PASS (1/1 ok)
100+
[INFO] 2025-09-02 05:09:01 - Summary: total=5 pass=5 fail=0 skip=0
101+
[PASS] 2025-09-02 05:09:01 - Video_V4L2_Runner: PASS
102+
[PASS] 2025-09-02 05:09:01 - Video_V4L2_Runner passed
103+
104+
[INFO] 2025-09-02 05:09:01 - ========== Test Summary ==========
105+
PASSED:
106+
Video_V4L2_Runner
107+
108+
FAILED:
109+
None
110+
111+
SKIPPED:
112+
None
113+
[INFO] 2025-09-02 05:09:01 - ==================================
71114
```
72-
3. Results will be available in the `Runner/suites/Multimedia/Video/` directory under each usecase folder.
115+
116+
4. Results will be available in the `Runner/suites/Multimedia/Video/Video_V4L2_Runner` directory.
117+
118+
## Common Options
119+
120+
| Option | Description |
121+
|--------|-------------|
122+
123+
| `--extract-input-clips true|false` | Auto-fetch missing clips (default: true) |
124+
| `--stack auto|upstream|downstream|base|overlay|up|down` | Select video stack |
125+
| `--platform lemans|monaco|kodiak` | Specify platform for validation |
126+
| `--downstream-fw PATH` | Path to downstream firmware (Kodiak-specific) |
127+
| `--force` | Force stack switch or firmware override |
128+
| `--verbose` | Enable verbose logging |
129+
| `--config path.json` | Run a specific config file |
130+
| `--dir DIR` | Directory to search for configs |
131+
| `--pattern GLOB` | Filter configs by glob pattern |
132+
| `--timeout S` | Timeout per test (default: 60s) |
133+
| `--strict` | Fail on critical dmesg errors |
134+
| `--no-dmesg` | Disable dmesg scanning |
135+
| `--max N` | Run at most N tests |
136+
| `--stop-on-fail` | Stop on first failure |
137+
| `--loglevel N` | Set log level for `iris_v4l2_test` |
138+
| `--repeat N` | Repeat each test N times |
139+
| `--repeat-delay S` | Delay between repeats |
140+
| `--repeat-policy | all or any |
141+
| `--junit FILE` | Output JUnit XML to file |
142+
| `--dry-run` | Show commands without executing |
143+
73144

74145
## Notes
75146

76-
- The script does not take any arguments.
147+
- The script auto-detects encode/decode mode based on config filename.
77148
- It validates the presence of required libraries before executing tests.
78-
- If any critical tool is missing, the script exits with an error message.
149+
- If any critical tool is missing, the script exits with an error message.
150+
- Missing input clips are fetched from:
151+
https://github.com/qualcomm-linux/qcom-linux-testkit/releases/download/IRIS-Video-Files-v1.0/video_clips_iris.tar.gz
152+
153+
## License
154+
155+
SPDX-License-Identifier: BSD-3-Clause-Clear
156+
(C) Qualcomm Technologies, Inc. and/or its subsidiaries.

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)