Google Earth Engine Tutorial: Beginners Guide 21 Create and Export Timelapse Videos
Credit: Youtube Channel “Terra Spatial, Tutorial on creating animated timelapse videos from satellite imagery and exporting them for presentation.”
You can see all the tutorials from here: Techgeo Academy.
As a GIS specialist, creating timelapse videos with Google Earth Engine (GEE) can be a powerful way to visualize environmental changes over time. This guide will walk you through the basics of generating and exporting timelapse videos, even if you’re new to GEE.
Step 1: Access the Google Earth Engine Code Editor
- Go to https://code.earthengine.google.com.
- Sign in with your Google account if you haven’t already.
- Ensure you have valid access to GEE by activating your account through the Quickstart guide.
Step 2: Select a Dataset and Define the Time Range
- Choose a dataset (e.g., Landsat 8 surface reflectance or MODIS).
- Filter the dataset by date and region. Example code:
var dataset = ee.ImageCollection('LANDSAT/LC08/C02/T1_L2')
.filterDate('2010-01-01', '2020-12-31')
.filter(ee.Filter.eq('WRS_PATH', 131));
Step 3: Process the Images for Visualization
- Define a function to select and process each image (e.g., using false-color composites or NDVI).
- Example function:
var visParams = {bands: ['SR_B4', 'SR_B3', 'SR_B2'], min: 0, max: 3000};
var timelapse = dataset.map(function(image) {
return image.select(['SR_B4', 'SR_B3', 'SR_B2']).resample('bilinear');
}).visualize(visParams);
Step 4: Create the Timelapse Video
- Use the GEE Video API to generate the video. Example code:
var videoParams = {
frameRate: 10,
quality: 10,
dimensions: 1024,
region: geometry
};
var video = timelapse.toVideo(videoParams);
Step 5: Export the Video to Google Cloud Storage
- Use the
Export.video.toDrive
function. Example:
Export.video.toDrive({
video: video,
description: 'Timelapse_Export',
folder: 'GEE_Exports',
fileNamePrefix: 'timelapse',
maxFrames: 1000
});
Step 6: Monitor and Retrieve the Export
- Check the Tasks tab in the Code Editor.
- Once completed, download the video from Google Drive.
Additional Tips
- Adjust parameters like
frameRate
anddimensions
for smoother or higher-resolution videos. - Use
geometry
variables to define your area of interest or create a region by drawing on the map. - For advanced users, consider computing indices like NDVI or using Landsat 8/9 data for better results.
FAQ
What datasets can I use for timelapse videos?
You can use any Earth observation dataset available in GEE, such as Landsat, MODIS, Sentinel, or custom datasets. The choice depends on your project’s resolution and temporal coverage needs.
How long does it take to export a timelapse?
Export duration varies based on the size of the dataset, video resolution, and available cloud resources. Large regions or high-resolution exports may take hours.
Can I use a custom region instead of a predefined area?
Absolutely. Define your region using geometry
(e.g., a polygon or a point) or draw it interactively in the Code Editor map.
Is there a limit on the number of frames?
GEE allows up to 10,000 frames for video exports. For larger datasets, consider reducing the time range or downsampling.
How to visualize the timelapse in the browser before exporting?
Use the Map.addLayer()
function to preview images. Adjust the visualization parameters to emphasize changes in the area of interest.
Can I export the video in different formats?
Yes. GEE supports MP4 and WebM video formats. Modify the fileNamePrefix
to match your desired format (e.g., .webm).
What if I encounter errors during export?
Common issues include incorrect geometry, dataset inaccessibility, or timeout problems. Review your code in the console and ensure your account is properly authorized.