×

Discussion Board

Results 1 to 12 of 12
  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
    Super Contributor
    Join Date
    Jan 2009
    Location
    Melbourne, Australia
    Posts
    2,578

    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
    Super Contributor
    Join Date
    Jan 2009
    Location
    Melbourne, Australia
    Posts
    2,578

    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/

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

    Re: Problem saving a video from an http request

    Quote Originally Posted by hamishwillee View Post
    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/
    I already tried downloading some videos that works well on the device, and the result was that some WMV videos are downloaded and opened well, but the others formats like "mp4, 3GPP..." are not working.
    Really it's a big problem that I need to solve, and I'm not finding any solution. it's been 1 week since i wrote this post and no one is able to help me in this issue. Do you guess it's a bug that I should report ?

  8. #8
    Super Contributor
    Join Date
    Jan 2009
    Location
    Melbourne, Australia
    Posts
    2,578

    Re: Problem saving a video from an http request

    Can the device play a file it has generated if downloaded and played from your server? If so, then this is definitely and issue with the format of the files you're trying to download.
    Quote Originally Posted by lipos123 View Post
    Do you guess it's a bug that I should report ?
    I don't know enough about the area to assess this - but I'd verify the above point before posting in either case.

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

    Re: Problem saving a video from an http request

    Quote Originally Posted by hamishwillee View Post
    Can the device play a file it has generated if downloaded and played from your server? If so, then this is definitely and issue with the format of the files you're trying to download.

    I don't know enough about the area to assess this - but I'd verify the above point before posting in either case.
    So it's a format issue since I downloaded audio files and images using the same algorithm without any error.
    I am stuck and don't know what to do now :S

  10. #10
    Registered User
    Join Date
    Nov 2011
    Posts
    80

    Re: Problem saving a video from an http request

    .MP4 is just a container. If you create the files by yourself, you have to use a compatible codec with compatible settings. If the files are from a 3rd party place, you have to convert them.
    Maybe you can check first what exactly is in the MP4 container of the non working videos and post the exact format here for further help.

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

    Re: Problem saving a video from an http request

    I have downloaded a 3rd party software that encode the video into H264 and copy it to my device(it works fine), and then I have put the video encoded on the server and try to download it and it works fine.
    So I think it's an H264 encoding. I have surfed the web and didn't find how to encode the video using qt c++ libraries, So I will search how to encode the video on the server side.
    Note that the problem is not solved in a proper way.

    Thanks all for your help.

  12. #12
    Registered User
    Join Date
    Nov 2011
    Posts
    80

    Re: Problem saving a video from an http request

    I think transcoding a video on the phone isn't very useful, because it would take ages to finish, because of the very limited processing power.
    To transcode it on a server, have a look to FFmpeg.

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
  •