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. How to play YUV format camera in camera application?
Forum Updated to NodeBB v4.3 + New Features

How to play YUV format camera in camera application?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
4 Posts 3 Posters 997 Views 1 Watching
  • 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
    Bonty
    wrote on last edited by
    #1

    Hi,

    I am working application based on camera having format only YUV-420-P. Other camera are working fine in camera application but YUV is very slow in application. Is it possible to change format or add encoder to the streaming video>

    D 1 Reply Last reply
    0
    • B Bonty

      Hi,

      I am working application based on camera having format only YUV-420-P. Other camera are working fine in camera application but YUV is very slow in application. Is it possible to change format or add encoder to the streaming video>

      D Offline
      D Offline
      Dennisleon
      wrote on last edited by
      #2

      @Bonty said in How to play YUV format camera in camera application?:

      Hi,

      I am working application based on camera having format only YUV-420-P. Other camera are working fine in camera application but YUV is very slow in application. Is it possible to change format or add encoder to the streaming video>

      Hello,

      When working with YUV format camera data, there are a few considerations to keep in mind. Let’s explore some relevant information:

      YUV Format:
      YUV is a color space that separates brightness (luma, Y) from color information (chroma, U and V).
      YUV420 (also known as YCbCr 4:2:0) is a common YUV format used in video compression and transmission.
      In YUV420, the chroma channels (U and V) are subsampled, resulting in reduced data size compared to RGB.

      Performance Issues:
      You mentioned that YUV is slow in your application. This could be due to various factors:
      Processing Overhead: YUV data requires additional processing steps to convert it to RGB for display.
      ImageReader Configuration: Ensure that the ImageReader you’re using is configured correctly for YUV420 format.
      Frame Size: Larger frame sizes may impact performance.
      Device-Specific Limitations: Different devices may handle YUV data differently.

      Camera2 API and ImageReader:
      The Android Camera2 API provides more control over camera features and better performance compared to the old Camera API.
      To work with YUV data using Camera2, follow these steps:
      Create an ImageReader with the desired format (e.g., YUV_420_888).
      Set up a CameraCaptureSession and configure it to receive frames from the camera.
      Process the YUV frames in the ImageReader.OnImageAvailableListener.

      Optimizations:
      To improve performance:
      Use a lower resolution (e.g., 640x480) to reduce processing load.
      Consider using hardware acceleration (e.g., OpenGL) for YUV to RGB conversion.
      Profile your code to identify bottlenecks.

      Encoder:
      If you want to encode the YUV frames (e.g., for streaming), consider using a video encoder (e.g., MediaCodec).
      Convert YUV frames to a suitable format (e.g., NV21 or YUV420 semi-planar) before passing them to the encoder.

      I hope the information may helps you.

      D 1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        In addition, are you using QtQuick or widgets for your application ?

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • D Dennisleon

          @Bonty said in How to play YUV format camera in camera application?:

          Hi,

          I am working application based on camera having format only YUV-420-P. Other camera are working fine in camera application but YUV is very slow in application. Is it possible to change format or add encoder to the streaming video>

          Hello,

          When working with YUV format camera data, there are a few considerations to keep in mind. Let’s explore some relevant information:

          YUV Format:
          YUV is a color space that separates brightness (luma, Y) from color information (chroma, U and V).
          YUV420 (also known as YCbCr 4:2:0) is a common YUV format used in video compression and transmission.
          In YUV420, the chroma channels (U and V) are subsampled, resulting in reduced data size compared to RGB.

          Performance Issues:
          You mentioned that YUV is slow in your application. This could be due to various factors:
          Processing Overhead: YUV data requires additional processing steps to convert it to RGB for display.
          ImageReader Configuration: Ensure that the ImageReader you’re using is configured correctly for YUV420 format.
          Frame Size: Larger frame sizes may impact performance.
          Device-Specific Limitations: Different devices may handle YUV data differently.

          Camera2 API and ImageReader:
          The Android Camera2 API provides more control over camera features and better performance compared to the old Camera API.
          To work with YUV data using Camera2, follow these steps:
          Create an ImageReader with the desired format (e.g., YUV_420_888).
          Set up a CameraCaptureSession and configure it to receive frames from the camera.
          Process the YUV frames in the ImageReader.OnImageAvailableListener.

          Optimizations:
          To improve performance:
          Use a lower resolution (e.g., 640x480) to reduce processing load.
          Consider using hardware acceleration (e.g., OpenGL) for YUV to RGB conversion.
          Profile your code to identify bottlenecks.

          Encoder:
          If you want to encode the YUV frames (e.g., for streaming), consider using a video encoder (e.g., MediaCodec).
          Convert YUV frames to a suitable format (e.g., NV21 or YUV420 semi-planar) before passing them to the encoder.

          I hope the information may helps you.

          D Offline
          D Offline
          Dennisleon
          wrote on last edited by
          #4

          @Dennisleon said in How to play YUV format camera in camera application?:

          @Bonty said in How to play YUV format camera in camera application?:

          Hi,

          I am working application based on camera having format only YUV-420-P. Other camera are working fine in camera application but YUV is very slow in application. Is it possible to change format or add encoder to the streaming video>

          Hello,

          When working with YUV format camera data, there are a few considerations to keep in mind. Let’s explore some relevant information:

          YUV Format:
          YUV is a color space that separates brightness (luma, Y) from color information (chroma, U and V).
          YUV420 (also known as YCbCr 4:2:0) is a common YUV format used in video compression and transmission.
          In YUV420, the chroma channels (U and V) are subsampled, resulting in reduced data size compared to RGB.

          Performance Issues:
          You mentioned that YUV is slow in your application. This could be due to various factors:
          Processing Overhead: YUV data requires additional processing steps to convert it to RGB for display.
          ImageReader Configuration: Ensure that the ImageReader you’re using is configured correctly for YUV420 format.
          Frame Size: Larger frame sizes may impact performance.
          Device-Specific Limitations: Different devices may handle YUV data differently.

          Camera2 API and ImageReader:
          The Android Camera2 API provides more control over camera features and better performance compared to the old Camera API. HealthInsuranceMarket
          To work with YUV data using Camera2, follow these steps:
          Create an ImageReader with the desired format (e.g., YUV_420_888).
          Set up a CameraCaptureSession and configure it to receive frames from the camera.
          Process the YUV frames in the ImageReader.OnImageAvailableListener.

          Optimizations:
          To improve performance:
          Use a lower resolution (e.g., 640x480) to reduce processing load.
          Consider using hardware acceleration (e.g., OpenGL) for YUV to RGB conversion.
          Profile your code to identify bottlenecks.

          Encoder:
          If you want to encode the YUV frames (e.g., for streaming), consider using a video encoder (e.g., MediaCodec).
          Convert YUV frames to a suitable format (e.g., NV21 or YUV420 semi-planar) before passing them to the encoder.

          I hope the information may helps you.

          Hello,

          No, I am not using QtQuick or any kind of widget for my application. Thanks for the best response.

          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