-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slowdown on resize between RC6 and build of June 15, 2014 #223
Comments
Hi @jamesst20, Thank you for the report. It seems like painting in the screen buffer, even when the double buffering is enabled, makes it perform much slower than painting on buffered image. |
Adding @syliks to the thread. Sylwia, can you please confirm? I do not have such experience in Swing, so cannot tell if this is the root cause, plus you did this commit, so you may know it much better :) |
Hi guys, I will look into this later since I do not have much time lately. @jamesst20 can you verify if you have double buffering enabled on the painted panel?http://docs.oracle.com/javase/7/docs/api/javax/swing/JComponent.html#isDoubleBuffered%28%29Od: "jamesst20" <notifications@github.com>Do: "sarxos/webcam-capture" <webcam-capture@noreply.github.com>; Wysłane: 22:52 Niedziela 2014-06-15Temat: Re: [webcam-capture] Slowdown on resize between RC6 and build of June 15, 2014 (#223)@sarxos @syliks I hope she will see because according to her profile, the only activity she had was this commit. —Reply to this email directly or view it on GitHub. |
@syliks Thanks Edit : Do you think it will be a very long to fix or it is just a very small error? |
I tried to reproduce the issue on my Ubuntu laptop, but no luck - I constantly have rendering performance around 20-40 repaints per second, no matter if I have the window very small or full screen, so either my screen resolution is too small to observe the problem (1336x768), or it does not occur on Ubuntu Linux... I guess we will need wait for Sylwia or I can rework the code to use the old painting code and you will verify if it fixed the problem or not. |
Hi, I tried to confirm if the issue was there in Ubuntu but sadly it looks like my Webcam isn't working very well with VMWare Workstation. The camera turns on I know it because of the white led but there is no image. I tried a random camera app from the Ubuntu Store and same problem --> Not a library problem I guess. Thanks |
Today I will try to reproduce this issue on Windows 7. Will keep you informed. |
Thanks :) This is odd because the FPS is always 30 but it becomes laggy. |
The fps describes how fast frames are being processed by the camera. The |
You're right, this is definitively the panel repainting because even the "FPS" is refreshed less often if I make the window bigger. I have tested on Max OS X Mavericks and the issue is there aswell. Thanks |
I managed to set up everything on Win7 and performed small test. Here is the output:
As you can see, the painting performance with panel size 1920x1028 is about one third smaller than the one with size 640x480. I wouldn't call it laggy since ~20 repaints per second is pretty good. I will try to gather some better (from statistical point of view) results for the newest and older releases, but now I need to take care of some other business. You can fetch the source code and play with it a little bit as well. |
Have you tried looking the panel instead of looking at debug ? Because I don't say it is laggy because of the FPS number, I say it is VERY laggy because of the image. It is not smooth at all. I am going to record a video to show you, hold on |
Please, take a minute to watch the whole video describing the issue. |
Hi. I will take a look at this video. The debug output i posted presents image painting rate, not fps. It's |
Have you seen the video? What could causes that? |
Hi. Yes. The lag is terrible. I guess that I'm not able to observe it on my PC (on both Ubuntu and Windows 7) is because JVM may be using some sort of hardware acceleration on my machine. In the meantime I replaced part of the code that Sylwia changed by the old one trying to keep overall functionality untouched. Can you please try this JAR and let me know if it fixed your issue? Regards |
@sarxos Will you merge this into the official repo :D ? Otherwise, how do you get that "Hardware Acceleration", what am I missing ? |
Great! I would like you to test this last JAR (I want to verify that my last changes did not break the fix) and I will merge this as soon as you confirm it's ok. Java guys implemented quite fancy API which hides the rendering complexity and all the details causing the image to be accelerated when we are not even aware of this fact. There is no option to enable or disable it, but one need to use specific "hacks" to make use of it. Like in this issue, when drawing image on screen is more time consuming than drawing image into another image, and then on screen ;P |
Still fixed :) |
Hi,
I just discovered this awesome project. A big thanks to the author!
I have downloaded the RC6 and tested the example WebcamViewerExample and it works fine. However, I was curious and built the project as today to check if performance or whatever was better.
Here is the issue I have noticed. With the build of today, if I resize the Window, the WebcamPanel gets really really laggy. On the other hand, with the RC6, I don't have this problem. PS: To test the problem, add one of these : panel.setFillArea(true) or panel.setFitArea(true)
My guess is that the issue is coming from this : d36900b but I didn't check.
I just thought it would be good to know. Is there any way to fix this?
Thanks again!
The text was updated successfully, but these errors were encountered: