Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python live video streaming flask

def generate_frames():
    capture = cv2.VideoCapture(-1)
    while True:
        bollean , frame = capture.read()
        ret , buffer = cv2.imencode('.jpg',frame)
        frame = buffer.tobytes()
        yield (b'--frame
'
               b'Content-Type: image/jpeg

' + frame + b'
')

@app.route('/video_feed')
def video_feed():
    return Response(generate_frames(), mimetype='multipart/x-mixed-replace; boundary=frame')

Comment

video streaming flask

<html>
  <head>
    <title>Video Streaming Demonstration</title>
  </head>
  <body>
    <h1>Video Streaming Demonstration</h1>
    <img src="{{ url_for('video_feed') }}">
  </body>
</html>
Comment

PREVIOUS NEXT
Code Example
Python :: python typeddict 
Python :: sending email in django 
Python :: convert a tuple into string python 
Python :: python close browser 
Python :: scikit learn k means 
Python :: ipython play sound 
Python :: colab install library 
Python :: pandas row where value in list 
Python :: python center window 
Python :: where to import kivy builder 
Python :: import matplotlib 
Python :: cast tensor type pytorch 
Python :: implicit conversion in python example 
Python :: return max repeated value in list 
Python :: discord.py send messages 
Python :: python - oordinated universal time 
Python :: how to read a text file from url in python 
Python :: python count total no of word in a text 
Python :: python getting class name 
Python :: charcodeat python 
Python :: call a Python range() using range(start, stop, step) 
Python :: python list except last element 
Python :: equal sides of an array python 
Python :: python create environment linux 
Python :: add text to pygame window 
Python :: how to use ggplot matplotlib 
Python :: Adding new column to existing DataFrame in Pandas by assigning a list 
Python :: pasal 
Python :: remove all integers from list python 
Python :: check python version kali linux 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =