# onInitialize(…) callback intermittently not firing in raw-recording sample

**URL:** <https://devforum.zoom.us/t/oninitialize-callback-intermittently-not-firing-in-raw-recording-sample/134254>\
**Category:** Meeting SDK\
**Created:** [June 20, 2025, 2:51pm UTC](https://devforum.zoom.us/t/oninitialize-callback-intermittently-not-firing-in-raw-recording-sample/134254 "2025-06-20T14:51:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![purnam-admin](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/purnam-admin/32/58850_2.png) [@purnam-admin](https://devforum.zoom.us/u/purnam-admin)\
**Post date:** [June 20, 2025, 2:51pm UTC](https://devforum.zoom.us/t/oninitialize-callback-intermittently-not-firing-in-raw-recording-sample/134254/1 "2025-06-20T14:51:19Z")

</div>

@amanda-recallai @chunsiong.zoom

I’ve been running a Zoom Meeting bot that streams audio and video into a meeting based on “meetingsdk-linux-raw-recording-sample” ([GitHub - zoom/meetingsdk-linux-raw-recording-sample](https://github.com/zoom/meetingsdk-linux-raw-recording-sample)) unchanged for ~6 months.

Recently, about~20% of the time my `IZoomSDKVideoSource::onInitialize(...)` never fires, even though `setExternalVideoSource(...)` returns SDKERR\_SUCCESS. Because of this the video streaming fails.

I’m upgraded Zoom SDK to the latest as well v6.5.0.3211, on Ubuntu 22.04 with GStreamer 1.18.  
I downgraded/re-upgraded the SDK and still see the same intermittent behavior.

Below are the two key pieces of code:

```cpp
### 1) My override in `ZoomSDKVideoSource.h`  

class ZoomSDKVideoSource : public IZoomSDKVideoSource {
public:
    // …

    // SDK calls this when your external source is bound
    void onInitialize(IZoomSDKVideoSender* sender,
                      IList<VideoSourceCapability>* support_cap_list,
                      VideoSourceCapability& suggest_cap) override
    {
        std::cout << "[VS] onInitialize – sender ready\n";
        video_sender_ = sender;
        initialized_.store(true);
    }

    // …
private:
    std::atomic<bool> initialized_{false};
    IZoomSDKVideoSender* video_sender_ = nullptr;
};

```

```cpp
void CheckAndStartRawSending(bool isVideo, bool isAudio,
                             bool skipState, bool isIntro = false) {
    if (!isIntro && isVideo && isAudio) {
        determineDefaultMediaSource(...);
        std::cout << "Video Source: " << DEFAULT_VIDEO_SOURCE << "\n";

        // create new source each time
        ZoomSDKVideoSource* virtual_camera_video_source =
            new ZoomSDKVideoSource(DEFAULT_VIDEO_SOURCE);
        IZoomSDKVideoSourceHelper* vsHelper = GetRawdataVideoSourceHelper();
        IZoomSDKAudioRawDataHelper* audioHelper = GetAudioRawdataHelper();

        SDKError errvid =
            vsHelper->setExternalVideoSource(virtual_camera_video_source);
        SDKError erraud =
            audioHelper->setExternalAudioSource(
                new ZoomSDKVirtualAudioMicEvent(DEFAULT_AUDIO_SOURCE));

        if (errvid == SDKERR_SUCCESS && erraud == SDKERR_SUCCESS) {
            std::cout << "setExternalVideoSource(): Success\n";
            // unmute & join VOIP…
            m_pMeetingService->GetMeetingVideoController()->UnmuteVideo();
            m_pMeetingService->GetMeetingAudioController()->JoinVoip();
        } else {
            std::cerr << "Failed to bind video or audio source: "
                      << errvid << " / " << erraud << "\n";
        }
    }
}

```

I ve been struggling to figure out why onInitialize does not fire. Because without it my video\_sender is null and the video does not stream.

Any pointers or workarounds would be hugely appreciated!

---

<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:** [June 23, 2025, 10:25pm UTC](https://devforum.zoom.us/t/oninitialize-callback-intermittently-not-firing-in-raw-recording-sample/134254/2 "2025-06-23T22:25:51Z")

</div>

Hey @surya!

Thanks for providing such detailed context!

Just to clarify, had you made any changes to the application at all before this started failing? Was the problem introduced after you changed to a newer Zoom SDK, or does that seem unrelated?

If so, it might be worth changing your environment to use the exact same configuration it had before you started noticing the issues. There might be a difference in behavior between different SDK versions that’s causing this to happen.

Let me know how that goes!

---

<div class="post-metadata">

**Author:** ![MichaelCG8](https://avatars.discourse-cdn.com/v4/letter/m/6a8cbe/32.png) [@MichaelCG8](https://devforum.zoom.us/u/MichaelCG8)\
**Post date:** [July 16, 2025, 4:43pm UTC](https://devforum.zoom.us/t/oninitialize-callback-intermittently-not-firing-in-raw-recording-sample/134254/3 "2025-07-16T16:43:12Z")

</div>

@purnam-admin Did you get to the bottom of this? I am seeing the same thing in the android sdk for a new app. I’ve worked back through a few older SDK releases but haven’t had better results. For me the onInititalize seems to only be called rarely.
