Recording video in windowed mode games on Java - java

Is it possible to capture a video stream from a game in windowed mode?
I tried using "FFmpeg" to get only a record of applications not related to Directx or Open GL.
When recording games, a duplicate video stream consisting of black frames is obtained.
Attempting to record a game Devil May Cry 5 in windowed mode using FFmpeg
Any capture methods related to Java are needed. Since my course project is based on the knowledge of this language. Thanks in advance!

If you simply need to record something happening on your screen use OBS https://obsproject.com/ - its free and will directly copy whatever's on your screen, then just use any video editor to reduce anything on the recording you don't want

Related

mediaRecoder.reset() while recording a video CAMERA2 API

Can we reset all the values that hold in mediaRecorder while recording video?
I've tried just using mediaRecorder.reset() while recording video. But it won't work. I don't know is it possible or not. If it is possible please any references will appreciate.
I've read this and also google developers, mediaRecorder in developers. But any of references didn't mention my issue.
EDIT :
What I want is while recording a video set mediaRecorder.reset() and mediaRecorder.start(). The problem occurs when I'm doing this. I need to chunk of video clips while recording the same video. Need those process in parallel. While I'm trying to stop and restart the camera capturing methods it will miss many frames. Bcoz handling camera is somewhat cost for the processor. I tried this and it occurs some errors that telling session configuration failed. Now I'm stuck in here. Need help!
Thank you for your valuable time.
Edit in response to clarifications:
Ok, so you want to split the video file into multiple separate files.
You'll need to use the lower-level APIs (MediaCodec, MediaMuxer) to implement this yourself; the higher-level MediaRecorder does not support this without losing frames.
Original:
So you're trying to pause the video recording temporarily.
Unfortunately, there's no support for this before API level 24, which added MediaRecorder.pause(). You can't call MediaRecorder.reset() mid-video and have it work.
All you can really do is to record the full video and then post-process it to crop sections you don't want.

How to play other video formats in JavaFX

I am busy with a movie/video-clip player/library.
I want to do this in JavafX. Almost 90% of the video clips is in AVI format. I cannot for several reasons covert the movies/video-clips.
I also want the program to mark the video files that were played, from start to complete, so that I will know what have been watched. So the program needs to be able to interact with the video player to know when the video has played to the end.
JavafX doesn't allow playback for AVI files. What's the alternative to be able to use this with? And how will I know if the video has fully played from beginning to end.
I read the following
Adding other video codecs / DVD support to JavaFX 2.2
Where they suggest I use portable VLC player. Is this the best way to use it in JavafX and if possible does the API have register hooks to register a method that can be triggered to know when the video has stopped?

How can I use the output of my monitor as the input to a program?

Some context: I am hoping to make a program that can play a videogame based on visual input. While I could just point a webcam at my monitor whilst the game is on the screen, I'd prefer to just have some way to send whatever pixel information is going to the screen to my program.
Specifically, I'm hoping to sample screenshots at a rate ~30fps and compute on them. So far the only thing I can think of is to use Fraps to take screenshots whenever my program 'presses' a certain key, but those can only be taken at a maximum rate of one per second and require using this outside program. I'm hoping there is some way to intercept this screen information more directly.
I'm currently planning on using a combination of Java and Matlab, but I'd be happy to switch to whichever language has a nice way to grab screenshots rapidly. Oh, and I'm doing this on Windows 7, in case this screen grabbing operation is low-level enough for that to matter.
I'll take a stab at answering your question. The basic answer is that the screen data itself is memory mapped, so it resides somewhere in physical memory. However, your operating system has probably cut you off from accessing that memory directly through its virtual memory system. So, the only way to get access is to either:
a) Write a device driver to access it
or
b) Use a device driver written by someone else to access it
On Windows you could use DirectX to access the screen data. This website explains how to do that:
http://www.dgrigoriadis.net/post/2008/01/29/Taking-screenshots-with-DirectX-90.aspx
If it's a 2D Java game, you'd just send it to the framebuffer as well as your visual input program. If it's 3D and in Java, you could possibly do a similar thing with screenshotting functions in the library the game is written in. If it's a game in another window, you could try using java.awt.Robot (http://download.oracle.com/javase/1,5.0/docs/api/java/awt/Robot.html) and see if the screenshot capability works. You get a BufferedImage, which you would send to the visual input program (like if you were sending the game view from a Java 2D or 3D app).
You can do it , But with complex image processing, gesture recognition and machine learning algorithms.
And the response of the system should be real-time if you want to win that game which naturally makes your research complex.
But if the original game is developed by yourself , then you probably don't need any of image processing, ,webcam and FRAPS. In that case all you need is Machine Learning for game playing.

Real Time Audio Visualization Java

I have built an application using Java Sound API which enables to record and play the voice and the program shows a wave form of the recorded voice after the recording is finished. I want to show the wave form at the same time when the recording is done. Can anyone suggest a method or a java library to achieve this?
Thanks a lot.
You could use Processing for your visualization. It does a good job of visualizing realtime data. Write your analyzer using Java Sound API to process the audio input in real time, and draw the visualization using processing.

Video training program

I am looking to create a video training program which records videos - via webcam, user screen capture and captures sound. Now the main problem is that I need a cross-platform (mac and windows) solutions.
I know its possible to use flash to record webcam + audio. But its not possible to record the user's screen via flash.
So am wonder if I should use Java (which i believe will work on mac & windows). I do not want to develop to separate versions because of the cost involved in developing two versions.
Please guide me as I am new to this.
Thank you.
UPDATE
Hello again,
I had a look at the following site: www.screencast-o-matic.com or www.screentoaster.com. I see that they have developed a java applet which helps interact with Windows/Mac to record the screen.
I am wondering how to go about developing something like that and integrating it with Flash (for webcam and audio recording).
Is this a better idea?
This is not an answer to your question, but I strongly recommend against using video for educational programmes. Our company delivers university courses on-line, and we long ago learned that video feeds are only effective under particular scenarios. In general, a talking head is a waste of bandwidth. You're much better off to put together a well designed powerpoint presentation, record a voice-over (and edit it!) and then assemble the whole thing as a flash presentation. This is a non-trivial amount of work, but it provides a much more interesting product for the student.
When to use video:
1) When you are demonstrating something dynamic - Mechanics or Chemistry for example.
2) When you are acting out a scenario or case as an illustration -- For example, threat de-escalation techniques for high school teachers.
When you solve the screen recording problem, seriously consider whether you need full motion or if you can get away with stills. Often the motion is distracting, and a still with good voice over can be more effective. (Hint: Replace mouse pointers with something HUGE before recording -- Like Fox did with hockey pucks)
Try CamStudio. I don't know, if it works on Mac, but on windows, it's the best solution I know. It's open source, so you can use it's source code, if you want to :)
If you're looking to build an application that does all of the recording and screen capture itself, then you might consider using Adobe AIR (essentially, Flash running on the desktop) in combination with Merapi. Merapi is essentially a bridge between Adobe AIR and Java. So for example, for your project, you might use Java to handle the lower-level (but still cross-platform) stuff you can't do natively in AIR, and use Merapi to wire the Java application to your AIR UI.
This is by no means a simple project. Lets get that said and out the way. There are open source (and cross-platform) options for each element, but nothing (I know of) that will do everything for you.
I think the "cleanest" option would be to use Flash for webcam and audio, as you said, and run a VNC server to send the screen video... The only closed-platform code will be the VNC launching code. That should be pretty simple to maintain!
That raises a problem because most people are behind NAT firewalls these days. Setting up port forwarding is a pain in the behind. I've used an app called Gitso before which allows people to connect to me and send their desktop to my screen (for tech support). Its VNC-based and all it really does is add another layer on top of the VNC connection so rather than me connecting to them, they connect to me. That makes the whole business of port forwarding a non-issue.
And once you've recorded everything, there's the final issue of syncing it all back together... Might not be so hard.
Well, Camtasia provides the solution to get your problem done. It can record the onscreen activity and also the webcam video and put them in the same player template. Another screen recorder DemoCreator can publish the screen recording as Flash movie, but can not record the webcam.

Categories