How to Find Video Chroma Location Using FFprobe
This article provides a quick guide on using FFprobe to inspect and display the chroma location metadata of a video file. Chroma location defines where sub-sampled chroma components are positioned relative to luma samples, which is critical for accurate color reproduction during playback, transcoding, and editing. Below, you will find direct FFprobe commands to extract this information in standard text, plain values, or structured JSON format.
Why Chroma Location Matters
In chroma subsampling formats such as 4:2:0 or 4:2:2, color
information is stored at a lower resolution than brightness (luma). The
chroma location parameter (often specified in the video's VUI or stream
headers) tells decoders exactly how to align chroma pixels with luma
pixels—such as left, center,
topleft, or bottomleft. Improper alignment
during scaling or conversion can lead to subtle color shifts or fringing
artifacts along sharp edges.
The Basic Command to View Chroma Location
To retrieve only the chroma location for the primary video stream,
use the -show_entries option targeting the
stream=chroma_location field:
ffprobe -v error -select_streams v:0 -show_entries stream=chroma_location input.mp4This returns the entry wrapped in default FFprobe output tags:
[STREAM]
chroma_location=left
[/STREAM]
Extracting Only the Raw Value
If you are writing an automated script or only need the plain text
value without wrappers, add the
-of default=noprint_wrappers=1:nokey=1 argument:
ffprobe -v error -select_streams v:0 -show_entries stream=chroma_location -of default=noprint_wrappers=1:nokey=1 input.mp4Output:
left
Outputting as JSON
For integration into pipelines using Python, Node.js, or other
programming environments, format the result as JSON using
-of json:
ffprobe -v error -select_streams v:0 -show_entries stream=chroma_location -of json input.mp4Output:
{
"programs": [
],
"streams": [
{
"chroma_location": "left"
}
]
}Interpreting Undefined Values
If FFprobe returns unspecified or leaves the value
blank, the video container or elementary bitstream does not contain
explicit chroma location metadata. In these cases, decoders typically
fall back to format standards (such as MPEG-2/H.264/H.265 defaults,
which generally assume left for progressive content and
topleft for interlaced content).