順序付き画像コレクションを動画としてエクスポートするには、フレームがコレクション内の画像で定義されている場合は Export.video()
を使用します。フレームレート、スケール、サイズを設定して、ImageCollection
を動画に変換する方法を構成できます。動画は MP4 としてエンコードされます。
ドライブに移動
Export.video.toDrive()
を使用して動画を Google ドライブ アカウントにエクスポートします。たとえば、次のエクスポートでは、20 年間の Landsat 画像から動画を作成します。
// Load a Landsat 5 image collection. var collection = ee.ImageCollection('LANDSAT/LT05/C02/T1_TOA') // San Francisco Bay. .filter(ee.Filter.eq('WRS_PATH', 44)) .filter(ee.Filter.eq('WRS_ROW', 34)) // Filter cloudy scenes. .filter(ee.Filter.lt('CLOUD_COVER', 30)) // Get 20 years of imagery. .filterDate('1991-01-01','2011-12-30') // Make each image an 8-bit RGB image. .map(function(image) { return image.visualize({bands: ['B4', 'B3', 'B2'], min: 0.02, max: 0.35}); }); // Define an area to export. var polygon = ee.Geometry.Rectangle([-122.7286, 37.6325, -122.0241, 37.9592]); // Export (change dimensions or scale for higher quality). Export.video.toDrive({ collection: collection, description: 'sfVideoExample', dimensions: 720, framesPerSecond: 12, region: polygon });
フレームレートとサイズは、エクスポートに渡されるパラメータの辞書から設定できます。これらのパラメータを調整して動画をカスタマイズします。また、入力 ImageCollection には 3 バンド(RGB)の 8 ビット画像が必要です。この例では、8 ビットの 3 バンド形式が明示的に設定されています。または、コレクションに対して image.visualize()
を呼び出す関数をマッピングします。詳細については、可視化画像に関するセクションをご覧ください。動画のエクスポートは完了までにかなりの時間がかかることがあるため、エクスポート タスクが長時間実行されるのは珍しいことではありません。
Cloud Storage に転送する
動画を Cloud Storage にエクスポートするには、Export.video.toCloudStorage()
を使用します。たとえば、前の例の ImageCollection
を使用すると、次のようになります。
// Export video to cloud storage. Export.video.toCloudStorage({ collection: collection, description: 'sfVideoExampleToCloud', bucket: 'your-bucket-name', dimensions: 720, framesPerSecond: 12, region: polygon });