Tested using:
ffprobe version 4.4.2-0ubuntu0.22.04.1
.ffmpeg-python==0.2.0
package frompip
.- (Optional, for
get_rotation_code()
)opencv-contrib-python==4.6.0.66
package frompip
.
get_rotation
is intentionally separated for those not using opencv.
Another note: this code expects given file to always have one stream that has codec_type
to be video
,
if your use case might have otherwise (example of audio only files), modify the code to handle such exceptions.