Skip to content

Commit

Permalink
ffmpeg: enable network reconnects
Browse files Browse the repository at this point in the history
This commit adds the HTTP reconnect* args to the ffmpeg subprocess so
that it will attempt to reconnect when a network error occurs.
  • Loading branch information
charlievieth committed Jan 2, 2025
1 parent 0d5db38 commit 0b68a64
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions scdl/scdl.py
Original file line number Diff line number Diff line change
Expand Up @@ -1310,6 +1310,16 @@ def build_ffmpeg_encoding_args(
"0.1",
]

reconnect_args = [
["-reconnect", "1"],
["-reconnect_streamed", "1"],
["-reconnect_max_retries", "10"],
["-reconnect_delay_total_max", "60"],
]
for rargs in reconnect_args:
if rargs[0] in supported:
ffmpeg_args += rargs

ffmpeg_args += [
# User provided arguments
*args,
Expand Down

0 comments on commit 0b68a64

Please sign in to comment.