Skip to content

Windows: ffmpeg/ffprobe subprocesses flash console windows (CREATE_NO_WINDOW missing in process_tree::configure_command) #248

Description

@owenglenfehr

Summary

On Windows, every ffmpeg/ffprobe subprocess flashes a console window.
Starting playback on a timeline spawns roughly ten of them, producing
visible flicker and focus churn for several seconds before the first frame.

Cause

opentake-process-tree::configure_command is the single choke point for
Windows spawn flags (crates/opentake-process-tree/src/lib.rs:40). It sets:

CREATE_NEW_PROCESS_GROUP | CREATE_SUSPENDED

but not CREATE_NO_WINDOW, so every child process gets a console window.

opentake-media/src/ff.rs routes its spawns through that helper
(crate::process_tree::configure_command(command.as_std_mut()) at lines
241 and 313), so one added flag should cover the ffmpeg/ffprobe paths.

Suggested fix

use windows_sys::Win32::System::Threading::{
    CREATE_NEW_PROCESS_GROUP, CREATE_NO_WINDOW, CREATE_SUSPENDED,
};
command.creation_flags(
    CREATE_NEW_PROCESS_GROUP | CREATE_SUSPENDED | CREATE_NO_WINDOW,
);

CREATE_NO_WINDOW composes fine with the existing two flags and does not
affect the suspend-then-assign-to-Job-Object sequence the doc comment
describes.

Also worth checking ff.rs:726 (FfmpegCommand::new_with_path) and
ff.rs:733 (Command::new(ffmpeg_path())), which do not appear to call
configure_command and may need the flag separately.

Environment

v1.0.0-beta.5, official Windows release build, Windows 11.

Impact

Cosmetic but constant — visible on every playback start, scrub and probe,
and it steals focus. Note this is separate from the spawn count itself:
suppressing the windows makes playback quiet, not faster.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions