This message was deleted.
# cloud
s
This message was deleted.
m
@adamant-napkin-5261 please thread your messages when they’re related to the same issue/question.
Piyush also said:
can anyone help me what host to pass in egressclient
is it livekitcloud host id or my website/app bundle id?
a
Sorry @magnificent-art-43333 , will do the same going forward
🙏 1
Can you help me! how can i start recording Using livekit-cloud What i have done so far- 1. Created a flutter project and connected Livekit cloud with it. 2. Exposed an api to generate token for room joining. 3. Now i m trying to add record feature to store into a gcp(bucket)/local device. (i have exposed one more api to with livekit-server-sdk using the apikey and secret, but i getting an error in response)
Error i m getting is data: { code: 'malformed', msg: 'the json request could not be decoded' }
@magnificent-art-43333?
d
as the error message indicated, please ensure you are passing in a correct JSON. You probably have already seen the docs here. It'll be a good idea to pass your request JSON through a validator to ensure formatting is correct.
a
Hi @dry-elephant-14928 i m using GCP for this. and i have followed this format from docs
Copy code
import * as fs from 'fs';

const content = fs.readFileSync('/path/to/credentials.json')

const output = {
    fileType:  EncodedFileType.MP4,
    filepath: 'livekit-demo/room-composite-test.mp4',
    gcp: {
        // credentials needs to be a UInt8Array
        credentials: content,
        bucket:      'my-bucket',
    }
};

await egressClient.startRoomCompositeEgress('my-room', output);
My Version:-
Copy code
const content = fs.readFileSync(
        "../functions/creds.json"
      );

 const output = {
        fileType: EncodedFileType.MP4,
        filePath: "${entityId}/recording01.mp4",
        gcp: {
          // credentials needs to be a Buffer
          credentials: Buffer.from(content), // Uint8Array
          bucket: "recording_calls",
        },
      };

      const data = await egressClient.startRoomCompositeEgress(
        roomName,
        output,
        {
          layout: "speaker",
          videoOnly: true,
          encodingOptions: EncodingOptionsPreset.H264_1080P_30,
          audioOnly: true,
          
        }
      );
```my Credentials are going like this
"credentials": {
"type": "Buffer",
"data": [
123,
10,
32,
32,
34,
116,
121,
112,
101,
34,
58,
32,
34,
115,........
]
}```
d
@adamant-napkin-5261, I misunderstood your initial question.. looks like you are trying to follow the JS guide, instead of CLI.
How about trying this instead?
Copy code
const content = fs.readFileSync(
        "../functions/creds.json"
      );

 const output = {
        fileType: EncodedFileType.MP4,
        filePath: "${entityId}/recording01.mp4",
        gcp: {
          // credentials needs to be a Buffer
          credentials: content.toString(),
          bucket: "recording_calls",
        },
      };

      const data = await egressClient.startRoomCompositeEgress(
        roomName,
        output,
        {
          layout: "speaker",
          videoOnly: true,
          encodingOptions: EncodingOptionsPreset.H264_1080P_30,
          audioOnly: true,
          
        }
      );
note the
content.toString()
a
Yes Its working now. Thanx @dry-elephant-14928 ☺️
🙌 1
HI @dry-elephant-14928, one question is their a way i can close all of mysessions via cloud ( my account have some session on running but no participants are in them) so need to close the sessions
m
That shouldn’t happen, it may be an analytics issue. Could you provide a link to your project pls? cc @bright-dream-51521
👀 1
b
@adamant-napkin-5261 can you DM the link to your project?
a
Hey, @magnificent-art-43333 & @bright-dream-51521, they closed automatically after an hour
👍 1