-
Notifications
You must be signed in to change notification settings - Fork 21
Public CI Video Decode and Encode Shell Scripts. #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. | ||
# SPDX-License-Identifier: BSD-3-Clause-Clear | ||
|
||
# Iris V4L2 Video Test Scripts for Qualcomm Linux based platform (Yocto) | ||
|
||
## Overview | ||
|
||
Video scripts automates the validation of video encoding and decoding capabilities on the Qualcomm Linux based platform running a Yocto-based Linux system. It utilizes iri_v4l2_test test app which is publicly available @https://github.com/quic/v4l-video-test-app | ||
|
||
## Features | ||
|
||
- V4L2 driver level test | ||
- Encoding YUV to H264 bitstream | ||
- Decoding H264 bitstream to YUV | ||
- Compatible with Yocto-based root filesystem | ||
|
||
## Prerequisites | ||
|
||
Ensure the following components are present in the target Yocto build: | ||
|
||
- `iris_v4l2_test` (available in /usr/bin/) - this test app can be compiled from https://github.com/quic/v4l-video-test-app | ||
- input json file for iris_v4l2_test app | ||
- input bitstream for decode script | ||
- input YUV for encode script | ||
- Write access to root filesystem (for environment setup) | ||
|
||
## Directory Structure | ||
|
||
```bash | ||
Runner/ | ||
├── suites/ | ||
│ ├── Multimedia/ | ||
│ │ ├── Video/ | ||
│ │ │ ├── iris_v4l2_video_encode/ | ||
│ │ │ │ ├── H264Encoder.json | ||
│ │ │ │ ├── run.sh | ||
│ │ │ ├── iris_v4l2_video_decode/ | ||
│ │ │ │ ├── H264Decoder.json | ||
│ │ │ │ ├── run.sh | ||
``` | ||
|
||
## Usage | ||
|
||
1. Copy repo to Target Device: Use scp to transfer the scripts from the host to the target device. The scripts should be copied to the /var directory on the target device. | ||
|
||
2. Verify Transfer: Ensure that the repo have been successfully copied to the /var directory on the target device. | ||
|
||
3. Run Scripts: Navigate to the /var directory on the target device and execute the scripts as needed. | ||
|
||
Run a specific test using: | ||
--- | ||
Quick Example | ||
``` | ||
git clone <this-repo> | ||
cd <this-repo> | ||
scp -r common Runner user@target_device_ip:/var | ||
ssh user@target_device_ip | ||
cd /var/Runner && ./run-test.sh iris_v4l2_video_encode | ||
``` | ||
Sample output: | ||
``` | ||
sh-5.2# cd /var/Runner && ./run-test.sh iris_v4l2_video_encode | ||
[Executing test case: /var/Runner/suites/Multimedia/Video/iris_v4l2_video_encode] 1980-01-08 22:22:15 - | ||
[INFO] 1980-01-08 22:22:15 - ----------------------------------------------------------------------------------------- | ||
[INFO] 1980-01-08 22:22:15 - -------------------Starting iris_v4l2_video_encode Testcase---------------------------- | ||
[INFO] 1980-01-08 22:22:15 - Checking if dependency binary is available | ||
[PASS] 1980-01-08 22:22:15 - Test related dependencies are present. | ||
... | ||
[PASS] 1980-01-08 22:22:17 - iris_v4l2_video_encode : Test Passed | ||
[INFO] 1980-01-08 22:22:17 - -------------------Completed iris_v4l2_video_encode Testcase---------------------------- | ||
``` | ||
3. Results will be available in the `Runner/suites/Multimedia/Video/` directory under each usecase folder. | ||
|
||
## Notes | ||
|
||
- The script does not take any arguments. | ||
- It validates the presence of required libraries before executing tests. | ||
- If any critical tool is missing, the script exits with an error message. |
20 changes: 20 additions & 0 deletions
20
Runner/suites/Multimedia/Video/iris_v4l2_video_decode/h264Decoder.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"ExecutionMode": "Sequential", | ||
"TestCases": [ | ||
{ | ||
"Name" : "Decoder Testcase", | ||
"TestConfigs" : { | ||
"Domain": "Decoder", | ||
"InputPath": "./simple_AVC_720p_10fps_90frames.264", | ||
"NumFrames": -1, | ||
"CodecName": "AVC", | ||
"PixelFormat": "NV12", | ||
"Width": 1280, | ||
"Height": 720, | ||
"Outputpath": "./output_simple_nv12_720p_90frms.yuv", | ||
"InputBufferCount": 16, | ||
"OutputBufferCount": 16 | ||
} | ||
} | ||
] | ||
} |
23 changes: 16 additions & 7 deletions
23
Runner/suites/Multimedia/Video/iris_v4l2_video_decode/run.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,34 @@ | ||
#!/bin/sh | ||
|
||
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. | ||
# SPDX-License-Identifier: BSD-3-Clause-Clear | ||
|
||
# Import test suite definitions | ||
/var/Runner/init_env | ||
TESTNAME="video_decode" | ||
# shellcheck source=../../../../init_env | ||
. "${PWD}"/init_env | ||
TESTNAME="iris_v4l2_video_decode" | ||
TAR_URL="https://github.com/qualcomm-linux/qcom-linux-testkit/releases/download/IRIS-Video-Files-v1.0/video_clips_iris.tar.gz" | ||
|
||
#import test functions library | ||
. $TOOLS/functestlib.sh | ||
# shellcheck source=../../../../utils/functestlib.sh | ||
. "${TOOLS}"/functestlib.sh | ||
test_path=$(find_test_case_by_name "$TESTNAME") | ||
log_info "-----------------------------------------------------------------------------------------" | ||
log_info "-------------------Starting $TESTNAME Testcase----------------------------" | ||
|
||
log_info "Checking if dependency binary is available" | ||
check_dependencies iris_v4l2_test | ||
extract_tar_from_url "$TAR_URL" | ||
|
||
# Run the first test | ||
iris_v4l2_test --config /Video/DEC_AVC_NV12_BASIC_CFG.json --loglevel 15 >> video_dec.txt | ||
iris_v4l2_test --config "${test_path}/h264Decoder.json" --loglevel 15 >> "${test_path}/video_dec.txt" | ||
|
||
if grep -q "Test Passed" "video_dec.txt"; then | ||
if grep -q "SUCCESS" "${test_path}/video_dec.txt"; then | ||
log_pass "$TESTNAME : Test Passed" | ||
echo "$TESTNAME : Test Passed" > $test_path/$TESTNAME.res | ||
echo "$TESTNAME PASS" > "$test_path/$TESTNAME.res" | ||
else | ||
log_fail "$TESTNAME : Test Failed" | ||
echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res | ||
echo "$TESTNAME FAIL" > "$test_path/$TESTNAME.res" | ||
fi | ||
|
||
log_info "-------------------Completed $TESTNAME Testcase----------------------------" |
30 changes: 30 additions & 0 deletions
30
Runner/suites/Multimedia/Video/iris_v4l2_video_encode/h264Encoder.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"ExecutionMode": "Sequential", | ||
"TestCases": [ | ||
{ | ||
"Name" : "Encoder Testcase", | ||
"TestConfigs" : { | ||
"Domain": "Encoder", | ||
"InputPath": "./simple_nv12_720p_90frms.yuv", | ||
"NumFrames": -1, | ||
"CodecName": "AVC", | ||
"PixelFormat": "NV12", | ||
"Width": 1280, | ||
"Height": 720, | ||
"Outputpath": "./output_simple_AVC_720p_10fps.h264", | ||
"InputBufferCount": 32, | ||
"OutputBufferCount": 32, | ||
"OperatingRate": 10, | ||
"FrameRate": 10, | ||
"StaticControls": [ | ||
{"Id": "Profile", "Vtype": "String", "Value": "BASELINE"}, | ||
{"Id": "Level", "Vtype": "String", "Value": "5.0"}, | ||
{"Id": "FrameRC", "Vtype": "Int", "Value": 1}, | ||
{"Id": "BitRate", "Vtype": "Int", "Value": 18000000}, | ||
{"Id": "BitRateMode", "Vtype": "String", "Value": "CBR"}, | ||
{"Id": "PrefixHeaderMode", "Vtype": "String", "Value": "JOINED"} | ||
] | ||
} | ||
} | ||
] | ||
} |
23 changes: 16 additions & 7 deletions
23
Runner/suites/Multimedia/Video/iris_v4l2_video_encode/run.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,34 @@ | ||
#!/bin/sh | ||
|
||
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. | ||
# SPDX-License-Identifier: BSD-3-Clause-Clear | ||
|
||
# Import test suite definitions | ||
/var/Runner/init_env | ||
TESTNAME="video_encode" | ||
# shellcheck source=../../../../init_env | ||
. "${PWD}"/init_env | ||
TESTNAME="iris_v4l2_video_encode" | ||
TAR_URL="https://github.com/qualcomm-linux/qcom-linux-testkit/releases/download/IRIS-Video-Files-v1.0/video_clips_iris.tar.gz" | ||
|
||
#import test functions library | ||
. $TOOLS/functestlib.sh | ||
# shellcheck source=../../../../utils/functestlib.sh | ||
. "${TOOLS}"/functestlib.sh | ||
test_path=$(find_test_case_by_name "$TESTNAME") | ||
log_info "-----------------------------------------------------------------------------------------" | ||
log_info "-------------------Starting $TESTNAME Testcase----------------------------" | ||
|
||
log_info "Checking if dependency binary is available" | ||
check_dependencies iris_v4l2_test | ||
extract_tar_from_url "$TAR_URL" | ||
|
||
# Run the first test | ||
iris_v4l2_test --config /Video/ENC_AVC_NV12_BASIC_CFG.json --loglevel 15 >> video_enc.txt | ||
iris_v4l2_test --config "${test_path}/h264Encoder.json" --loglevel 15 >> "${test_path}/video_enc.txt" | ||
|
||
if grep -q "Test Passed" "video_enc.txt"; then | ||
if grep -q "SUCCESS" "${test_path}/video_enc.txt"; then | ||
log_pass "$TESTNAME : Test Passed" | ||
echo "$TESTNAME : Test Passed" > $test_path/$TESTNAME.res | ||
echo "$TESTNAME PASS" > "$test_path/$TESTNAME.res" | ||
else | ||
log_fail "$TESTNAME : Test Failed" | ||
echo "$TESTNAME : Test Failed" > $test_path/$TESTNAME.res | ||
echo "$TESTNAME FAIL" > "$test_path/$TESTNAME.res" | ||
fi | ||
|
||
log_info "-------------------Completed $TESTNAME Testcase----------------------------" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please fix indentation.