Ant-Media-Server
Ant-Media-Server copied to clipboard
Return VodId in Recording endpoint
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
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
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.
Hi @mekya Can we add vodId in the rest APIs which is fit for our usecase.
@mustafaboleken is there any update on this?
@mustafaboleken is there any update on this?
It's almost done. I will open a pull request today.
Hi! Any update on when we can expect this? In our workflow we also require vodId in the start/stop recording responses.
Hey @danavramescu ,
I'm trying to merge today.
Hey Guys, It's merged @danavramescu @shibupanda @KenzoIkeizume @Mohit-3196 @mustafaboleken
FYI A. Oguz
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}'
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
- You can listen the vodReady webhook -> https://resources.antmedia.io/docs/using-webhooks
- You can get the vods by filtering with streamId via REST API -> https://antmedia.io/rest/#/VoD%20Rest%20Service/getVodList
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
- You can listen the vodReady webhook -> https://resources.antmedia.io/docs/using-webhooks
- 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: @.***>
Hey @danavramescu,
Thank you for follow up. Then just let me tell what is working for me and find the difference in our tests
- The latest snapshot(Enterprise Edition 2.4.4-SNAPSHOT 20221001_0736 ) is deployed to here -> ovh36.antmedia.io
- I've created just a sample app for testing with name testVodId
- I've published stream with WebRTC with stream1
- 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}
- 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}
- I last checked that VoD is recorded with the correct VodId

What's the difference in your scenario?
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!
No worries, it's great to hear that it's working for you and it helps you :)
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 ?
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

Once I upgrade server with latest snapshot getting some exception. https://gist.github.com/shibupanda/d305d3e21a9fd0a6d78f82cb85b6f155
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