Hi, i’m struggeling to write a stream to the canvas. I can get one frame every time the sketch loads but its not updating the variable. My thought was that if i call image() in draw() it updates every cycle, but it doesn’t? I there a more straight forward way of connecting to a url stream?
var video;
function setup() {
createCanvas(600,600)
background(51);
video = createImg('http://192.168.11.122:81/stream', "");
video.size(320,240);
image(video,320, 240);
}
function draw(){
image(video,320, 240);
}
I would help if you entered the source code in your question instead of making us re-write it by looking at an image. Edit your question and use two sets of three grave characters with your code sandwiched in between, eg
```
your code
```
Thanks.
i tried to set it up using createCapture but it won’t take a url as an input. After reading a bit it looked like it’s only ment to be used with internal audio/video. The only thing i found that would allow me to connect to the url was with createImg().
But maybe my implementation ist wrong?:
let capture;
function setup() {
createCanvas(390, 240);
capture = createCapture('http://192.168.11.122:81/stream');
capture.size(320, 240);
//capture.hide();
}
function draw() {
background(255);
image(capture, 0, 0, 320, 240);
filter(INVERT);
}