How to get the VOD Id for the stream automatically after the recording is stopped? - webrtc

I would like to put the vod_id info in my database but the recording endpoint 'PUT' /v2/broadcasts/{id}/recording/{recording-status} does not return the VOD id after stopping the recording. We have looked into the source code and the dataId field returns always null. Is there any way to achieve it?

You can use Webhook calls to get the Vod Id.
Ant Media Server provides webhooks integration for making your system/app know when certain events occurs on the server.
Ant Media Server calls vodReady hook when the recording of the live stream is ended.
I hope I was able to help.
Thank You!
antmedia.io

Related

Agora cloud recording is not working. Start and acquire work normally, but I don't get any video files and query and stop return error 404

I have problems with cloud recording. Right now I am testing it with postman. I call acquire, then start, start returns code 200 ok or code 201 created. Then, when I call query or stop they return code 404 not found. Why is this happening and how to fix this? Also, I'm not quite sure if I set correct key and secret key. I am using Azure, I created a storage resource and I have a tab with keys there. I just copied the key from the first key field and pasted it both to key and secret key variables. Am I doing it right or should I use some other keys?
Currently looking into why the stop api call is returning a 404, it's happening across all storage vendor options.
"recordingConfig": {"maxIdleTime": 86400} // - one day
add above line.
By default maxIdleTime set to one minute. Once you start the recording and the recording will be stopped after one minute. so you got 404 status code for both query and stop Api call

Capture start of long running POST VB.net MVC4

I have a subroutine in my Controller
<HttpPost>
Sub Index(Id, varLotsOfData)
'Point B.
'By the time it gets here - all the data has been accepted by server.
What I would like to do it capture the Id of the inbound POST and mark, for example, a database record to say "Id xx is receiving data"
The POST receive can take a long time as there is lots of data.
When execution gets to point B I can mark the record "All data received".
Where can I place this type of "pre-POST completed" code?
I should add - we are receiving the POST data from clients that we do not control - that is, it is most likely a client's server sending the data - not a webbrowser client that we have served up from our webserver.
UPDATE: This is looking more complex than I had imagined.
I'm thinking that a possible solution would be to inspect the worker processes in IIS programatically. Via the IIS Manager you can do this for example - How to use IIS Manager to get Worker Processes (w3wp.exe) details information ?
From your description, you want to display on the client page that the method is executing and you can show also a loading gif, and when the execution completed, you will show a message to the user that the execution is completed.
The answer is simply: use SignalR
here you can find some references
Getting started with signalR 1.x and Mvc4
Creating your first SignalR hub MVC project
Hope this will help you
If I understand your goal correctly, it sounds like HttpRequest.GetBufferlessInputStream might be worth a look. It allows you to begin acting on incoming post data immediately and in "pieces" rather than waiting until the entire post has been received.
An excerpt from Microsoft's documentation:
...provides an alternative to using the InputStream propertywhich waits until the whole request has been received. In contrast, the GetBufferlessInputStream method returns the Stream object immediately. You can use the method to begin processing the entity body before the complete contents of the body have been received and asynchronously read the request entity in chunks. This method can be useful if the request is uploading a large file and you want to begin accessing the file contents before the upload is finished.
So you could grab the beginning of the post, and provided your client-facing page sends the ID towards the beginning of its transmission, you may be able to pull that out. Of course, this would be reading raw byte data which would need to be decoded so you could grab the inbound post's ID. There's also a buffered one that will allow the stream to be read in pieces but will also build a complete request object for processing once it has been completely received.
Create a custom action filter,
Action Filters for executing filtering logic either before or after an action method is called. Action Filters are custom attributes that provide declarative means to add pre-action and post-action behavior to the controller's action methods.
Specifically you'll want to look at the
OnActionExecuted – This method is called after a controller action is executed.
Here are a couple of links:
http://www.infragistics.com/community/blogs/dhananjay_kumar/archive/2016/03/04/how-to-create-a-custom-action-filter-in-asp-net-mvc.aspx
http://www.asp.net/mvc/overview/older-versions-1/controllers-and-routing/understanding-action-filters-vb
Here is a lab, but I think it's C#
http://www.asp.net/mvc/overview/older-versions/hands-on-labs/aspnet-mvc-4-custom-action-filters

Red5, how to get parameters form request in live stream

Now the client(jwplayer) post request "rtmpt://XXXXX/RtmpRelay/resName", and can play video(RtmpRelay is my red5 project name, and redName is the resource name), but I want the user of client to be verified, That is the client must post userId, like this rtmpt://XXXXX/RtmpRelay/resName?userId=XXX
And in my server I use
conn.getConnectParams() // conn is a instance of IConnection
to get the parameters, it's Ok, but the resource can not be played any more,
I doubt that it took the whole "resName?userId=XXX" as a resource?
Any suggestion will be appreciated!
I found the solution from this page: https://support.jwplayer.com/customer/portal/questions/6062354-passing-custom-parameters-to-wowza-with-jw-player-6
it taught me using url like this(jwplayer) : rtmp://stream01.amherst.edu:1935/protected/?token=TESTTOKENmp4:sand_mandala_video.mp4
and I knew from other place that live stream or flv fomat may use flv:, so I use rtmpt://XXXXX/RtmpRelay/?userId=XXXflv:myLiveSteamName,
and everthing goes ok.

sending gps data using icomsat v1.1

I am doing my final year project that tracks the vehicle and displays the position on google maps,am using an arduino,GPS module and icomsat v1.1 GPRS module.Am trying to send the GPS data to a web page at my local server with no success,how do i do this, pls help :
this is how am doing it:
//set http param value
GPRS.print("AT+HTTPPARA=\"URL\",\"http://my_domain/gps_tracker.php?");
GPRS.print("visor=false");
GPRS.print("&latitude=");
GPRS.print(latitude);
GPRS.print("&longitude=");
GPRS.print(longitude);
GPRS.print("speed=");
GPRS.print(speedOTG);
GPRS.print("\"");
I suppose that you need to send the url as a single line message, using: println instead of print.
And check if you're receiving or not any data on your GPRS module, or if you're not managing it right.

Use AWS S3 success_action_redirect policy with XHR

I'm using signed POST to upload file directly to amazon S3. I had some trouble with the signature of the policy using PHP but finally fixed it and here is the sample of code.
This xhr request is send in javascript and I'm waiting for an answer from amazon. At first I was using success_action_status setting it to 201 to get the XML response.
What I'd like to do is using the success_action_redirect to call a script on my server to create a record in the database.
The reason why is that I could create the record in the database and if anything wrong happen at this stage I can return an error message directly at this point. Also it saves me another ajax request to my server.
So I've tried to set this up specifying the success_action_redirect to http:\\localhost\callback.php where I have a script that is waiting for some parameters.
But it looks like this script is never called and the response of the xhr.send() is empty.
I think it's a cross-browser issue and I'm wondering if it would be possible to use jsonp somehow to pass-by this?
Any ideas?
UPDATE
Apparently xhr is following redirect natively so it should work but when I specified the success_action_redirect it returns error Server responded with 0 code.
At first I thought it was because the redirect URL was on my local server so I've changed it to an accessible server but no chance.
Anyone knows why it's returning this error message?
I also run into this problem. It seems like nobody has a solution to this like this
maybe the best workaround i have found is something like this.
It seems thet the only workaround includes a second xhr-request to execute the callback manually. therefore the
success_action_status
should be used. Witht his you will get a 201 response if the upload was successful and you can start a second request for the actual callback. For me it looks like the only possible solution at the moment.
Any other solutions?