Skip to content

[Bug]: Video recording on Windows opens a visible console window for ffmpeg #43515

Closed

Description

Version

playwright-core 1.64.0-alpha-1790635538000, as bundled in @playwright/cli 0.1.22.

Steps to reproduce

  1. On Windows 11 with Windows Terminal as the default terminal application, install @playwright/cli@0.1.22 globally and run playwright-cli install-browser ffmpeg.
  2. Run playwright-cli -s=demo open https://example.com --browser=chrome.
  3. Run playwright-cli -s=demo video-start demo.webm.
  4. Wait a few seconds, then run playwright-cli -s=demo video-stop and playwright-cli -s=demo close.

Expected behavior

No window appears. The browser is headless, and the recording runs in the background.

Actual behavior

A Windows Terminal window titled with the path of ffmpeg-win64.exe opens at step 3 and stays open until video-stop. An agent that records every run opens one of these windows per recording, so windows keep popping up and stealing focus.

Additional context

The video recorder starts ffmpeg through launchProcess, which builds its spawn options without windowsHide. Since #42155 the CLI session daemon is spawned detached with windowsHide: true, so the daemon has no console. A console program it starts therefore gets a new console window of its own. When Playwright runs inside a terminal, ffmpeg inherits that terminal's console instead, which may be why this shows up mostly with the CLI. That last point is inferred, not measured.

#41630 asked for windowsHide on every launchProcess call and was closed as not planned. Per #40741, an earlier attempt, #38776, was reverted in #39994 after it broke Inspector, codegen and UI mode in #39990. ffmpeg has no GUI, so passing windowsHide: true for the ffmpeg launch alone avoids that risk.

This local patch to the bundled lib/coreBundle.js removed the window:

   const spawnOptions = {
     detached: process.platform !== "win32",
     env: options.env,
     cwd: options.cwd,
     shell: options.shell,
+    windowsHide: options.windowsHide,
     stdio
   };
           command: this._ffmpegPath,
           args,
           stdio: "stdin",
+          windowsHide: true,

With the patch applied, I polled every visible top-level window every 250 ms during a recording. ffmpeg was running, no window appeared, and the saved webm was a normal 89 KB file.

Environment

  • OS: Windows 11, build 10.0.26200
  • Node.js: 22.11.0
  • @playwright/cli: 0.1.22
  • Browser: Chrome 155.0.8059.84 through --browser=chrome
  • Default terminal application: Windows Terminal

Activity

  1. github-actions commented on Oct 20, 2026

    @github-actions
    Contributor

    Hi, I'm the Playwright bot and I took a first look.

    Reproduced on Windows with both the reported release and tip-of-tree. Starting a CLI video recording changed the visible Windows Terminal window title to the full ffmpeg-win64.exe path for the lifetime of the recording. video-stop restored the previous terminal window, and the saved WebM decoded successfully. This looks like a real Windows-specific bug in how the CLI daemon launches ffmpeg.

    The identical opt-in fix proposed in #43520 and #43529 also worked in my Windows test: forwarding windowsHide through launchProcess and setting it only for ffmpeg kept the Windows Terminal window unchanged while ffmpeg was running, and the resulting WebM still decoded successfully. Both PRs are currently open.

    What I ran
    • Windows 11 runner, build 10.0.26100
    • Reported package: @playwright/cli@0.1.22, bundling playwright-core@1.64.0-alpha-1790635538000
      • Node.js 22.23.3
      • Chrome 155.0.8059.40
      • ffmpeg 1011
      • before recording: Windows Terminal title was the runner host path
      • during recording: title was C:\Users\runneradmin\AppData\Local\ms-playwright\ffmpeg-1011\ffmpeg-win64.exe
      • output: VP8 WebM, 800x450, 25 fps
    • Tip-of-tree: 1.65.0-next, sha 89cd2a6463ea14cf36a83e629d4bfbc9988e6771
      • Node.js 24.21.0
      • Chrome 155.0.8059.40
      • ffmpeg 1013
      • during recording: title was C:\Users\runneradmin\AppData\Local\ms-playwright\ffmpeg-1013\ffmpeg-win64.exe
      • output: VP9 WebM, 800x450, 25 fps
    • Tip-of-tree with the change from fix(video): hide the ffmpeg console window on Windows #43520/fix(video): prevent ffmpeg console window popup on Windows #43529 applied:
      • ffmpeg remained running, but the Windows Terminal title and window handle did not change
      • output: VP9 WebM, 800x450, 25 fps

    Triaged on Windows by the Playwright bot - agent run

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions