file-video icon indicating copy to clipboard operation
file-video copied to clipboard

Speed up video upload times

Open adamsoffer opened this issue 4 years ago • 13 comments

As reported by user @geebotron a video only 6.5MB in size takes 2-3 mins to upload. As a user, file upload times should be on par with other video hosting solutions such as https://streamable.com and https://stream.new.

adamsoffer avatar Nov 05 '20 17:11 adamsoffer

@rajdeepbharati any idea what's causing the slow upload time? Is the culprit therb-resumablejs package we're using?

adamsoffer avatar Nov 05 '20 17:11 adamsoffer

The upload stage seems to progress at a reasonable lick. The percentage completion readout progresses responsively. It's always the "finishing up" stage that takes time.

(Or at least - that's how it appears to the front-end user.)

geebotron avatar Nov 05 '20 17:11 geebotron

Looking into it.

rajgoesout avatar Nov 05 '20 17:11 rajgoesout

I just changed the server region, the upload/processing has become fast at my end now. Could you try it out too?

@geebotron Actually in the "finishing up" stage, the video is being transcoded in the livepeer network, so it might take some time (though it shouldn't take 2 minutes).

@adamsoffer You can keep this issue open for now

rajgoesout avatar Nov 05 '20 18:11 rajgoesout

OK - when I successfully used firefox to upload the 6.5MB vid, I was on a Windows laptop. Now I'm using a linux desktop, again firefox - and it's hanging at the "finishing up" stage again. The vid clip is slightly larger - 14 MB.

I opened up the network debugging tools in FF to observe the network interactions on both machines.

On the Windows machine, I noticed a domain: demux.onrender.com This domain seemed to be used in both cases ... BUT ... There was a subdomain of onrender.com that appeared when the successful upload occurred ... something about revproxy ... which NEVER has appeared in the network transactions list when using the hung instance on FF on the Linux machine.

geebotron avatar Nov 05 '20 18:11 geebotron

and it's hanging at the "finishing up" stage again

Could you give an estimate of the time it is taking in "uploading x%" and "finishing up" stages, and whether it is still stuck?

rajgoesout avatar Nov 05 '20 18:11 rajgoesout

Uploading took under a min. Still stuck at "finishing up" now after 15+ mins.

geebotron avatar Nov 05 '20 18:11 geebotron

@geebotron could you share the file that you uploaded (the one which got stuck)?

rajgoesout avatar Nov 05 '20 19:11 rajgoesout

Ah. Sorry I have deleted it that specific file. It was just a minute long clip generated with FFMPEG from a longer movie file.

geebotron avatar Nov 05 '20 20:11 geebotron

It looks like there's some issue transcoding that file. Can you create another clip (using ffmpeg) from that movie file and share?

rajgoesout avatar Nov 06 '20 05:11 rajgoesout

The MP4 files I have used so far have been snippets of longer files recorded off British free-to-air TV. When I get chance I'll create a selection of new snippets of different lengths file sizes and use HD and SD etc. Might be the weekend before I get time.

geebotron avatar Nov 06 '20 09:11 geebotron

Here are three video clips that I used to test the upload.

  • test 1A didn't work - and hung at the "finishing up" stage. The codec is the same as it was broadcast (mp4v, DivX?)
  • test 2 worked - it is an HD TV broadcast using the H264 codec, and required no conversion.
  • test 1B worked This is test 1A converted using FFMPEG to H264 video and AAC audio. The aspect ratio is wrong on the playback on file.video though. If you play the video input file that was uploaded in your browser, the aspect ratio is correct.

These are the switches I used to convert test 1A to test 1B:

-vcodec libx264
-aspect 16:9
-acodec aac 

I think the reason for the hang-ups I noticed before, were due to the codec of the video clips I attempted to upload being the same default codec that was broadcast via UK SD TV - mp4v.

So it seems file.video likes MP4 video, but specifically h264 encoded MP4 video!

Hope this helps.

geebotron avatar Nov 06 '20 22:11 geebotron

Yes, you're right. It currently just supports h264 encoded mp4. We should return a failure in this case. Thanks for reporting the issue.

rajgoesout avatar Nov 07 '20 05:11 rajgoesout