Page 2 of 2 FirstFirst 12
Results 21 to 29 of 29

Thread: Webcam Video Capture

  1. #21
    Join Date
    May 2011
    Location
    Indonesia, Surabaya
    Posts
    24
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Webcam Video Capture

    accept the video stream then display it

  2. #22
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Webcam Video Capture

    If you are designing the server as well as the client, then I would recommend TCP, otherwise you need to know which the server supports.

  3. The following user says thank you to squidge for this useful post:

    bajoelkid12 (30th May 2011)

  4. #23
    Join Date
    May 2011
    Location
    Indonesia, Surabaya
    Posts
    24
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Webcam Video Capture

    thank you for the suggestion squide. may i ask another suggestion ?

    here is my program.

    at the client side, the program captures video the transmit it via wlan to the server side.

    at the server side, the program plays the video.

    i have the source code for the capturing stuff and play the video stuff. but i'm stuck with the client - server video transfer stuff.

    thanks in advance

  5. #24
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Webcam Video Capture

    So what is the question? You do not know how to use QTCPSocket?

  6. #25
    Join Date
    May 2011
    Location
    Indonesia, Surabaya
    Posts
    24
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Webcam Video Capture

    use QUdpSocket.. .i have a made a simple client server class.. the problem how to put my stream into the socket.. here is my client - server class

    Qt Code:
    1. #include "jcxudp.h"
    2.  
    3. jcxUDP::jcxUDP(QObject *parent) :
    4. QObject(parent)
    5. {
    6. socket = new QUdpSocket(this);
    7. socket->bind(QHostAddress::LocalHost,5678);
    8. connect(socket,SIGNAL(readyRead()),this,SLOT(SiapBaca()));
    9. }
    10.  
    11. void jcxUDP::NulisHallo()
    12. {
    13. QByteArray Data;
    14. Data.append("halo dari jincheng");
    15. socket->writeDatagram(Data,QHostAddress::LocalHost,5678);
    16. }
    17.  
    18. void jcxUDP::SiapBaca()
    19. {
    20. QByteArray Buffer;
    21. Buffer.resize(socket->pendingDatagramSize());
    22.  
    23. QHostAddress sender;
    24. quint16 senderPort;
    25. socket->readDatagram(Buffer.data(),Buffer.size(),&sender,&senderPort);
    26.  
    27. qDebug() << "Pesan Dari :" << sender.toString();
    28. qDebug() << "Port Pesan :" << senderPort;
    29. qDebug() << "Pesan :" << Buffer;
    30. }
    To copy to clipboard, switch view to plain text mode 

  7. #26
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Webcam Video Capture

    Sorry to interrupt, but this is getting a little off topic
    @bajoelkid12: I suggest you create new thread about your socket problems, "Webcam Video Capture" no longer describes this thread correctly. Imagine someone searching the forum in the future for video capturing problems, ending up on some sort of server code

  8. The following user says thank you to stampede for this useful post:

    bajoelkid12 (31st May 2011)

  9. #27
    Join Date
    May 2011
    Location
    Indonesia, Surabaya
    Posts
    24
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Webcam Video Capture

    ahh.. thanks a lot Stampede i'll create a new thread then

  10. #28
    Join Date
    Jul 2011
    Posts
    1
    Qt products
    Platforms
    Windows

    Default Re: Webcam Video Capture

    You guys can use Screen Recording Suite to help you record video from webcam.

  11. #29
    Join Date
    Jun 2010
    Posts
    102
    Thanks
    3
    Qt products
    Qt4 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Webcam Video Capture

    Quote Originally Posted by bajoelkid12 View Post
    actually yes.. i have some problems with using OpenCV in my code.. this is what i've done so far..

    mycamerawindow.cpp
    Qt Code:
    1. #include "MyCameraWindow.h"
    2.  
    3. MyCameraWindow::MyCameraWindow(CvCapture *cam, QWidget *parent) : QWidget(parent) {
    4. camera = cam;
    5. QVBoxLayout *layout = new QVBoxLayout;
    6. cvwidget = new QOpenCVWidget(this);
    7. layout->addWidget(cvwidget);
    8. setLayout(layout);
    9. resize(500, 400);
    10.  
    11. startTimer(100); // 0.1-second timer
    12. }
    13.  
    14. void MyCameraWindow::timerEvent(QTimerEvent*) {
    15. IplImage *image=cvQueryFrame(camera);
    16. cvwidget->putImage(image);
    17. }
    To copy to clipboard, switch view to plain text mode 

    i get this code from http://qt-apps.org/content/show.php/...?content=89995

    btw thank you for the algorithm, now i'll try to implement it to my code.. but if you don't mind, may i send my project file to you ?
    if you use your code, you cant record with audio, how to record video with audio use OpenCV ???
    Contact: Skype: sonnh89
    Yahoo: nhs_0702@yahoo.com

    Liên hệ SKype: sonnh89

Similar Threads

  1. How to get video streaming from USB webcam
    By sanket.mehta in forum Qt Programming
    Replies: 4
    Last Post: 15th July 2011, 06:45
  2. capture iamge form webcam
    By bibhukalyana in forum Newbie
    Replies: 8
    Last Post: 29th April 2011, 09:43
  3. capture video from DV camera
    By ekkondela in forum Newbie
    Replies: 1
    Last Post: 7th March 2010, 09:38
  4. Replies: 3
    Last Post: 5th July 2009, 17:22
  5. synchronise QLabel display and webcam capture
    By fbmfbm in forum Qt Programming
    Replies: 2
    Last Post: 24th February 2009, 11:10

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.