Copy link to clipboard
Copied
The workflow:
I push a live feed to the rtmp url rtmp://localhost/my-app/tester where my-app is a copy of the live app in AMS but with the following addition of code in main.asc:
application.onPublish = function( p_client, p_stream) {
s = Stream.get("my_hello5");
trace( s.name + " = name, " + s.publishQueryString + " = pqs");
if(s) {
s.record();
trace("recording...");
s.play(p_stream.name);
}
}
application.onUnpublish = function( p_client, p_stream) {
s = Stream.get("my_hello5");
trace("getting stream my_hello5...");
if(s) {
trace("stopping recording...");
s.record(false);
}
}
And Iam facing multiple issues:
* The file my_hello5.flv gets generated in applications/my-app/streams/_definst_/ . And Once the recording is complete, If I open it using the url below in media player (Mine is Totem movie player on ubuntu) that I have on linux, it plays. But if I open the same url in the OSMF flash media playback setup page (http://www.osmf.org/configurator/fmp/# ) , it is always showing "buffering".
The flv url I used is: rtmp://localhost/my-app/my_hello5
* If I try to open either the flv url or the live feed url inside the osmf page while the recording is still going on, then Iam not able to view either. It just shows "buffering" all the time.
Your help is valuable and much appreciated.
Copy link to clipboard
Copied
As a good practice if should not play a file while it is being recorded...on other hand you can programatically create chunks of recordking at preodic intervals and use those chunks for laying or copy those chunks to a different folder where a different application and make those availabel to subscribers for rtmp streaming..