# Trying to resize video from ipCapture - Processing (AndroidMode)

**URL:** <https://discourse.processing.org/t/trying-to-resize-video-from-ipcapture-processing-androidmode/15719>\
**Category:** Processing for Android\
**Created:** [November 22, 2019, 3:27pm UTC](https://discourse.processing.org/t/trying-to-resize-video-from-ipcapture-processing-androidmode/15719 "2019-11-22T15:27:19Z")\
**Posts on this page:** 3\
**Page:** 1

<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, 3:27pm UTC](https://discourse.processing.org/t/trying-to-resize-video-from-ipcapture-processing-androidmode/15719/1 "2019-11-22T15:27:19Z")

</div>

I am streaming `mjpg video` over `http` .

It works fine if the resolution of the video I am streaming is the same as the phones resolution (I’m displaying it on the background). The library `ipcapture` inhereits methods from `PImage` such as `resize` , but it doesn’t work to me and the app crashes at `cam.read()`.

```auto
IPCapture cam;

void setup() {
  size(800, 480);//resolution of the phone
  orientation(LANDSCAPE);
  cam = new IPCapture(this, "http://"+R2B2ip+"/?action=stream", "", "");
  cam.start();
}

void draw() {
  if (cam.isAvailable()) {
    //cam.resize(800,480); 
    cam.read();
    background(cam);
  }
  else{
    print("fail");
  }

```

So, if I stream in 800x480 this will work just fine, yet if i change the phones resolution or the resolution i’m streaming in, it doesn’t work, even if I try to use the `resize(x,y)` function. Any ideas?

[Error I get](https://i.stack.imgur.com/Ja4SQ.png)

---

<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, 4:17pm UTC](https://discourse.processing.org/t/trying-to-resize-video-from-ipcapture-processing-androidmode/15719/2 "2019-11-22T16:17:58Z")

</div>

The error says no such method. I looked into the class on github, and I couldn’t find a method resize. So I think you have to find out a work around.  
Just a wild guess. Declare PImage img;  
img = cam.read();  
img.resize(800,400);

---

<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:11pm UTC](https://discourse.processing.org/t/trying-to-resize-video-from-ipcapture-processing-androidmode/15719/3 "2019-11-22T17:11:51Z")

</div>

Thanks for answering.  
What you propose its not correct since read() is a void. I actually posted this yesterday but my account wasn’t validated until today. I’ve found this post which should solve my problem but it just makes it a little bit better. I’ve made a comment with my current problem there.

> [@Is the 'IPCapture' library not usable? (not Android mode?)](https://discourse.processing.org/t/is-the-ipcapture-library-not-usable-not-android-mode/11315/16):
>
> @akenaton 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. Existing code: img.init(w, h, PImage.RGB,1); Modification code: img.init(w, h, PImage.RGB); Thanks.~

It’s a little bit old, but I’m hoping I can get some help
