mirror of
https://github.com/myronblair/kino-app
synced 2026-07-28 13:33:49 -05:00
Fix progress flags being inserted before nice's own -n flag, breaking every job
-progress pipe:1 -nostats belong to ffmpeg, not nice — they were landing right after cmd[0] (nice) instead of after the ffmpeg token, which made nice choke on an unrecognized option and fail before ffmpeg ever started.
This commit is contained in:
@@ -195,7 +195,10 @@ async def _run(cmd: List[str], on_status, out_dir: Path, entry_filename: str, so
|
|||||||
duration = await probe_duration(source) if source else 0.0
|
duration = await probe_duration(source) if source else 0.0
|
||||||
await on_status("running", progress=0.0)
|
await on_status("running", progress=0.0)
|
||||||
# Machine-readable progress on stdout, separate from ffmpeg's normal stderr logging.
|
# Machine-readable progress on stdout, separate from ffmpeg's normal stderr logging.
|
||||||
cmd = [cmd[0], "-progress", "pipe:1", "-nostats"] + cmd[1:]
|
# Insert right after the "ffmpeg" token, not cmd[0] — cmd is prefixed with `nice -n N`,
|
||||||
|
# and these flags belong to ffmpeg, not to nice.
|
||||||
|
ffmpeg_idx = cmd.index("ffmpeg")
|
||||||
|
cmd = cmd[:ffmpeg_idx + 1] + ["-progress", "pipe:1", "-nostats"] + cmd[ffmpeg_idx + 1:]
|
||||||
try:
|
try:
|
||||||
proc = await asyncio.create_subprocess_exec(
|
proc = await asyncio.create_subprocess_exec(
|
||||||
*cmd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE,
|
*cmd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE,
|
||||||
|
|||||||
Reference in New Issue
Block a user