Skip to content

Commit 886b9a4

Browse files
committed
Adding sample checks
1 parent 2a270cf commit 886b9a4

File tree

1 file changed

+49
-11
lines changed

1 file changed

+49
-11
lines changed

.github/workflows/samples.yml

Lines changed: 49 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ jobs:
2121
args: -f sample.mp4
2222
- name: kvs_gstreamer_file_uploader_sample
2323
args: sample.mp4 0 audio-video
24-
# - name: kvs_gstreamer_multistream_sample
25-
# args: ""
24+
- name: kvs_gstreamer_multistream_sample
25+
args: rtsp-urls.txt
2626
- name: kvs_gstreamer_sample
2727
args: sample.mp4
2828
- name: kvssink_gstreamer_sample
@@ -93,11 +93,47 @@ jobs:
9393
- name: Build samples (Windows)
9494
if: runner.os == 'Windows'
9595
run: |
96-
$env:Path += ';C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Strawberry\c\bin;C:\Program Files\NASM;${{ github.workspace }}\open-source\local\lib;${{ github.workspace }}\open-source\local\bin'
96+
$env:Path += ';C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Strawberry\c\bin;C:\Program Files\NASM;D:\producer\open-source\local\lib;D:\producer\open-source\local\bin'
97+
mkdir D:\producer
98+
Move-Item -Path "D:\a\amazon-kinesis-video-streams-producer-sdk-cpp\amazon-kinesis-video-streams-producer-sdk-cpp\*" -Destination "D:\producer"
99+
cd D:\producer
97100
git config --system core.longpaths true
98101
dir
99102
.github\build_windows.bat
100-
mkdir "%KVS_DEBUG_DUMP_DATA_FILE_DIR%"
103+
104+
- name: Setup RTSP source (Linux & Mac)
105+
if: (runner.os == 'Linux' || runner.os == 'macOS') && matrix.sample.name == 'kvs_gstreamer_multistream_sample'
106+
working-directory: ./build/debug_output
107+
run: |
108+
if [ "$RUNNER_OS" == "Linux" ]; then
109+
sudo apt-get install -y docker.io
110+
else
111+
brew install --cask docker
112+
open -a Docker
113+
114+
# Wait for Docker to be ready
115+
sleep 15
116+
fi
117+
118+
docker run -d --rm -e RTSP_PORT=8558 -p 8558:8558 -e GST_PIPELINE="videotestsrc pattern=ball ! videoscale ! video/x-raw,width=640,height=480,framerate=10/1 ! x264enc tune=zerolatency bitrate=512 ! rtph264pay name=pay0 pt=96" -e STREAM_NAME=stream1 bluenviron/mediamtx
119+
docker run -d --rm -e RTSP_PORT=8559 -p 8559:8559 -e GST_PIPELINE="videotestsrc ! videoscale ! video/x-raw,width=640,height=480,framerate=10/1 ! x264enc tune=zerolatency bitrate=512 ! rtph264pay name=pay0 pt=96" -e STREAM_NAME=stream2 bluenviron/mediamtx
120+
121+
echo "rtsp://0.0.0.0:8558/stream1" > rtsp-urls.txt
122+
echo "rtsp://0.0.0.0:8559/stream2" >> rtsp-urls.txt
123+
124+
- name: Setup RTSP source (Windows)
125+
if: runner.os == 'Windows' && matrix.sample.name == 'kvs_gstreamer_multistream_sample'
126+
working-directory: D:\producer\build
127+
run: |
128+
wsl --set-default-version 2
129+
130+
# Run the RTSP server using bluenviron/mediamtx
131+
docker run -d --rm -e RTSP_PORT=8558 -p 8558:8558 -e GST_PIPELINE="videotestsrc pattern=ball ! videoscale ! video/x-raw,width=640,height=480,framerate=10/1 ! x264enc tune=zerolatency bitrate=512 ! rtph264pay name=pay0 pt=96" -e STREAM_NAME=stream1 bluenviron/mediamtx
132+
docker run -d --rm -e RTSP_PORT=8559 -p 8559:8559 -e GST_PIPELINE="videotestsrc ! videoscale ! video/x-raw,width=640,height=480,framerate=10/1 ! x264enc tune=zerolatency bitrate=512 ! rtph264pay name=pay0 pt=96" -e STREAM_NAME=stream2 bluenviron/mediamtx
133+
134+
# Write RTSP URLs to a file
135+
echo "rtsp://0.0.0.0:8558/stream1" | Out-File -FilePath rtsp-urls.txt -Encoding UTF8
136+
echo "rtsp://0.0.0.0:8559/stream2" | Out-File -FilePath rtsp-urls.txt -Append -Encoding UTF8
101137
102138
- name: Configure AWS Credentials
103139
uses: aws-actions/configure-aws-credentials@v4
@@ -118,17 +154,19 @@ jobs:
118154
./${{ matrix.sample.name }} demo-stream-producer-cpp-${{ matrix.runner.id }}-ci-${{ matrix.sample.name }} ${{ matrix.sample.args }}
119155
120156
- name: Run ${{ matrix.sample.name }} (Windows)
121-
if: runner.os == 'Windows'
157+
if: runner.os == 'Windows' && matrix.sample.name != 'kvs_gstreamer_multistream_sample'
122158
env:
123-
GST_PLUGIN_PATH: ${{ github.workspace }}/build
124-
KVS_DEBUG_DUMP_DATA_FILE_DIR: ${{ github.workspace }}/build/debug_output
125-
working-directory: ./build
159+
GST_PLUGIN_PATH: D:\producer\build
160+
KVS_DEBUG_DUMP_DATA_FILE_DIR: D:\producer\debug_output
161+
working-directory: D:\producer\build
126162
run: |
127163
# Equivalent to set -x
128164
Set-PSDebug -Trace 1
129165
130166
$env:Path += ';C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Strawberry\c\bin;C:\Program Files\NASM;D:\producer\open-source\local\lib;D:\producer\open-source\local\bin;D:\gstreamer\1.0\msvc_x86_64\bin'
131167
168+
mkdir D:\producer\debug_output
169+
132170
Invoke-WebRequest -Uri https://awsj-iot-handson.s3-ap-northeast-1.amazonaws.com/kvs-workshop/sample.mp4 -OutFile sample.mp4
133171
dir
134172
$exePath = Join-Path $PWD ${{ matrix.sample.name }}.exe
@@ -153,13 +191,13 @@ jobs:
153191
done
154192
shell: bash
155193

156-
- name: Verify MKV dump
194+
- name: Verify MKV dump (Windows)
157195
if: runner.os == 'Windows'
158196
working-directory: D:\producer\build
159197
run: |
160198
$env:Path += ";C:\Program Files\MKVToolNix"
161-
dir debug_output
162-
$mkvFiles = Get-ChildItem -Path "D:\producer\build\debug_output" -Filter *.mkv
199+
dir D:\producer\debug_output
200+
$mkvFiles = Get-ChildItem -Path "D:\producer\debug_output" -Filter *.mkv
163201
if ($mkvFiles.Count -eq 0) {
164202
Write-Error "No MKV files found in D:\producer\build\debug_output"
165203
exit 1

0 commit comments

Comments
 (0)