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 dictionary comprehension 
Python :: pause python 
Python :: multiple arguments in python 
Python :: ipython save session 
Python :: pandas sort by date descending 
Python :: block window if another window is open tkinter 
Python :: python palindrome 
Python :: Changing the number of ticks on a Matplotlib plot axis 
Python :: python list empty 
Python :: import sklearn.metrics from plot_confusion_matrix 
Python :: TypeError: exceptions must derive from BaseException 
Python :: python get value from decimal object 
Python :: python for loop even numbers 
Python :: python remove empty list 
Python :: playsound error 
Python :: images in django 
Python :: sys.path[0] 
Python :: SciPy 1D Interpolation 
Python :: what should you call a decimal value in python 
Python :: pylint import error 
Python :: genrate unique key in python 
Python :: clean punctuation from string python 
Python :: how to print thgings in multiple linew in python 
Python :: python list to string 
Python :: select rows where column value is in list of values 
Python :: python sort two key 
Python :: create new list in for loop python 
Python :: python keyboardinterrupt 
Python :: convert dict to string python 
Python :: df groupby loop 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =