title: How to rotate camera recorded video?
body: <p>I am trying to detect faces in a camera recorded video. When i did it with webcam video, it's working fine. But, with camera recorded video, the video gets rotated by -90 degree. Please suggest me, how do I get the actual video output for face detection?</p>
  
  <pre><code>import cv2
  import sys
  
  cascPath = sys.argv[1]
  faceCascade = cv2.CascadeClassifier('C:/Users/HP/Anaconda2/pkgs/opencv-3.2.0-np112py27_204/Library/etc/haarcascades/haarcascade_frontalface_default.xml')
  
  #video_capture = cv2.videoCapture(0)
  video_capture = cv2.VideoCapture('C:/Users/HP/sample1.mp4')
  w=int(video_capture.get(3))
  h=int(video_capture.get(4))
  
  #output = cv2.VideoWriter('output_1.avi',cv2.VideoWriter_fourcc('M','J','P','G'), 60,frameSize = (w,h))
  
  while True:
  
      ret, frame = video_capture.read()
      frame = rotateImage(frame,90)
  
      gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
  
      faces = faceCascade.detectMultiScale(gray, 1.3, 5) 
  
      # Draw a rectangle around the faces
      for (x, y, w, h) in faces:
          cv2.rectangle(frame, (x, y), (x+w, y+h), (0, 255, 0), 2)
      #cv2.imshow('face',i)
  
      #output.write(frame)
  
      cv2.imshow('Video', frame)
  
          if cv2.waitKey(1) &amp; 0xFF == ord('q'):
              break
  
      video_capture.release()
      output.release()
  
  cv2.destroyAllWindows()
  </code></pre>