# Is the 'IPCapture' library not usable? (not Android mode?)

**URL:** <https://discourse.processing.org/t/is-the-ipcapture-library-not-usable-not-android-mode/11315>\
**Category:** Processing for Android\
**Created:** [May 16, 2019, 9:35pm UTC](https://discourse.processing.org/t/is-the-ipcapture-library-not-usable-not-android-mode/11315 "2019-05-16T21:35:54Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![GWAK](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@GWAK](https://discourse.processing.org/u/GWAK)\
**Post date:** [May 16, 2019, 9:35pm UTC](https://discourse.processing.org/t/is-the-ipcapture-library-not-usable-not-android-mode/11315/1 "2019-05-16T21:35:54Z")

</div>

For the IPCapture library,

Is the ‘IPCapture’ library not usable?

[User environment]

- (JAVA) Processing 3.3.7
- (Android) API.8.1  
 ![TT](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/6/62a2a6a9dad52c24292db66f3e02d8cf7f20c209.jpeg)

Is there any way to view IP camera images using ‘IPCapture’?

---

<div class="post-metadata">

**Author:** ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)\
**Post date:** [May 16, 2019, 10:11pm UTC](https://discourse.processing.org/t/is-the-ipcapture-library-not-usable-not-android-mode/11315/2 "2019-05-16T22:11:31Z")

</div>

Hi,

If you don’t provide your code, we can’t help you.  
To do that, just press `Ctrl+T` int the Processing IDE and use the `</>` button in the message editor on the forum.

---

<div class="post-metadata">

**Author:** ![GWAK](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@GWAK](https://discourse.processing.org/u/GWAK)\
**Post date:** [May 16, 2019, 10:24pm UTC](https://discourse.processing.org/t/is-the-ipcapture-library-not-usable-not-android-mode/11315/3 "2019-05-16T22:24:21Z")

</div>

```auto
import ipcapture.*;

IPCapture cam;

void setup() {
  size(320,240);
  cam = new IPCapture(this, "http://192.168.0.12:8080" , "admin", "admin" );
  cam.start();
 
}

void draw() {
  if (cam.isAvailable()) {
    cam.read();
    image(cam,0,0);
  }
}

void keyPressed() {
  if (key == ' ') {
    if (cam.isAlive()) cam.stop();
    else cam.start();
  }
}

```

@josephh

Common source code shown in the example.

---

<div class="post-metadata">

**Author:** ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)\
**Post date:** [May 16, 2019, 10:48pm UTC](https://discourse.processing.org/t/is-the-ipcapture-library-not-usable-not-android-mode/11315/4 "2019-05-16T22:48:12Z")

</div>

Is your camera connected to the network?. Can you access it with your computer? Does the port `8080` is open?

If you are on linux, you can try :

```auto
nmap 192.168.0.12

```

To scan all the ports of your camera.

```auto
ifconfig

```

To check if you are on the same network with your camera.

---

<div class="post-metadata">

**Author:** ![GWAK](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@GWAK](https://discourse.processing.org/u/GWAK)\
**Post date:** [May 17, 2019, 12:04am UTC](https://discourse.processing.org/t/is-the-ipcapture-library-not-usable-not-android-mode/11315/5 "2019-05-17T00:04:36Z")

</div>

![zz](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/4/4687f6f2edb9661df0859c2ec4dc0f01b4ad5ac2.jpeg)

[http://192.168.0.12:8080/web/index.html](http://192.168.0.12:8080/web/index.html)

The port address is obvious.

---

<div class="post-metadata">

**Author:** ![josephh](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/josephh/32/210_2.png) [@josephh](https://discourse.processing.org/u/josephh)\
**Post date:** [May 17, 2019, 12:47pm UTC](https://discourse.processing.org/t/is-the-ipcapture-library-not-usable-not-android-mode/11315/6 "2019-05-17T12:47:54Z")

</div>

If your code is exaclty the example of the library `IPCapture`, then maybe it has something to do with the :

```auto
"admin", "admin"

```

---

<div class="post-metadata">

**Author:** ![akenaton](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@akenaton](https://discourse.processing.org/u/akenaton)\
**Post date:** [May 17, 2019, 2:39pm UTC](https://discourse.processing.org/t/is-the-ipcapture-library-not-usable-not-android-mode/11315/7 "2019-05-17T14:39:33Z")

</div>

@GWAK ===  
Though this library was not upated since 4 or 5 years it seems to work; i have tried it with a public IP camera without user name or password && i got the images; so i think that your problem is not here.  
PS: the test example does not work, the url is dead.

---

<div class="post-metadata">

**Author:** ![GWAK](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@GWAK](https://discourse.processing.org/u/GWAK)\
**Post date:** [May 20, 2019, 7:50am UTC](https://discourse.processing.org/t/is-the-ipcapture-library-not-usable-not-android-mode/11315/8 "2019-05-20T07:50:12Z")

</div>

> import ipcapture.\*;
> 
> IPCapture cam;
> 
> void setup() {
> 
> size(1000,500);  
> cam = new IPCapture(this, “http://”+“192.168.0.110/Streaming/Channels/2/preview?openalprfiletype=file.mjpg”, “admin”, “aa852!”);  
> cam.start();
> 
> delay(1000);  
> }
> 
> void draw() {  
> if (cam.isAvailable()) {  
> cam.read();  
> image(cam,0,0);  
> }  
> }
> 
> void keyPressed() {
> 
> }

 ![t1](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/f/f45c69ace52f174d5c8f4d6bacaf2760810ea4a8.jpeg)

 ![t2](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/4/4b63e31a394ac4c9cdfaff514b8cae9c0e644eb5.jpeg)

@akenaton  
@josephh

Thank you for your interest.

As above, it works in JAVA mode  
It does not work in Android mode.

Why?  
Do you know the answer?

- Android mode 3.0.1 (Processing tool)
- SDK: API6.0 / 7.0 / 8.1 → not action
- Smart Phone: 6.0 / 8.1 → not action

---

<div class="post-metadata">

**Author:** ![akenaton](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@akenaton](https://discourse.processing.org/u/akenaton)\
**Post date:** [May 20, 2019, 8:30am UTC](https://discourse.processing.org/t/is-the-ipcapture-library-not-usable-not-android-mode/11315/9 "2019-05-20T08:30:23Z")

</div>

@GWAK === as you an see there is an error but i cannot read it: cut && copy.

---

<div class="post-metadata">

**Author:** ![GWAK](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@GWAK](https://discourse.processing.org/u/GWAK)\
**Post date:** [May 20, 2019, 9:07am UTC](https://discourse.processing.org/t/is-the-ipcapture-library-not-usable-not-android-mode/11315/10 "2019-05-20T09:07:56Z")

</div>

@akenaton

The above photo debug content is as follows.

> debug:  
> (HTTPLog)-Static: isSBSettingEnabled false  
> (HTTPLog)-Static: isSBSettingEnabled false  
> (HTTPLog)-Static: isSBSettingEnabled false  
> (HTTPLog)-Static: isSBSettingEnabled false  
> Frame resize: from 1000x500 to 640x360  
> FATAL EXCEPTION: Animation Thread  
> Process: processing.test.ipcapturetest, PID: 8894  
> java.lang.NoSuchMethodError: No virtual method init(IIII)V in class Lprocessing/core/PImage; or its super classes (declaration of ‘processing.core.PImage’ appears in /data/app/processing.test.ipcapturetest-2/base.apk)  
> at ipcapture.FrameBuffer.toPImage(Unknown Source)  
> at ipcapture.IPCapture.read(Unknown Source)  
> at processing.test.ipcapturetest.IPCaptureTest.draw(IPCaptureTest.java:46)  
> at processing.core.PApplet.handleDraw(Unknown Source)  
> at processing.core.PGraphicsAndroid2D.requestDraw(Unknown Source)  
> at processing.core.PApplet.run(Unknown Source)  
> at java.lang.Thread.run(Thread.java:818)

 ![tt](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/6/6384c2e54a4334a4ef2467b59c9c3621b72a24fb.jpeg)

---

<div class="post-metadata">

**Author:** ![akenaton](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@akenaton](https://discourse.processing.org/u/akenaton)\
**Post date:** [May 20, 2019, 9:39am UTC](https://discourse.processing.org/t/is-the-ipcapture-library-not-usable-not-android-mode/11315/11 "2019-05-20T09:39:54Z")

</div>

@GWAK ===  
ok; try to set your size (in setup) to 640X360

---

<div class="post-metadata">

**Author:** ![GWAK](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@GWAK](https://discourse.processing.org/u/GWAK)\
**Post date:** [May 20, 2019, 10:11am UTC](https://discourse.processing.org/t/is-the-ipcapture-library-not-usable-not-android-mode/11315/12 "2019-05-20T10:11:23Z")

</div>

@akenaton

 ![%E3%85%85%E3%85%85](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/7/767d88064163ddb67da99f2c55a23b56fdaa704e.jpeg)

Dear akenaton,

As you say, you can do it with a smaller size.  
You are a genius. Thanks for your kindness.

But what I want is  
fullScreen ();  
On the full screen screen,  
I want to make the CCTV screen as big as possible.

Do you have a way(solution)?

---

<div class="post-metadata">

**Author:** ![akenaton](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@akenaton](https://discourse.processing.org/u/akenaton)\
**Post date:** [May 20, 2019, 10:15am UTC](https://discourse.processing.org/t/is-the-ipcapture-library-not-usable-not-android-mode/11315/13 "2019-05-20T10:15:48Z")

</div>

@GWAK ===  
it s not with a “smaller size” it s with the same size than the cam in order to avoid the error you got which is related to “frame resize()” - So if your image from the cam is bigger that is not a problem, you have only (i guess, not tested) to adapt size() to it.

---

<div class="post-metadata">

**Author:** ![GWAK](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@GWAK](https://discourse.processing.org/u/GWAK)\
**Post date:** [May 20, 2019, 11:06am UTC](https://discourse.processing.org/t/is-the-ipcapture-library-not-usable-not-android-mode/11315/14 "2019-05-20T11:06:03Z")

</div>

@akenaton

Thank you for your kind reply.

However, the conclusion is that it does not raise the image screen.  
(Not action)  
I’m so sad.  
I hope you find a way.

---

<div class="post-metadata">

**Author:** ![akenaton](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@akenaton](https://discourse.processing.org/u/akenaton)\
**Post date:** [May 20, 2019, 12:24pm UTC](https://discourse.processing.org/t/is-the-ipcapture-library-not-usable-not-android-mode/11315/15 "2019-05-20T12:24:49Z")

</div>

@GWAK===  
not sure to understand  
post a picture of what you (ideally) want to get  
knowing that your phone has probably a very higher res than your cam  
&& that it is probably not homothetic to your cam images

---

<div class="post-metadata">

**Author:** ![GWAK](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@GWAK](https://discourse.processing.org/u/GWAK)\
**Post date:** [May 20, 2019, 10:27pm UTC](https://discourse.processing.org/t/is-the-ipcapture-library-not-usable-not-android-mode/11315/16 "2019-05-20T22:27:14Z")

</div>

@akenaton

[![](https://img.youtube.com/vi/LKyNoKic1dA/hqdefault.jpg "CCTV 스마트폰과 연동하기 / 스마트폰 영상 연동하기") ](https://www.youtube.com/watch?v=LKyNoKic1dA)

Dear akenaton  
Corrected by correcting the library.  
Processing was a conflict between Android mode and IPcature library. It works well because it solves it.  
Thank you very much for your help.

 ![zz](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/2/2ce5e20c089d4386311ce2dfa564c92497df19bd.jpeg)

Existing code: img.init(w, h, PImage.RGB,1);  
Modification code: img.init(w, h, PImage.RGB);

Thanks.~

---

<div class="post-metadata">

**Author:** ![Veci](https://avatars.discourse-cdn.com/v4/letter/v/977dab/32.png) [@Veci](https://discourse.processing.org/u/Veci)\
**Post date:** [November 22, 2019, 5:07pm UTC](https://discourse.processing.org/t/is-the-ipcapture-library-not-usable-not-android-mode/11315/17 "2019-11-22T17:07:17Z")

</div>

I’ve modified the IPCapture library as you suggested.  
Now, the image resizes but only the first one, then the image freezes and, eventhough the console says it keeps resizing images, they are not shown.  
This is the code I have:

```auto
 IPCapture cam;

 void setup() {
   fullScreen();
   cam = new IPCapture(this, "http://"+R2B2ip+"/?action=stream", "", "");
   cam.start();
 }
 
 void draw() {
   if (cam.isAvailable()) {
     cam.read();
     cam.resize(displayWidth,displayHeight); 
     image(cam, 0, 0);
   }
   else{
     print("fail");
   }
 }

```

@GWAK Do you remember if you did something different? Maybe you still have the code? I’ve been trying to solve this problem for days and I am getting desperate. Thank you so much!

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [November 22, 2019, 7:30pm UTC](https://discourse.processing.org/t/is-the-ipcapture-library-not-usable-not-android-mode/11315/18 "2019-11-22T19:30:07Z")

</div>

The fourth parameter in the init void of the PImage Class should be used I think. I do not understand this.  
@akenaton can you explain this?

```auto
init
public void init(int width,
                 int height,
                 int format,
                 int factor)
Function to be used by subclasses of PImage 
to init later than at the constructor,
or re-init later when things changes. 
Used by Capture and Movie classes (and perhaps others), 
because the width/height will not be known when super() is called.
 (Leave this public so that other libraries can do the same.)

```

---

<div class="post-metadata">

**Author:** ![GWAK](https://avatars.discourse-cdn.com/v4/letter/g/13edae/32.png) [@GWAK](https://discourse.processing.org/u/GWAK)\
**Post date:** [November 22, 2019, 11:58pm UTC](https://discourse.processing.org/t/is-the-ipcapture-library-not-usable-not-android-mode/11315/19 "2019-11-22T23:58:58Z")

</div>

@Veci

This is a problem when you are in Android mode.  
If you do not have a PC.

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [November 23, 2019, 6:22am UTC](https://discourse.processing.org/t/is-the-ipcapture-library-not-usable-not-android-mode/11315/20 "2019-11-23T06:22:35Z")

</div>

@technew maybe you can help?

[Next page](https://discourse.processing.org/t/is-the-ipcapture-library-not-usable-not-android-mode/11315.md?page=2)
