Results 1 to 2 of 2

Thread: Stream recorder status API REST call gives wrong result

  1. #1
    Join Date
    May 2015
    Posts
    3

    Default Stream recorder status API REST call gives wrong result

    Hi,
    I am using the Wowza API REST in order to record a live stream.
    curl -X POST http://myhost:8087/v2/servers/_defaultServer_ /vhosts/_defaultVHost_/applications/test/instances/_definst_/streamrecorders/live 
    -d '
    {
     "restURI":"http://myhost:8087/v2/servers/_defaultServer_ /vhosts/_defaultVHost_/applications/test/instances/_definst_/streamrecorders/live",
     "recorderName":"live",
    "instanceName":"_definst_",
    "defaultRecorder":true,
    "segmentationType":"None",
    "outputPath": "",
    "baseFile":"Test.flv",
    "fileFormat":"FLV",
    "fileVersionDelegateName":"com.wowza.wms.livestreamrecord.manager.StreamRecorderFileVersionDelegate",
    "fileTemplate":"${BaseFileName}_${RecordingStartTime}_${SegmentNumber}",
    "segmentDuration":900000,
    "segmentSize":10485760,
    "segmentSchedule":"0 * * * * *",
    "recordData":true,
    "startOnKeyFrame":true,
    "option":"Overwrite existing file",
    "moveFirstVideoFrameToZero":true,
    "currentSize":0,
    "currentDuration":0,
    "recordingStartTime":""
    }'
    Immediately I request the status of the stream recorder:
    curl -X GET http://myhost:8087/v2/servers/_defaultServer_ /vhosts/_defaultVHost_/applications/test/instances/_definst_/streamrecorders/live
    In most of the cases although the incoming stream is active, Wowza API response has recorderState field as "Waiting for stream".
    {"recorderName":"live","instanceName":"_definst_","recorderState":"Waiting for stream","defaultRecorder":false,"segmentationType":"None","outputPath":"","baseFile":"Test.flv","fileFormat":"FLV","fileVersionDelegateName":"com.wowza.wms.livestreamrecord.manager.StreamRecorderFileVersionDelegate","fileTemplate":"${BaseFileName}","segmentDuration":0,"segmentSize":10485760,"segmentSchedule":"0 * * * * *","recordData":true,"startOnKeyFrame":true,"option":"Overwrite existing file","moveFirstVideoFrameToZero":true,"currentSize":0,"currentDuration":0,"recordingStartTime":""}
    This status ("Waiting for stream") is returned when the incoming stream of the stream recorder does not exist, so in my opinion recorderState could not be "Waiting for stream" when the incoming stream is active.

  2. #2
    Join Date
    May 2013
    Posts
    680

    Default

    Hello

    In your examples I would ensure that you include your headers into your request and ensure the stream name and application are in fact matching the active stream. For example, I took your request and setup the same scenario. I published a stream name "live" to an application named "test" and after publishing to it, I used the following query:
    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/test/instances/_definst_/streamrecorders/live -d '
    {
     "restURI":"http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/test/instances/_definst_/streamrecorders/live",
     "recorderName":"live",
    "instanceName":"_definst_",
    "recorderState":"Waiting for stream",
    "defaultRecorder":true,
    "segmentationType":"None",
    "outputPath":"/Library/WowzaStreamingEngine/content/",
    "baseFile":"myrecord2.mp4",
    "fileFormat":"MP4",
    "fileVersionDelegateName":"com.wowza.wms.livestreamrecord.manager.StreamRecorderFileVersionDelegate",
    "fileTemplate":"${BaseFileName}_${RecordingStartTime}_${SegmentNumber}",
    "recordData":true,
    "startOnKeyFrame":true,
    "option":"Version existing file",
    "moveFirstVideoFrameToZero":true,
    "currentSize":0,
    "currentDuration":0,
    "recordingStartTime":""
    }'
    And received the following response:
    {"success":true,"message":"Recorder Created","data":null}
    Thereafter I completed a GET against the stream recorder (for the stream) as follows:
    curl -X GET --header 'Accept:application/json; charset=utf-8' http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/test/instances/_definst_/streamrecorders/live
    This did show it was in progress:
    {"serverName":"_defaultServer_","recorderName":"live","instanceName":"_definst_","recorderState":"Recording in Progress" ..... "recordingStartTime":"2016-02-03-08.48.17.699--05:00"}
    Should you continue to have problems, please do the following:

    1. Restart Wowza
    2. Publish your stream
    3. Initiate the recorder (via api) as mentioned above
    4. Do a GET thereafter.

    Then copy and paste both cURL commands and zip up your conf/ and logs/ directories and send them via our support form here.

    Thanks,
    Matt

Similar Threads

  1. Get monthly network status use REST API
    By hanwook in forum Wowza Streaming Engine REST API
    Replies: 3
    Last Post: 11-03-2015, 07:28 PM
  2. REST API or Java call to Disable/Enable Stream Targets
    By mtownsend in forum Wowza Streaming Engine REST API
    Replies: 2
    Last Post: 07-30-2015, 11:05 AM
  3. 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
  4. My .stream I using with stream manager gives me "...Failure no URL"
    By timeview in forum Live Streaming and Encoder Discussion
    Replies: 4
    Last Post: 02-02-2014, 02:31 PM

Posting Permissions

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