I can add pictures to the video in the normal python editor. When I write the codes for flask, the video works but the pictures I added are not visible.
from flask import Flask, render_template, Response
from camera import VideoCamera
import os
arrow_folder = os.path.join('static', 'arrow')
app = Flask(__name__,template_folder='Templates')
app.config['UPLOAD_FOLDER'] = arrow_folder
@app.route('/')
def index():
return render_template('index.html')
def gen(camera):
while True:
try:
frame = camera.get_frame()
yield (b'--frame\r\n' b'Content-Type: image/jpeg\r\n\r\n' + bytearray(frame) +
b'\r\n\r\n')
except Exception as e:
pass
@app.route('/video_feed')
def video_feed():
return Response(gen(VideoCamera()),mimetype='multipart/x-mixed-replace; boundary=frame')
if __name__ == '__main__':
app.run(host='0.0.0.0', port='5000', debug=True,threaded=True)
The file which has images where the application is located is named static and is in the same folder, but I cannot add an image to the video.I cannot add images to video