Skip to content
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

Initial implemention of a push av server #36004

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fmonniot
Copy link

@fmonniot fmonniot commented Oct 9, 2024

Push AV Server implementation for cameras. This PR is currently a draft to gather early feedback from the camera tiger team. It is not intended to be merged as part of the Matter 1.4 release.

This PR introduce a new tool (src/tools/push_av_server/server.py) that offer a web server to test the PUSH AV Transport cluster. The tool also manage TLS certificates for both the server itself as well as the cameras uploading to it. The server can be interacted with via HTTP calls when used as a standalone tool (work on a UI is in progress) or via python functions when used as a module (mostly targeting the test harness).

Note that test harness integration is mostly a work in progress at this point. The added test file in this PR is only intended as a guide (as well as to provide information onto how the tool can be used in that context) to help develop correct APIs and is not intended to be merged as part of this PR.

The web server provide few checks in term of validation for the ingested media. The idea is to have a server permissive enough that record as much information as possible, and then rely on the actual test to validate that the camera is working as it should.

Copy link

semanticdiff-com bot commented Oct 9, 2024

Review changes with SemanticDiff.

Analyzed 4 of 8 files.

Filename Status
src/tools/push_av_server/.flake8 Unsupported file format
src/tools/push_av_server/README.md Unsupported file format
src/tools/push_av_server/generate_cmaf_content.sh Unsupported file format
✔️ src/tools/push_av_server/index.html Analyzed
src/tools/push_av_server/requirements.txt Unsupported file format
✔️ src/tools/push_av_server/server.py Analyzed
✔️ src/python_testing/TC_PAVS_1_0.py Analyzed
✔️ src/python_testing/push_av_server.py Analyzed

@CLAassistant
Copy link

CLAassistant commented Oct 9, 2024

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added tools tests matter-1.4-te2-script-change Script changes before end of Matter 1.4 TE2 labels Oct 9, 2024
@fmonniot fmonniot marked this pull request as draft October 9, 2024 23:10
Copy link

github-actions bot commented Oct 9, 2024

PR #36004: Size comparison from a7bbd7b to 2bc6170

