agomezmoron / screen-recorder

Java screen recorder library
MIT License
22 stars 14 forks source link

I'm getting javax.media.NoDataSinkException #11

Open maks1mov opened 3 years ago

maks1mov commented 3 years ago

Please, help!

Cannot create the DataSink: javax.media.NoDataSinkException: Cannot find a DataSink for: com.sun.media.multiplexer.BasicMux$BasicMuxDataSource@31b7dea0 Failed to create a DataSink for the given output MediaLocator: C:\Users\Public\Pictures\debug.mov

My code:

public static void main(String args[]) throws InterruptedException, MalformedURLException {

    VideoRecorderConfiguration.wantToUseFullScreen(true);
    VideoRecorderConfiguration.setCaptureInterval(150);

    VideoRecorderConfiguration.setVideoDirectory(new File("C:\\Users\\Public\\Pictures"));
    VideoRecorderConfiguration.setKeepFrames(true);
    VideoRecorder.start("debug");

    VideoRecorderTestNGConfiguration.wantToKeepVideoOnSuccess(true);

    Thread.sleep(5000);
    VideoRecorder.stop();
}
Gamebuster19901 commented 1 year ago

Looks like this was fixed in #12

Silverin commented 1 year ago

I'm having the same error

Cannot create the DataSink: javax.media.NoDataSinkException: Cannot find a DataSink for: com.sun.media.multiplexer.BasicMux$BasicMuxDataSource@22ead351
Failed to create a DataSink for the given output MediaLocator
Gamebuster19901-Alt commented 1 year ago

I'm having the same error

Cannot create the DataSink: javax.media.NoDataSinkException: Cannot find a DataSink for: com.sun.media.multiplexer.BasicMux$BasicMuxDataSource@22ead351
Failed to create a DataSink for the given output MediaLocator

Post code

Silverin commented 1 year ago
if (Helper.checkConfigValue("video", "true")){
            VideoRecorderConfiguration.setCaptureInterval(50); // 20 frames/sec
            VideoRecorderConfiguration.wantToUseFullScreen(true);
            VideoRecorderConfiguration.setVideoDirectory(new File(Paths.get(System.getProperty("user.dir")).toUri()));
            VideoRecorderConfiguration.setKeepFrames(false);
            VideoRecorder.start("test");
}

and then

if (Helper.checkConfigValue("video", "true")){
            String videoPath; // video created
            try {
                videoPath = VideoRecorder.stop();
            } catch (MalformedURLException e) {
                throw new RuntimeException(e);
            }
            System.out.println("path:" + videoPath);
}

SO: Win 11

Gamebuster19901 commented 1 year ago
if (Helper.checkConfigValue("video", "true")){
            VideoRecorderConfiguration.setCaptureInterval(50); // 20 frames/sec
            VideoRecorderConfiguration.wantToUseFullScreen(true);
            VideoRecorderConfiguration.setVideoDirectory(new File(Paths.get(System.getProperty("user.dir")).toUri()));
            VideoRecorderConfiguration.setKeepFrames(false);
            VideoRecorder.start("test");
}

and then

if (Helper.checkConfigValue("video", "true")){
            String videoPath; // video created
            try {
                videoPath = VideoRecorder.stop();
            } catch (MalformedURLException e) {
                throw new RuntimeException(e);
            }
            System.out.println("path:" + videoPath);
}

SO: Win 11

What is the output of System.getProperty("user.dir")

Silverin commented 1 year ago

What is the output of System.getProperty("user.dir")

It's my project's dir => C:\Silvero\Proyectos\Decathlon\Pedidos