Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

get aspect ratio of video?

In python I process a mp4 video with <stream =="" cv2.videocapture(filename)&gt;.="" the="" video="" has="" a="" resolution="" of="" 1440x1080,="" but="" an="" aspect="" ratio="" of="" 16:9.="" this="" is="" how="" it="" comes="" from="" my="" sony="" camera.="" to="" preserve="" the="" aspect="" ratio,="" i="" need="" to="" know="" it.="" how="" can="" i="" get="" it?<="" p="">

get aspect ratio of video?

In python I process a mp4 video with <stream =="" cv2.videocapture(filename)&gt;.="" the="" video="" has="" a="" resolution="" of="" 1440x1080,="" but="" an="" aspect="" ratio="" of="" 16:9.="" this="" is="" how="" it="" comes="" from="" my="" sony="" camera.="" to="" preserve="" the="" aspect="" ratio,="" i="" need="" to="" know="" it.="" how="" can="" i="" get="" it?<="" p="">

stream = cv2.VideoCapture(filename)

. The video has a resolution of 1440x1080, but an aspect ratio of 16:9. This is how it comes from my sony camera. To preserve the aspect ratio, I need to know it. How can I get it?

get aspect ratio of video?

In python I process a mp4 video with

stream = cv2.VideoCapture(filename)

. The video has a resolution of 1440x1080, but an a display aspect ratio of 16:9. This is how it comes from my sony camera. To preserve the aspect ratio, I need to know it. How can I get it?the display aspect ratio it with OpenCV? ffmpeg -I tells me this:

Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709/bt709/iec61966-2-4), 1440x1080 [SAR 4:3 DAR 16:9]

get aspect ratio of video?

In python I process a mp4 video with

stream = cv2.VideoCapture(filename)

The video has a resolution of 1440x1080, but a display aspect ratio of 16:9. This is how it comes from my sony camera. To preserve the aspect ratio, I need to know it. How can I get the display aspect ratio it with OpenCV? ffmpeg -I -i tells me this:

Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709/bt709/iec61966-2-4), 1440x1080 [SAR 4:3 DAR 16:9]

get display aspect ratio of video?

In python I process a mp4 video with

stream = cv2.VideoCapture(filename)

The video has a resolution of 1440x1080, but a display aspect ratio of 16:9. This is how it comes from my sony camera. To preserve the aspect ratio, I need to know it. How can I get the display aspect ratio with OpenCV? ffmpeg -i tells me this:

Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709/bt709/iec61966-2-4), 1440x1080 [SAR 4:3 DAR 16:9]

get display aspect ratio of video?

In python I process a mp4 video with

stream = cv2.VideoCapture(filename)

The video has a resolution of 1440x1080, 1440x1080 and a SAR of 4:3, but a display aspect ratio (DAR) of 16:9. This is how it comes from my sony camera. To preserve the display aspect ratio, I need to know it. How can I get the display aspect ratio with OpenCV? ffmpeg -i tells me this:

Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709/bt709/iec61966-2-4), 1440x1080 [SAR 4:3 DAR 16:9]