# ZoomSDKError\_WrongUsage on subscribing to raw video data

**URL:** <https://devforum.zoom.us/t/zoomsdkerror-wrongusage-on-subscribing-to-raw-video-data/80942>\
**Category:** macOS\
**Created:** [January 3, 2023, 6:23am UTC](https://devforum.zoom.us/t/zoomsdkerror-wrongusage-on-subscribing-to-raw-video-data/80942 "2023-01-03T06:23:32Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![shubhangsati](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/shubhangsati/32/44080_2.png) [@shubhangsati](https://devforum.zoom.us/u/shubhangsati)\
**Post date:** [January 3, 2023, 6:23am UTC](https://devforum.zoom.us/t/zoomsdkerror-wrongusage-on-subscribing-to-raw-video-data/80942/1 "2023-01-03T06:23:32Z")

</div>

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:

```auto
- (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 `

```auto
- (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

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [January 3, 2023, 7:06am UTC](https://devforum.zoom.us/t/zoomsdkerror-wrongusage-on-subscribing-to-raw-video-data/80942/2 "2023-01-03T07:06:33Z")

</div>

@shubhangsati, Hi hope you will be fine.

> [@shubhangsati](#):
>
> `ZoomSDKError_WrongUsage`

To resolve 👆 please bind SDK renderer inside onMeetingStatus event when `status=="joined"`.

If still any problem you are facing share that.

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [January 3, 2023, 7:14am UTC](https://devforum.zoom.us/t/zoomsdkerror-wrongusage-on-subscribing-to-raw-video-data/80942/3 "2023-01-03T07:14:52Z")

</div>

Here is [the rendering logic](https://devforum.zoom.us/t/how-to-determine-whether-the-frame-is-screenshare-or-video-rawdata-in-onrawdataframereceived/74221/10) for multi-renderers.

---

<div class="post-metadata">

**Author:** ![shubhangsati](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/shubhangsati/32/44080_2.png) [@shubhangsati](https://devforum.zoom.us/u/shubhangsati)\
**Post date:** [January 3, 2023, 8:00am UTC](https://devforum.zoom.us/t/zoomsdkerror-wrongusage-on-subscribing-to-raw-video-data/80942/4 "2023-01-03T08:00:01Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [January 3, 2023, 8:01am UTC](https://devforum.zoom.us/t/zoomsdkerror-wrongusage-on-subscribing-to-raw-video-data/80942/5 "2023-01-03T08:01:52Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![shubhangsati](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/shubhangsati/32/44080_2.png) [@shubhangsati](https://devforum.zoom.us/u/shubhangsati)\
**Post date:** [January 3, 2023, 8:11am UTC](https://devforum.zoom.us/t/zoomsdkerror-wrongusage-on-subscribing-to-raw-video-data/80942/6 "2023-01-03T08:11:12Z")

</div>

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

```auto
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.

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [January 3, 2023, 8:43am UTC](https://devforum.zoom.us/t/zoomsdkerror-wrongusage-on-subscribing-to-raw-video-data/80942/7 "2023-01-03T08:43:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![amanda-recallai](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/amanda-recallai/32/44747_2.png) [@amanda-recallai](https://devforum.zoom.us/u/amanda-recallai)\
**Post date:** [January 5, 2023, 4:11am UTC](https://devforum.zoom.us/t/zoomsdkerror-wrongusage-on-subscribing-to-raw-video-data/80942/8 "2023-01-05T04:11:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [February 4, 2023, 2:11pm UTC](https://devforum.zoom.us/t/zoomsdkerror-wrongusage-on-subscribing-to-raw-video-data/80942/9 "2023-02-04T14:11:58Z")

</div>

Closed on February 4, 2023, 2:11pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
