-
QuestionI am streaming usb camera's to rtsp and want to dynamically control the name of the stream based on the camera serial number. This works well by patching the mediamtx.yml file with the proper path name and RunOnDemand string . MediaMTx automatically picks up the changes. Impressive work! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hello, if want a ready-to-use client library for interacting with MediaMTX, you can generate one by using openapi-generator. Download the MediaMTX API definitions here: Then install openapi-generator:
then generate the library:
then take a look at the README.md that was just generated. It provides ready-to-use code: import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost:9997
# See configuration.py for a list of all supported configuration parameters.
configuration = openapi_client.Configuration(
host = "http://localhost:9997"
)
# Enter a context with an instance of the API client
with openapi_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = openapi_client.ConfigurationApi(api_client)
try:
# returns the global configuration.
api_response = api_instance.config_global_get()
print("The response of ConfigurationApi->config_global_get:\n")
pprint(api_response)
except ApiException as e:
print("Exception when calling ConfigurationApi->config_global_get: %s\n" % e) |
Beta Was this translation helpful? Give feedback.
Hello, if want a ready-to-use client library for interacting with MediaMTX, you can generate one by using openapi-generator.
Download the MediaMTX API definitions here:
https://github.com/bluenviron/mediamtx/blob/main/apidocs/openapi.yaml
Then install openapi-generator:
then generate the library:
then take a look at the README.md that was just generated. It provides ready-to-use code: