PhotoBackup / client-android

The Android PhotoBackup client, made to free your pictures from your device
https://photobackup.github.io/
GNU General Public License v2.0
48 stars 15 forks source link

Not backing up video #4

Closed mr337 closed 7 years ago

mr337 commented 9 years ago

Checking out the project and looking for something to upload videos and pictures as I take them. Any reason video backup isn't supported? I consider my videos as important as my photos :)

stephanepechard commented 9 years ago

It's on my TODO list, but it is not that easy. Videos are commonly bigger than pictures, therefore need fancy upload with resume handling, both on client and server sides.

psychedelys commented 9 years ago

@stephanepechard: do you have aready any pointers on how to implement it? Do you need any help on this topic?

mr337 commented 9 years ago

I too would like to pitch in, but don't really know where to start as I think you already have something in mind. I was thinking of doing something simple as split file into X byte chunks and notify the server how many pieces and start shipping them over etc.

If you have an overview of what you would like to see I'd def be interested.

stephanepechard commented 8 years ago

@psychedelys @mr337 Thanks for your help. Here are my thoughts on the topic.

Obviously, you need several requests to get it done. I don't know HTTP enough to be sure if such multi-requests file sending is handled gracefully by the protocol but I don't think so. Maybe we can add a specific header to help us in the process, but nothing more probably. Of course, we'll need the state of the uploaded file, but we can stick with the answer of each received chunks.

As @mr337 proposed, the simplest would probably be to split the file in chunks. I was first thinking of sending the file in a whole at first, with the server writing simultaneously, then letting the request die, then resume it starting where the file stopped... But I don't think it would be the smartest idea after all :-1:

What we need now is to modify both clients and servers to handle this. I already know how to detect a new video taken on Android, so that part is covered. As I see it, the task would be, in order:

  1. update the API with a new version defining all of this ;
  2. write a compatibility matrix with the API versions for all the clients and servers we now have :-) ;
  3. update the clients (Python and Android) to stick to the new version of the API ;
  4. update the servers (Python, Node, Perl, Go) to stick to the new version of the API, in collaboration with their maintainers ;
  5. update the official website (and yes, it would still be called PhotoBackup anyway :-) ) ;
  6. make some buzz for it ;-)

What do you think about this? Did I forget anything? What part(s) would you take in charge?

stephanepechard commented 8 years ago

I forgot to mentioned that the writer of the new Go server implementation made some very interesting improvements over my humble Python one. You can read them at: https://github.com/PhotoBackup/server-go

It would probably be better to add some of them before hacking such a functionality. Again, tell me what you think about it.

lsowen commented 8 years ago

@stephanepechard have you thought any more about how you would want to implement this? I would definitely be willing to pitch in.

I was thinking about something like POST to a url to get a resource URL with the full file size, then PUT all the different slices of the file to that URL until the full file is uploaded. The drawback of this is it will greatly increase the complexity of the server implementations.

Thoughts?

mr337 commented 8 years ago

I have been kicking around some ideas, but would anyone be opposed to just shooting the entire video up for now to get video uploading working. Then start bringing smarter features like resume, chunking, etc.

lsowen commented 8 years ago

@mr337 That sounds like a good idea. What is the old adage, something like perfect is the enemy of good (enough).

mr337 commented 8 years ago

@lsowen HA! agree with that, I've also heard it called "perfect paralyzation "

zealot128 commented 8 years ago

I also would like a video upload. Right now I am using another App, AutoShare for this (This app also doesn't upload video automatically, but at least I can upload any media from the gallery as Intent). So far, I didn't have to many problems with video sizes. Most videos are 10..100mb and failures are very rare.

I agree with @mr337, "stupid" upload would be suffice for the beginning?

stephanepechard commented 7 years ago

Done in version 0.11 in the "stupid" version (no chunks for the moment). Will work on that next!