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

**URL:** <https://community.wowza.com/t/rest-api-v-4-append-to-the-same-file-not-working/46878>\
**Category:** Wowza Developer Dojo\
**Created:** [April 26, 2016, 6:02pm UTC](https://community.wowza.com/t/rest-api-v-4-append-to-the-same-file-not-working/46878 "2016-04-26T18:02:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcelo\_Henrique\_Car](https://avatars.discourse-cdn.com/v4/letter/m/97f17d/32.png) [@Marcelo\_Henrique\_Car](https://community.wowza.com/u/Marcelo_Henrique_Car)\
**Post date:** [April 26, 2016, 6:02pm UTC](https://community.wowza.com/t/rest-api-v-4-append-to-the-same-file-not-working/46878/1 "2016-04-26T18:02:29Z")

</div>

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](http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/instances/_definst_/streamrecorders/myStream) -d ’

{

“restURI”:“[http://localhost:8087/v2/servers/](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.

---

<div class="post-metadata">

**Author:** ![Marcelo\_Henrique\_Car](https://avatars.discourse-cdn.com/v4/letter/m/97f17d/32.png) [@Marcelo\_Henrique\_Car](https://community.wowza.com/u/Marcelo_Henrique_Car)\
**Post date:** [May 3, 2016, 3:14pm UTC](https://community.wowza.com/t/rest-api-v-4-append-to-the-same-file-not-working/46878/2 "2016-05-03T15:14:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Matt\_Young](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/matt_young/32/389_2.png) [@Matt\_Young](https://community.wowza.com/u/Matt_Young)\
**Post date:** [May 4, 2016, 4:06am UTC](https://community.wowza.com/t/rest-api-v-4-append-to-the-same-file-not-working/46878/3 "2016-05-04T04:06:13Z")

</div>

Hello Marcelo

The **“option”** parameter allows for the following values:

```auto
"Append to existing file"
"Version existing file"
"Overwrite existing file"

```

So your query would have to include the following:

```auto
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:

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

```

Thanks,

Matt

---

<div class="post-metadata">

**Author:** ![Matt\_Young](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/matt_young/32/389_2.png) [@Matt\_Young](https://community.wowza.com/u/Matt_Young)\
**Post date:** [May 5, 2016, 8:06am UTC](https://community.wowza.com/t/rest-api-v-4-append-to-the-same-file-not-working/46878/4 "2016-05-05T08:06:47Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Marcelo\_Henrique\_Car](https://avatars.discourse-cdn.com/v4/letter/m/97f17d/32.png) [@Marcelo\_Henrique\_Car](https://community.wowza.com/u/Marcelo_Henrique_Car)\
**Post date:** [May 4, 2016, 2:55pm UTC](https://community.wowza.com/t/rest-api-v-4-append-to-the-same-file-not-working/46878/5 "2016-05-04T14:55:44Z")

</div>

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](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.

---

<div class="post-metadata">

**Author:** ![Vinicius\_Gajo](https://avatars.discourse-cdn.com/v4/letter/v/f14d63/32.png) [@Vinicius\_Gajo](https://community.wowza.com/u/Vinicius_Gajo)\
**Post date:** [March 9, 2021, 2:27pm UTC](https://community.wowza.com/t/rest-api-v-4-append-to-the-same-file-not-working/46878/6 "2021-03-09T14:27:14Z")

</div>

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