This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Create a host for your project | |
| - Do not need run 'php artisan serve' anymore in your laravel project. | |
| # 1. Go to linux terminal and type | |
| ```php | |
| cd /etc/apache2/sites-available | |
| ``` | |
| # 2. Now create a file name like | |
| ```php |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (navigator.getUserMedia) { // navigator.getUserMedia pass three arguments | |
| navigator.getUserMedia({video: true}, //if want audio can be true | |
| stream => { | |
| let camera = document.getElementById('camera'); //class or id for load stream on html | |
| camera.srcObject = stream; //src of stream | |
| camera.onloadedmetadata = () => { | |
| camera.play(); | |
| } | |
| }, err => { | |
| console.log(err) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import cv2 | |
| camera = cv2.VideoCapture(0) # use 0 for web camera | |
| # for cctv camera'rtsp://username:password@ip_address:554/user=username_password='password'_channel=channel_number_stream=0.sdp' | |
| def camera_stream(): | |
| while True: | |
| # Capture frame-by-frame | |
| success, frame = camera.read() | |
| if not success: | |
| break |
NewerOlder