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 =
It looks like OpenCV
does not record the rotation metadata of the video file with VideoCapture() as you can see by the propId
s that it stores.
I'm not sure if scikit-video
does. It looks like they have a metadata puller called ffprobe which might be able to pull the rotation. See here for an example of how to call and see the output. This shows a hefty list of metadata---no rotation---but that might just be because it's not set or of a movie type which doesn't have rotation metadata.
Another way to grab it would be to read the metadata directly from ffmpeg
. I found an old StackOverflow answer that wrote a little python
code to extract specifically the rotation metadata from a video using ffmpeg
.