Calculate Video SI and TI Using FFmpeg siti Filter
This article explains how to use the siti filter in
FFmpeg to calculate the Spatial Information (SI) and Temporal
Information (TI) of a video. You will learn the basic command-line
syntax, how to analyze the console output, and how to export the results
for further video quality analysis.
Understanding SI and TI
Spatial Information (SI) and Temporal Information (TI) are standard metrics defined in ITU-T Rec. P.910 used to measure the complexity of a video sequence:
- Spatial Information (SI): Measures the amount of spatial detail in a video frame. Videos with lots of edges, fine textures, or complex scenes have high SI.
- Temporal Information (TI): Measures the amount of motion or change between consecutive frames. High-action scenes, fast camera pans, and rapid cuts result in high TI.
These metrics are highly useful for determining the appropriate bitrate and encoding settings for a given video.
The Basic FFmpeg Command
To calculate SI and TI, you apply the siti video filter
using the -vf flag. Since you only need the calculated
metrics and do not need to encode a new video, you can output to a null
muxer to speed up the process.
Run the following command in your terminal:
ffmpeg -i input.mp4 -vf siti -f null -Command Breakdown:
-i input.mp4: Specifies your input video file.-vf siti: Applies the Spatial/Temporal Information filter.-f null -: Tells FFmpeg to discard the output video stream, running the analysis as quickly as possible.
Understanding the Output
As FFmpeg processes the video, it will print the frame-by-frame SI and TI values directly to the console (stderr):
[Parsed_siti_0 @ 0x55d0a2f4a3c0] n:1 si:42.12 ti:0.00
[Parsed_siti_0 @ 0x55d0a2f4a3c0] n:2 si:42.15 ti:12.45
[Parsed_siti_0 @ 0x55d0a2f4a3c0] n:3 si:42.10 ti:12.30
- n: The current frame number.
- si: The Spatial Information value for that frame.
- ti: The Temporal Information value compared to the previous frame (frame 1 always has a TI of 0.00).
Once the entire video is processed, FFmpeg outputs the summary statistics:
[Parsed_siti_0 @ 0x55d0a2f4a3c0] SI min:38.20 max:45.10 mean:42.15
[Parsed_siti_0 @ 0x55d0a2f4a3c0] TI min:0.00 max:18.40 mean:11.25
The mean values represent the overall spatial and temporal complexity of the video.
Exporting Results to a Log File
To save the calculated metrics for later analysis, redirect the standard error output (where FFmpeg prints logs) to a text file:
ffmpeg -i input.mp4 -vf siti -f null - 2> siti_results.txtYou can then open siti_results.txt to parse, graph, or
analyze the frame-by-frame data using external tools like Excel, Python,
or R.