-
-
Notifications
You must be signed in to change notification settings - Fork 454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Start a stream programatically using API without using the GUI #366
Comments
Hey @NeveIsa
curl -X 'POST' \
'http://127.0.0.1:8080/api/login' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"username": "your-username",
"password": "your-password"
}'
curl -X 'GET' \
'http://127.0.0.1:8080/api/v3/process' \
-H 'accept: application/json' \
-H 'Authorization: Bearer ACCESS_TOKEN'
curl -X 'POST' \
'http://127.0.0.1:8080/api/v3/process' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-d '{
"type": "ffmpeg",
....
}' More API details: |
So in step 5 we just pass the contents of the modified process config section? This means that the payload {"type": "ffmpeg",...} is the config part of the process details from step 4? |
You can find the existing configuration in the object "config": [
{
"config": {
"autostart": true,
"id": "string",
"input": [],
"limits": {
"cpu_usage": 0,
"memory_mbytes": 0,
"waitfor_seconds": 0
},
"options": [],
"output": [],
"reconnect": true,
"reconnect_delay_seconds": 0,
"reference": "string",
"stale_timeout_seconds": 0,
"type": "ffmpeg"
},
.....
}
] And an example of the process configuration looks like this: {
"autostart": true,
"id": "string",
"input": [
{
"address": "string",
"cleanup": [],
"id": "string",
"options": [
"string"
]
}
],
"limits": {
"cpu_usage": 0,
"memory_mbytes": 0,
"waitfor_seconds": 0
},
"options": [
"string"
],
"output": [
{
"address": "string",
"cleanup": [],
"id": "string",
"options": [
"string"
]
}
],
"reconnect": true,
"reconnect_delay_seconds": 0,
"reference": "string",
"stale_timeout_seconds": 0,
"type": "ffmpeg"
} You use this as payload: curl -X 'POST' \
'http://127.0.0.1:8080/api/v3/process' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
-d '{
"autostart": true,
"id": "string",
"input": [
{
"address": "string",
"cleanup": [],
"id": "string",
"options": [
"string"
]
}
],
"limits": {
"cpu_usage": 0,
"memory_mbytes": 0,
"waitfor_seconds": 0
},
"options": [
"string"
],
"output": [
{
"address": "string",
"cleanup": [],
"id": "string",
"options": [
"string"
]
}
],
"reconnect": true,
"reconnect_delay_seconds": 0,
"reference": "string",
"stale_timeout_seconds": 0,
"type": "ffmpeg"
}' |
@NeveIsa Did it work? Any questions? |
I will try soon and post here. Sorry, my machine is under repair |
I tried to check the API through swagger but I entered the access_token and refresh_token obtained through /api/login correctly, but I get a 401 Missing or invalid JWT token when requesting /api/v3/process |
@faters-taylor In the token field you have to add This is currently a limitation of the Swagger 2.0 specs. |
@ioppermann Thanks, I'm using it by calling it directly instead of testing it in swagger-ui |
@faters-taylor Did you generate a client from the swagger file? Then you will most likely need to modify the generated code such that |
For me this description worked well, thanks! |
Hello We are closing your ticket #366. This may be due to the following reasons:
You can reopen this ticket at any time! Please only open related tickets once! Always answer/ask in the original ticket with the same issue! With kind regards, |
I actually created a process this way and it's added to the list of my processes, however It's just not showing in my restreamer GUI. I want the GUI to be in sync with my own program isn't that how it should be ? |
Currently the documentation is not clear on how to start a process using the API.
For example, I want to use /dev/video1 and want to get the stream on the htmlplayer.
How do I accomplish this using POST on the url /api/v3/process?
Later I want to get the livestream player's url which I guess is easy to do using GET on the endpoint /api/v3/process and retrieving the process id.
Can we get some example JSON that helps us understand how to use the API?
The text was updated successfully, but these errors were encountered: