Skip to content
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

IPCamDriver with Android IP WebCam app #607

Closed
neilyoung opened this issue Jan 12, 2018 · 20 comments
Closed

IPCamDriver with Android IP WebCam app #607

neilyoung opened this issue Jan 12, 2018 · 20 comments

Comments

@neilyoung
Copy link

neilyoung commented Jan 12, 2018

Works - kind of.
The frame rate is decent, pretty good. Usually I'm having about 25 "debug repaints" per second (is this kind of "fps"?)

EDIT: Delay very, very small. Great

But sometimes the image stutters for several ms. That time the debug display shows "200 debug repaints" or so, a big number.

The original browser based app doesn't have that problem. Any chance to approach?

EDIT: It is stuck, if the scene is changing quickly. Maybe a clue.

Regards

@neilyoung
Copy link
Author

No, much better. It is getting stuck every 5 secs. Some timer running?

@neilyoung
Copy link
Author

neilyoung commented Jan 12, 2018

@sarxos Do you remember, when I asked you, if it is possible to access the buffered image as like with an ordinary cam? I think to remember, you have confirmed that.

But it doesn't work:

Exception in thread "Thread-32" java.lang.IllegalStateException: Driver com.github.sarxos.webcam.ds.ipcam.IpCamDriver does not support buffer access
	at com.github.sarxos.webcam.Webcam.getImageBytes(Webcam.java:734)
	at com.myCompany.myApp.Capture.run(CameraAPI.java:33)

This is the response to

webCam.getImageBytes()

Pointer welcome

@neilyoung
Copy link
Author

Disregard. Found alternatives

@sarxos
Copy link
Owner

sarxos commented Jan 15, 2018

Hi @neilyoung,

Yes I remember this discussion and indeed I confirmed this to be possible. Obviously I was wrong :( Sorry for misleading you.

Will fix this.

@neilyoung
Copy link
Author

@sarxos No prob. Found an older post here which suggested to patch IPCamDriver. Did that. Works

@sarxos
Copy link
Owner

sarxos commented Jan 15, 2018

@neilyoung Cool :) Before I read your last comment I did this as well, but the change is not tested. You may take a look and decide which one performs better. I did not test this in any way so it can be laggy or not working. In this case I'm open for suggestions and/or pull requests.

@neilyoung
Copy link
Author

@sarxos Well, my "solution" is a bit different. I was not going the detour via the image again, but using the "frame" byte[] produced earlier. This incorporates more changes, though

@sarxos
Copy link
Owner

sarxos commented Jan 16, 2018

@neilyoung, but isn't the frame a BufferedImage image instance? In the code I see:

The image variable is returned when you invoke getImage(). Therefore to have byte[] data you still have to detour via the image.

Or are you maybe referring to frame variable from IpCamMJPEGStream?

But in this case you have to note that this byte[] array is not an RGB24, but a JPEG frame.

@neilyoung
Copy link
Author

@sarxos I see. You are right. Will switch to your solution. Thanks

@neilyoung
Copy link
Author

@sarxos OK, works fine. When do you plan to publish it?

@sarxos
Copy link
Owner

sarxos commented Jan 16, 2018

@neilyoung I can roll SNAPSHOT right now.

@sarxos
Copy link
Owner

sarxos commented Jan 16, 2018

@neilyoung

I just deployed SNAPSHOT to Sonatype Maven repository.

This is repository to add into POM:

<repository>
	<id>Sonatype OSS Snapshot Repository</id>
	<url>http://oss.sonatype.org/content/repositories/snapshots</url>
</repository>

And dependency:

<dependency>
	<groupId>com.github.sarxos</groupId>
	<artifactId>webcam-capture-driver-ipcam</artifactId>
	<version>0.3.12-SNAPSHOT</version>
</dependency>

If you do not use Maven but manage your JARs manually then please let me know. I will zip required files and put them here.

@neilyoung
Copy link
Author

@sarxos I see all the capture drivers there, but I don't see a webcam-capture snapshot.

@sarxos
Copy link
Owner

sarxos commented Jan 16, 2018

@neilyoung Oh, there is (webcam-capture-0.3.12-20180116.162525-8.jar):

https://oss.sonatype.org/content/repositories/snapshots/com/github/sarxos/webcam-capture/0.3.12-SNAPSHOT/

@sarxos
Copy link
Owner

sarxos commented Jan 16, 2018

@neilyoung Here are all required JARs: target.zip

@neilyoung
Copy link
Author

neilyoung commented Jan 16, 2018

Hmm. ok. seems to be not used by Intellij

Thanks for the zip... Will use that.

@neilyoung
Copy link
Author

@sarxos Problem is, that a coworker is also depending on it and I would rather like to let him do the Maven stuff instead of asking him to replace two JARs... .Would be great if there could be an official 0.3.12 asap

@sarxos
Copy link
Owner

sarxos commented Jan 18, 2018

Hi @neilyoung,

I spent whole yesterday's evening working on this, but finally, after several failed attempts, I was able to roll new official release, that is the 0.3.12. 🎉

The artifacts I deployed yesterday are available already in Maven Central:

image

And the ZIP bundles are available from my private repository:

image

image

@neilyoung
Copy link
Author

@sarxos Wow, you are my hero. Thanks for your patience with this project. Very much appreciated.

@sarxos
Copy link
Owner

sarxos commented Jan 19, 2018

@neilyoung The pleasure is mine :) Feel free to open new issue in case of further problems or questions. I'm closing this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants