Skip to content

Commit

Permalink
Tweak ffmpeg Opus encoding optoins for more reliable audio (#1299)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsightler authored Aug 20, 2023
1 parent b2c65e5 commit d6a5414
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 95 deletions.
5 changes: 5 additions & 0 deletions .changeset/tame-onions-trade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'homebridge-ring': patch
---

Improve 2-way audio quality in homebridge
100 changes: 8 additions & 92 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 16 additions & 2 deletions packages/homebridge-ring/camera-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,9 @@ class StreamingSessionWrapper {
'-frame_duration',
request.audio.packet_time,
'-application',
'lowdelay',
'voip',
'-vbr',
'off',
]
: [
// AAC-eld specific
Expand Down Expand Up @@ -346,7 +348,19 @@ class StreamingSessionWrapper {
outputArgs: [
'-acodec',
...(isRingUsingOpus
? ['libopus', '-ac', 2, '-ar', '48k']
? [
'libopus',
'-ac',
1,
'-ar',
'24k',
'-vbr',
'off',
'-b:a',
'24k',
'-application',
'voip',
]
: ['pcm_mulaw', '-ac', 1, '-ar', '8k']),
'-flags',
'+global_header',
Expand Down
2 changes: 1 addition & 1 deletion packages/homebridge-ring/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@homebridge/camera-utils": "^2.2.0",
"@homebridge/plugin-ui-utils": "^0.1.0",
"ring-client-api": "12.0.0-beta.3",
"werift": "0.17.6"
"werift": "0.18.5"
},
"devDependencies": {
"concurrently": "^8.2.0",
Expand Down

0 comments on commit d6a5414

Please sign in to comment.