Video Generation
EcoLogits can estimate the environmental impacts of video generation requests with the video_impacts function.
This is useful when you call a video generation API and want to attach impact estimates to the request metadata, logs, analytics, or product reporting. You only need the model name, requested resolution, and requested duration.
This page focuses on usage
To learn how the estimation is modeled, read the video generation methodology.
Quickstart
from ecologits.estimations import video_impacts
impacts = video_impacts(
model_name="openai/sora-2-pro",
resolution="1080p",
duration=10,
)
print(impacts.energy.value)
print(impacts.gwp.value)
The function returns an ImpactsOutput, the same object used by EcoLogits provider integrations. It contains total impacts, usage impacts, embodied impacts, and possible warnings or errors.
print(impacts.energy.value) # Direct electricity consumption, in kWh
print(impacts.gwp.value) # Global warming potential, in kgCO2eq
print(impacts.adpe.value) # Abiotic resource depletion, in kgSbeq
print(impacts.pe.value) # Primary energy, in MJ
print(impacts.wcf.value) # Water consumption footprint, in L
print(impacts.usage.gwp.value) # Usage phase only
print(impacts.embodied.gwp.value) # Embodied phase only
Video impact values are usually RangeValue intervals. You can access the mean, min, and max values directly:
print(impacts.gwp.value.mean) # Central estimate
print(impacts.gwp.value.min) # Lower bound
print(impacts.gwp.value.max) # Upper bound
Function Inputs
model_name
Use one of the video model identifiers supported by EcoLogits:
| Provider | Models |
|---|---|
| Alibaba | alibaba/wan2.1, alibaba/wan2.2 |
| ByteDance | bytedance/seedance-1.0, bytedance/seedance-1.5-pro |
google/veo-3.0, google/veo-3.0-fast, google/veo-3.1, google/veo-3.1-fast |
|
| Kling AI | klingai/kling-v1.6, klingai/kling-v2.6, klingai/kling-v3 |
| Lightricks | lightricks/ltx-2-t2v, lightricks/ltx-2-t2va |
| OpenAI | openai/sora-2-pro |
| Runway | runway/gen-4.5 |
| Tencent | tencent/hunyuanvideo, tencent/hunyuanvideo-1.5 |
If the model is unknown, EcoLogits returns an ImpactsOutput with an error instead of raising an exception.
impacts = video_impacts(
model_name="unknown/model",
resolution="720p",
duration=5,
)
if impacts.has_errors:
print(impacts.errors)
resolution
You can use a named resolution:
Supported named resolutions are:
| Name | Size |
|---|---|
720p |
1280 x 720 |
1080p |
1920 x 1080 |
4k |
3840 x 2160 |
You can also pass an explicit widthxheight value:
duration
Pass the requested video duration in seconds:
Longer videos usually have higher impacts because they require more generated frames.
with_audio
Set with_audio=False when the request generates video without audio:
The default is True, which matches video models that generate audio with the video.
Data Center Defaults
By default, EcoLogits uses provider-level assumptions for the model deployment location, PUE, and WUE. This keeps the function simple when you do not know where the provider served the request.
If you have better information for your context, you can override these values.
Location
Use datacenter_location to select the electricity mix used for usage impacts:
impacts = video_impacts(
model_name="runway/gen-4.5",
resolution="1080p",
duration=10,
datacenter_location="USA",
)
Available zones follow ISO 3166-1 alpha-3 codes, with extra aggregate zones such as WOR for World and EEE for Europe. When a zone is unknown, EcoLogits returns an ImpactsOutput with an error.
PUE and WUE
Use datacenter_pue and datacenter_wue when you know the serving environment:
impacts = video_impacts(
model_name="openai/sora-2-pro",
resolution="1080p",
duration=10,
datacenter_location="USA",
datacenter_pue=1.2,
datacenter_wue=0.569,
)
You can also pass ranges:
from ecologits.utils.range_value import RangeValue
impacts = video_impacts(
model_name="runway/gen-4.5",
resolution="1080p",
duration=10,
datacenter_pue=RangeValue(min=1.09, max=1.14),
datacenter_wue=RangeValue(min=0.13, max=0.999),
)
Integration Pattern
The simplest integration is to compute impacts from the same request parameters you send to your video provider.
from ecologits.estimations import video_impacts
model = "openai/sora-2-pro"
resolution = "1080p"
duration = 10
# response = client.videos.generate(
# model=model,
# prompt="A city street at sunrise",
# resolution=resolution,
# duration=duration,
# )
impacts = video_impacts(
model_name=model,
resolution=resolution,
duration=duration,
)
Then serialize the result if you want to store it in logs, traces, or a database:
Or attach it to your own response payload:
return {
# "video_id": response.id,
"model": model,
"resolution": resolution,
"duration": duration,
"impacts": impact_payload,
}
This keeps the estimation close to the request parameters that matter without depending on a provider-specific response shape.
Handling Warnings and Errors
Always check warnings and errors before using estimates in automated reporting.
impacts = video_impacts(
model_name="runway/gen-4.5",
resolution="1080p",
duration=10,
datacenter_location="ABW",
)
if impacts.has_errors:
for error in impacts.errors:
print(error.message)
if impacts.has_warnings:
for warning in impacts.warnings:
print(warning.message)
Warnings usually mean EcoLogits completed the estimation but had to use a fallback value for part of the calculation. Errors mean the estimate could not be computed.