bytedeco/javacv

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

Open

#31 ouverte le 24 août 2014

Voir sur GitHub
 (19 commentaires) (0 réactions) (0 assignés)Java (1 583 forks)batch import
enhancementhelp wanted

Métriques du dépôt

Stars
 (6 985 stars)
Métriques de merge PR
 (Aucune PR mergée en 30 j)

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.

Guide contributeur