fix(tools): pass -nostdin to all ffmpeg calls

When ffmpeg runs with the terminal on stdin it turns off echo for its
interactive keys. If several run at once, or one gets killed, echo never
comes back and the terminal is left broken after dl exits.
This commit is contained in:
imSp4rky
2026-08-02 13:44:21 -06:00
parent 330e274da6
commit b580ccdd42
4 changed files with 20 additions and 1 deletions
+15 -1
View File
@@ -135,7 +135,19 @@ def crop(path: Path, aspect: str, letter: bool, offset: int, preview: bool) -> N
]
ffmpeg_call = subprocess.Popen(
[binaries.FFMPEG, "-y", "-i", str(video_path), "-map", "0:v:0", "-c", "copy", "-bsf:v", crop_filter]
[
binaries.FFMPEG,
"-nostdin",
"-y",
"-i",
str(video_path),
"-map",
"0:v:0",
"-c",
"copy",
"-bsf:v",
crop_filter,
]
+ out_path,
stdout=subprocess.PIPE,
)
@@ -216,6 +228,7 @@ def range_(path: Path, full: bool, preview: bool) -> None:
ffmpeg_call = subprocess.Popen(
[
binaries.FFMPEG,
"-nostdin",
"-y",
"-i",
str(video_path),
@@ -267,6 +280,7 @@ def test(path: Path, map_: str) -> None:
p = subprocess.Popen(
[
binaries.FFMPEG,
"-nostdin",
"-hide_banner",
"-benchmark",
"-err_detect",
+1
View File
@@ -1074,6 +1074,7 @@ class HLS:
subprocess.check_call(
[
binaries.FFMPEG,
"-nostdin",
"-hide_banner",
"-loglevel",
"error",
+1
View File
@@ -921,6 +921,7 @@ class Track:
def _ffmpeg(extra_args: list[str] = None, bsf: Optional[str] = None):
args = [
binaries.FFMPEG,
"-nostdin",
"-hide_banner",
"-loglevel",
"error",
+3
View File
@@ -385,6 +385,7 @@ class Video(Track):
subprocess.run(
[
binaries.FFMPEG,
"-nostdin",
"-hide_banner",
"-loglevel",
"panic",
@@ -493,6 +494,7 @@ class Video(Track):
subprocess.run(
[
binaries.FFMPEG,
"-nostdin",
"-hide_banner",
"-loglevel",
"error",
@@ -667,6 +669,7 @@ class Video(Track):
subprocess.run(
[
binaries.FFMPEG,
"-nostdin",
"-hide_banner",
"-loglevel",
"panic",