Skip to content

Commit

Permalink
fix: talkback stream bitrate settings (#248)
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptk authored Oct 29, 2024
1 parent bb61507 commit f10dedf
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/uiprotect/stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,6 @@ def __init__(
if len(input_args) > 0:
input_args += " "

bitrate = camera.talkback_settings.bits_per_sample * 1000
# 8000 seems to result in best quality without overloading the camera
udp_bitrate = bitrate + 8000

# vn = no video
# acodec = audio codec to encode output in (aac)
# ac = number of output channels (1)
Expand All @@ -143,8 +139,8 @@ def __init__(
"-loglevel info -hide_banner "
f'{input_args}-i "{content_url}" -vn '
f"-acodec {camera.talkback_settings.type_fmt.value} -ac {camera.talkback_settings.channels} "
f"-ar {camera.talkback_settings.sampling_rate} -b:a {bitrate} -map 0:a "
f'-f adts "udp://{camera.host}:{camera.talkback_settings.bind_port}?bitrate={udp_bitrate}"'
f"-ar {camera.talkback_settings.sampling_rate} -b:a {camera.talkback_settings.sampling_rate} -map 0:a "
f'-f adts "udp://{camera.host}:{camera.talkback_settings.bind_port}?bitrate={camera.talkback_settings.sampling_rate}"'
)

super().__init__(cmd, ffmpeg_path)
Expand Down

0 comments on commit f10dedf

Please sign in to comment.