Hi,
I think a nice improvement would be to add an option to resize the videos before you upload, as well as going to the pictures.
I made a change that allows you to do this using ffmpeg, but the solution is too dependent on the operating system and is hard-coded in the source.
I think the best solution would be to add an option to commandline program as "--reszievideo" that let user to choose if resize or not videos, reading which command to use to resize from a config file.
I think also , that this new feature is easy to make.
These are the changes I made to implement the resize video:
And these are the change made in the upload_local_video function
def upload_local_video(self, subAlbum):
name = urllib.quote(self.name, '')
metadata = gdata.photos.VideoEntry()
metadata.title = atom.Title(text=name) # have to quote as certain charecters, e.g. / seem to break it
self.addMetadata(metadata)
shrinkFile = resizeVideo(self.path)
currentFile = self.path
if (shrinkFile is not None):
currentFile = shrinkFile
photo = gd_client.InsertVideo(subAlbum.albumUri, metadata, currentFile, self.type)
if (shrinkFile is not None):
os.remove(shrinkFile)
subAlbum.numberFiles = subAlbum.numberFiles + 1
return photo
How can you see, the only change i made is to add the resizeVideo function and i call him ever before upload video.
The best thing would be to add the option --resize video to the command line and change the function resizeVideo so that it reads the command to use to resize from a configuration file, and perhaps give the user the possibility of choose whether to resize the video only in certain circumstances (for example, files larger than a certain size etc ..)
Thanks for the suggestion. I'm a little sceptical about making the codebase more complex for one user. Perhaps if you keep your own fork for now, and if I get much interest we can look at merging back in?
Hi, I think a nice improvement would be to add an option to resize the videos before you upload, as well as going to the pictures. I made a change that allows you to do this using ffmpeg, but the solution is too dependent on the operating system and is hard-coded in the source. I think the best solution would be to add an option to commandline program as "--reszievideo" that let user to choose if resize or not videos, reading which command to use to resize from a config file. I think also , that this new feature is easy to make. These are the changes I made to implement the resize video:
added the resizeVideo function:
And these are the change made in the upload_local_video function
How can you see, the only change i made is to add the resizeVideo function and i call him ever before upload video.
The best thing would be to add the option --resize video to the command line and change the function resizeVideo so that it reads the command to use to resize from a configuration file, and perhaps give the user the possibility of choose whether to resize the video only in certain circumstances (for example, files larger than a certain size etc ..)