3 Replies Latest reply on Oct 7, 2016 7:41 AM by shotts@adobe

    How to upload video super fast?


      Hi there. I'm building an app that will upload video and image. The image performs fine but video struggle and becomes super slow. On small resolutions it performs better but not acceptable. It should work well with high resolution videos uploading it fast.


      I'm using Cloudinary to host the content. Is there any trick on phonegap side to improve the upload time?

      It takes the same time of youtube to upload content but it might be better than. Any idea? Any help? Any suggestion? Code snippet


                    }, // error cb
                    function(err){/*alert(err);*/console.log('error')}, // error cb
                        fileUri: fileURI, // the path to the video on the device
                        outputFileName: that.guid(), // the file name for the transcoded video
                        outputFileType: VideoEditorOptions.OutputFileType.MPEG4, // android is always mp4
                        optimizeForNetworkUse: VideoEditorOptions.OptimizeForNetworkUse.YES, // ios only
                        saveToLibrary: true, // optional, defaults to true
                         deleteInputFile: false, // optional (android only), defaults to false
                         maintainAspectRatio: true, // optional (ios only), defaults to true
                         width: 640, // optional, see note below on width and height
                         height: 640, // optional, see notes below on width and height
                         videoBitrate: 1000000, // optional, bitrate in bits, defaults to 1 megabit (1000000)
                         fps: 24, // optional (android only), defaults to 24
                         audioChannels: 2, // optional (ios only), number of audio channels, defaults to 2
                         audioSampleRate: 44100, // optional (ios only), sample rate for the audio, defaults to 44100
                         audioBitrate: 128000, // optional (ios only), audio bitrate for the video in bits, defaults to 128 kilobits (128000)
                        progress: function(info) {} // info will be a number from 0 to 100


              var ft = new FileTransfer();
                encodeURI("https://api.cloudinary.com/v1_1/mybucket/" + type + "/upload"),
                    cordovaHTTP.post(backend, {data: data["response"]}, {}, function(response) { }, function(response) { alert(response.error) })


      Please I need to upload a video as fast as image. I know that's impossible but I think you got the idea.

        • 1. Re: How to upload video super fast?
          shotts@adobe Adobe Employee

          You can't upload video any faster than your bandwidth and the bandwidth of the receiving site allows. The longer, larger, and higher quality a video is, the longer it will take to upload (this is why you provide progress indicators and great error handling in case of failure). You will need to determine the resolution and quality that meets your needs without being onerous to upload. Regardless of all that, if the bandwidth at any point along the route to your target is limited, you'll be limited to those upload speeds, and there's no way around that.


          Lastly, it's possible that the host (... or maybe your ISP) is throttling you depending upon usage or due to a misconfiguration. That's out of our scope, unfortunately, since you'd need to address any issues with your host/ISP.

          • 2. Re: How to upload video super fast?
            faustot4544220 Level 1

            Could I improve it? Somehow upload video in realtime if bandwith is good .  My concerns is not about bandwith that is somethng I can improve I'm lookin to something I can improve.

            • 3. Re: How to upload video super fast?
              shotts@adobe Adobe Employee

              You improve upload speeds by doing the following:

              • Reduce the bitrate -- however, this will reduce video quality, so you can either have a low bitrate, fast(er) upload, and really compressed video with a lot of artifacts, or you can have a high bitrate, slow(er) upload, and great looking video. Usually you'll end up somewhere in the middle unless your needs are otherwise.
              • Reduce the video resolution -- the lower the resolution, the smaller the video files. Of course, this doesn't look very good when shown on larger screens, so again, you'll end up compromising somewhere.


              As for uploading in realtime ... Are you trying to stream video to a cloud service? In which case, I don't think this particular plugin set is going to do you any favors since you can only upload a video once it is done. The file transfer plugin will upload as fast as it can within the limits of the network and all the hosts along the route to your target. Live streaming would require variable bit rates, bandwidth detection (and adjusting those bit rates as necessary, which may cause artifacting), and a streaming upload. Maybe there's a plugin that does that, but if not, you'd have to write one yourself.


              Video is big. It can be mind-numbingly big. It's not like an image or audio file. Compound that with the fact that most users will have slower upload speeds than download speeds, and uploading good quality video is going to be a problem with no great solution. Also, don't forget that if your user is on a cellular network, then you need to be VERY mindful about how much data you upload in the first place -- in fact, I'd suggest not allowing video uploads greater than, say, 250MB on a cell network in the first place unless the user consents that they understand they may run over their allotted data plan.