Skip to content

Commit

Permalink
Merge pull request #109 from daily-co/only-use-fps
Browse files Browse the repository at this point in the history
transport: only use fps to set maxFramerate
  • Loading branch information
aconchillo authored Apr 6, 2024
2 parents dd696be + eb45504 commit b678097
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/dailyai/transports/abstract_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ def __init__(self, **kwargs):
self._camera_enabled = kwargs.get("camera_enabled") or False
self._camera_width = kwargs.get("camera_width") or 1024
self._camera_height = kwargs.get("camera_height") or 768
self._camera_max_bitrate = kwargs.get("camera_max_bitrate") or 250000
self._camera_max_framerate = kwargs.get("camera_max_framerate") or 30
self._camera_bitrate = kwargs.get("camera_bitrate") or 250000
self._camera_framerate = kwargs.get("camera_framerate") or 10
self._speaker_enabled = kwargs.get("speaker_enabled") or False
self._speaker_sample_rate = kwargs.get("speaker_sample_rate") or 16000
self._fps = kwargs.get("fps") or 8

self._logger: logging.Logger = logging.getLogger("dailyai.transport")

Expand Down
4 changes: 2 additions & 2 deletions src/dailyai/transports/daily_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,9 @@ def _prerun(self):
"maxQuality": "low",
"encodings": {
"low": {
"maxBitrate": self._camera_max_bitrate,
"maxBitrate": self._camera_bitrate,
"scaleResolutionDownBy": 1.333,
"maxFramerate": self._camera_max_framerate,
"maxFramerate": self._camera_framerate,
}
},
}
Expand Down
2 changes: 1 addition & 1 deletion src/dailyai/transports/threaded_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def _run_camera(self):
this_frame = next(self._images)
self.write_frame_to_camera(this_frame)

time.sleep(1.0 / self._fps)
time.sleep(1.0 / self._camera_framerate)
except Exception as e:
self._logger.error(f"Exception {e} in camera thread.")
raise e
Expand Down

0 comments on commit b678097

Please sign in to comment.