ZoomSDKError_WrongUsage on subscribing to raw video data

I am trying to use the zoomSDK sample app to capture raw video data for all users in a meeting.
After reading the documentation and a few posts on the forum, I figured that I need to create an instance of ZoomSDKRenderer for every user. So I wrote a helper class which creates a new ZoomSDKRenderer instance. But when I call the method to subscribe to a userID, the SDK throws ZoomSDKError_WrongUsage error.

init method of the helper class:

- (id)initWithUID:(unsigned int)uid {
    if (self = [super init]) {
        self.uid = uid;
        ZoomSDKRenderer* sdkrenderer = nil;
        ZoomSDKError e = [[[ZoomSDK sharedSDK] getRawDataController] creatRender:&sdkrenderer];
        if (e == ZoomSDKError_Success) {
            ZoomSDKError rawDataSubscriptionError = [sdkrenderer subscribe:uid rawDataType:ZoomSDKRawDataType_Video];
            NSLog(@"Subscription Error: %d", rawDataSubscriptionError);
            if (rawDataSubscriptionError == ZoomSDKError_Success) {
                self.renderer = sdkrenderer;
                self.renderer.delegate = self;
                return self;
            }
        }
    }
    return nil;
}

In the log I’m getting ZoomSDKError_WrongUsage with no particular reasons mentioned.

I am creating instances of this class inside
- (void)onVideoStatusChange:(ZoomSDKVideoStatus)videoStatus UserID:(unsigned int)userID

- (void)onVideoStatusChange:(ZoomSDKVideoStatus)videoStatus UserID:(unsigned int)userID {
    if (videoStatus == ZoomSDKVideoStatus_On) {
        ZoomRendererHelper* renderHelper = [[ZoomRendererHelper alloc] initWithUID:userID];
    }
}

  • Device: Apple MacBook Pro (13-inch, M2)
  • OS: macOS Ventura 13.1

@shubhangsati, Hi hope you will be fine.

To resolve :point_up_2: please bind SDK renderer inside onMeetingStatus event when status=="joined".

If still any problem you are facing share that.

Here is the rendering logic for multi-renderers.

Hi Naeem,
Thanks for the quick response.
I am creating the renderer and subscribing when the user turns on their video. That should imply the user has already “joined” the meeting, right?

Then it is OK. Do you have properly configured local_recording and zak tokens when joining the meeting?

Yes. I am able to start the raw recording and the recording gets saved locally as well once the meeting ends.

Interestingly enough, if I create the renderer inside
- (void)onMeetingStatusChange:(ZoomSDKMeetingStatus)state, as follows

if (state == ZoomSDKMeetingStatus_InMeeting) {
    ...
    ...
    NSArray *userList = [actionController getParticipantsList];
    NSNumber* userID = userList.firstObject;
    
    ZoomSDKRenderer *sdkrenderer = nil;
    ZoomSDKError e = [[[ZoomSDK sharedSDK] getRawDataController] creatRender:&sdkrenderer];
    if (e == ZoomSDKError_Success) {
        sdkrenderer.delegate = self;
        ZoomSDKError rawDataSubscriptionError = [sdkrenderer subscribe:[userID unsignedIntValue] rawDataType:ZoomSDKRawDataType_Video];
        NSLog(@"subscription error: %@", [NSString stringWithFormat:@"%u", rawDataSubscriptionError]);
    }
    ...
    ...
}

This works. And I’m able to get raw frames for the host.

But I don’t get the callback in this method every time a user joins or starts their video which is why I had used onVideoStatusChange to create the renderers.

I have also verified that the control reaches onVideoStatusChange after the recording has started.

@shubhangsati Please read my shared topic where I shared the solution on how to create the renderers for other users.

@shubhangsati, if you’re still having trouble another option is to use a third party hosted bot API like Recall.ai.