livekit / python-sdks

LiveKit real-time and server SDKs for Python
https://docs.livekit.io
Apache License 2.0
72 stars 23 forks source link

FPS limiter #175

Closed sergeevii123 closed 3 months ago

sergeevii123 commented 3 months ago

Hi, is it possible to add FPS limiter to livekit?

so

async def receive_frames(stream: rtc.VideoStream):
        async for frame in video_stream:
            # received a video frame from the track, process it here
            pass

will actually give frames with FPS x

davidzhao commented 3 months ago

This would be handled in your application logic. if you want say 5 FPS, you would just drop frames until it's been ~200ms since the last frame processed.