streaming from ip camera issue

Dear team,

We have an IP-camera (foscam C1). (cgi cmds=http://www.foscam.es/descarga/Foscam-IPCamera-CGI-User-Guide-AllPlatforms-2015.11.06.pdf)

we try to access the stream with Processing 3.

we used the IP_Capture example in the examples. The example works correctly. However when using our own ip-address it only takes a snapshot and doesn't refresh to new frames . We would be helped to which changes could get the frames refreshing. Tried some cgi-cmd's but not sure if that is the primary issue).

the code used:

import ipcapture.*;

IPCapture cam;

void setup() {
  size(640,360);
 // cam = new IPCapture(this, "http://195.235.198.107:3346/axis-cgi/mjpg/video.cgi?resolution=320x240", "", "");    //<-- EXAMPLE WORKS 
  
 cam = new IPCapture(this, "http://abt_bfi_2017:cv_2017@192.168.0.16:88/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=NAME&pwd=EXAMPLE","","");    //<-- OWN IP LINK WONT WORK


  
 cam.start();
  

}

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

Answers

  • edited February 2017

    It seems that a way to solve this (not ideal due to slow refresh) seems to add: cam.start(); in the draw section. The result is a slow refreshing frame sequence.

    Is there a way to setup the collection of streamed data more efficient ?

    void setup() {
      size(640,360);
     // cam = new IPCapture(this, "http://195.235.198.107:3346/axis-cgi/mjpg/video.cgi?resolution=320x240", "", "");    //<-- EXAMPLE WORKS 
      
     cam = new IPCapture(this, "http://abt_bfi_2017:cv_2017@192.168.0.16:88/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=login&pwd=psswrd","","");    //<-- OWN IP LINK WONT WORK
    
    
      
     cam.start();
      
    
    }
    
    void draw() {
     cam.start();
      if (cam.isAvailable()) {
        cam.read();
        image(cam,0,0);
        println("hi");
      }
    }
     
    
  • An option seems to be to dive in the world of threads: Does a person has the overview to know if that is or isn't necessary in order to improve the collected frames/second? Exploring potential solutions (find a direction) without knowing if its fruitful in the end yet).

  • Try changing line 15 for if (!cam.isAlive()) cam.start();. Not sure if it will make a difference.

    Kf

  • kfrajer, thank you for your thoughts, implemented such as suggested though does not tackle the issue yet

  • edited February 2017

    exploring threads seem not to tackle the issue as well (i might use it wrong). i tried to implement:

    import ipcapture.*;
    IPCapture cam;
    
    
    void setup() {
      size(640,360);
      thread("retrieveData");
      cam = new IPCapture(this, "http://abt_bfi_2017:cv_2017@192.168.0.16:88/cgi-bin/CGIProxy.fcgi?cmd=snapPicture2&usr=USER&pwd=PWD","","");    //<-- OWN IP LINK WONT WORK
      cam.start();
      
    }
    
    
    void draw() {
      //frameRate(15);
        thread("retrieveData");
       cam.read();
      //frameRate(15);
        image(cam,0,0);
    }
    
     
     
    
    void retrieveData() {
    
        cam.start();
        println("thread_start");
    }
    

    no improvement yet

  • If your video link public? I couldn't get it to work. Plus the format is not correct due to forum auto formatting of web links. Try cam = new IPCapture(this, "http://"+"you_web_link_address","",""); In this way I can try to reproduce your error. One thought is that you shouldn't be calling cam.read() directly but only when a new frame is available so I think.

    Kf

  • Dear kfajer, it is not a public link (stays within a network), i will see if i can make it public as it would be of great help to tackle this issue. currently looking into the ip camera and see if settings require to change.

  • What OS and Processing version? Did you run the example provided by the library, connecting to a public video link that they provide? Do you get the same effect?

    Kf

  • edited February 2017

    Correct, I started using the example with the included link. That works correctly with good stream of data refreshing.

    I use Processing 3 windows 10.

    the issue might be due to the camera itself, though it works good on own software + 3rd party software that access the ip address ( as sighthound).

  • Progress so far:

    when using vlc player and use iplink: rtsp://username:password@192.168.0.16:554/videoSub

    it runs smoothly in vlc player, same is not yet running in processing.

  • edited February 2017

    Update so far without a good resolution. Not sure if i am going in the wrong direction. Would be helped with some inspiration regarding potential solutions.

    tried to use a way as described in: http://quedig.com/questions/35816039/rtsp-stream-in-processing-3/

    code:

    import codeanticode.gsvideo.*;
    import processing.video.*;
    import codeanticode.syphon.*;
    
    Capture myCapture;
    
    
    
    
    GSPipeline pipe; 
    
    void setup() { 
            size(640,480); 
            pipe = new GSPipeline(this, "rtsp://login:pswd@192.168.0.16:554/videoSub"); 
            pipe.play(); 
        } 
    
    void draw() { 
            if (pipe.available()) { 
                pipe.read(); 
                image(pipe, 0, 0); 
          } 
    }
    
  • Trying to come up with suggestions i can work out for the weekend, is there an rtsp (realtimestreamingprotocol) converter available that converts the rtsp:// ip-link to a format processing accepts?

  • if a person knows an ip-camera that definetly will work with processing's interpetation of the incomming feed, i would be keen to hear (best would be an affordable type of camera). warmest regards,

    Dino

  • edited February 2017

    for whomever will need a kind of solution:

    for now i use: a sort of restreamer by using camera software (free) http://www.webcamxp.com/home.aspx that restreams the rstp. (ispy is better though i have issues with firewall). cpu cost is low which makes it an acceptable solution.

    the webserver creates a local stream : http:// servername : portname. this link can be used in the processing ICapture command. inmy case: http://abt2928w8l:8080/cam_1.cgi if there is trouble with finding the correct link play arround with some settings (you also can rightclick the stream to inspect the image/mpeg you can retrieve the link from there.

    hope to find a more elegant way. Very open to know about a smooth way to solve the rstp feed into processing directly.

  • Answer ✓

    @Dino_van_Deijzen Thank you for sharing your solution. I have tagged @neilcsmith_net. Maybe he has some suggestions and he would be interested to know this.

    Kf

  • edited February 2017

    Kfajer, hope it put people on ideas and this can function as a temporary solution at least. This forum helped me out so many times already. hope it helps others in time

Sign In or Register to comment.