Skip to content

Commit

Permalink
Add Corpus to demostrate usage (#17)
Browse files Browse the repository at this point in the history
Co-authored-by: Ze Gan <ganze718@gmail.com>
  • Loading branch information
Xia Zhongyang and Pterosaur authored Nov 20, 2020
1 parent b32e1e3 commit bb8509e
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 57 deletions.
64 changes: 7 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,63 +135,13 @@ This section describes required fields for the json configuration file.
- **fps**: Frames per second of the output video file
- **file_path**: The file path of the output video file in YUV format

#### Example

``` json
{
"serverless_connection": {
"sender": {
"enabled": false,
"dest_ip": "127.0.0.1",
"dest_port": 8888
},
"autoclose": 20
},
"bwe_feedback_duration": 200,
"onnx": {
"onnx_model_path": "onnx-model.onnx"
},
"video_source":{
"video_disabled": {
"enabled": true
},
"webcam": {
"enabled": false
},
"video_file": {
"enabled": true,
"height": 480,
"width": 640,
"fps": 24,
"file_path": "testmedia/test.yuv"
}
},
"audio_source": {
"microphone": {
"enabled": false
},
"audio_file": {
"enabled": true,
"file_path": "testmedia/test.wav"
}
},
"save_to_file": {
"enabled": true,
"audio": {
"file_path": "outaudio.wav"
},
"video": {
"width": 640,
"height": 480,
"fps": 24,
"file_path": "outvideo.yuv"
}
}
}
#### Run peerconnection_serverless

To better demonstrate the usage of peerconnection_serverless, we provide an all-inclusive corpus in `examples/peerconnection/serverless/corpus`. You can use the following commands to execute a tiny example. After these commands terminates, you will get `outvideo.yuv` and `outaudio.wav`.

``` shell
sudo docker run -d --rm -v `pwd`/examples/peerconnection/serverless/corpus:/app -w /app --name alphartc alphartc peerconnection_serverless receiver.json
sudo docker exec alphartc peerconnection_serverless sender.json
```

## Who Are We
Expand Down
6 changes: 6 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,9 @@ steps:
- script: make app
displayName: 'build application'

- script: make release
displayName: 'build release image'

- script: docker run -d --rm -v `pwd`/examples/peerconnection/serverless/corpus:/app -w /app --name alphartc alphartc peerconnection_serverless receiver.json
&& docker exec alphartc peerconnection_serverless sender.json
displayName: 'run example'
3 changes: 3 additions & 0 deletions examples/peerconnection/serverless/corpus/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.onnx filter=lfs diff=lfs merge=lfs -text
*.wav filter=lfs diff=lfs merge=lfs -text
*.yuv filter=lfs diff=lfs merge=lfs -text
2 changes: 2 additions & 0 deletions examples/peerconnection/serverless/corpus/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.yuv
*.wav
3 changes: 3 additions & 0 deletions examples/peerconnection/serverless/corpus/onnx-model.onnx
Git LFS file not shown
53 changes: 53 additions & 0 deletions examples/peerconnection/serverless/corpus/receiver.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"serverless_connection": {
"autoclose": 20,
"sender": {
"enabled": false
},
"receiver": {
"enabled": true,
"listening_ip": "0.0.0.0",
"listening_port": 8000
}
},
"bwe_feedback_duration": 200,
"onnx": {
"onnx_model_path": "onnx-model.onnx"
},
"video_source": {
"video_disabled": {
"enabled": true
},
"webcam": {
"enabled": false
},
"video_file": {
"enabled": false,
"height": 240,
"width": 320,
"fps": 10,
"file_path": "testmedia/test.yuv"
}
},
"audio_source": {
"microphone": {
"enabled": false
},
"audio_file": {
"enabled": true,
"file_path": "testmedia/test.wav"
}
},
"save_to_file": {
"enabled": true,
"audio": {
"file_path": "outaudio.wav"
},
"video": {
"width": 320,
"height": 240,
"fps": 10,
"file_path": "outvideo.yuv"
}
}
}
44 changes: 44 additions & 0 deletions examples/peerconnection/serverless/corpus/sender.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"serverless_connection": {
"autoclose": 20,
"sender": {
"enabled": true,
"dest_ip": "0.0.0.0",
"dest_port": 8000
},
"receiver": {
"enabled": false
}
},
"bwe_feedback_duration": 200,
"onnx": {
"onnx_model_path": "onnx-model.onnx"
},
"video_source": {
"video_disabled": {
"enabled": false
},
"webcam": {
"enabled": false
},
"video_file": {
"enabled": true,
"height": 240,
"width": 320,
"fps": 10,
"file_path": "testmedia/test.yuv"
}
},
"audio_source": {
"microphone": {
"enabled": false
},
"audio_file": {
"enabled": true,
"file_path": "testmedia/test.wav"
}
},
"save_to_file": {
"enabled": false
}
}
3 changes: 3 additions & 0 deletions examples/peerconnection/serverless/corpus/testmedia/test.wav
Git LFS file not shown
3 changes: 3 additions & 0 deletions examples/peerconnection/serverless/corpus/testmedia/test.yuv
Git LFS file not shown

0 comments on commit bb8509e

Please sign in to comment.