This time lapse creator is composed of two python scripts, a transmitter and a receiver.
It is designed to send images, one at a time, from a transmitter running on one computer to a receiver running on another at a specified interval.
The receiver then gives each image a unique name (format: "TL_dd-mm-YY_H-M-S"), and then save it to a folder named images. The create_time_lapse
endpoint
can be used to create an MP4 time lapse video. Time lapse videos are saved in the "video" folder.
Transmitter
Run the following commands in a terminal/command prompt. This assumes python and pip are installed. I have tested with Python 3
but it can be tweaked to run with Python 2.
git clone https://github.com/ataffe/TimeLapseHelper.git
pip install numpy opencv-python schedule
python transmitter.py --host <host> --port <port> -i <interval in minutes>
Replace "host" and "port" with the ip address and port of the receiver. To get the ip address of the receiver, on the receiver machine runipconfig
on Windows andifconfig
on Unix to get the ip address of the machine.
Receiver
Run the following commands in a terminal/command prompt.
git clone https://github.com/ataffe/TimeLapseHelper.git
pip install numpy opencv-python jsonpickle Flask
python receiver.py
Creating a Time Lapse Video
Call http://host:port/image/create_time_lapse
to generate a time lapse video. This will create a folder named "video"
and add the time lapse videos to the folder. The naming format for each video is "TL_Video_mm-dd-YY_H-M.mp4"
Default Host: localhost
Default Port: 5000
POST image/create_time_lapse
- Used for creating a time lapse using the images taken by the sender.
An optional json payload can be sent to customize the video name suffix, frame rate, width, and height.
Here is an example payload:
{ "frame_rate": 20, "width": 2560, "height": 1440, "name_suffix": "youtube" }
GET image/heart_beat
- Used for checking that the server is alive.
POST image/add
- Used to send an image from the sender to the receiver.
The REST API is created using Flask, and images are taken using OpenCV.