Skip to content

cv::VideoCapture ignores orientation metadata #15499

@shinexunju

Description

@shinexunju

For some videos, using get() to get VideoCapture's width/height property, the results are not correct (the width and height are swapped).

I found that there is a rotate tag in the video metadata (ref. link ffmpeg get orientation inverted), e.g.,

Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2019-09-10T04:58:23.000000Z
    location        : +31.2664+120.7302/
    location-eng    : +31.2664+120.7302/
    com.android.version: 10
  Duration: 00:00:25.15, start: 0.000000, bitrate: 42894 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt470bg/bt470bg/smpte170m), 3840x2160, 42808 kb/s, SAR 1:1 DAR 16:9, 30.01 fps, 30 tbr, 90k tbn, 180k tbc (default)
    Metadata:
      rotate          : 90
      creation_time   : 2019-09-10T04:58:23.000000Z
      handler_name    : VideoHandle
    Side data:
      displaymatrix: rotation of -90.00 degrees

Could this issue be considered in future releases?

Metadata

Metadata

Labels

Hackathonhttps://opencv.org/opencv-hackathon-starts-next-week/category: videoioeffort: few daysExtra design work may required (think about tests too). Or prepare a great tutorial.feature

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions