ESP32Cam Pan Tilt code —- ESP32Cam book Pan and Tilt Video streaming (2 axis)
I was able to change the port from 80 to 8020 in main code
Only pan / tilt blocks show on 8020 port —- no video stream
Where do I specify in code to send video to port 8020? To get video stream to show on 8020?
Hi Ray.
There are a few things you need to change.
You need to change this line:
config.server_port = 80;
To this:
config.server_port = 8020;
The following line:
bool jpeg_converted = frame2jpg(fb, 80, &_jpg_buf, &_jpg_buf_len);
To this:
bool jpeg_converted = frame2jpg(fb, 8020, &_jpg_buf, &_jpg_buf_len);
At this moment, the video streaming is running on the selected port(+1), followed by /stream. So it is running on the following URL:
IPaddress:8081/stream.
So, we also need to change the source of the video to embed it on the page.
So, change the following line:
window.onload = document.getElementById("photo").src = window.location.href.slice(0, -1) + ":81/stream";
To this:
window.onload = document.getElementById("photo").src = window.location.href.slice(0, -6) + ":8021/stream";
Here’s a link to the complete working code:https://gist.github.com/sarasantos/1518a2d137ef7c0500ebdbb4154c81b0
I hope this helps.
Regards,
Sara