Conversation
|
Hi, I added the field "Custom" in the path config because in my setup I am using ffmpeg in a runOnReady script to create multiple transcodings and want to pass it some extra information without polluting MTX_PATH or misusing another path config field. Implements feature request #5406 |
6519fae to
162fcb7
Compare
Available as MTX_CUSTOM env var to RunOnInit, RunOnReady, RunOnNotReady, RunOnDemand, RunOnUndemand
162fcb7 to
2930f43
Compare
|
Hi @aler9 , BR |
|
Hello @Snafu, the problem here is that we've always avoided merging patches that added generic properties to paths, because external properties are meant to be saved outside the server, in an external wrapper. The main reason for this is to avoid imposing a data model for additional properties which wouldn't satisfy everyone, for instance, in this case you assigned a single "custom" field to each path, and this field is a string, but i can think about several other data models, for instance there are people that asked to add custom key/value properties to each path, some of which are using integer keys, others string keys. Therefore: the feature is not universal and not directly bound to any server feature. Using "custom" to personalize hooks has its usefulness, but you could also hardcode these values inside hooks, eventually duplicating path definitions in order to cover each case: paths:
path1:
runOnReady: ffmpeg with hardcoded MTX_CUSTOM_1
path2:
runOnReady: ffmpeg with hardcoded MTX_CUSTOM_2
...Therefore: we prefer to keep integrations outside the servers, in order to concentrate on streaming-specific issues, nonetheless it's perfectly possible to develop integrations, by placing them outside the server and interacting with the current server interfaces (configuration file / API). Of course if you spot something that cannot be currently done, even in a really verbose way, report that and feel free to send a patch for that. |
|
Hi @aler9, Currently I've got a very nasty solution by having some information hidden in the path name that I am creating (think a suffix that is the hex representation of a bit mask), but that is a very ugly and hacky way to do so. Of course I could store the data I need in some database and have a custom API which I use to query that database for transcoding information, but that is in my mind a lot of unnecessary code if MediaMTX by itself already gets me 99.99% to where I want to be. |
Available as MTX_CUSTOM env var to RunOnInit, RunOnReady, RunOnNotReady, RunOnDemand, RunOnUndemand