Closed jdsemma closed 5 years ago
@jdsemma I think that's a little out of the scope of this library. You can easily do that once you have the videos and snapshots downloaded.
out of scope? I guess so but this is one of the most annoying omissions in the arlo system and this is the arlo library so... I wrote a quicky that may be of some use ("quick" meaning it took me all morning).
import time
import wand.image
import wand.font
def time_stamp(filename, text_size=40, position="north_west"):
# requirements:
# wand python library. See http://docs.wand-py.org/
# imagemagick. See https://imagemagick.org/index.php
#
# valid position (aka 'gravity') argument types: 'forget', 'north_west', 'north', 'north_east',
# 'west', 'center', 'east', 'south_west', 'south', 'south_east', 'static'
font = wand.font.Font(path='', size=text_size, stroke_color="snow2") # use default font
timestamp = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())
with wand.image.Image(filename=filename) as img:
img.caption(timestamp, font=font, gravity=position)
img.save(filename=filename)
Hi Art,
I really do appreciate your efforts, but I really don't want to add any more dependencies to this package than I absolutely have to. Your watermarking code is excellent and very useful, but it can be used independent from this Arlo package. May I suggest that you create a public github repository for your watermarking package and we can create an example in the Wiki that uses your repo to demonstrate water marking videos? If you would like help with that, I'd be happy to help however I can.
I get your point of view. Thanks for listening. I will take up up on your suggestion and let you know when I have something.
@apsteinmetz is your code just that single function? If so, and you'd rather not create a github repo, I'd say we can just add that example to the Arlo wiki.
@apsteinmetz I took the liberty of creating a wiki page with an example of using your function. Please let me know what you think.
Thanks!
Yup. Just that function. The bit that needs some explanation is the installation of the imagemagick library. Some (many?) linux installations have it by default but it could be step beyond just importing a new package via pip
, certainly for Windows and Mac users. With that in mind, you are right not to create a new hurdle for what is a super clean package today.
That wiki page looks great. I think that does it! Thanks for letting me contribute.
Thank you for your contribution!
Since Arlo doesn't put a time/date stamp in videos or snapshot images currently, how about adding a way to add a watermark datestamp at the bottom of images?