Stream recording on demand 404 - Not found

cheinan

Member
Hello

With our WCS version 5.1.3483
I am trying to do Stream recording on demand by REST methods:
startRecording and stopRecording like:
https://my-WCS-domain:8444/rest-api/stream/startRecording
https://my-WCS-domain:8444/rest-api/stream/stopRecording
with data: {
"mediaSessionId": "the-mediaSessionId"
}
But i all ways get error: 404 - Not found

On the same Session connection i succeed to do other REST methods like:
https://my-WCS-domain:8444/rest-api/push/find_all
https://my-WCS-domain:8444/rest-api/push/startup
And i succeed to do full stream recording when i set: record: true
on createStream options

What can be the problem?

Thanks
Cheinan
 

Max

Administrator
Staff member
Hello
The error 404 Not found is returned in two cases:
1. Media session with this id not found. This is not your case.
2. No stream found in this mediasession. The stream cannot be recorded while it is in state "NEW", "PROCESSED_" or "PLAYING". Only streams in state "PUBLISHED" are recorded. This is probably your case.
Note that when you set "record: true" on createStream options and then call play() for the stream, it will not be recorded.
So you have to check in your scripts is the stream in specified mediasession in "PUBLISHING" state, this information is returned on /rest-api/stream/find request, for example
request:
Code:
/rest-api/stream/find
{
    "mediaSessionId": "5675e540-acc2-11e8-a40b-f9e75bae754a"
}
response:
Code:
200 OK
[
    {
        "appKey": "defaultApp",
        "sessionId": "sessionId",
        "mediaSessionId": "5675e540-acc2-11e8-a40b-f9e75bae754a",
        "name": "test",
        "published": true,
        "hasVideo": true,
        "hasAudio": true,
        "status": "PUBLISHING",
        "sdp": "SDP data",
        "audioCodec": "opus",
        "videoCodec": "H264",
        "record": false,
        "width": 320,
        "height": 240,
        "bitrate": 0,
        "minBitrate": 0,
        "maxBitrate": 0,
        "quality": 0,
        "createDate": 1535681131927,
        "mediaProvider": "WebRTC",
        "history": false,
        "origin": "origin"
    }
]
 

cheinan

Member
Hi Max

The problem was solved
I took the wrong mediaSessionID. i took it from the connection session and not from the stream...

Is there any way i can get the recorded file name in the rest response?
I noticed i do not get any thing in response to the rest methods:
stream/startRecording
stream/stopRecording
Maybe its a good idea for WCS update...

Thanks
Cheinan
 
Last edited:
Top