Skip to content

Commit

Permalink
Don't specify ar for aac #1241
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlt8 committed Jun 3, 2024
1 parent 29bba53 commit 3a5dcc2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/wyzebridge/ffmpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ def get_ffmpeg_cmd(
audio_out = "aac"
thread_queue = "-thread_queue_size 8 -analyzeduration 32 -probesize 32"
if audio and "codec" in audio:
audio_in = f"{thread_queue} -f {audio['codec']} -ac 1 -ar {audio['rate']} -i /tmp/{uri}_audio.pipe"
# `Option sample_rate not found.` if we try to specify -ar for aac:
rate = "" if audio["codec"] == "aac" else f" -ar {audio['rate']}"
audio_in = f"{thread_queue} -f {audio['codec']}{rate} -i /tmp/{uri}_audio.pipe"
audio_out = audio["codec_out"] or "copy"
a_filter = env_bool("AUDIO_FILTER", "volume=5") + ",adelay=0|0"
a_options = ["-filter:a", a_filter]
Expand Down

0 comments on commit 3a5dcc2

Please sign in to comment.