Coder Social home page Coder Social logo

javascreencapture's Introduction

JavaScreenCapture

Allows to record a video of your desktop screen. And is completely platform independent, if your platform can run Java, this will run on it, as its only dependency is AWT, which is supplied with the JRE version of SE platform since version 1.3 !!! Altough it does use a modern scheduler construct from JRE version 1.7 so you will need atleast that to run this :P.

Screen capture written in pure java, no dependencies, runs at ANY FPS !!! (Limited by machine's performance) Runs 30FPS+ on my machine no problem whatsover without even loading my machine. Recording is smooth although with some settings weird things can happen.

###Implementation###

Written using AWT's Robot class, but as many of you will know, with that thing you can almost never get above 15FPS but you want 30 or atleast 25.

But no matter how much you optimize you just can't do it. That is because the native calls that they use are quite slow. Fast enough for screenshots but too slow for video.

If one Robot can capture at about 12FPS, what about 2 Robots ? Can they both capture at 12FPS ? THE ANSWER IS YES !!! It only becomes a matter of scheduling. And that is what I do here. I have a couple of threads with Robot's that are scheduled using ScheduledThreadPoolExecutor construct from Java 7. Each are scheduled to start capturing one after another in such manner that they become interleaved. Constucting a pipeline of Screencapturing robots I am able to achieve higher FPS by combining few low FPS robots.

javascreencapture's People

Contributors

bahusvel avatar

Stargazers

João Gabriel avatar Tom Xin avatar shlc avatar Ahmed Ali avatar KIRILL GOLIKOV avatar Farkhad avatar  avatar  avatar Mara avatar ai-java avatar Zhoraev D. avatar Courtney Robinson avatar  avatar  avatar  avatar  avatar  avatar Trevor Flynn avatar Sabaat Ahmad avatar Payam Mashrequi avatar  avatar mengrong.yang avatar Yaseen avatar  avatar  avatar lyrachord avatar Mauricio Binda da Costa avatar

Watchers

 avatar Mauricio Binda da Costa avatar  avatar  avatar

javascreencapture's Issues

The entire example is wrong.

At least in the OpenJDK implementation, createScreenCapture is synchronized because it's using the underlying OS calls to read the screen buffer directly, so no, it's explicitly impossible to do take more screenshots using ScheduledThreadPoolExecutor.

Presumably the underlying graphics primitives either aren't or can't be guaranteed to be reentrant.

Hope that this issue will save some time to people trying this example :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.