Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.

gdigrab is not available #1323

@bluewave41

Description

@bluewave41

./ffmpeg -formats
D d gdigrab GDI API Windows frame grabber

Delete FFMPEG.exe and run my source file
FFmpeg error: Cannot find ffmpeg

Confirmed it's using the ffmpeg.exe in the directory

ffmpeg()
  .input("desktop")
  .inputFormat("gdigrab")
  .inputOptions([
    "-framerate 30",
    "-probesize 50M",
  ])
  .videoCodec("h264_nvenc")
  .outputOptions([
    "-preset fast",
    "-b:v 5M",
    "-pix_fmt yuv420p",
    "-movflags +faststart",
  ])
  .on("start", (cmd) => {
    console.log("FFmpeg started with:", cmd);
  })
  .on("stderr", (line) => {
    // Avoid excessive logging
    if (!line.includes("frame=")) {
      console.error("FFmpeg stderr:", line);
    }
  })
  .on("error", (err) => {
    console.error("FFmpeg error:", err.message);
  })
  .on("end", () => {
    console.log("Recording finished");
  })
  .save("output.mp4");

FFmpeg error: Input format gdigrab is not available

I just proved that it is available and that it's using this executable. getAvailableFormats isn't showing gdigrab as being a format despite the executable reporting that it does.

When run manually on the command line gdigrab works correct as expected.

I've just done a choco install ffmpeg and deleted all local copies of ffmpeg. Running my script again returns

FFmpeg error: Input format gdigrab is not available

ffmpeg -formats

Still correctly reports gdigrab as being available while the library does not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions