Results 1 to 2 of 2

Thread: Qt + OpenCV : Ghost process when using cvCreateVideoWriter in a QThread

  1. #1
    Join Date
    Mar 2011
    Posts
    5
    Qt products
    Qt4
    Platforms
    Windows

    Default Qt + OpenCV : Ghost process when using cvCreateVideoWriter in a QThread

    I have a strange behavior.
    My program saves video using openCV. On the developpment PC ( WinXP ), the programs runs correctly, moving my videoWriter to a QThread helps a lot in performance gain.
    When I run it on a laptop, still on WinXP ( same SP ), I get a ghost process in the Windows task manager after exiting the program.
    After tons of tests, I've isolated the faulty line :
    Qt Code:
    1. mVideoWriter = cvCreateVideoWriter(filename.toUtf8(), CV_FOURCC('X','V','I','D'), mFps, size);
    To copy to clipboard, switch view to plain text mode 
    Commenting it removes the ghost process when the program exits.
    The really strange behavior is that this line is only called when I hit the "Record" button. So I can have the ghost process even if the line isn't reached by the program.
    It seems that there is a kind of static object created by the compiler that is not released when using a QThread but it's been days I'm searching for it.

    Any help would be helpfull !

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 418 Times in 411 Posts

    Default Re: Qt + OpenCV : Ghost process when using cvCreateVideoWriter in a QThread

    The really strange behavior is that this line is only called when I hit the "Record" button.
    I take it that this is the way you meant the code to run, did you check to make sure?
    Put a break point on the line, run the application, and see if the break point does not get caught.
    Or put a message box there, if you want to try it without a debugger.
    Also, search the code for other instances of cvCreateVideoWriter(), or you still might be wrong by thinking this is the problem.
    Did you check (and how?) to make sure your worker thread actually does terminate?
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. OpenCV + QT4
    By thereisnoknife in forum Qt Programming
    Replies: 6
    Last Post: 8th March 2013, 06:19
  2. Replies: 2
    Last Post: 7th June 2011, 09:24
  3. JAI vs. OpenCV vs. ITK
    By tpieciak in forum General Programming
    Replies: 0
    Last Post: 8th July 2009, 14:45
  4. How to communicate Qt Process with non-qt process
    By nrabara in forum Qt for Embedded and Mobile
    Replies: 9
    Last Post: 15th February 2009, 22:01
  5. Replies: 4
    Last Post: 26th June 2008, 19:41

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.