# Setting resolution for recording

**URL:** <https://openvidu.discourse.group/t/setting-resolution-for-recording/2252>\
**Category:** Issues with deployment\
**Tags:** v2\
**Created:** [November 12, 2020, 7:34am UTC](https://openvidu.discourse.group/t/setting-resolution-for-recording/2252 "2020-11-12T07:34:56Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![deepak\_hegde](https://avatars.discourse-cdn.com/v4/letter/d/f6c823/32.png) [@deepak\_hegde](https://openvidu.discourse.group/u/deepak_hegde)\
**Post date:** [November 12, 2020, 7:34am UTC](https://openvidu.discourse.group/t/setting-resolution-for-recording/2252/1 "2020-11-12T07:34:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![cruizba](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/cruizba/32/18_2.png) [@cruizba](https://openvidu.discourse.group/u/cruizba)\
**Post date:** [November 13, 2020, 12:12pm UTC](https://openvidu.discourse.group/t/setting-resolution-for-recording/2252/2 "2020-11-13T12:12:07Z")

</div>

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](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](https://docs.openvidu.io/en/2.15.0/advanced-features/recording/#2-configure-your-sessions-to-be-recorded)

---

<div class="post-metadata">

**Author:** ![deepak\_hegde](https://avatars.discourse-cdn.com/v4/letter/d/f6c823/32.png) [@deepak\_hegde](https://openvidu.discourse.group/u/deepak_hegde)\
**Post date:** [November 13, 2020, 12:27pm UTC](https://openvidu.discourse.group/t/setting-resolution-for-recording/2252/3 "2020-11-13T12:27:21Z")

</div>

Hi Cruizba,  
I am following [https://docs.openvidu.io/en/2.15.0/deployment/deploying-on-premises/](https://docs.openvidu.io/en/2.15.0/deployment/deploying-on-premises/) and [https://docs.openvidu.io/en/2.15.0/developing/](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.

---

<div class="post-metadata">

**Author:** ![cruizba](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/cruizba/32/18_2.png) [@cruizba](https://openvidu.discourse.group/u/cruizba)\
**Post date:** [November 13, 2020, 12:44pm UTC](https://openvidu.discourse.group/t/setting-resolution-for-recording/2252/4 "2020-11-13T12:44:23Z")

</div>

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](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](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](https://openvidu.discourse.group/c/request-for-feature/11)

---

<div class="post-metadata">

**Author:** ![deepak\_hegde](https://avatars.discourse-cdn.com/v4/letter/d/f6c823/32.png) [@deepak\_hegde](https://openvidu.discourse.group/u/deepak_hegde)\
**Post date:** [January 19, 2021, 6:28am UTC](https://openvidu.discourse.group/t/setting-resolution-for-recording/2252/5 "2021-01-19T06:28:46Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![cruizba](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/cruizba/32/18_2.png) [@cruizba](https://openvidu.discourse.group/u/cruizba)\
**Post date:** [January 19, 2021, 10:19am UTC](https://openvidu.discourse.group/t/setting-resolution-for-recording/2252/6 "2021-01-19T10:19:46Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![deepak\_hegde](https://avatars.discourse-cdn.com/v4/letter/d/f6c823/32.png) [@deepak\_hegde](https://openvidu.discourse.group/u/deepak_hegde)\
**Post date:** [January 19, 2021, 10:21am UTC](https://openvidu.discourse.group/t/setting-resolution-for-recording/2252/7 "2021-01-19T10:21:11Z")

</div>

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]  
},

---

<div class="post-metadata">

**Author:** ![cruizba](https://yyz2.discourse-cdn.com/free1/user_avatar/openvidu.discourse.group/cruizba/32/18_2.png) [@cruizba](https://openvidu.discourse.group/u/cruizba)\
**Post date:** [January 19, 2021, 10:58am UTC](https://openvidu.discourse.group/t/setting-resolution-for-recording/2252/8 "2021-01-19T10:58:48Z")

</div>

That’s because no users has joined to the session, it is stated here: [OpenVidu Docs](https://docs.openvidu.io/en/2.16.0/reference-docs/openvidu-server-cdr/#participantjoined)

Use OpenVidu Webhooks to listen to events in your server:  
- Webhook: [OpenVidu Docs](https://docs.openvidu.io/en/2.16.0/reference-docs/openvidu-server-webhook/)  
- Events: [OpenVidu Docs](https://docs.openvidu.io/en/2.16.0/reference-docs/openvidu-server-cdr/)

If you listen to [participantjoined](https://docs.openvidu.io/en/2.16.0/reference-docs/openvidu-server-cdr/) you can check by the sessionId if the recording is active and if not, start it.

---

<div class="post-metadata">

**Author:** ![deepak\_hegde](https://avatars.discourse-cdn.com/v4/letter/d/f6c823/32.png) [@deepak\_hegde](https://openvidu.discourse.group/u/deepak_hegde)\
**Post date:** [January 19, 2021, 11:03am UTC](https://openvidu.discourse.group/t/setting-resolution-for-recording/2252/9 "2021-01-19T11:03:39Z")

</div>

Thanks a million.  
Will try to achieve this.

Suggesting you to mention this in docs page
