Results 1 to 5 of 5

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

  1. #1
    Join Date
    Apr 2016
    Posts
    4

    Default 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/_de...rders/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.

  2. #2
    Join Date
    Apr 2016
    Posts
    4

    Default

    No help on this issue someone?

    tried with:

    <Streams>
    <StreamType>live</StreamType>
    <StorageDir>${com.wowza.wms.context.VHostConfigHome}/content</StorageDir>
    <KeyDir>${com.wowza.wms.context.VHostConfigHome}/keys</KeyDir>
    <!-- LiveStreamPacketizers (separate with commas): cupertinostreamingpacketizer, smoothstreamingpacketizer, sanjosestreamingpacketizer, mpegdashstreamingpacketizer, cupertinostreamingrepeater, smoothstreamingrepeater, sanjosestreamingrepeater, mpegdashstreamingrepeater, dvrstreamingpacketizer, dvrstreamingrepeater -->
    <LiveStreamPacketizers>cupertinostreamingpacketizer, mpegdashstreamingpacketizer, sanjosestreamingpacketizer, smoothstreamingpacketizer</LiveStreamPacketizers>
    <!-- Properties defined here will override any properties defined in conf/Streams.xml for any streams types loaded by this application -->
    <Properties>
    <Property>
    <Name>versionFile</Name>
    <Value>false</Value>
    <Type>Boolean</Type>
    </Property>
    <Property>
    <Name>appendFile</Name>
    <Value>true</Value>
    <Type>Boolean</Type>
    </Property>
    </Properties>
    </Streams>


    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

  3. #3
    Join Date
    May 2013
    Posts
    680

    Default

    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

  4. #4
    Join Date
    Apr 2016
    Posts
    4

    Default

    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.

  5. #5
    Join Date
    May 2013
    Posts
    680

    Default

    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

Similar Threads

  1. REST API 4.1.2 call problem - POST methods not working in Swagger UI
    By keiserSoze in forum Wowza Streaming Engine REST API
    Replies: 1
    Last Post: 06-30-2015, 06:45 AM
  2. How to append the file in content folder
    By vinodkumarc in forum General Forum
    Replies: 6
    Last Post: 03-27-2014, 05:17 AM
  3. Wowza MP4 Append and file mover addon
    By essence in forum Wowza Media Server 3 for Amazon EC2 Discussion
    Replies: 11
    Last Post: 01-17-2012, 09:27 AM
  4. Convert video file recorded by Wowza using append mode to another format
    By VSheyanov in forum Live Streaming and Encoder Discussion
    Replies: 2
    Last Post: 01-15-2012, 05:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •