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. Stream video and download it
Forum Updated to NodeBB v4.3 + New Features

Stream video and download it

Scheduled Pinned Locked Moved General and Desktop
9 Posts 4 Posters 4.4k Views 1 Watching
  • 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.
  • Y Offline
    Y Offline
    yazwas
    wrote on last edited by
    #1

    Good day

    is there a way to stream a video from online location and also save the streamed video on the device.

    I've looked on quite few posts, but could not find anything clear, except for this "post":http://web.archiveorange.com/archive/v/LFNfvMaPE2IZQHvr2yq1.

    Any suggestions are welcomed

    Thanks!

    1 Reply Last reply
    0
    • A Offline
      A Offline
      AcerExtensa
      wrote on last edited by
      #2

      Short answer is: - "Yes, there is".
      If you need a little bit more information on how to do that, we need more detailed explanation from you. From which online location? How do you want to play it? Are you using Phonon or 3rd libraries? Do your libraries do the download or should you do it by yourself? Etc...

      God is Real unless explicitly declared as Integer.

      1 Reply Last reply
      0
      • Y Offline
        Y Offline
        yazwas
        wrote on last edited by
        #3

        Ok, here are the details

        1- I have an mp4 video on a webserver, so the mp4 files would mostly be from personal server
        2- when I say play it, I mean view the video, not sure if you mean anything else by that.
        3- I would like to do it using Phonon, no 3rd party libraries
        4- I would prefer to do the download myself as well.
        5- if this can be for mobile phones in the first place, if not possible then for pc's

        Thanks

        1 Reply Last reply
        0
        • A Offline
          A Offline
          AcerExtensa
          wrote on last edited by
          #4

          Subclass "QIODevice":http://qt-project.org/doc/qt-4.8/qiodevice.html and pass it to the Phonon "MediaSource":http://qt-project.org/doc/qt-4.8/phonon-mediasource.html

          In your QIODevice you can also save downloaded data to the file.

          God is Real unless explicitly declared as Integer.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            AcerExtensa
            wrote on last edited by
            #5

            It will work for Desktop and Mobile devices. There is an mediadownloader project on the web, for desktop and Nokia N900. It is opensource. You can take a look how does they have implemented this functionality...

            God is Real unless explicitly declared as Integer.

            1 Reply Last reply
            0
            • Y Offline
              Y Offline
              yazwas
              wrote on last edited by
              #6

              Thanks, very good idea

              I will give it a try and do it.

              1 Reply Last reply
              0
              • D Offline
                D Offline
                deimos
                wrote on last edited by
                #7

                I did that "mediadownloader":https://marcobavagnoli.wordpress.com/mediadownloader-desktop/ app, but it is a bit old and since youtube chaged thing last week, it will not work as it should now. I have updated the sources lately but didn't published yet.
                I reimplemented QIODevice like AcerExtensa said, but only to try to manage remote streams as if they were local files ( with a red buffer like you see on youtube while watching a video ). But it's not working very good.
                With Phonon you can play remote videos using just (I remind you to the "VideoPlayer":http://qt-project.org/doc/qt-4.8/phonon-videoplayer.html doc for more):

                @ VideoPlayer *player = new VideoPlayer(Phonon::VideoCategory, parentWidget);
                player->play(url);@

                To download just use "QNAM":http://qt-project.org/doc/qt-4.8/qnetworkaccessmanager.html and get it. But this is not enough if you want to play youtube videos.

                cheers

                1 Reply Last reply
                0
                • Y Offline
                  Y Offline
                  yazwas
                  wrote on last edited by
                  #8

                  I'm using "mediadownloader":marcobavagnoli.wordpress.com app source code as a base code, but there is one problem when using it with N8. it seems that N8 cant handle opening the same file for read/write simultaneously.
                  on desktop and N9 it works perfect, but with N8 or Symbian^3 in when the media

                  @
                  buffer = new MBbuffer(QUrl(mediaLocation));
                  connect(buffer, SIGNAL(bufferEmptyed()), mediaObject, SLOT(pause()), Qt::DirectConnection );
                  connect(buffer, SIGNAL(bufferReady()), mediaObject, SLOT(play()), Qt::DirectConnection );
                  connect(buffer, SIGNAL(downloadFinished(QString)), this, SLOT(downloadFinished(QString)));

                  mediaObject->setCurrentSource(Phonon::MediaSource(buffer));
                  @

                  When the bufferReady signal is fired, and mediaobject tries to play, the "Cant determine media type" error is popped up

                  but if the i wait till the completion of the download and then try to play the file, it plays correctly.
                  This only happens with Symbian, but on N9, and desktop it works OK!

                  Any suggestion is welcomed!

                  1 Reply Last reply
                  0
                  • C Offline
                    C Offline
                    Camillapluck
                    wrote on last edited by
                    #9

                    maybe "this YouTube video tutorial guide":http://www.youtube.com/watch?v=0srs4kJMahw&feature=youtu.be can help you.

                    1 Reply Last reply
                    0

                    • Login

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