bytedeco/javacv

ScreenCapture on Windows using new FFmpegFrameGrabber("screen-capture-recorder");

Open

#31 opened on Aug 24, 2014

View on GitHub
 (19 comments) (0 reactions) (0 assignees)Java (1,583 forks)batch import
enhancementhelp wanted

Repository metrics

Stars
 (6,985 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Apparently ffmpeg supports screen capture on Windows according to this: https://trac.ffmpeg.org/wiki/Capture/Desktop

Attempting to do so using:

        FrameGrabber grabber = new FFmpegFrameGrabber("screen-capture-recorder");// As well as FFmpegFrameGrabber("UScreenCapture");
        grabber.setFormat("dshow");
        grabber.setFrameRate(30);
        grabber.start();

Results in:

run:
Exception in thread "main" org.bytedeco.javacv.FrameGrabber$Exception: avformat_open_input() error -5: Could not open input "screen-capture-recorder". (Has setFormat() been called?)
    at org.bytedeco.javacv.FFmpegFrameGrabber.startUnsafe(FFmpegFrameGrabber.java:368)
    at org.bytedeco.javacv.FFmpegFrameGrabber.start(FFmpegFrameGrabber.java:318)
    at testarea.JavaCVDemo.main(JavaCVDemo.java:40)
[dshow @ 154dc160] Malformed dshow input string.
[dshow @ 154dc160] Malformed dshow input string.
Java Result: 1
BUILD SUCCESSFUL (total time: 9 seconds)

This may possibly have something to do with(maybe???): https://trac.ffmpeg.org/wiki/DirectShow#Specifyinginputframerate

This is here as a resource in case other people experience this error and wish to look into it, as well as a reminder to myself to do so in the future. If you find any solutions or fixes, please let me know.

Contributor guide