@bp_video.route('/upload', methods=['GET','POST'])
def create():
my_file = Path(app.root_path + '/' + app.config['UPLOAD_FOLDER'] + '/videos')
if not my_file.exists():
os.makedirs(app.root_path + '/' + app.config['UPLOAD_FOLDER'] + '/videos')
if request.method == 'POST':
if 'video' in request.files:
file = request.files["video"]
clip1 = VideoFileClip(file).subclip(00.01,00.10)
clip1.write_videofile(app.root_path + '/' + app.config['UPLOAD_FOLDER'] + '/videos' +
'dd.mp4',codec='libx264')
Error :
AttributeError: '_io.BufferedRandom' object has no attribute 'endswith'
request.file["video"] --> FileStorage: 'aideed.mp4' ('video/mp4')
Directory file point to static file. What is wrong in my code, can anyone help?