Full report (88 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
platform target config section a7bbd7b 2bc6170 change % change
bl602 lighting-app bl602 FLASH 1280856 1280856 0 0.0
RAM 95808 95808 0 0.0
bl602+mfd FLASH 1308904 1308904 0 0.0
RAM 95464 95464 0 0.0
bl602+rpc FLASH 1335532 1335532 0 0.0
RAM 103784 103784 0 0.0
bl702 lighting-app bl702 FLASH 945236 945236 0 0.0
RAM 15105 15105 0 0.0
bl702+mfd FLASH 957690 957690 0 0.0
RAM 14769 14769 0 0.0
bl702+rpc FLASH 1051394 1051394 0 0.0
RAM 23661 23661 0 0.0
bl706-eth FLASH 658368 658368 0 0.0
RAM 24745 24745 0 0.0
bl706-wifi FLASH 825164 825164 0 0.0
RAM 13965 13965 0 0.0
bl702l lighting-app bl702l FLASH 962172 962172 0 0.0
RAM 16804 16804 0 0.0
bl702l+mfd FLASH 974934 974932 -2 -0.0
RAM 16468 16468 0 0.0
cc13x4_26x4 lighting-app LP_EM_CC1354P10_6 FLASH 829460 829460 0 0.0
RAM 123292 123292 0 0.0
lock-ftd LP_EM_CC1354P10_6 FLASH 814792 814792 0 0.0
RAM 125172 125172 0 0.0
pump-app LP_EM_CC1354P10_6 FLASH 761356 761356 0 0.0
RAM 113664 113664 0 0.0
pump-controller-app LP_EM_CC1354P10_6 FLASH 745584 745584 0 0.0
RAM 113856 113856 0 0.0
cc32xx air-purifier CC3235SF_LAUNCHXL FLASH 617114 617114 0 0.0
RAM 205396 205396 0 0.0
lock CC3235SF_LAUNCHXL FLASH 657218 657218 0 0.0
RAM 205548 205548 0 0.0
cyw30739 light CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 678437 678437 0 0.0
RAM 78508 78508 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 698281 698281 0 0.0
RAM 81140 81140 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 698281 698281 0 0.0
RAM 81140 81140 0 0.0
CYW930739M2EVB-02 unknown 2040 2040 0 0.0
FLASH 655217 655217 0 0.0
RAM 73576 73576 0 0.0
light-switch CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 614765 614765 0 0.0
RAM 71468 71468 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 634393 634393 0 0.0
RAM 74020 74020 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 634393 634393 0 0.0
RAM 74020 74020 0 0.0
lock CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 634085 634085 0 0.0
RAM 74516 74516 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 653793 653793 0 0.0
RAM 77068 77068 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 653793 653793 0 0.0
RAM 77068 77068 0 0.0
thermostat CYW30739B2-P5-EVK-01 unknown 2040 2040 0 0.0
FLASH 609389 609389 0 0.0
RAM 68604 68604 0 0.0
CYW30739B2-P5-EVK-02 unknown 2040 2040 0 0.0
FLASH 629249 629249 0 0.0
RAM 71236 71236 0 0.0
CYW30739B2-P5-EVK-03 unknown 2040 2040 0 0.0
FLASH 629249 629249 0 0.0
RAM 71236 71236 0 0.0
efr32 lighting-app BRD4187C FLASH 934544 934544 0 0.0
RAM 135956 135956 0 0.0
lock-app BRD2605a FLASH 740640 740632 -8 -0.0
RAM 230816 230816 0 0.0
BRD4338a FLASH 741288 741280 -8 -0.0
RAM 230848 230848 0 0.0
window-app BRD4187C FLASH 1018108 1018108 0 0.0
RAM 127892 127892 0 0.0
esp32 all-clusters-app c3devkit DRAM 94088 94088 0 0.0
FLASH 1538678 1538678 0 0.0
IRAM 82538 82538 0 0.0
m5stack DRAM 115032 115032 0 0.0
FLASH 1549018 1549018 0 0.0
IRAM 117039 117039 0 0.0
linux air-purifier-app debug unknown 4688 4688 0 0.0
FLASH 2780949 2780949 0 0.0
RAM 129520 129520 0 0.0
all-clusters-app debug unknown 5528 5528 0 0.0
FLASH 6085426 6085426 0 0.0
RAM 514720 514720 0 0.0
all-clusters-minimal-app debug unknown 5424 5424 0 0.0
FLASH 5418228 5418228 0 0.0
RAM 241200 241200 0 0.0
bridge-app debug unknown 5408 5408 0 0.0
FLASH 4751700 4751700 0 0.0
RAM 218384 218384 0 0.0
chip-tool debug unknown 5960 5960 0 0.0
FLASH 12779836 12779836 0 0.0
RAM 567890 567890 0 0.0
chip-tool-ipv6only arm64 unknown 20880 20880 0 0.0
FLASH 11396256 11396256 0 0.0
RAM 618432 618432 0 0.0
fabric-admin debug unknown 5792 5792 0 0.0
FLASH 11090809 11090809 0 0.0
RAM 567578 567578 0 0.0
fabric-bridge-app debug unknown 4632 4632 0 0.0
FLASH 4574898 4574898 0 0.0
RAM 205048 205048 0 0.0
lighting-app debug+rpc+ui unknown 6056 6056 0 0.0
FLASH 5692289 5692289 0 0.0
RAM 228488 228488 0 0.0
lock-app debug unknown 5344 5344 0 0.0
FLASH 4801264 4801264 0 0.0
RAM 204472 204472 0 0.0
ota-provider-app debug unknown 4720 4720 0 0.0
FLASH 4430688 4430688 0 0.0
RAM 198192 198192 0 0.0
ota-requestor-app debug unknown 4656 4656 0 0.0
FLASH 4569502 4569502 0 0.0
RAM 202760 202760 0 0.0
shell debug unknown 4216 4216 0 0.0
FLASH 3111005 3111005 0 0.0
RAM 159280 159280 0 0.0
thermostat-no-ble arm64 unknown 9448 9448 0 0.0
FLASH 4319472 4319472 0 0.0
RAM 242888 242888 0 0.0
tv-app debug unknown 5624 5624 0 0.0
FLASH 6029621 6029621 0 0.0
RAM 588256 588256 0 0.0
tv-casting-app debug unknown 5208 5208 0 0.0
FLASH 10979229 10979229 0 0.0
RAM 656960 656960 0 0.0
nrfconnect all-clusters-app nrf52840dk_nrf52840 FLASH 914420 914420 0 0.0
RAM 142199 142199 0 0.0
nrf7002dk_nrf5340_cpuapp FLASH 885228 885228 0 0.0
RAM 140338 140338 0 0.0
all-clusters-minimal-app nrf52840dk_nrf52840 FLASH 847836 847836 0 0.0
RAM 141101 141101 0 0.0
nxp contact k32w0+release FLASH 582168 582168 0 0.0
RAM 70792 70792 0 0.0
k32w1+release FLASH 596896 596896 0 0.0
RAM 63016 63016 0 0.0
mcxw71+release FLASH 596656 596656 0 0.0
RAM 63016 63016 0 0.0
light k32w0+release FLASH 618700 618700 0 0.0
RAM 70256 70256 0 0.0
k32w1+release FLASH 682904 682904 0 0.0
RAM 48648 48648 0 0.0
mcxw71+release FLASH 682904 682904 0 0.0
RAM 48648 48648 0 0.0
lock k32w1+release FLASH 705248 705248 0 0.0
RAM 67156 67156 0 0.0
mcxw71+release FLASH 705256 705256 0 0.0
RAM 67156 67156 0 0.0
psoc6 all-clusters cy8ckit_062s2_43012 FLASH 1646292 1646292 0 0.0
RAM 210888 210888 0 0.0
all-clusters-minimal cy8ckit_062s2_43012 FLASH 1552356 1552356 0 0.0
RAM 207688 207688 0 0.0
light cy8ckit_062s2_43012 FLASH 1467828 1467828 0 0.0
RAM 200688 200688 0 0.0
lock cy8ckit_062s2_43012 FLASH 1464900 1464900 0 0.0
RAM 225048 225048 0 0.0
qpg lighting-app qpg6105+debug FLASH 660488 660488 0 0.0
RAM 105236 105236 0 0.0
lock-app qpg6105+debug FLASH 618508 618508 0 0.0
RAM 99704 99704 0 0.0
stm32 light STM32WB5MM-DK FLASH 481784 481784 0 0.0
RAM 144684 144684 0 0.0
telink air-quality-sensor-app tlsr9528a_retention FLASH 620946 620946 0 0.0
RAM 50488 50488 0 0.0
all-clusters-app tlsr9118bdk40d FLASH 688144 688144 0 0.0
RAM 148328 148328 0 0.0
all-clusters-minimal-app tlsr9528a FLASH 781136 781136 0 0.0
RAM 110280 110280 0 0.0
bridge-app tlsr9258a FLASH 681042 681042 0 0.0
RAM 91144 91144 0 0.0
contact-sensor-app tlsr9528a_retention FLASH 620710 620710 0 0.0
RAM 50440 50440 0 0.0
light-switch-app-ota-shell-factory-data tlsr9528a FLASH 708652 708652 0 0.0
RAM 73780 73780 0 0.0
lighting-app-ota-factory-data tlsr9118bdk40d FLASH 625648 625648 0 0.0
RAM 144308 144308 0 0.0
lighting-app-ota-rpc-factory-data-4mb tlsr9518adk80d FLASH 811408 811408 0 0.0
RAM 98940 98940 0 0.0
lock-app-dfu tlsr9528a FLASH 656616 656616 0 0.0
RAM 66500 66500 0 0.0
ota-requestor-app tlsr9258a FLASH 697020 697020 0 0.0
RAM 90736 90736 0 0.0
pump-app-usb tlsr9518adk80d FLASH 634344 634344 0 0.0
RAM 55316 55316 0 0.0
pump-controller-app tlsr9518adk80d FLASH 611534 611534 0 0.0
RAM 52560 52560 0 0.0
shell tlsr9518adk80d FLASH 467872 467872 0 0.0
RAM 68168 68168 0 0.0
smoke_co_alarm-app tlsr9528a_retention FLASH 627860 627860 0 0.0
RAM 52160 52160 0 0.0
temperature-measurement-app-mars-ota tlsr9518adk80d FLASH 653666 653666 0 0.0
RAM 56108 56108 0 0.0
thermostat tlsr9518adk80d FLASH 638266 638266 0 0.0
RAM 52952 52952 0 0.0
window-covering tlsr9118bdk40d FLASH 524404 524404 0 0.0
RAM 97284 97284 0 0.0
tizen all-clusters-app arm unknown 4904 4904 0 0.0
FLASH 1726732 1726732 0 0.0
RAM 89084 89084 0 0.0
chip-tool-ubsan arm unknown 10528 10528 0 0.0
FLASH 17717818 17717818 0 0.0
RAM 7714500 7714500 0 0.0

Comment on lines +40 to +62
-f mp4 \
-frag_duration "$((1 * 1000 * 1000))" \
-min_frag_duration "$((1 * 1000 * 1000))" \
-write_prft wallclock \
-use_editlist 0 \
-movflags "+cmaf+dash+delay_moov+skip_sidx+skip_trailer+frag_custom" \
\
-method PUT \
-multiple_requests 1 \
-chunked_post 1 \
-send_expect_100 1 \
-headers "DASH-IF-Ingest: 1.1" \
-headers "Host: localhost:8080" \
-content_type "" \
-icy 0 \
-rw_timeout "$((200 * 1000 * 1000))" \
-reconnect 1 \
-reconnect_at_eof 1 \
-reconnect_on_network_error 1 \
-reconnect_on_http_error 4xx,5xx \
-reconnect_delay_max 2 \
-http_opts $HTTP_OPTS \
"$PUBLISHING_ENDPOINT/cmaf/example.str/Switching(video)/video-720p.cmfv" \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the looks of this, this is generating non multiplexed tracks, aka video and audio are in seperate files instead of interleaved m4s / mp4 content.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. I missed the "All content SHALL be sent as a single stream and track." section of the Matter spec and was basing that example of off the DASH Ingest one, which I think do not limit the number of files. Will modify the script to generate one stream instead.

A question that comes to me from having only one stream, do we want to have the ecosystem provide the complete url as opposed to only the base? That may simplify the implementation on the ecosystem implementation, but would also restrict the spec if we want to expand it to include multiple streams in the future.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on my understanding of the DASH spec we are asking the ecosystem to provide the base URL and the camera then only appends the track name (always fixed since we are a single track) and segment number and file extension onto that to form the complete URL.
Right now the interleaved vs separate tracks is an enum in the spec that only defines interleaved (single track), so we have the ability to change in the future if we want.

@gmarcosb gmarcosb added cameras and removed matter-1.4-te2-script-change Script changes before end of Matter 1.4 TE2 labels Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

4 participants