Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Different number of mappedBytes in QVideoFrame in android versus ios
Forum Updated to NodeBB v4.3 + New Features

Different number of mappedBytes in QVideoFrame in android versus ios

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
qvideoframeandroidiosqimage
2 Posts 1 Posters 1.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bdtower8
    wrote on last edited by
    #1

    I'm working on a mobile application where I would like to process a QVideoFrame in OpenCV (or QImage). I am able to properly receive a QVideoFrame in Android, where I receive a logical number of bytes (3110400 for a 1920x1080 image). When I run the same code on ios, i receive a weird number of bytes (3136384 for a 1920x1080 image).

    After I map the QVideoFrame, I am able to properly process the Image using the NV21 format (as reported by the QVideoFrame pixelFormat() function). In ios, I am able to process the image (using the NV12 format), but I noticed that there is a shift in the colors (about 16 columns to the left). This is unsurprising, as I am only reading in 3110400 bytes versus the full 3136384 bytes.

    Both Android and ios report a QVideoFrame size of 1920x1080. Is there a way to properly read a QVideoFrame for processing such that there is no shift in the data?

    1 Reply Last reply
    0
    • B Offline
      B Offline
      bdtower8
      wrote on last edited by
      #2

      I was able to resolve the issue by changing the QCameraViewFinderSettings on my QCamera to use QVideoFrame::Format_ARGB32 @ 1920x1080. After this change, the QVideoFrame reported the proper number of mappedBytes.

      One interesting note, I had to QCameraViewFinderSettings.setMinimumFrameRate(0). For some reason there was a lag on the viewfinder in low light, but changing this setting fixed it.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved