![]() ![]() serve_forever () except KeyboardInterrupt : capture. Streamer ( address, StreamProps ) print ( 'Server started at', ' + address + ':' + str ( address )) server. ![]() set_Quality ( StreamProps, 90 ) server = ps. set_Capture ( StreamProps, capture ) StreamProps. set_Mode ( StreamProps, 'cv2' ) capture = cv2. set_Page ( StreamProps, HTML ) address = ( '192.168.1.1', 9000 ) # Enter your IP address Import cv2 import pyshine as ps # pip3 install pyshine=0.0.9 # Part 01 using opencv access webcam and transmit the video in HTML Let’s say your IP address is 192.168.1.1, then the following code is all we need to observe the video stream in another device’s webbrowser. The HTML page will get the mjpeg stream plays it in an inline fashion.įrom our previous tutorials, you may already have known the idea to get the IP address of your device. ![]() We will cover these details in upcoming tutorials so let us get back to the streaming part.įor this purpose, we need a main.py code as shown below, which will use the docstring of an HTML page and pass it to the streaming server through pyshine library. However, the range also depends on antenna characteristics and, of course, the transmission power. The wifi standard used in RPi zero is IEEE 802.11n, which relatively supports a longer distance of about 200 m in Line of sight theoretically. We will use raspberry pi zero board in this tutorial, but theoretically, you can use any other boards as long as they have the Python3 installed and access wifi. Although the code below will work on any PC connected to the same wifi router, we recommend using RPi for its numerous advantages in daily life applications. Please note that you can easily observe the current IP address of the Raspberry Pi. So you can use the latest version 0.0.9 as: 1) cv2 You can easily install opencv as cv2 by following the tutorial here:Ģ) pyshine pyshine is required to enable the streaming features in this tutorial. ![]()
0 Comments
Leave a Reply. |