Results 1 to 5 of 5

Thread: Video Stream Over UDP

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

    Default Video Stream Over UDP

    i'm workin on client - server video capturing and displaying application.. .my client capture the video via webcam then send it to the server over WLAN via UDP, then the server display the captured video stream continously (real - time).. i have made a simple client - server application using QUdpsocket. but the problem now is to put the video stream into the socket.. any suggestion ?

    here is the udp client - server code that i developed :
    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 

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

    Default Re: Video Stream Over UDP

    Break it down. How are you encoding the video stream for transfer? Are you using MPEG compression? MJPEG? Raw images? Take each frame and send it to the server and then re-assemble at the server side. Note that the server will need to know the expected sizes when receiving.

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

    Default Re: Video Stream Over UDP

    this is my problem too.. how can we implement the MPEG compression in Qt ? what class should i use ?

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

    Default Re: Video Stream Over UDP

    There isn't one as far as I know, you'll need to find an appropriate C++ class to do it for you.

  5. #5
    Join Date
    Feb 2011
    Posts
    64
    Thanks
    16
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Video Stream Over UDP

    There a outdated tutorial about using ffmpeg but it is still useful

  6. The following user says thank you to SIFE for this useful post:

    bajoelkid12 (1st June 2011)

Similar Threads

  1. Replies: 0
    Last Post: 17th March 2011, 19:38
  2. Saving video stream
    By frknml in forum Qt Programming
    Replies: 0
    Last Post: 13th December 2010, 08:10
  3. Live stream for Phonon video widget
    By Leolander in forum Qt Programming
    Replies: 0
    Last Post: 1st March 2010, 06:05
  4. How can we convert video stream to QPixmap?
    By learning_qt in forum Qt Programming
    Replies: 1
    Last Post: 9th September 2008, 23:44
  5. Video Stream, extending QIODevice
    By rextr in forum Qt Programming
    Replies: 3
    Last Post: 27th June 2008, 08:55

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.