Setting resolution for recording

How can I set the resolution of the recording without effecting the resolution while streaming?
I have used recordingMode as ALWAYS.

You can use a different resoulition if you’re using COMPOSED recording in the resolution body parameter of the recoding API call /api/recordings/start: https://docs.openvidu.io/en/stable/reference-docs/REST-API/#post-apirecordingsstart

If you’re using Node or Java Client this section would be usefull too to check: https://docs.openvidu.io/en/2.15.0/advanced-features/recording/#2-configure-your-sessions-to-be-recorded

Hi Cruizba,
I am following https://docs.openvidu.io/en/2.15.0/deployment/deploying-on-premises/ and https://docs.openvidu.io/en/2.15.0/developing/
Is there any way I can set recording resolution in openvidu-call-back or openvidu-call-front application?

I have used recordingMode as ALWAYS.

Ok so if I understand you correctly what you did is to modify openvidu-call-back to start sessions with recordingMode: ALWAYS

In this case it is not possible to set resolution. But you can do this:
In your openvidu-call-back endpoint where the sessions are created:

  1. Create a session with recordingMode: ALWAYS
  2. Check if the session is recording: https://docs.openvidu.io/en/2.15.0/reference-docs/REST-API/#get-apirecordingsltrecording_idgt
  3. If it is not recording, start the recording with custom properties: https://docs.openvidu.io/en/2.15.0/reference-docs/REST-API/#post-apirecordingsstart. If it is recording, do nothing.

Recordings will be stopped automatically when no user is streaming in 120 seconds.

TLDR: This is not implemented. You need to manage your recordings in your openvidu-call-back with some logic that “autostart” recordings with http requests instead of let OpenVidu manage recordings.

You’re always free to do a “Request for enhacement” and we can consider implement this: https://openvidu.discourse.group/c/request-for-feature/11

Hi,

I do not want to keep a check of session has started or not, whenever call starts recording must start.
Where can I trigger the recording manual recording?
Can you let me know the file and function where I can put the REST api request to always start recording?

With custom resolution, it is not possible right now. The recodingMode: ALWAYS don’t accept custom properties.

With recodingMode: MANUAL, how can I trigger the video when session is initiated? which fucntion I can put my REST api to start the recording?
If I call the recording api in createSession function inside OpenviduService file. it gives me 406 error.
In callController.ts also same issue.
Find logs below:

socketPath: undefined,
method: ‘POST’,
insecureHTTPParser: undefined,
path: ‘/api/recordings/start’,
_ended: true,
res: IncomingMessage {
_readableState: [ReadableState],
readable: false,
_events: [Object: null prototype],
_eventsCount: 3,
_maxListeners: undefined,
socket: [TLSSocket],
connection: [TLSSocket],
httpVersionMajor: 1,
httpVersionMinor: 1,
httpVersion: ‘1.1’,
complete: true,
headers: [Object],
rawHeaders: [Array],
trailers: {},
rawTrailers: [],
aborted: false,
upgrade: false,
url: ‘’,
method: null,
statusCode: 406,
statusMessage: ‘’,
client: [TLSSocket],
_consuming: false,
_dumped: false,
req: [Circular],
responseUrl: ‘https://.com:4443/api/recordings/start’,
redirects: [],
[Symbol(kCapture)]: false
},
aborted: false,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
reusedSocket: false,
host: '
.com’,
protocol: ‘https:’,
_redirectable: Writable {
_writableState: [WritableState],
writable: true,
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
_options: [Object],
_ended: true,
_ending: true,
_redirectCount: 0,
_redirects: [],
_requestBodyLength: 412,
_requestBodyBuffers: [],
_onNativeResponse: [Function],
_currentRequest: [Circular],
_currentUrl: 'https://
.com:4443/api/recordings/start’,
[Symbol(kCapture)]: false
},
[Symbol(kCapture)]: false,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object: null prototype] {
accept: [Array],
‘content-type’: [Array],
authorization: [Array],
‘user-agent’: [Array],
‘content-length’: [Array],
‘x-dynatrace’: [Array],
traceparent: [Array],
tracestate: [Array],
host: [Array]
},
[Symbol(DynatraceEmbeddedData)]: [Object: null prototype] { clientRequest: undefined }
},
response: {
status: 406,
statusText: ‘’,
headers: {
server: ‘nginx/1.18.0’,
date: ‘Tue, 19 Jan 2021 05:05:50 GMT’,
‘content-length’: ‘0’,
connection: ‘close’,
vary: ‘Origin, Access-Control-Request-Method, Access-Control-Request-Headers’,
‘set-cookie’: [Array],
‘x-content-type-options’: ‘nosniff’,
‘cache-control’: ‘no-cache, no-store, max-age=0, must-revalidate’,
pragma: ‘no-cache’,
expires: ‘0’,
‘x-frame-options’: ‘SAMEORIGIN’
},
config: {
url: 'https://
*******.com:4443/api/recordings/start’,
method: ‘post’,
data: ‘{“session”:“MjAyMS0wMS0xOXx8MDk6MzB8fDIwMDBtaW58fHRydWV8fGh0dHA6Ly9kaWdpdGJvdC1kYXNoYm9hcmQuZ29kaWdpdC5jb206ODA4MC98fFNVUi1ETS1sb2FkLUphbjE4LTd8fEZST05U”,“name”:“MjAyMS0wMS0xOXx8MDk6MzB8fDIwMDBtaW58fHRydWV8fGh0dHA6Ly9kaWdpdGJvdC1kYXNoYm9hcmQuZ29kaWdpdC5jb206ODA4MC98fFNVUi1ETS1sb2FkLUphbjE4LTd8fEZST05U”,“outputMode”:“COMPOSED”,“hasAudio”:true,“hasVideo”:true,“resolution”:“800x600”,“recordingLayout”:“BEST_FIT”}’,
headers: [Object],
transformRequest: [Array],
transformResponse: [Array],
timeout: 0,
adapter: [Function: httpAdapter],
xsrfCookieName: ‘XSRF-TOKEN’,
xsrfHeaderName: ‘X-XSRF-TOKEN’,
maxContentLength: -1,
maxBodyLength: -1,
httpsAgent: [Agent],
validateStatus: [Function: validateStatus]
},

That’s because no users has joined to the session, it is stated here: OpenVidu Docs

Use OpenVidu Webhooks to listen to events in your server:
- Webhook: OpenVidu Docs
- Events: OpenVidu Docs

If you listen to participantjoined you can check by the sessionId if the recording is active and if not, start it.

Thanks a million.
Will try to achieve this.

Suggesting you to mention this in docs page

1 Like