Skip to content

Commit

Permalink
Adding sample checks
Browse files Browse the repository at this point in the history
  • Loading branch information
sirknightj committed Feb 6, 2025
1 parent 2a270cf commit e48422a
Showing 1 changed file with 47 additions and 11 deletions.
58 changes: 47 additions & 11 deletions .github/workflows/samples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
args: -f sample.mp4
- name: kvs_gstreamer_file_uploader_sample
args: sample.mp4 0 audio-video
# - name: kvs_gstreamer_multistream_sample
# args: ""
- name: kvs_gstreamer_multistream_sample
args: rtsp-urls.txt
- name: kvs_gstreamer_sample
args: sample.mp4
- name: kvssink_gstreamer_sample
Expand Down Expand Up @@ -93,11 +93,45 @@ jobs:
- name: Build samples (Windows)
if: runner.os == 'Windows'
run: |
$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'
$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'
mkdir D:\producer
Move-Item -Path "D:\a\amazon-kinesis-video-streams-producer-sdk-cpp\amazon-kinesis-video-streams-producer-sdk-cpp\*" -Destination "D:\producer"
cd D:\producer
git config --system core.longpaths true
dir
.github\build_windows.bat
mkdir "%KVS_DEBUG_DUMP_DATA_FILE_DIR%"
- name: Setup RTSP source (Linux & Mac)
if: (runner.os == 'Linux' || runner.os == 'macOS') && ${{ matrix.sample.name == kvs_gstreamer_multistream_sample }}
working-directory: ./build/debug_output
run: |
if [[ runner.os == 'Linux' ]]; then
sudo apt-get install -y docker.io
else
brew install docker
open -a Docker
fi
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
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
echo "rtsp://0.0.0.0:8558/stream1" > rtsp-urls.txt
echo "rtsp://0.0.0.0:8559/stream2" >> rtsp-urls.txt
- name: Setup RTSP source (Windows)
if: runner.os == 'Windows' && ${{ matrix.sample.name == kvs_gstreamer_multistream_sample }}
working-directory: D:\producer\build
run: |
# Install Docker
choco install docker-desktop
# Run the RTSP server using bluenviron/mediamtx
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
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
# Write RTSP URLs to a file
echo "rtsp://0.0.0.0:8558/stream1" | Out-File -FilePath rtsp-urls.txt -Encoding UTF8
echo "rtsp://0.0.0.0:8559/stream2" | Out-File -FilePath rtsp-urls.txt -Append -Encoding UTF8
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
Expand All @@ -118,17 +152,19 @@ jobs:
./${{ matrix.sample.name }} demo-stream-producer-cpp-${{ matrix.runner.id }}-ci-${{ matrix.sample.name }} ${{ matrix.sample.args }}
- name: Run ${{ matrix.sample.name }} (Windows)
if: runner.os == 'Windows'
if: runner.os == 'Windows' && ${{ matrix.sample.name }} != kvs_gstreamer_multistream_sample
env:
GST_PLUGIN_PATH: ${{ github.workspace }}/build
KVS_DEBUG_DUMP_DATA_FILE_DIR: ${{ github.workspace }}/build/debug_output
working-directory: ./build
GST_PLUGIN_PATH: D:\producer\build
KVS_DEBUG_DUMP_DATA_FILE_DIR: D:\producer\debug_output
working-directory: D:\producer\build
run: |
# Equivalent to set -x
Set-PSDebug -Trace 1
$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'
mkdir D:\producer\debug_output
Invoke-WebRequest -Uri https://awsj-iot-handson.s3-ap-northeast-1.amazonaws.com/kvs-workshop/sample.mp4 -OutFile sample.mp4
dir
$exePath = Join-Path $PWD ${{ matrix.sample.name }}.exe
Expand All @@ -153,13 +189,13 @@ jobs:
done
shell: bash

- name: Verify MKV dump
- name: Verify MKV dump (Windows)
if: runner.os == 'Windows'
working-directory: D:\producer\build
run: |
$env:Path += ";C:\Program Files\MKVToolNix"
dir debug_output
$mkvFiles = Get-ChildItem -Path "D:\producer\build\debug_output" -Filter *.mkv
dir D:\producer\debug_output
$mkvFiles = Get-ChildItem -Path "D:\producer\debug_output" -Filter *.mkv
if ($mkvFiles.Count -eq 0) {
Write-Error "No MKV files found in D:\producer\build\debug_output"
exit 1
Expand Down

0 comments on commit e48422a

Please sign in to comment.