Jump to content

Stream recording status - REST API


Recommended Posts

Hi All, is there a REST API call to check whether a particular stream is being recorded? I start and stop recordings many times during a streaming session and I am wondering what happens if I try to record a stream which is currently recording. In general, it would be very useful to be able to query the recording status. Thanks.

Link to comment
Share on other sites

Hi All, is there a REST API call to check whether a particular stream is being recorded? I start and stop recordings many times during a streaming session and I am wondering what happens if I try to record a stream which is currently recording. In general, it would be very useful to be able to query the recording status. Thanks.

Link to comment
Share on other sites

Hi @fabioc
I hope you are fine.

Yes, there is a Rest API function to enable/disable recording. Please check https://antmedia.io/rest/#/BroadcastRestService/enableRecording

If the recording status for the stream that you want to record again is already true, the response will be as follows:

{
    "success": false,
    "message": "mp4 recording status  is already: true",
    "dataId": null,
    "errorId": 0
}


I hope it helps.

Link to comment
Share on other sites

Ah cool!

The errorId doesn't change though, that could be used to detect why the recording failed.

The first time I activate the recording I get:

{"success":true,"message":"1673437660443","dataId":"eIp4B2dxdh2gONlEbMosR7iz","errorId":0}

If I try to record again, I get:

{"success":false,"message":"mp4 recording status  is already: true","dataId":null,"errorId":0}

Same thing if I try to stop the recording.

First time:

{"success":true,"message":"1673437660443","dataId":"eIp4B2dxdh2gONlEbMosR7iz","errorId":0}

Second time:

{"success":false,"message":"mp4 recording couldn't be stopped","dataId":null,"errorId":0}

I guess just checking the value of 'success' is inconclusive as there can be a number of reasons why the operation failed.

Thanks again.

Link to comment
Share on other sites

if you try to record the stream again which is already recording you will see a message something like this 

{"success":false,"message":"mp4 recording status  is already: true","dataId":null,"errorId":0}

Link to comment
Share on other sites

Hi, I am creating multiple recordings from the same stream and I am using the date and time in the filename, so the stream ID alone is only partially helpful. But I have noticed a VoD Id associated uniquely with each recording which is also the dataId returned by the start/stop recording api calls. Then, I can use the calls from the VoD Rest Service to get the full filename path. Thanks!

Link to comment
Share on other sites

 Share

×
×
  • Create New...