Wowza Community

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.

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