Hi @hglanzer,
Indeed, the livestreaming API is somewhat complex as it has a lot of options.
I’ll do my best to simplify it for you.
First of all, I am assuming you are using our SaaS and not self hosting Kaltura on your own servers. If that is not so, please let me know as the answer in the event you are using Kaltura CE is different.
The first thing you need to do is call conversionprofile->list() in order to get your conversion profile ID. Here is a basic example, using cURL. Of course, the same can be done using any of our API clients and in fact, it is most recommended that you do use one of our client libs.
curl "-dclientTag=kalcli%3A17-10-02&filter%3AobjectType=KalturaConversionProfileFilter&filter%3AtypeEqual=2&ks=YOUR_KS_STRING_HERE&format=1" "http://www.kaltura.com/api_v3/service/conversionprofile/action/list"
typeEqual is set to 2 because that’s the value for the KalturaConversionProfileFilter::LIVE_STREAM enum.
You should get a result similar to the below:
{
"objects": [
{
"id": PASSTHROUGH_CONVERSION_PROFILE_ID,
"partnerId": YOUR_PARANER_ID,
"status": 2,
"type": 2,
"name": "Passthrough",
"systemName": "Passthrough_Live",
"tags": "",
"description": "Publish only the broadcasted stream",
"createdAt": 1463589712,
"flavorParamsIds": "32,36,37",
"isDefault": false,
"isPartnerDefault": false,
"cropDimensions": {
"left": -1,
"top": -1,
"width": -1,
"height": -1,
"objectType": "KalturaCropDimensions"
},
"clipStart": -1,
"clipDuration": -1,
"mediaParserType": 0,
"calculateComplexity": true,
"collectionTags": "mbr,ism",
"detectGOP": 0,
"objectType": "KalturaConversionProfile"
},
{
"id": CLOUD_TRANSCODE_PROFILE_ID,
"partnerId": YOUR_PARANER_ID,
"status": 2,
"type": 2,
"name": "Cloud transcode",
"systemName": "Default_Live",
"tags": "",
"description": "The default set of live renditions",
"createdAt": 1463589712,
"flavorParamsIds": "32,33,34,35",
"isDefault": true,
"isPartnerDefault": true,
"cropDimensions": {
"left": -1,
"top": -1,
"width": -1,
"height": -1,
"objectType": "KalturaCropDimensions"
},
"clipStart": -1,
"clipDuration": -1,
"mediaParserType": "0",
"calculateComplexity": true,
"collectionTags": "mbr,ism",
"detectGOP": 0,
"objectType": "KalturaConversionProfile"
}
],
"totalCount": 2,
"objectType": "KalturaConversionProfileListResponse"
}
So, in this example, two profiles are available: “Passthrough” and “Cloud transcode”, each with a unique ID [masked as PASSTHROUGH_CONVERSION_PROFILE_ID and CLOUD_TRANSCODE_PROFILE_ID in the above output].
The ID is unique per partner and so, you need to make this request to find yours.
Once you have that, you are ready to create a live entry. This is done by making a request to the service/livestream/action/add endpoint [livestream->add()].
The relevant params are:
# KalturaSourceType::LIVE_STREAM = 32
sourceType=32
liveStreamEntry:objectType=KalturaLiveStreamEntry
# KalturaMediaType::LIVE_STREAM_FLASH = 201
liveStreamEntry:mediaType=201
# the DVR window
liveStreamEntry:dvrWindow=120
# to get the conversion profile ID, call conversionprofile list filter:objectType=KalturaConversionProfileFilter filter:typeEqual=2
# the profile ID you got back from service/conversionprofile/action/list request:
liveStreamEntry:conversionProfileId=
liveStreamEntry:name=testme
# enable DVR, set to 0 if not required
liveStreamEntry:dvrStatus=1
# whether or not to create a VOD entry out of the stream:
# recordStatus=0 (DISABLED) - disable recording
# recordStatus=1 (APPENDED) - append all streams to one VOD entry
# recordStatus=2__(PER_SESSION) - create a new VOD entry per live stream session
liveStreamEntry:recordStatus=2
# optional entry description
liveStreamEntry:description=
For example, here is a full cURL request [KS is masked, of course]:
curl "-dclientTag=kalcli%3A17-10-02&liveStreamEntry%3AobjectType=KalturaLiveStreamEntry&liveStreamEntry%3AsourceType=32&liveStreamEntry%3AmediaType=201&liveStreamEntry%3AdvrWindow=120&liveStreamEntry%3AconversionProfileId=7561812&liveStreamEntry%3Aname=testme&liveStreamEntry%3AdvrStatus=1&liveStreamEntry%3ArecordStatus=2&ks=YOUR_KS_STRING_HERE" "http://www.kaltura.com/api_v3/service/livestream/action/add"
This request will return a KalturaLiveStreamEntry object which includes the following members:
primaryBroadcastingUrl rtmp://$ENTRY_ID.p.kpublish.kaltura.com:1935/kLive?t=$STREAM_PASSWD
secondaryBroadcastingUrl rtmp://$ENTRY_ID.b.kpublish.kaltura.com:1935/kLive?t=$STREAM_PASSWD
primaryRtspBroadcastingUrl rtsp://$ENTRY_ID.p.s.kpublish.kaltura.com:554/kLive/$ENTRY_ID_%i?t=$STREAM_PASSWD
secondaryRtspBroadcastingUrl rtsp://$ENTRY_ID.b.s.kpublish.kaltura.com:554/kLive/$ENTRY_ID_%i?t=$STREAM_PASSWD
streamName $ENTRY_ID_%i
streamPassword $STREAM_PASSWD
You can then use primaryBroadcastingUrl
or primaryRtspBroadcastingUrl
[depending on whether you want to use RTMP or RTSP] and $ENTRY_ID_%i as the stream name.
For example, when using the ffmpeg CLI binary to stream over RTMP, your command would be:
$ ffmpeg -re -i /path/to/some.mp4 -c:v copy -c:a libmp3lame -f flv -rtmp_live 1 \
rtmp://$ENTRY_ID.p.kpublish.kaltura.com:1935/kLive?t=$STREAM_PASSWD/$ENTRY_ID_1