×

Discussion Board

Results 1 to 12 of 12

Hybrid View

  1. #1
    Registered User
    Join Date
    Jan 2011
    Posts
    192

    Question Problem saving a video from an http request

    Hi ,

    I have a problem when downloading a video. It can't be played on Symbian 3 devices. it's downloaded with the same size, but when i go to the video to play it , i got the following error :
    "Unable to play. File corrupted or format not supported."
    I am using the below code.
    Code:
        QNetworkAccessManager *nam;
        nam = new QNetworkAccessManager(this);
        connect(nam, SIGNAL(finished(QNetworkReply*)), this, SLOT(downloadvideo(QNetworkReply*)));
        nam->get(QNetworkRequest(QUrl("http://......./1.mp4")));
    
    void MainWindow::downloadvideo(QNetworkReply *httpmsg)
    {
        if (httpmsg->error() == QNetworkReply::NoError)
        {
            QByteArray byteshttpx = httpmsg->readAll();
    
            QByteArray sic2;   // i can remove those 2 lines, but 
            sic2+=byteshttpx; // some websites said that some image problem can be solved by this
    
            QString filename;
            filename= "C:\\data\\videos\\1.mp4";
            QFile file1(filename);
            if (file1.open(QIODevice::WriteOnly))
            {
                file1.write(sic2);
                file1.close();
            }
        }
    }
    Anyone can help me in this issue ????

    Best Regards,
    Lipos123

  2. #2
    Registered User
    Join Date
    Jan 2011
    Posts
    192

    Re: Problem saving a video from an http request

    I forgot to tell you that if i copy the video from my N8 to my desktop, it works well on the laptop.

  3. #3
    Registered User
    Join Date
    Jan 2011
    Posts
    192

    Re: Problem saving a video from an http request

    May any expert or champion help in this issue please....

  4. #4
    Registered User
    Join Date
    Jan 2009
    Location
    Melbourne, Australia
    Posts
    2,571

    Re: Problem saving a video from an http request

    I don't count as an expert, but can you play the file though the gallery or videos apps on the device. It may be that the file is corrupted or not a supported format.

  5. #5
    Registered User
    Join Date
    Jan 2011
    Posts
    192

    Re: Problem saving a video from an http request

    Quote Originally Posted by hamishwillee View Post
    I don't count as an expert, but can you play the file though the gallery or videos apps on the device. It may be that the file is corrupted or not a supported format.
    The file isn't playing in the gallery, neither in the video apps. But when I copy the file on the laptop, it works fine. so I think maybe it's an encoding issue. donno

  6. #6
    Registered User
    Join Date
    Jan 2009
    Location
    Melbourne, Australia
    Posts
    2,571

    Re: Problem saving a video from an http request

    Quote Originally Posted by lipos123 View Post
    The file isn't playing in the gallery, neither in the video apps. But when I copy the file on the laptop, it works fine. so I think maybe it's an encoding issue. donno
    That would be my guess. If you wanted to debug further you could start from a file you know plays on device to confirm your download code. I don't know much about encoding formats, but the obvious information about what is supported is in the multimedia section here http://www.developer.nokia.com/Devic...cations/N8-00/

Similar Threads

  1. Http request problem!
    By rekha2103 in forum Mobile Java Networking & Messaging & Security
    Replies: 8
    Last Post: 2011-03-09, 07:02
  2. HTTP request problem
    By Asif Nazir in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2008-04-09, 09:28
  3. Replies: 1
    Last Post: 2006-08-24, 15:37
  4. Http get request problem
    By white_dragon in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2004-12-08, 10:08

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×