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:

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:

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

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.txt

You can then open siti_results.txt to parse, graph, or analyze the frame-by-frame data using external tools like Excel, Python, or R.