frog0214 / google-gdata

Automatically exported from code.google.com/p/google-gdata
0 stars 0 forks source link

Memory of the process equals the size of the video in direct upload #592

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

Video newVideo = new Video();

                newVideo.YouTubeEntry.MediaSource = new MediaFileSource(new FileStream(Path.Combine(dir, uploadData.FileName),FileMode.Open), Path.Combine(dir, uploadData.FileName), "video/raw");
                Video createdVideo = request.Upload(newVideo);

What is the expected output? What do you see instead?

What I see is that the RAM on the process is going up to the size of the video 
(300mb video). But iam using a Stream instead of a path in MediaFileSource 
constructor. I think is not reading and writing within a buffer.

Please use labels and text to provide additional information.

Original issue reported on code.google.com by acr...@gmail.com on 1 Jun 2012 at 9:01

GoogleCodeExporter commented 8 years ago
Direct upload tries to send the file in a single request, you should use the 
ResumableUploader component instead and split the request into chunks.
The YouTubeUploader sample shows how to use this component:

http://code.google.com/p/google-gdata/source/browse/#svn%2Ftrunk%2Fclients%2Fcs%
2Fsamples%2FYouTubeUploader%253Fstate%253Dclosed

Original comment by ccherub...@google.com on 1 Jun 2012 at 9:05