I want to control VLC player via command line in windows 7 64 bit. I want to overlay an image in particular position on a video stream. This can be done easily via vlc command line option.
Now I want to change this logo image while video is playing. Is there any way to o it? ie change logo image while vlc player play some video.
I will call this commands from net beans Java....
Have a look at vlcj. (I never used it but looking at the listed features it seems like it's capable of what you are trying to achieve.)
Related
We are working on Tensorflow to train a dataset of images.
To get images we record video using our phones and, using OpenCV in Python we extract each frame and save them as JPG images. I rotate some of them to portrait mode with the Photos App on Windows 10.
Then, we have our own annotation tool written in Java to label each item we see on the images. It return a CSV file for each object with their coordinates (in percentage).
However, when I ran the training yesterday, I noticed via the tensorboard interface that some were not annotated rightly (the ones I rotated with Photos)
Here is the image opened on Tensorboard, you can see that the can is very badly annotated.
It turns out that if I open this image with our Java software it is well annotated, but as you can see below, the image is horizontal (it doesn't take in account the rotation applied with Photos) :
If I open it with Paint, or the explorer it appears in portrait mode like in tensorboard.
An other fact, If I send the picture via Facebook, and download it again, it will appear in portrait mode on the Java tool as it would have been from the beginning.
I tried to rotate the image with Paint this time, and it appears correctly in the Java tool.
The code that displays the image in Java:
panel.image = New File(srcFile);
The code that saves video frame in Python:
cap = cv.VideoCapture(video_path)
while cap.isOpened():
ret, frame = cap.read()
if ret:
try:
cv.imwrite(output_img_path, frame)
except Exception:
pass
else:
break
cap.release()
Do you know why Java ignores the rotation applied via the Win10 Photos software, why it works via Paint ?
Is there a way to make Java take it in account because it would be very unpleasant to start again from scratch.
Thanking you in advance,
After noticing that rotating images with Paint instead of Photos was giving what we wanted, I found out what was wrong.
"If you’re using Windows 10, File Explorer and the default image viewer will properly obey the Exif Orientation tag, so photos that come from your smartphone or digital camera will be display properly. Google’s Android and Apple’s iOS both natively create photos with the Exif Orientation tag and support it." (source)
I used JPG autorotate to fix this.
I am trying to make animated Gif Splash screen in java netbeans but it doesn't works.. so I use jpg or PNG files it works .. I want to use gif animated file in splash screen I am using -splash:src/Images/sspp.PNG in VM options.. please tell some solutions so I am able to use animated splash screen.
I think you'll find that the problem comes down to two things...
1.Using the command line parameter (-splash), Java expects the image to be a file on the file system, whereas the manifest file expects it to be an embedded resource.
2.Java doesn't seem capable of playing optimised gifs, that is gifs whose frames represent the difference between the last and current frame, instead of a complete image (as far as the splash screen goes).
I tried using
and
The first image failed, but the second worked, the difference, as near as I can tell, is the first is optimized and the second is not...
I'm trying to get an animated gif to appear in the MACOS System Tray using Java. I have PNG icons showing corretly, but as soon as I try and set the icon to an animated gif (so I can show a spinning timer) it goes blank and shows nothing in the system menu tray.
According to the JavaDocs for the System Tray class, setImage should automatically support animated images if given but it doesn't specify the image format or anything else required to get animated icons in the system tray.
Does anyone know how to get this working?
Chances are this problem cannot be resolved with the java.awt.SystemTray class. The only option you have is to try JDIC which uses native code. Frankly I'm not sure whether the JDIC project is maintained anymore, it is quite hard to find information on the web...
In a project of mine I used JDIC do integrate the system tray. You can use it as starting point and get the libraries from there, if you can't find any other resources.
I wrote a Java application that uses the java.awt.Robot to take screen captures of the screen and was wondering if capturing a program using DirectX/OpenGL would be possible?
Each time I try to do this, I get a black screen
Don't know if this is really a solution but seems there's more possible ways to get the screenshot information using a "FrameGrabber" or some related class from JavaCV possibly: http://code.google.com/p/javacv/
Some of the final output shown on the screen could be calculated on a graphics card that has shaders set to act on the image data before it gets put into a display buffer for what's shown so it's possible some effects would be impossible to capture without an analog loopback (go from video out to video in on a capture card).
Related post How to take screenshots fast in Java?
OpenGL is a drawing API, not an all purpose interface to the graphics system. There were times, when taking screenshots with OpenGL was indeed possible through some dirty hacks. However recently I tried to re-implement this on modern OS to see if it still works, and no, it doesn't anymore.
Yes it is possible. But maybe only in limited circiumstances.
I've successfully captured the contents on OpenGL (jogl) windows on linux and windows using the Robot createScreenCapture.
Some specific information about the implementation that may be different for you:
The call to createScreenCapture was done from within the OpenGL
application.
The application used heavyweight GLCanvas
It used Java 6
Make sure you pass it the correct coordinates. You can get the screen coordinates to use from the GraphicsEnvironment
Uhh... a hard one ;o)
I had a try with some other screenshot utils and got a black screen, too. Looks like DirectX is passing the graphics directly to the monitor output. I am wondering if that could be accessed within a java application.
I'm writing a java App thats going to run on windows and uses the JMF, I've got the video capture working but I need to stop the Video Source Window from popping up each time I start the App, this is the first time I've used the JMF however I've looked at the Api and googled but found nothing that talks about the Video Source Window. Thanks.
Most likely you created your window like this:
ml is your MediaLocator
videoPanel is where your adding the video window too
Player player = Manager.createRealizedPlayer(ml);
Component video = player.getVisualComponent();
video.setSize(videoPanel.getSize());
video.setPreferredSize(videoPanel.getPreferredSize());
videoPanel.add(video);
player.start();
A simple solution would then to not add the video component to a panel and call player.stop();
But without any example of your code, all I can do is speculate.
Hope this helps