• Stream recording query examples for the Wowza Streaming Engine REST API

    Wowza Streaming Engine™ media server software has a REST Application Programming Interface (API) that can be used to configure, manage, and monitor the media server through HTTP requests. This article demonstrates ways to create and control stream recordings in a Wowza Streaming Engine instance using some basic cURL examples to query the Wowza Streaming Engine REST service. For a complete breakdown and documentation of the API, see How to access documentation for the Wowza Streaming Engine REST API.

    Note: Wowza Streaming Engine 4.3.0 or later is required. You must also have working knowledge of cURL and REST-related services.

    Contents


    Get a list of recorders
    Create a recorder
    Split a recording
    Stop a recording

    Get a list of recorders


    The following example shows how to get a list of all defined stream recordings in your Wowza Streaming Engine instance:
    curl -X GET --header 'Accept:application/json; charset=utf-8' http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/instances/_definst_/streamrecorders

    Create a recorder


    The following example shows how to define a stream recorder and start it:
    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":""
    }'

    Split a recording


    To split a current recording, you can use the following request:
    curl -X PUT --header 'Accept:application/json; charset=utf-8' http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/instances/_definst_/streamrecorders/myStream/actions/splitRecording

    Stop a recording


    To stop a current recording, you can use the following request:
    curl -X PUT --header 'Accept:application/json; charset=utf-8' http://localhost:8087/v2/servers/_defaultServer_/vhosts/_defaultVHost_/applications/live/instances/_definst_/streamrecorders/myStream/actions/stopRecording

    Originally Published: 06-16-2015.
    Updated: For Wowza Streaming Engine 4.3.0 on 10-06-2015.

    If you're having problems or want to discuss this article, post in our forum.