Django Live Stream Webcam | Django Opencv Live Streaming Web Cam | Opencv Django Video Stream | AIOC

preview_player
Показать описание
#livestream #djangostream #djangolivestream #aioc #allinonecode #python #opencv #opencvlivestream

Hi! In this video, I will show you the fast and easiest way to stream your web camera using OpenCV and Django on your website.

SOurce Code:

from .models import *
import cv2
import threading

def Home(request):
try:
cam = VideoCamera()
return StreamingHttpResponse(gen(cam), content_type="multipart/x-mixed-replace;boundary=frame")
except:
pass

#to capture video class
class VideoCamera(object):
def __init__(self):

def __del__(self):

def get_frame(self):

def update(self):
while True:

def gen(camera):
while True:
yield (b'--frame\r\n'
b'Content-Type: image/jpeg\r\n\r\n' + frame + b'\r\n\r\n')
Рекомендации по теме
Комментарии
Автор

Justo lo que necesitaba, gracias hermano me sirvio, no tenia idea de como pasar un valor a la clase de la camara pero al ver tu ejemplo tuyeron las ideas, gracias Hermano

joseluisreyes
Автор

Bruh u r a legend legitimately!, Thanks for this video it helped me a lot in my web app😍😍❤❤

shabazshiralkar
Автор

Thank you so much bro. I used this coding on my project too. Worked well.Thanks for sharing code.

alphonseinbaraj
Автор

Just keep in mind this approach will not work when you host your project, since open cv detects the camera in the back end but it will not be able to detect the client's media device camera.

baselmahmoud
Автор

Thanks, bro, it's helped me to progress my mini-thesis

SW-WS
Автор

Gracias por el video, tu ejemplo me ayudo muchisimo, saludos desde Perú

Para los de habla hispana,
para finalizar la ejecución de la camara al momento de cambiar o redireccionar la pag web.
***
def gen(camera):
while True:
try:
frame = camera.get_frame()
yield (
b'--frame\r\n'
b'Content-Type: image/jpeg \r\n\r\n'+frame+
b'\r\n\r\n' )
except:
camera.__del__()

***

denilsonedgardofloresvaldi
Автор

Hello! After that, how do I style the html page to suit my needs?

Thanks

danielazevedosouza
Автор

nicee hey can you show tutorial how to connect ip camera cctv and play to live streaming in web page?

pakeffendi
Автор

Please help with how to use webcam in Django project, basically imp working on how to implement a pose detection ml model integration in Django. Please it will be very helpful if you can help.

tigerjain
Автор

what did you make app1.html say? why is it necessary? I'm very new to this

jrod
Автор

HI Thank you, may I know why the background is black instead of white color? Add my html tag information all disapper with this method, any help?

engineerchew
Автор

Awesome boss just one question can we resize the frame

shivamdubey
Автор

hi can you please help with how to use webcam in Django project, basically imp working on how to implement a pose detection ml model integration in Django, and I'm struck with how to use webcam in real time

hydradynamo
Автор

Is there a way to trained this camera? if so, where should I start inputting the codes for the camera to be trained?

markvincentobligarpagala
Автор

hello, after i save the image from caputring the frame using cv2.imwrite, how can i redirect to other page?

joeretzyee
Автор

Could you please post the link for next video and git or a link for your page ? I would like get the source code, best regards.

jsny
Автор

can we use openCV and django to make an app for live video broadcast (one-to-many broadcast, one video live and other users or followers are only viewers) ?

uen
Автор

How to capture that and save inside a folder

manishdashsharma
Автор

how can we show the video with specific width and height on a specific html page?

abubakarshf
Автор

Hi, please, can you show us, how to run it on heroku? Im am trying but withour results.

MarcelSuleiman