{"action":"created","issue":{"url":"https://api.github.com/repos/leocrawford/picasawebsync/issues/37","repository_url":"https://api.github.com/repos/leocrawford/picasawebsync","labels_url":"https://api.github.com/repos/leocrawford/picasawebsync/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/leocrawford/picasawebsync/issues/37/comments","events_url":"https://api.github.com/repos/leocrawford/picasawebsync/issues/37/events","html_url":"https://github.com/leocrawford/picasawebsync/issues/37","id":129385704,"number":37,"title":"Request option for resize video before upload","user":{"login":"andreasqueri","id":4195661,"avatar_url":"https://avatars.githubusercontent.com/u/4195661?v=3","gravatar_id":"","url":"https://api.github.com/users/andreasqueri","html_url":"https://github.com/andreasqueri","followers_url":"https://api.github.com/users/andreasqueri/followers","following_url":"https://api.github.com/users/andreasqueri/following{/other_user}","gists_url":"https://api.github.com/users/andreasqueri/gists{/gist_id}","starred_url":"https://api.github.com/users/andreasqueri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreasqueri/subscriptions","organizations_url":"https://api.github.com/users/andreasqueri/orgs","repos_url":"https://api.github.com/users/andreasqueri/repos","events_url":"https://api.github.com/users/andreasqueri/events{/privacy}","received_events_url":"https://api.github.com/users/andreasqueri/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-01-28T08:54:17Z","updated_at":"2016-02-08T20:53:30Z","closed_at":"2016-02-08T20:53:30Z","body":"Hi,\r\nI think a nice improvement would be to add an option to resize the videos before you upload, as well as going to the pictures.\r\nI 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.\r\nI 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.\r\nI think also , that this  new feature is easy to make. \r\n These are the changes I made to implement the resize video:\r\n\r\nadded the resizeVideo function:\r\n\r\n```\r\ndef resizeVideo(path):\r\n \r\n   filename = os.path.basename(path)\r\n   filename_new = \"/tmp/\" + filename\r\n   res=0\r\n   if not(os.path.exists(filename_new)):\r\n     res=call([\"ffmpeg\",\"-loglevel\",\"-8\",\"-i\",path,\"-strict\",\"-2\",\"-s\",\"176x144\",\"-b:v\",\"800000\",\"-b:a\",\"32k\",\"-r\",\"23\",filename_new])\r\n \r\n     if (res==0):\r\n       return filename_new\r\n     else:\r\n       return None\r\n```\r\n\r\n\r\nAnd these are the change made in the upload_local_video function \r\n\r\n\r\n```\r\ndef upload_local_video(self, subAlbum):\r\n         name = urllib.quote(self.name, '')\r\n        metadata = gdata.photos.VideoEntry()\r\n         metadata.title = atom.Title(text=name)  # have to quote as certain charecters, e.g. / seem to break it\r\n         self.addMetadata(metadata)\r\n         shrinkFile = resizeVideo(self.path)\r\n         currentFile = self.path\r\n        if (shrinkFile is not None):\r\n             currentFile = shrinkFile\r\n        photo = gd_client.InsertVideo(subAlbum.albumUri, metadata, currentFile, self.type)\r\n\r\n        if (shrinkFile is not None):\r\n             os.remove(shrinkFile)\r\n         subAlbum.numberFiles = subAlbum.numberFiles + 1\r\n         return photo\r\n```\r\n\r\n\r\n\r\nHow can you see, the only change i made is to add the resizeVideo function and i call him ever before upload video.\r\n\r\nThe 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 ..)"},"comment":{"url":"https://api.github.com/repos/leocrawford/picasawebsync/issues/comments/181563216","html_url":"https://github.com/leocrawford/picasawebsync/issues/37#issuecomment-181563216","issue_url":"https://api.github.com/repos/leocrawford/picasawebsync/issues/37","id":181563216,"user":{"login":"leocrawford","id":915016,"avatar_url":"https://avatars.githubusercontent.com/u/915016?v=3","gravatar_id":"","url":"https://api.github.com/users/leocrawford","html_url":"https://github.com/leocrawford","followers_url":"https://api.github.com/users/leocrawford/followers","following_url":"https://api.github.com/users/leocrawford/following{/other_user}","gists_url":"https://api.github.com/users/leocrawford/gists{/gist_id}","starred_url":"https://api.github.com/users/leocrawford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leocrawford/subscriptions","organizations_url":"https://api.github.com/users/leocrawford/orgs","repos_url":"https://api.github.com/users/leocrawford/repos","events_url":"https://api.github.com/users/leocrawford/events{/privacy}","received_events_url":"https://api.github.com/users/leocrawford/received_events","type":"User","site_admin":false},"created_at":"2016-02-08T20:53:30Z","updated_at":"2016-02-08T20:53:30Z","body":"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?"}}