livepeer / file-video

https://file.video
79 stars 14 forks source link

Speed up video upload times #15

Open adamsoffer opened 4 years ago

adamsoffer commented 4 years ago

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 commented 4 years ago

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

geebotron commented 4 years ago

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.)

rajgoesout commented 4 years ago

Looking into it.

rajgoesout commented 4 years ago

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

geebotron commented 4 years ago

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.

rajgoesout commented 4 years ago

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?

geebotron commented 4 years ago

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

rajgoesout commented 4 years ago

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

geebotron commented 4 years ago

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

rajgoesout commented 4 years ago

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

geebotron commented 4 years ago

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 commented 4 years ago

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

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.

rajgoesout commented 4 years ago

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