Skip to content

Instantly share code, notes, and snippets.

View akmamun's full-sized avatar
🎯
Focusing

Al Mamun Khan akmamun

🎯
Focusing
View GitHub Profile
@akmamun
akmamun / create-a-host
Created February 13, 2019 08:35
Create a Host for Php Laravel Project (always run project without artisan serve)
# 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
@akmamun
akmamun / Webcam.js
Created February 13, 2019 07:49
React JS (ES6 Function) Camera Stream
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)
@akmamun
akmamun / camera.py
Created February 7, 2019 10:31
Camera Live Streaming with Flask and Open-CV
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