Ant-Media-Server icon indicating copy to clipboard operation
Ant-Media-Server copied to clipboard

Return VodId in Recording endpoint

Open KenzoIkeizume opened this issue 2 years ago • 5 comments

Is your feature request related to a problem? Please describe. No

Describe the solution you'd like After request this endpoint I'd like to have the VodId [PUT] /v2/broadcasts/{id}/recording/{recording-status}

The dataId field could return the VodId, because today is always null

{
    "success": true,
    "message": "1647442263069",
    "dataId": [SOMETHING IN HERE {VODID}],
    "errorId": 0
}

Describe alternatives you've considered N/A

Additional context N/A

KenzoIkeizume avatar Mar 16 '22 16:03 KenzoIkeizume

Hi @KenzoIkeizume , Thank you for the issue.

You can use webhook calls to get the VoD Id. Ant Media Server calls vodReady hook when the recording of the live stream is ended.

You can refer to this stack overflow answer

I hope I was able to help.

Thank you

Mohit-3196 avatar Mar 18 '22 10:03 Mohit-3196

Thank you for the issue @KenzoIkeizume and work around solution @Mohit-3196

I think we can also add vod id to the response of the REST call. It makes life easy.

mekya avatar Mar 21 '22 17:03 mekya

Hi @mekya Can we add vodId in the rest APIs which is fit for our usecase.

shibupanda avatar Aug 23 '22 11:08 shibupanda

@mustafaboleken is there any update on this?

shibupanda avatar Sep 01 '22 07:09 shibupanda

@mustafaboleken is there any update on this?

It's almost done. I will open a pull request today.

mustafaboleken avatar Sep 01 '22 08:09 mustafaboleken

Hi! Any update on when we can expect this? In our workflow we also require vodId in the start/stop recording responses.

danavramescu avatar Sep 28 '22 13:09 danavramescu

Hey @danavramescu ,

I'm trying to merge today.

mekya avatar Sep 28 '22 16:09 mekya

Hey Guys, It's merged @danavramescu @shibupanda @KenzoIkeizume @Mohit-3196 @mustafaboleken

FYI A. Oguz

mekya avatar Sep 29 '22 14:09 mekya

Hi ! Thanks!

What do we need to do from our end? We're still not receiving the vodId on response on either start or stop 2022/09/30 10:23:36 [info] [ams] Start REC: '{"success":true,"message":"1664533416874","dataId":null,"errorId":0}' 2022/09/30 10:23:47 [info] [ams] Stop REC: '{"success":true,"message":"1664533427192","dataId":null,"errorId":0}'

danavramescu avatar Sep 30 '22 10:09 danavramescu

Hi @danavramescu,

Thank you for your question. It's a good point.

VodId is returned in dataId field if the stream is broadcasting at that time. If the stream is not broadcasting, it just returns with the old way because there is no VoD recording at that time and we want to make things simple in the server side.

If you enable recording when the stream is not broadcasting yet, I can just recommend two things to get the vod Id

  1. You can listen the vodReady webhook -> https://resources.antmedia.io/docs/using-webhooks
  2. You can get the vods by filtering with streamId via REST API -> https://antmedia.io/rest/#/VoD%20Rest%20Service/getVodList

mekya avatar Oct 01 '22 08:10 mekya

Hi! The stream was live and broadcasting in the example, on both start and stop rec calls. But neither call returned vodId in the dataId field. Both times it was null. We are only working with recordings on broadcasting streams

Sent from my iPhone

On 1 Oct 2022, at 11:22, Ahmet Oğuz Mermerkaya @.***> wrote:



Hi @danavramescuhttps://github.com/danavramescu,

Thank you for your question. It's a good point.

VodId is returned in dataId field if the stream is broadcasting at that time. If the stream is not broadcasting, it just returns with the old way because there is no VoD recording at that time and we want to make things simple in the server side.

If you enable recording when the stream is not broadcasting yet, I can just recommend two things to get the vod Id

  1. You can listen the vodReady webhook -> https://resources.antmedia.io/docs/using-webhooks
  2. You can get the vods by filtering with streamId via REST API -> https://antmedia.io/rest/#/VoD%20Rest%20Service/getVodList

— Reply to this email directly, view it on GitHubhttps://github.com/ant-media/Ant-Media-Server/issues/4062#issuecomment-1264289901, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFMIPJ5WPBQLCAUHGGTACQTWA7YDJANCNFSM5Q4MSNJQ. You are receiving this because you were mentioned.Message ID: @.***>

danavramescu avatar Oct 01 '22 09:10 danavramescu

Hey @danavramescu,

Thank you for follow up. Then just let me tell what is working for me and find the difference in our tests

  1. The latest snapshot(Enterprise Edition 2.4.4-SNAPSHOT 20221001_0736 ) is deployed to here -> ovh36.antmedia.io
  2. I've created just a sample app for testing with name testVodId
  3. I've published stream with WebRTC with stream1
  4. I've executed the following command to start streaming
curl -X 'PUT'   'https://ovh36.antmedia.io:5443/testVodId/rest/v2/broadcasts/stream1/recording/true'   -H 'accept: application/json'

the incoming response as expected

{"success":true,"message":"1664620260843","dataId":"FeGReCzBm2DWs9Xe2YA8BT4J","errorId":0}
  1. I've executed the following command to stop streaming
curl -X 'PUT'   'https://ovh36.antmedia.io:5443/testVodId/rest/v2/broadcasts/stream1/recording/false'   -H 'accept: application/json'

and the incoming response as follows

{"success":true,"message":null,"dataId":"FeGReCzBm2DWs9Xe2YA8BT4J","errorId":0}
  1. I last checked that VoD is recorded with the correct VodId
Screenshot 2022-10-01 at 13 35 15

What's the difference in your scenario?

mekya avatar Oct 01 '22 10:10 mekya

Sorry, didn't pay attention, was still using enterprise edition version 2.4.3. upgraded to 2.4.4 and all good now! Thanks! This update is really useful and makes working with remote recs much easier! Good job!

danavramescu avatar Oct 05 '22 08:10 danavramescu

No worries, it's great to hear that it's working for you and it helps you :)

mekya avatar Oct 05 '22 09:10 mekya

Hi @mekya not yet tested but I have a query.

curl -X 'PUT' 'https://ovh36.antmedia.io:5443/testVodId/rest/v2/broadcasts/stream1/recording/true' -H 'accept: application/json'

is the testVodId is the custom one which user can generate ?

shibupanda avatar Oct 10 '22 16:10 shibupanda

Hi @shibupanda ,

testVodId is the application for Ant Media Server and you can generate applications with anyname on the web panel. War File is optional in the form below. You can keep it empty and create application by just clicking the Create button in the screenshot

Screenshot 2022-10-10 at 20 26 54 .

mekya avatar Oct 10 '22 17:10 mekya

Once I upgrade server with latest snapshot getting some exception. https://gist.github.com/shibupanda/d305d3e21a9fd0a6d78f82cb85b6f155

shibupanda avatar Oct 11 '22 06:10 shibupanda

Hi @shibupanda ,

Shall we proceed through support channel? Because your problem is not directly related to this issue.

BTW, this improvement is available on version 2.5.0

mekya avatar Oct 19 '22 10:10 mekya