diff --git a/backend/transcode.py b/backend/transcode.py index efb2e71..6ecf201 100644 --- a/backend/transcode.py +++ b/backend/transcode.py @@ -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 await on_status("running", progress=0.0) # 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: proc = await asyncio.create_subprocess_exec( *cmd, stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE,