I am developing an interactive video player and would like to dynamically set motion blur using VLCj 3.0.1. Since EmbeddedMediaPlayer doesn't provide some kind of setBlur method, I guess I am supposed to use addMediaOptions(String... options).
However, I haven't been able to figure out how to use it. Starting VLC from the command line I would have to add the following parameters --video-filter=motionblur blur-factor=44. Providing the same parameter in an array, doesn't show any effect though. I would be glad, if someone could show me the correct syntax. This is essentially my code:
EmbeddedMediaPlayerComponent vlc = new EmbeddedMediaPlayerComponent();
EmbeddedMediaPlayer player = vlc.getMediaPlayer();
player.playMedia(path);
String[] options = { "video-filter=motionblur", "blur-factor=" + blur };
player.addMediaOptions(options);
In your example code you are adding options after you play the media, that might work in some instances but you should really (generally) just pass them in as additional parameters on your playMedia call.
However...
Some of those options that are not directly supported by a LibVLC API function must be passed when you create the LibVLC instance (i.e. the vlcj MediaPlayerFactory) rather than when you play media.
Since you are using EmeddedMediaPlayerComponent then you should subclass your EmbeddedMediaPlayerComponent and override onGetMediaPlayerFactoryArgs() and pass your motion blur options, along with whatever else you need, there.
Note that you need to send the exact command-line switches, so you must prefix your options with "--".
There is an example of doing precisely that in the vlcj Javadoc for EmbeddedMediaPlayerComponent.
People often ask is there any documentation describing how each of the available VLC options can be set - the short answer is no there is not, and that any use of options like this is totally unsupported and may not work with a future version of VLC/LibVLC.
Ideally, enabling motion blur would be achievable by a new LibVLC API function, but someone would have to write a patch for VLC to make that happen.
Related
I'm wondering if it's possible to add some custom screen GUI's to my Bukkit server. So I can display a lot of text on someone's screen. Or do I need to find another option to do this?
Thanks!
The only practical way is to use an Inventory using blocks with name and lore for users to click on as can be seen here
As Cole Nelson mentioned, a custom inventory with lore displayed might work. A good guide for that can be found on the bukkit forums, and although it's a bit outdated it should still provide useful information.
Another possibility would be to utilize title screens; obviously those can't hold a ton of information, but the player is pretty much guaranteed to notice them immediatly.
I recommend using Title Api, as it's a bit tedious to directly work with packets.
Once you added the jar to your project and set the dependency, simply use:
TitleAPI.sendTitle(player,fadeIn,stay,fadeOut,"Title","Subtitle");
to send a title with all corresponding attributes.
Example result:
i try to create an EGLContext in C++ and bint it to a GLSurfaceView.
After some research on google and even here, i don't see something close to my problem.
It is possible to do this ?
I already know that i can do a NativeActivity, but i also need to use Java library for Loading Image, Audio, make HttpRequest, get Device information, etc.
Any help is welcome.
I really need a simple camera that i could use with my application. I would like to be able to control the movement of the camera with the keyboard. I only really require that it moves forwards and backwards and rotates with respect to the y-axis.
thanks in advance for any help as i don't know where to start with this one. Many tutorials around on google, but not for jogl :/
among the files included with downloading the official jogl things you can download (demos, tutorials, etc) is included the 'gleem' package, which I've used and quite like.
gleem stands for: GL-E-E-M: GL Extremely Easy-to-use Manipulators
here's the original page for gleem: http://alumni.media.mit.edu/~kbrussel/gleem/#DEMOS (with some pretty images, and context for)
link to source downloads within the offical-ish jogl page: http://java.net/projects/jogl
anyway, however you get it, amongst the file check out these specific options:
gleem.TestExaminerViewer.java
gleem.TestHandleBox.java
gleem.TestMultiWin.java
gleem.TestTranslate1.java
gleem.TestTranslate2.java
gleem.Translate1Manip.java
gleem.Translate2Manip.java
and, I'd expect you'll find what you're looking for. gl
PS - I'm boldy guessing/assuming that you want to control some sort of 'camera' that can be seen, vs. per-say just updating the model_matrix stack (if the later, of course just tie your key bindings to the different values you pass in as you call to update the matrix stack, ala using 'gluLookAt' ... etc)
I want to try to create a learning chess application as a school project. My first plan was to simply pit this AI against itself, but to really show if it has been succesful it needs to be able to show how well it progresses. In order to do this, i want it to play rated games on sites such as chess.com. However, they do not (yet) have a public API, i believe.
Therefore, i wanted to make a program in java that recognizes colors and images. It keeps an internal 2-dimensional array of all the positions, and recognizes the pieces on the board. I think i have found a way to do this in a window using something like the Java Robot Class.
What i would like it to do, however, is to open this webpage in an internal window and keep doing this in the background. Is there a way to recognize colors within the own window, without needing to be in the foreground?
Edit: I'm planning on using this browser component i just found. I noticed that it is possible to create a full-page snapshot of the page and save it as a BufferedImage(?). Would this make it easier to do this?
Edit 2: I just read that 'Outside assistance from other people, computers/chess engines, or endgame tablebases is entirely prohibited'. I suppose letting a computer do all the playing does certainly include in that. So i might try using another site, so answers that are specific for chess.com won't cut it!
I don't know it it helps but may be you can have a look at the Sikuli project.
http://sikuli.org/
Sikuli is a program (and an API) to handle the interactions with the User Interface. For instance, you can write a script to click on an image or a button in certain conditions.
Especially interesting for you, there is a Java integration: http://sikuli.org/docx/faq/030-java-dev.html
Here is an extract of the website to give you an idea of the code you can write.
EDIT: in this code it is important to notice that you are defining new Patterns with the images. Sikuli will be able to find matching patterns.
import org.sikuli.script.*;
public class TestSikuli {
public static void main(String[] args) {
Screen s = new Screen();
try{
s.click("imgs/spotlight.png", 0);
s.wait("imgs/spotlight-input.png");
s.type(null, "hello world\n", 0);
}
catch(FindFailed e){
e.printStackTrace();
}
}
}
You should consider playing on a chess server where an API is avaible and chess engines are allowed. There is The Internet Chess Club (ICC) where you must pay to have a human account and then you can get a free computer account for your engine. There is also the Free Internet Chess Server (FICS) where you and your engine can get free accounts.
The ICC is usually prefered because the level of players is higher there with lots of international masters and chess masters playing there.
The best way to Interface with theses sites is to implement the xboard protocol. This will allow your engines to play through the Winboard or XBoard interface (among others) and theses interface can be used to connect on FICS or ICC and automatically play there.
I hope this help, even if it does not directly answer the question.
I'm not sure what your input is but you have two options:
You can work an a PNG image. Load the image into a BufferedImage (docs) object and examine it there. You can use a screen shot tool to create those.
It seems chess.com uses HTML with JavaScript. You can download the HTML using HttpComponents and examine it to see where the pieces are. This has the additional benefit that you don't have to guess which piece goes where since the HTML contains the source information.
In short, I want to create a simple video player which can play some major video formats like quicktime *.mov, for example. What I need is:
video playback (at least the most major formats would be great)
play, pause
need information about where the movie currently is (how many seconds passed, or how much percent)
I'm targeting the mac, for the beginning. So the preferred technology is Cocoa and Objective-C. But if there's just nothing for that, I could also imagine to do something with Java. Any idea?
QTKit is the (built-in) Objective-C framework for developing with QuickTime. It includes QTMovieView and QTMovieLayer, an NSView and CALayer subclass respectively for playing any content that QuickTime understands. Simple playback controls can optionally be provided by these controls for free. Both can be used from Interface Builder, making a media app an almost zero-code affair. The QuickTime Programming Guide will get you started.
You should also check the QTKitPlayer sample code. It can do everything you describe and shows how to integrate all of the QTKit components for a playback-only application (QTKit also supports media capture and editing).
You can use QuickTime for Java
It's very easy to use.
Here's a snippet:
QTSession.open();
String url = "http://......mov";
DataRef dRef = new DataRef(url);
Movie mov = Movie.fromDataRef (dRef, StdQTConstants.newMovieActive);
MoviePlayer player = new MoviePlayer(mov);
mov.start();
JComponent qtPlayer = QTFactory.makeQTJComponent(player).asJComponent();
The snipped was taken from the examples from: Timing Framework written by Chet Haase
That sample ( the one from the Timing Framework ) looks like this:
Java quicktime http://img41.imageshack.us/img41/7268/capturadepantalla200909p.png
If you want to use Java then Java Media Framework or it's open source analog Freedom For Media in Java, will do the job. FMJ has native binding to DirectShow, QuickTime For Java and Gstreamer. It will do everything you need plus a little bit more. And you will not need to worry about which format you're playing.