Skip to content

Commit d0148f3

Browse files
committed
Adding sample checks
1 parent 2a270cf commit d0148f3

File tree

1 file changed

+47
-11
lines changed

1 file changed

+47
-11
lines changed

.github/workflows/samples.yml

Lines changed: 47 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,45 @@ 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 docker
112+
open -a Docker
113+
fi
114+
115+
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
116+
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
117+
118+
echo "rtsp://0.0.0.0:8558/stream1" > rtsp-urls.txt
119+
echo "rtsp://0.0.0.0:8559/stream2" >> rtsp-urls.txt
120+
121+
- name: Setup RTSP source (Windows)
122+
if: runner.os == 'Windows' && matrix.sample.name == 'kvs_gstreamer_multistream_sample'
123+
working-directory: D:\producer\build
124+
run: |
125+
# Install Docker
126+
choco install docker-desktop
127+
128+
# Run the RTSP server using bluenviron/mediamtx
129+
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
130+
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
131+
132+
# Write RTSP URLs to a file
133+
echo "rtsp://0.0.0.0:8558/stream1" | Out-File -FilePath rtsp-urls.txt -Encoding UTF8
134+
echo "rtsp://0.0.0.0:8559/stream2" | Out-File -FilePath rtsp-urls.txt -Append -Encoding UTF8
101135
102136
- name: Configure AWS Credentials
103137
uses: aws-actions/configure-aws-credentials@v4
@@ -118,17 +152,19 @@ jobs:
118152
./${{ matrix.sample.name }} demo-stream-producer-cpp-${{ matrix.runner.id }}-ci-${{ matrix.sample.name }} ${{ matrix.sample.args }}
119153
120154
- name: Run ${{ matrix.sample.name }} (Windows)
121-
if: runner.os == 'Windows'
155+
if: runner.os == 'Windows' && matrix.sample.name != 'kvs_gstreamer_multistream_sample'
122156
env:
123-
GST_PLUGIN_PATH: ${{ github.workspace }}/build
124-
KVS_DEBUG_DUMP_DATA_FILE_DIR: ${{ github.workspace }}/build/debug_output
125-
working-directory: ./build
157+
GST_PLUGIN_PATH: D:\producer\build
158+
KVS_DEBUG_DUMP_DATA_FILE_DIR: D:\producer\debug_output
159+
working-directory: D:\producer\build
126160
run: |
127161
# Equivalent to set -x
128162
Set-PSDebug -Trace 1
129163
130164
$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'
131165
166+
mkdir D:\producer\debug_output
167+
132168
Invoke-WebRequest -Uri https://awsj-iot-handson.s3-ap-northeast-1.amazonaws.com/kvs-workshop/sample.mp4 -OutFile sample.mp4
133169
dir
134170
$exePath = Join-Path $PWD ${{ matrix.sample.name }}.exe
@@ -153,13 +189,13 @@ jobs:
153189
done
154190
shell: bash
155191

156-
- name: Verify MKV dump
192+
- name: Verify MKV dump (Windows)
157193
if: runner.os == 'Windows'
158194
working-directory: D:\producer\build
159195
run: |
160196
$env:Path += ";C:\Program Files\MKVToolNix"
161-
dir debug_output
162-
$mkvFiles = Get-ChildItem -Path "D:\producer\build\debug_output" -Filter *.mkv
197+
dir D:\producer\debug_output
198+
$mkvFiles = Get-ChildItem -Path "D:\producer\debug_output" -Filter *.mkv
163199
if ($mkvFiles.Count -eq 0) {
164200
Write-Error "No MKV files found in D:\producer\build\debug_output"
165201
exit 1

0 commit comments

Comments
 (0)