Video Metadata Analysis Guide: FFprobe for Container, Codec, Frame Rate, Bitrate
Every video file carries a wealth of metadata: codec, resolution, frame rate, bitrate, duration, color space, and more. Understanding this metadata helps you diagnose playback issues, choose compression settings, and ensure compatibility. This guide explains the key parameters and how to extract them with FFprobe.
Container vs Codec
Before diving into metadata, understand the difference:
- Container (MP4, MKV, WebM, AVI): The "box" that holds streams together. Determines file extension and what players can open the file.
- Codec (H.264, H.265, AAC): The compression algorithm for each stream. Determines quality and decoding compatibility.
- Stream (video, audio, subtitle): The actual content inside the container. Most videos have at least one video stream and one audio stream.
Example: An MP4 file might contain H.264 video + AAC audio. Another MP4 file might contain H.265 video + AAC audio. Both are MP4 containers but use different codecs.
For codec comparison, see our H.264 vs H.265 vs AV1 guide.
Basic FFprobe commands
Quick overview
ffprobe input.mp4Shows basic info: duration, start time, bitrate, streams.
Detailed format and stream info
ffprobe -v error -show_format -show_streams input.mp4-v error: Suppress warnings, only show errors-show_format: Show container-level info-show_streams: Show stream-level info
JSON output (for scripting)
ffprobe -v error -show_format -show_streams -of json input.mp4Get specific field
# Video codec
ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of csv=p=0 input.mp4
# Resolution
ffprobe -v error -select_streams v:0 -show_entries stream=width,height -of csv=s=x:p=0 input.mp4
# Frame rate
ffprobe -v error -select_streams v:0 -show_entries stream=r_frame_rate -of csv=p=0 input.mp4
# Duration
ffprobe -v error -show_entries format=duration -of csv=p=0 input.mp4
# Bitrate
ffprobe -v error -show_entries format=bit_rate -of csv=p=0 input.mp4Key metadata fields explained
Container fields
| Field | Meaning | Example |
|---|---|---|
format_name | Container format | mov, mp4, m4a, 3gp, 3g2, mj2 |
duration | Total duration (seconds) | 360.5 |
bit_rate | Total bitrate (bps) | 2500000 |
size | File size (bytes) | 112500000 |
nb_streams | Number of streams | 2 |
Video stream fields
| Field | Meaning | Example |
|---|---|---|
codec_name | Video codec | h264, hevc, vp9, av1 |
profile | Codec profile | High, Main, Baseline |
level | Codec level | 40 (4.0) |
width, height | Resolution | 1920, 1080 |
pix_fmt | Pixel format | yuv420p, yuv444p |
r_frame_rate | Nominal frame rate | 30/1 |
avg_frame_rate | Average frame rate | 30/1 |
bit_rate | Video bitrate (bps) | 2000000 |
nb_frames | Total frames | 10800 |
color_space | Color space | bt709, bt2020nc |
color_transfer | Transfer characteristics | bt709, smpte2084 (HDR) |
color_primaries | Color primaries | bt709, bt2020 |
Audio stream fields
| Field | Meaning | Example |
|---|---|---|
codec_name | Audio codec | aac, mp3, opus, flac |
sample_rate | Sample rate (Hz) | 44100, 48000 |
channels | Channel count | 2 (stereo), 6 (5.1) |
channel_layout | Channel layout | stereo, 5.1, mono |
bit_rate | Audio bitrate (bps) | 128000 |
bits_per_sample | Bit depth | 16, 24 (for lossless) |
Common resolutions
| Name | Resolution | Aspect | Use case |
|---|---|---|---|
| SD | 640x480 | 4:3 | Old TV |
| HD | 1280x720 | 16:9 | Web, mobile |
| Full HD | 1920x1080 | 16:9 | Standard web |
| 2K | 2560x1440 | 16:9 | High quality |
| 4K UHD | 3840x2160 | 16:9 | 4K streaming |
| 8K UHD | 7680x4320 | 16:9 | Future-proof |
| Vertical | 1080x1920 | 9:16 | Mobile, TikTok |
| Square | 1080x1080 | 1:1 |
Common codecs
Video codecs
| Codec | Full name | Year | Compression | Browser support |
|---|---|---|---|---|
| H.264 (AVC) | Advanced Video Coding | 2003 | Good | All |
| H.265 (HEVC) | High Efficiency Video Coding | 2013 | 30-50% better than H.264 | Safari, partial others |
| VP9 | Google VP9 | 2013 | Similar to H.265 | Chrome, Firefox |
| AV1 | AOMedia Video 1 | 2018 | 20-30% better than H.265 | Modern browsers |
| MPEG-2 | MPEG-2 Part 2 | 1995 | Old | Legacy (DVD) |
Audio codecs
| Codec | Full name | Lossy/Lossless | Browser support |
|---|---|---|---|
| AAC | Advanced Audio Coding | Lossy | All |
| MP3 | MPEG-1 Audio Layer III | Lossy | All |
| Opus | Opus | Lossy | Modern browsers |
| FLAC | Free Lossless Audio Codec | Lossless | Good |
| PCM | Pulse-Code Modulation | Uncompressed | All |
Frame rate guide
| Frame rate | Use case |
|---|---|
| 23.976 fps | Cinema (NTSC) |
| 24 fps | Cinema |
| 25 fps | PAL TV |
| 29.97 fps | NTSC TV |
| 30 fps | Web standard |
| 50 fps | PAL HD |
| 60 fps | Gaming, sports |
| 120 fps | High-end gaming, slow motion |
Variable Frame Rate (VFR): Screen recordings and some mobile videos use VFR to save space. This can cause sync issues in editing software. Convert to CFR with ffmpeg -i input.mp4 -r 30 -c:v libx264 -crf 23 output.mp4.
Bitrate guide
| Resolution | Frame rate | Recommended (H.264) |
|---|---|---|
| 720p | 30fps | 2.5-4 Mbps |
| 1080p | 30fps | 5-8 Mbps |
| 1080p | 60fps | 8-12 Mbps |
| 4K | 30fps | 20-35 Mbps |
| 4K | 60fps | 35-50 Mbps |
Calculate bitrate from file:
ffprobe -v error -show_entries format=bit_rate -of csv=p=0 input.mp4
# Output: 2500000 (bits per second = 2.5 Mbps)Color space and HDR
| Color space | Use case |
|---|---|
| bt601 | SD video |
| bt709 | HD video (standard) |
| bt2020 | 4K HDR |
HDR indicators:
color_transfer=smpte2084: HDR10color_transfer=arib-std-b67: HLGside_data_listwithmastering_display_metadata: HDR metadata
# Check HDR
ffprobe -v error -select_streams v:0 -show_entries stream=color_transfer,color_primaries -of csv=p=0 input.mp4Multiple streams
Some videos have multiple audio tracks (different languages) or subtitle tracks:
# List all streams
ffprobe -v error -show_streams input.mp4
# List stream indexes and types
ffprobe -v error -show_entries stream=index,codec_type,codec_name,language -of csv=p=0 input.mp4Practical analysis script
#!/bin/bash
# Analyze video file
FILE=$1
echo "=== Container Info ==="
ffprobe -v error -show_entries format=format_name,duration,bit_rate,size -of default=noprint_wrappers=1 "$FILE"
echo ""
echo "=== Video Stream ==="
ffprobe -v error -select_streams v:0 -show_entries stream=codec_name,profile,level,width,height,pix_fmt,r_frame_rate,bit_rate,nb_frames,color_space,color_transfer -of default=noprint_wrappers=1 "$FILE"
echo ""
echo "=== Audio Stream ==="
ffprobe -v error -select_streams a:0 -show_entries stream=codec_name,sample_rate,channels,channel_layout,bit_rate -of default=noprint_wrappers=1 "$FILE"
echo ""
echo "=== Subtitles ==="
ffprobe -v error -select_streams s -show_entries stream=index,codec_name,language -of default=noprint_wrappers=1 "$FILE"Common issues
| Issue | Cause | Solution |
|---|---|---|
| No video stream | Audio-only file | Check nb_streams and stream types |
| Bitrate shows N/A | Container doesn't store bitrate | Calculate from file size and duration |
| Frame rate shows as fraction | Nominal vs actual rate | r_frame_rate is nominal, avg_frame_rate is actual |
| Multiple audio tracks | Multi-language video | Use -select_streams a:0 for first track |
| HDR not detected | Missing metadata | Check color_transfer field |
| Codec not recognized | Old FFmpeg version | Update FFmpeg |
Browser compatibility check
Based on metadata, predict browser compatibility:
#!/bin/bash
CODEC=$(ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of csv=p=0 "$1")
case $CODEC in
h264) echo "Compatible with all browsers" ;;
hevc) echo "Safari only (no Chrome/Firefox support)" ;;
vp9) echo "Chrome, Firefox, Edge (no Safari iOS)" ;;
av1) echo "Modern browsers only (Chrome 85+, Firefox 68+, Safari 16.4+)" ;;
*) echo "Unknown compatibility for codec: $CODEC" ;;
esacSummary
Video metadata tells you everything about a file: codec, resolution, frame rate, bitrate, color space, and more. FFprobe is the universal tool for extracting this info.
Quick reference:
- Basic info:
ffprobe input.mp4 - All details:
ffprobe -v error -show_format -show_streams -of json input.mp4 - Specific field:
ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of csv=p=0 input.mp4 - JSON output: Add
-of json
For browser-based metadata viewing, use our Video Info tool — no installation required.