REST API V.4 - Append to the same file not working.

Hi, i’m working in a node.js module to start and stop streaming from my own schedule.

Using the default Body params to start the stream not working to appending to the same file when restarting the same stream channel.

I’ll paste the default Body params here, because i’ve tried to change all the fields, file patters and the file continue to put the version number at the end, mystream_0.mp4, 1.mp4 so on.

curl -X POST --header ‘Accept:application/json; charset=utf-8’ --header ‘Content-type:application/json; charset=utf-8’ http://localhost:8087/v2/servers/defaultServer/vhosts/defaultVHost/applications/live/instances/definst/streamrecorders/myStream -d ’

{

“restURI”:“http://localhost:8087/v2/servers/defaultServer/vhosts/defaultVHost/applications/live/instances/definst/streamrecorders/myStream”,

“recorderName”:“myStream”,

“instanceName”:“definst”,

“recorderState”:“Waiting for stream”,

“defaultRecorder”:true,

“segmentationType”:“None”,

“outputPath”:"[output-path]",

“baseFile”:“myrecord2.mp4”,

“fileFormat”:“MP4”,

“fileVersionDelegateName”:“com.wowza.wms.livestreamrecord.manager.StreamRecorderFileVersionDelegate”,

“fileTemplate”:"${BaseFileName}${RecordingStartTime}${SegmentNumber}",

“segmentDuration”:900000,

“segmentSize”:10485760,

“segmentSchedule”:“0 * * * * *”,

“recordData”:true,

“startOnKeyFrame”:true,

“splitOnTcDiscontinuity”:false,

“option”:“Version existing file”,

“moveFirstVideoFrameToZero”:true,

“currentSize”:0,

“currentDuration”:0,

“recordingStartTime”:""

}’

Also how can i just start the streaming and not create a new one, like i do with Stop Stream, just passing the stream name and the action?.

Thanks in advance.

Marcelo.

No help on this issue someone?

tried with:

live

${com.wowza.wms.context.VHostConfigHome}/content

${com.wowza.wms.context.VHostConfigHome}/keys

cupertinostreamingpacketizer, mpegdashstreamingpacketizer, sanjosestreamingpacketizer, smoothstreamingpacketizer

versionFile

false

Boolean

appendFile

true

Boolean

No lucky, bellow my body params:

var bodyparam = {

“restURI” : WowzaApiProxy.REST_URL + “/streamrecorders/” + streamName,

“recorderName” : streamName,

“instanceName” : “definst”,

“recorderState” : “”,

“defaultRecorder” : false,

“segmentationType” : “None”,

“outputPath” : “/Library/WowzaStreamingEngine-4.4.1/content/”,

“baseFile” : streamName + ‘.mp4’,

“fileFormat” : “MP4”,

“fileVersionDelegateName” : “com.wowza.wms.livestreamrecord.manager.StreamRecorderFileVersionDelegate”,

“fileTemplate” : “${BaseFileName}”,

“segmentDuration” : 900000,

“segmentSize” : 10485760,

“segmentSchedule” : “0 * * * * *”,

“recordData” : true,

“startOnKeyFrame” : true,

“splitOnTcDiscontinuity” : false,

“option” : " — ",

“moveFirstVideoFrameToZero” : true,

“currentSize” : 0,

“currentDuration” : 0,

“recordingStartTime” : “”

};

As per docs the field “segmentationType” : “None” should be doing the work to append to the same file, but no lucky too.

Really need some help on this, don’t know more what to try.

Thanks in advance.

M

Hello Marcelo

The “option” parameter allows for the following values:

"Append to existing file"
"Version existing file"
"Overwrite existing file"

So your query would have to include the following:

curl -X POST --header 'Accept:application/json; charset=utf-8' --header 'Content-type:application/json; charset=utf-8' http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/instances/_definst_/streamrecorders -d '
{
 "restURI":"http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/instances/_definst_/streamrecorders",
 "recorderName":"myStream",
"instanceName":"_definst_",
"recorderState":"Waiting for stream",
"defaultRecorder":true,
"segmentationType":"None",
...
"option":"Append to existing file",
...
}'

Your Wowza access logs should indicate that this has occurred:

INFO server comment - StreamRecorder[live/_definst_] recordStream:  action:startRecording stream:myStream format:mp4 versioning:append .... 

Thanks,

Matt

Hello Marcelo

We definitely appreciate the feedback! Currently we are working towards providing more in-depth documentation for the REST API and striving to improve the functionality upon each release. Thank you for taking the time to send us your thoughts & suggestions!

Thanks again,

Matt

Thanks a bunch Matt.

It works. Are you part of the developer team?

We should not have Options been defined with white-space and camel case, etc. Well, at least in my entire programming life i never saw it, maybe in the old ages but i can’t remember.

As the REST API is still fresh and maybe it will change, ok, but until that you guys definitely need to include it on that API Request Examples.

Also i could not found it in my localhost REST Swagger Docs (http://localhost:xxxx/api-docs), also for each params there described we just have the param type (string, Number, …). So also need to put there all the options for each property available.

Just my view point, don’t want to cross the line and also i’m not complaining about, you guys do a awesome job, i can just thanks Wowza. But trying to help and point some issues is kind of “thanks” too.

Best regards,

Marcelo.

Where did you got this information? I’ve doesn’t found nothing in the swagger docs about those options.