Results 1 to 3 of 3

Thread: Help displaying frames from a webcam to the screen

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Help displaying frames from a webcam to the screen

    You will need to convert the input frame pixel by pixel from YUV( yes, YUV ), to RGB( meaning you store the pixel data to a QImage or QPixmap ).

    Information about conversion formulas you can find here:
    http://en.wikipedia.org/wiki/YUY2,
    http://www.fourcc.org/fccyvrgb.php, and here
    http://www.fourcc.org/fccyvrgb.php.

    First you need to initialize the QImage to the dimensions of the frame, Next you just process the frame starting from the first pixel, and set the RGB data at the corresponding location in the QImage.

    Regards

  2. The following user says thank you to marcel for this useful post:

    stealth86 (29th June 2007)

  3. #2
    Join Date
    Jun 2007
    Posts
    10
    Thanks
    3

    Default Re: Help displaying frames from a webcam to the screen

    Quote Originally Posted by marcel View Post
    You will need to convert the input frame pixel by pixel from YUV( yes, YUV ), to RGB( meaning you store the pixel data to a QImage or QPixmap ).

    Information about conversion formulas you can find here:
    http://en.wikipedia.org/wiki/YUY2,
    http://www.fourcc.org/fccyvrgb.php, and here
    http://www.fourcc.org/fccyvrgb.php.

    First you need to initialize the QImage to the dimensions of the frame, Next you just process the frame starting from the first pixel, and set the RGB data at the corresponding location in the QImage.

    Regards
    Are there any libraries that perform the conversion between YUY2 and RGB that I could just link in?

    nvm: I just found the libavcodec library.
    Last edited by stealth86; 3rd July 2007 at 20:00.

Similar Threads

  1. Replies: 8
    Last Post: 18th March 2011, 11:27

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.