Determine frame rate (fps) when only the host is present in a session

I need to know the video frame rate when a session is started and the host is the only participant in the session.

The sample app does not show the frame rate when only the host is present. It shows it as soon as a second person joins and the frame rate is that of the user. The frame rate is determined for each user separately using getVideoStatisticInfo. For the host, that would be:

ZoomInstantSDK.getInstance().getSession().mySelf.getVideoStatisticInfo()?.fps

However, this always returnns 0 when only the host is in the session. I am recording the video frames from the raw data received in the onRawDataFrameReceived callback. The frame rate is needed in order to encode the frames.

The only solution I can think of is to measure the time between two video buffers received in onRawDataFrameReceived, although this is somewhat hacky because the time will vary. Maybe I can take an average of a dozen frames to get a close approximation.

There is an API called opPropertyChanged that is a function of the ZoomInstantSDKVideoSource interface. The sample app does use this interface in a class but that class is not even used in the sample and there is no documentation on how to use it. Even if it were documented, I doubt that it would provide the frame rate when the host is the only participant.

Please indicate how to obtain the frame rate when only the host is present. If there is no way of determining it other than with the solution I suggested, please add a property or function to the SDK to make this available. This obviously does exist internally since you are delivering the raw data at a fixed time interval.

The sample app uses a default value of 25 fps, but testing has shown that when only the host is present, this is 30 fps. Still, there needs to be a consistent and guaranteed way for the developer to know the frame rate without using some fixed value (unless of course you can guarantee that it will ALWAYS be 30 fps for the host).

Hi @AndroidDev, thanks for the post.

I believe that the reasoning for this behavior is because when only the host is present, there are no other users to which you can transmit your video. The video statistics are only set up to measure data that is sent between users in the session, not local video.

We can investigate adding this as a new feature, but it may take a while to get added to the SDK if it is approved. Regardless, I will submit a feature request on your behalf for this.

In the meantime, I cannot think of a better workaround for this than calculating based on the system time difference between video frame callbacks as you mentioned.

Thanks!

I noticed that the fps for a host-only session is not consistent. Yesterday, it went from 30 to 25. Even though the video is not being transmitted to others, it does in fact have a variable fps and it should be reported in the same way as it is for additional members in the session. In the meantime, the time difference between frames does seem to work. Thanks again!

Hi @AndroidDev,

To be honest, I’m not sure what to make of the inconsistent FPS you’re seeing. It does not appear to be a huge red flag, since it isn’t doing anything crazy like dropping from 30 to 3. It’s possible that this is more related to the device’s performance, but if you start seeing significant drops in FPS we can try to investigate whether or not the SDK is at fault.

Thanks!

The change in fps is probably a result of a device’s performance or the demand on Zoom’s own infrastructure or a combination of the both. I don’t see anything unusual about that.

I agree. Let me know if you have any additional questions and I will be happy to help. :slightly_smiling_face:

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