vimeo-dot-net icon indicating copy to clipboard operation
vimeo-dot-net copied to clipboard

Upload file chunk error

Open talpro6370 opened this issue 3 years ago • 8 comments

Hey, I get this error when trying to upload files. Is there any explanation and a solution for this error? Thanks @mfilippov Tal

talpro6370 avatar Dec 31 '21 05:12 talpro6370

@talpro6370 Is it a stable reproducible issue?

mfilippov avatar Jan 12 '22 06:01 mfilippov

I have experienced the same issue.

I found that it may be from HttpClient timeout because of slow upload speed. I increased chunk size to improve upload speed (Vimeo API page recommends 128~512MB for chunk size), but it causes the issue on slow upload speed environment - a chunk upload is not completed in HttpClient timeout.

I suspect as the followings;

  • Legacy esumeable upload API has been deprecated but it does still work.
  • Vimeo may decrease hardware/network resources for legacy upload API
  • Upload speed at vimeo.com is 50x~100x fast than legacy esumeable upload API - vimeo.com web site uses new API using tus protocol.

503 Service Unavailable error somtimes occurs on uploading as well as Upload file chunk error (Bad request exception).

So. the implementation of new tus upload API will solve both upload error and upload speed issue.

Best regards.

ivoryguard avatar May 26 '22 09:05 ivoryguard

I'm also getting a lot of upload problems. A service not available (503) exception is being thrown when uploading a chunk of the video, this happens more frequently when we are doing parallel uploads from different processes.

We've also found that this SDK seems to be about 50% of the speed of using the Vimeo website a 500MB file for example took 70 seconds to upload on a relatively fast and stable internet connection where as the same file via the Vimeo web uploader took just 35 seconds. I see from the comment about that ivoryguard is suggesting that this SDK is using the legacy API. Is this the case. I see that the Vimeo API is now on v3.4 and this wrapper targets v3.0. Is 3.x the current API or is 3.0 legacy and 3.4 current?

Dame1701 avatar May 26 '22 13:05 Dame1701

On further investigation, you can use this SDK to do a TUS upload. You will need an additional TUS client library, I am using https://github.com/jonstodle/TusDotNetClient. To do the upload with this library use the following code:

// Get you access token in the usual way then.....
VimeoClient Client = new VimeoClient(AccessToken);

FileInfo UploadFileInfo = new FileInfo(m_clip.UnderlyingMediaFile.Path);

// Upload using TUS
var TUSTicket = await m_client.GetTusResumableUploadTicketAsync(UploadFileInfo.Length, m_clip.Title);
  
if (TUSTicket !=null)
{
TusDotNetClient.TusClient TusClient = new TusDotNetClient.TusClient();
                                var UploadOperation = TusClient.UploadAsync(TUSTicket.Upload.UploadLink, UploadFileInfo, ((double)ChunkSize / 1000000), m_uploadCTS.Token); // Meed to sort the chunk size....
                                UploadOperation.Progressed += TUSOperation_Progressed;
                                await UploadOperation;

                                // Update the metadata
                                await UpdateMetadataAsync((long)TUSTicket.Id);
                            }

Dame1701 avatar May 27 '22 08:05 Dame1701

Thank you @Dame1701 I changed legacy upload API to new TUS upload API using TusDotNetClient and solved the issue with 10~20x fast upload speed.

ivoryguard avatar May 30 '22 06:05 ivoryguard

I will investigate this issue.

mfilippov avatar May 30 '22 06:05 mfilippov

Any info on when this SDK will support TUS uploads natively? The cutoff for the old upload method is Jan 31 2023, so it would be awesome if we could implement it and test well before that.

duckwaffle avatar Aug 19 '22 02:08 duckwaffle

@duckwaffle I hope I will fix it.

mfilippov avatar Aug 25 '22 11:08 mfilippov

Any update on this issue?

GoncaloBastos avatar Jan 19 '23 11:01 GoncaloBastos

I released version 3.0.0 with TUS upload support.

mfilippov avatar Apr 09 '23 19:04 mfilippov