fix: update documentation and fix smaller issues (#1520)

This commit is contained in:
Markos Gogoulos
2026-05-13 21:14:02 +03:00
committed by GitHub
parent c7a1d60d73
commit d6a11514e5
15 changed files with 34 additions and 273 deletions
+13 -9
View File
@@ -453,17 +453,21 @@ def kill_ffmpeg_process(filepath):
filepath: Path to the file being processed by ffmpeg
Returns:
subprocess.CompletedProcess: Result of the kill command
bool: True if the lookup ran, False if input was unusable
"""
if not filepath:
if not filepath or not isinstance(filepath, str):
return False
cmd = "ps aux|grep 'ffmpeg'|grep %s|grep -v grep |awk '{print $2}'" % filepath
result = subprocess.run(cmd, stdout=subprocess.PIPE, shell=True)
pid = result.stdout.decode("utf-8").strip()
if pid:
cmd = "kill -9 %s" % pid
result = subprocess.run(cmd, stdout=subprocess.PIPE, shell=True)
return result
try:
ps = subprocess.run(["ps", "aux"], stdout=subprocess.PIPE, check=False)
except OSError:
return False
for line in ps.stdout.decode("utf-8", "replace").splitlines():
if "ffmpeg" not in line or filepath not in line or "grep" in line:
continue
parts = line.split()
if len(parts) > 1 and parts[1].isdigit():
subprocess.run(["kill", "-9", parts[1]], check=False)
return True
def copy_video(original_media, copy_encodings=True, title_suffix="(Trimmed)"):