Results 1 to 5 of 5

Thread: Avi File Class

  1. #1
    Join Date
    Aug 2008
    Posts
    17
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Question Avi File Class

    Hi..
    i want to do an easy screen recorder. But i can't create avi file. i think if i create an avi file i can add an pixmap or png file to avi file. i am trying windows avi file but it works for mfc but dont work with Qt. is there any solution for this problem. Or sample code. i couldnt find.

    is there any alternative solution for screen record api, i can try.

    please help me.. this problem make me crazy.

    thanks...

  2. #2
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 163 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Avi File Class

    reading the docs does help sometimes: desktop-screenshot

  3. #3
    Join Date
    Jul 2008
    Posts
    69
    Thanks
    9
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Avi File Class

    an idea:

    use screenshot to take a number of pictures every 0.5sec or less

    then use
    Qprocess with mencoder to transform the images into an .avi file

    Qt Code:
    1. QProcess *mencodeProcess = new QProcess(this);
    2. mencodeProcess->setWorkingDirectory("C:/JPG");
    3. QString program = "C:/JPG/mencoder";
    4.  
    5. arg << "mf://*.jpg" << "-mf" << "w=800:h=600:fps=25:type=jpg" << "-ovc"
    6. << "lavc" << "-lavcopts" << "vcodec=mpeg4" << "-oac" << "copy"
    7. << "-o" << "a.avi";//tested worked fine
    8.  
    9.  
    10. mencodeProcess->start(program, arg);
    11. QString msg;
    12. if (!mencodeProcess->waitForFinished(1000))
    13. msg = "Mencoder failed:" + mencodeProcess->errorString();
    14. else
    15. msg = "Mencoder output:" + mencodeProcess->readAll();
    16. qDebug() << msg;
    To copy to clipboard, switch view to plain text mode 

    I use this little code before to transform a sequence of jpg to an video .avi
    Last edited by SunnySan; 10th November 2008 at 12:06.

  4. #4
    Join Date
    Aug 2008
    Posts
    17
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Avi File Class

    so thank you...
    mencoder works...

    its work but i have another problem now.

    i couldn't capture screen with mouse, is there any way?

    Or can i draw a mouse arrow at event.x() and event.y() position on captured QPixmap?

  5. #5
    Join Date
    Aug 2008
    Posts
    17
    Thanks
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Avi File Class

    can i record screen realtime?

    for example i grab screen as a Pixmap or image and add to created avi file it.

    create avi file "x"?

    while()
    {
    grabWindow
    add avi file
    }

    like this

Similar Threads

  1. Replies: 1
    Last Post: 25th July 2008, 23:44
  2. class QHBoxLayout
    By csvivek in forum Installation and Deployment
    Replies: 2
    Last Post: 10th April 2008, 07:57
  3. Set up the Qt4.3.2 with Visual Studio 2005
    By lamoda in forum Installation and Deployment
    Replies: 6
    Last Post: 30th January 2008, 06:51
  4. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 15:21
  5. config file class
    By feizhou in forum Qt Programming
    Replies: 2
    Last Post: 23rd November 2006, 07:49

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.