-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathmedia-service-init.sh
executable file
·37 lines (31 loc) · 1.18 KB
/
media-service-init.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env bash
#Variables with the IPs of the aggregator, streaming engine and cms:
MA="192.168.185.83:5000"
MSE="192.168.185.89:1935"
CMS="192.168.185.87:50000"
#MEDIA SERVICE CONFIGURATION:
#Service init config API (emulates the FSM function)
curl -H'content-Type:application/json' -X POST -d'{
"Aggregators": [
{
"name": "Aggregator-001",
"location": "Madrid",
"ip": "'"$MA"'"
}
],
"StreamingEngines": [
{
"name": "Engine-001",
"location": "Madrid",
"ip": "'"$MSE"'"
}
]
}' http://$CMS/configure
#Register a camera:
#It is possible to register multiple cameras, just put a curl per camera
curl -H 'content-Type: application/json' -X POST -d '{"name":"360"}' http://$CMS/registerCamera
curl -H 'content-Type: application/json' -X POST -d '{"name":"plane"}' http://$CMS/registerCamera
#Connect a client:
#It is possible to connect multiple cameras, just put a curl per streaming-engine
curl -H 'content-Type: application/json' -X GET -d '{"name":"360"}' http://$CMS/getStreamURL
curl -H 'content-Type: application/json' -X GET -d '{"name":"plane"}' http://$CMS/getStreamURL