Closed vrince closed 7 years ago
Thanks for the pull request. Could you help me understand what you're trying to do here? I'm not sure I understand why we'd want a video stream rather than a file?
I used it yesterday and the "file" webReference.content.src
is pointing to is a jpg thumbnail of the video not the actual video stream. Plus google do not provide (nor even keep I guess) the original video the only thing that is accessible is the video stream they computed from the video file you uploaded.
So for video that you uploaded from an other source (phone etc), or generated (with the assistant) the only copy of the video you have is the stream.
Does it make more sense ?
Interesting. I hadn't spotted that. Will have a play when I get back to my dev box.
The purpose of hash and size are ways of determining if we have an identical copy of the file already (or if it has changed). That's going to be impossible if it has been transcoded so we'll need to deal with that elsewhere otherwise we'll endlessly recopy files back and forth.
What format format does the stream arrive in? Can it be written to a file and played?
Yeah tested it yesterday, simply downloading the stream with urllib
using origin file name work for me and produce valid .MOV
& .m4v
files. I have not tested other formats though (but when you think of it video format support of google photos is really limited). I guess media.content[i].type
give the actual format of the video stream, just guessing ...
For the hash / size comparison your are completely right they are quite useless for videos. Only file name (and perhaps time stamp) can be used. But transcoding process take time and I don't know how they deal with timestamps, but it they produce a file "later" it's important stream do not overwrite source video file.
Perhaps for videos, streams & original file must be completely kept separated to avoid confusion and accidental data loss.
In the end I gambled and merged without checking (sorry, haven't had much time). Hope it works for everyone..
Using last entry of photo.media.content to get video stream url instead of jpg video thumbnail ...
Not sure what to do with :
I have no ideas of possible edge cases.