Copy link to clipboard
Copied
How to add recording capabilities in fms, the main.asc Lane changes in it? If so, what should be added to the content, I push the stream with the Android compiled, only pushed a rtmp path.
[Moved from the generic Cloud/Setup forum to the specific Program forum... Mod]
Copy link to clipboard
Copied
Hi,
Please specify the application you are using.
Regards,
Sheena
Copy link to clipboard
Copied
It works on fms4.5. I want to record the stream while publishing.But it is bad.Could you help me,thinks.
My parting code:
------------------------------------------
application.onPublish = function(clientObj, streamObj)
{
// a race can happen during republish. if onPublish is called
// before onUnpublish, we need to wait for onUnpublish to
// complete before calling onPublish for the new stream.
if (streamObj.publishing == true)
{
// onUnpublish has not been called yet
//trace("Unpublish pending...");
streamObj.publishingClient = clientObj; // save and call onPublish later
return;
}
streamObj.publishing = true;
trace("onPublish : " + streamObj.name);
var queryString = streamObj.publishQueryString;
var liveEventName = streamObj.name;
var audioStreamSrc = "";
var audioStreamName = "";
var videoStreamSrc = "";
var videoStreamName = "";
var recordMode = "append";
//trace("queryString["+queryString+"] stream["+streamObj.name+"]");
if (queryString == undefined || (queryString.localeCompare("") == 0)) {
/* Did not find query string so use the streamname as the event id */
trace("Query string not specified. Using StreamName["
+streamObj.name+"] as eventname");
} else {
/* Looking for name value pair adbe-live-event in the query string. If specified, use event name based on it. Otherwise, it is a single stream so you don't need to configure Event.xml and Manifest.xml */
var nvpairs = new LoadVars();
nvpairs.decode(queryString);
for (var nv in nvpairs) {
var nval = nvpairs[nv];
/*trace("nv["+nv+"]=val["+nval+"]");*/
if (nv.localeCompare("adbe-live-event")==0) {
liveEventName = nval;
/*trace("live event set to["+liveEventName+"]");*/
}
else if (nv.localeCompare("adbe-audio-stream-src") == 0)
{
audioStreamSrc = nval;
}
else if (nv.localeCompare("adbe-audio-stream-name") == 0)
{
audioStreamName = nval;
}
else if (nv.localeCompare("adbe-video-stream-src") == 0)
{
videoStreamSrc = nval;
}
else if (nv.localeCompare("adbe-video-stream-name") == 0)
{
videoStreamName = nval;
}
else if (nv.localeCompare("adbe-record-mode") == 0)
{
recordMode = nval;
}
}
}
var s = Stream.get("f4f:" + streamObj.name);
if (s == undefined )
return;
if ((s.liveEvent != undefined)&&(s.liveEvent != "")&&(s.liveEvent != liveEventName)) {
trace("Rejecting publish from client: "+clientObj.ip +" as stream: "+streamObj.name+
" is already assigned to event: ["+s.liveEvent +"]");
application.disconnect(clientObj);
return;
}
s.onStatus = function(info)
{
this.trace(info.code);
}
s.liveEvent = liveEventName;
trace("Stream name is: " + streamObj.name + " and live event is: "+s.liveEvent);
s.play(streamObj.name,-1,-1);
if (!s.record(recordMode))
{
s.trace("record failed.");
}
application.s[streamObj.name] = s;
// check if audio only stream is desired
if (audioStreamName != "")
{
// if no stream src specified, use this stream
if (audioStreamSrc == "")
{
audioStreamSrc = streamObj.name;
}
if (audioStreamSrc == streamObj.name)
{
//trace("Creating audio only stream " + audioStreamName + " from " + audioStreamSrc);
var a = Stream.get("f4f:" + audioStreamName);
a.onStatus = function(info)
{
this.trace(info.code);
}
a.receiveAudio = true;
a.receiveVideo = false;
a.liveEvent = liveEventName;
a.play(audioStreamSrc, -1, -1);
if (!a.record(recordMode))
{
a.trace("record failed.");
}
application.a[streamObj.name] = a;
}
}
// check if video only stream is desired
if (videoStreamName != "")
{
// if no stream src specified, use this stream
if (videoStreamSrc == "")
{
videoStreamSrc = streamObj.name;
}
if (videoStreamSrc == streamObj.name)
{
//trace("Creating video only stream " + videoStreamName + " from " + videoStreamSrc);
var v = Stream.get("f4f:" + videoStreamName);
v.onStatus = function(info)
{
this.trace(info.code);
}
v.receiveAudio = false;
v.receiveVideo = true;
v.liveEvent = liveEventName;
v.play(videoStreamSrc, -1, -1);
if (!v.record(recordMode))
{
v.trace("record failed.");
}
application.v[streamObj.name] = v;
}
}
}
Copy link to clipboard
Copied
Manually Top!=。=
Copy link to clipboard
Copied
Manually Top!
Copy link to clipboard
Copied
What is the name of the Adobe program you are using?
You need to put the full name, fms does not mean anything
Copy link to clipboard
Copied
Oh,sorry.I use Adobe Flash Media Server. I would like to use it to record video stream pushed me, and looked at the statistics may need to change the Adobe Flash Media Server inside the main.asc file, I tried to change some, but did not succeed, I need your help, thanks.
Copy link to clipboard
Copied
Moving to Adobe Media Server