Skip to content

Instantly share code, notes, and snippets.

View ganbaaelmer's full-sized avatar

ganbaaelmer ganbaaelmer

View GitHub Profile
@ganbaaelmer
ganbaaelmer / index.html
Created August 5, 2022 03:34
index.html
<!DOCTYPE html>
<html>
<head>
<title>Streaming Video Recorder</title>
</head>
<body>
<h1>Streaming Video Recorder</h1>
<div id="recorder">
<button id="record">Video record</button>
<button id="stop">Stop video record</button>
@ganbaaelmer
ganbaaelmer / camera.py
Created August 5, 2022 03:33
camera.py
import cv2
import threading
class RecordingThread (threading.Thread):
def __init__(self, name, camera):
threading.Thread.__init__(self)
self.name = name
self.isRunning = True
self.cap = camera
@ganbaaelmer
ganbaaelmer / app.py
Last active August 5, 2022 03:32
app.py
from flask import Flask, render_template, Response, jsonify, request
from camera import VideoCamera
import pyaudio
app = Flask(__name__)
############ Audio recording section ############
FORMAT = pyaudio.paInt16
CHANNELS = 2
@ganbaaelmer
ganbaaelmer / index.html
Created August 3, 2022 03:48
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Document</title>
</head>
<body>
@ganbaaelmer
ganbaaelmer / app.py
Created August 3, 2022 03:43
app.py
from flask import Flask,render_template,Response
import cv2
import pyaudio
app=Flask(__name__)
camera=cv2.VideoCapture(0)
FORMAT = pyaudio.paInt16
CHANNELS = 2