Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. What Widget to use for video playback from Live Stream?

What Widget to use for video playback from Live Stream?

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 3.8k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    CrimsonGT
    wrote on 27 Sept 2012, 11:08 last edited by
    #1

    I am currently porting one of my .NET Projects over to C++ that plays live RTMP/RTSP Streams and have decided to use the Qt Framework for the GUI. I am using the "librtmp" library (used in XBMC/RTMPDump/etc) and it works currently by downloading the individual packets receiving and stuffing them into an .flv file.

    I would instead like to take the packets received and display them in a Video Widget, but am unsure as to what widget to use or how exactly to do this with Qt. Would anyone be able to offer some assistance with this? I really like the looks of the Phonon Multimedia Framework, and am looking over the video player example now, but not sure how I would use the data from librtmp in conjunction with it.

    Here is my C# loop code that grabs the packet data and writes it to a file...

    @ using (FileStream FS = File.Open("C:\teststream.flv", FileMode.Create, FileAccess.Write))
    {
    while (true)
    {
    bytes_read = LibRTMP.RTMP_Read(rtmp, b, b.Length);

                    if (bytes_read == 0)
                    {
                        break;
                    }
    
                    FS.Write(b, 0, bytes_read);
                }
            }@
    
    1 Reply Last reply
    0
    • B Offline
      B Offline
      Beacon11
      wrote on 27 Sept 2012, 13:17 last edited by
      #2

      You might want to take a look at this: http://doc.qt.digia.com/4.8-snapshot/multimedia-videowidget.html .

      Highlights: Use QtMultimedia's QAbstractVideoSurface to paint onto a QWidget.

      1 Reply Last reply
      0
      • C Offline
        C Offline
        CrimsonGT
        wrote on 27 Sept 2012, 20:28 last edited by
        #3

        Thank you, that does look like a solid option. The Phonon Multimedia Player and the QAbstractionVideoSurface could both potentially work perfect for my needs.

        I am still at a loss on how to play the byte stream that I am receiving into either of these though. Do you have any idea how I could go about feeding that data into one of these widgets as opposed to stuffing it into an FLV file?

        1 Reply Last reply
        0
        • B Offline
          B Offline
          Beacon11
          wrote on 28 Sept 2012, 14:34 last edited by
          #4

          I'd say phonon is a bit heavy for what you want. Seriously, look at that example. It shows you exactly how to do what you want. Look at the VideoPlayer::presentImage() function.

          1 Reply Last reply
          0

          1/4

          27 Sept 2012, 11:08

          • Login

          • Login or register to search.
          1 out of 4
          • First post
            1/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved