We save a video on a mobile client and send it to a server. On the server, I use the following code to save the frames:>
import skvideo.io
import cv2
haar =
'/home/ubuntu/opencv/data/haarcascades/haarcascade_frontalface_alt.xml'
face_cascade = cv2.CascadeClassifier(haar)
ret = True
video = 'my_video.mov'
i = 0
while ret == True:
cap = skvideo.io.VideoCapture(video)
ret, frame = cap.read()
cv2.imwrite('frame_'+str(i)+'.jpg',frame)
i+=1
When we play the video on a windows media player or itunes, it looks good. I.e. the player knows how to orient it.
But skvideo.io does not know that, and those frames we saved are rotated 90 degrees counterclockwise.
How can we embed info into the video file (a .mov) file that that skvideo knows the correct orientation?