I've wrote below code for an aerosol changes video, using Sentinel-5 products. When I'm going to save the video in Google Drive this error occurred:
Task details: myvideo
State: Failed
Started 17s ago (2019-08-27 20:18:34 +0430)
Runtime: 9s
Id: ZTMTUZWKR2TUL3TXP0E57VBZ
Source script
Error: ImageCollection must have 3 or 4 bands
code link: https://code.earthengine.google.com/9127141eaed10f0c40b485f488c202e9
var dust = ee.ImageCollection('COPERNICUS/S5P/NRTI/L3_AER_AI')
.filterBounds(table)
.filterDate('2018-01-01','2020-01-01')
.select('absorbing_aerosol_index');
var dust_test = dust.map(function(img){
return img.clip(table);
});
var coll4Video = dust_test
.map(function(image) {
return image.uint8(); // need to make it 8-bit
});
Export.video.toDrive({
collection: coll4Video,
description: "myvideo" ,
scale: 1000,
framesPerSecond: 2,
region: table
});
Best Answer
As the error says, Video export requires your images must have 3 bands (r,g,b) or 4 bands (r,g,b,alpha). Your image has only 1 band. You can call
visualize()
on it to apply a visualization and convert it to a 3-band image appropriate for export.Code link https://code.earthengine.google.com/7366d0ea6c24f3bcf3f3c0bf4eb623e9