Results 1 to 4 of 4

Thread: Video

  1. #1
    Join Date
    Mar 2007
    Location
    Bangalore
    Posts
    21
    Thanks
    1
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Video

    Hi,
    I have an application which uses webcam and i need to capture the image and display the image continuosly in a window.I am able to capture the image and m getting the buffer which has the image data.Now how will i display this data in a window???presently i am using QImage,but the quality of the image is very bad.Any help is appreciated.Thanks in advance...

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Video

    What does it mean that image quality is bad ??
    are u displaying the image in the same resolution as it i aptured ? whats the resolution of the camera ?

  3. #3
    Join Date
    Mar 2007
    Location
    Bangalore
    Posts
    21
    Thanks
    1
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: Video

    In the sense i get a feeling of viewing the negative of a film...resolution of the cam is 352x288,the camera works fine with xawtv and gqcam.I am using the same resolution to display the image.

  4. #4
    Join Date
    Mar 2007
    Location
    Bangalore
    Posts
    21
    Thanks
    1
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: Video

    I am using Qt 3.3.6 version and here is the code:

    This is video capture loop:


    void Video::captureloop()
    {
    unsigned char *raw_buf;
    img = new QImage(352, 288, 32, 0, QImage::IgnoreEndian);
    while(1)
    {
    raw_buf = read_test(0); ////////This function fetches fresh frames and returns the buffer pointer having the image data////////

    memcpy(img->bits(), raw_buf, 304128);
    update();
    }
    }

    This is paint event function:

    void Video:aintEvent( QPaintEvent * )
    {
    QPainter paint( this );
    if ( img )
    {
    paint.drawImage(0, 0, *img, 0, 0, -1, -1, 0 );
    }
    }

Similar Threads

  1. [SOLVED] DirectShow Video Player Inside Qt
    By ToddAtWSU in forum Qt Programming
    Replies: 16
    Last Post: 3rd November 2011, 07:47
  2. To make audio and video file player in Qt
    By merry in forum Qt Programming
    Replies: 11
    Last Post: 24th January 2008, 06:31
  3. Video streaming on QMainWindow
    By yagabey in forum Qt Programming
    Replies: 3
    Last Post: 13th January 2008, 17:15
  4. Simulating Video on QLabel or QGraphicsView
    By forrestfsu in forum Qt Programming
    Replies: 9
    Last Post: 21st March 2007, 10:39
  5. Video and QSlider
    By ToddAtWSU in forum Qt Programming
    Replies: 2
    Last Post: 1st May 2006, 19:37

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.