I have some python code that uses opencv to play a video from a certain path and I've been reading about how to incorporate that python code with Django and I saw that the python code can be put into the django views.py file but my question is what am I supposed to put as a parameter for the piece of code that renders it, like return render(request, [what do I put here?])
because usually after request the location of the html file is put but if I want that video to play do I just specify the html page I want the video to play on, will that work or do I have to do something more? Also if you know any good tutorials that deal with this type of stuff I would appreciate any links. Thanks in advance.
Here's the python code that just plays a video
filename = 'C:/Desktop/Videos/traffic2.mp4'
vidcap = cv2.VideoCapture(filename)
while(vidcap.isOpened()):
success, frame_org = vidcap.read()
cv2.imshow('frame',frame_org)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
vidcap.release()
cv2.destroyAllWindows()