Closed streamingsystems closed 5 months ago
Hi, the channel_id
and track_id
fields are both required -
https://github.com/kaltura/media-framework/tree/master/nginx-kmp-out-module#response-fields
They are used to identify the incoming media track - you will get an error if you don't send them.
But, if you don't need this functionality, you can probably just send some fixed values. As far as I remember, these modules do not enforce the uniqueness of these identifiers (unlike nginx-live-module, for example, which will not accept multiple inputs with the same channel_id+track_id)
When I look through the controller.php example it looks like:
In the case of mpegts, the streamName is the stream_id that is sent in:
$streamName = $params['mpegts']['stream_id'];
And then the $channelId and $variantId are derived from a stream_id that has and underscore in it:
$undPos = strrpos($streamName, '_'); $channelId = substr($streamName, 0, $undPos); $variantId = substr($streamName, $undPos + 1);
And then the $trackId is the $mediaType[0] with the $variantId appended to it.
$trackId = $mediaType[0] . $variantId;
So as you mentioned in your post it seems that although they are required fields and since I am not using the functionality that utilized their value:
Can I set them the same thing for each stream, eg:
$channelId = "channel_id_1234"; $trackId = "track_id_1234";
Or to make them unique for each stream I could replace 1234 with just some random/unique string?
Thanks for your help.
Yes, I think you can probably just set them to some const, but it will be better to put a real identifier there, because then if there's some error, you will at least know which channel is affected. As for the track, I think it will also be a good idea to at least distinguish between video and audio, for example "v" vs "a". The ids can be any alpha-numeric string, up to 32 chars.
Hi,
I am using your controller.php as an example:
https://github.com/kaltura/media-framework/blob/master/conf/controller.php
In my case I am just going from MPEGTS -> KMP -> RTMP.
As such, when I return the array from the controller, in my use-case the channel_id, and track_id seem to be not needed/not applicable.
Using your example response:
$params = array( 'code' => 'ok', 'channel_id' => $channelId, // can I remove this? 'track_id' => $trackId, // can I remove this? 'upstreams' => $upstreams, );
Can I just return code 'ok' and the RTMP information from your getRtmpOutUpstream() function and omit the channel_id and track_id?
Thanks!
-Rob