ffprobe -show_format input.mkv Shows detailed information about each stream (video, audio, subtitle, data). This includes codec name, profile, level, bitrate, frame rate, pixel format, color space, etc.
For video engineers, ffprobe is superior because it understands FFmpeg’s internal structures and can analyze packets, keyframes, and encoding artifacts. PowerShell Example: Get Video Info as Object $output = ffprobe -v quiet -print_format json -show_streams -show_format input.mp4 | ConvertFrom-Json $videoStream = $output.streams | Where-Object $_.codec_type -eq "video" Write-Host "Resolution: $($videoStream.width)x$($videoStream.height)" Bash Example: Check if Video is H.265/HEVC if ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of default=noprint_wrappers=1 input.mkv | grep -q hevc; then echo "HEVC video detected" fi Python Example (subprocess) import subprocess, json def get_media_info(filepath): cmd = ['ffprobe', '-v', 'quiet', '-print_format', 'json', '-show_format', '-show_streams', filepath] result = subprocess.run(cmd, capture_output=True, text=True) return json.loads(result.stdout)
Start with simple -show_streams commands, then graduate to JSON output and scripting. Combine it with ffmpeg for intelligent transcoding decisions (e.g., "only re-encode if the bitrate exceeds 5 Mbps"). Master ffprobe , and you will never again wonder what's really inside a media file. ffprobe.exe
width=1920 height=1080 r_frame_rate=30000/1001 ffprobe -v error -select_streams a:0 -show_entries stream=codec_name,sample_rate,channels -of default=noprint_wrappers=1 audio.mp3 Example 4: Get Duration and Bitrate Without Extra Text ffprobe -v error -show_entries format=duration,bit_rate -of default=noprint_wrappers=1 video.mkv Example 5: Detect if a File Contains Audio ffprobe -v error -select_streams a -show_entries stream=codec_type -of default=noprint_wrappers=1 sample.avi If nothing returns, there's no audio stream. Example 6: Extract All Metadata Tags ffprobe -v quiet -show_entries format_tags -of default=noprint_wrappers=1 input.mov Example 7: Verify HDR (High Dynamic Range) Information ffprobe -v error -select_streams v:0 -show_entries stream=color_primaries,color_transfer,color_space,pix_fmt -of default=noprint_wrappers=1 hdr_video.mkv Example 8: Analyze Packet Timestamps for A/V Sync Issues ffprobe -show_packets -select_streams v -v quiet input.ts > video_packets.txt Output Formats for Automation JSON (Recommended for Programming) ffprobe -v quiet -print_format json -show_format -show_streams input.mp4 Use jq (on Linux/macOS) or ConvertFrom-Json (PowerShell) to parse. XML ffprobe -print_format xml -show_streams input.mp4 CSV ffprobe -print_format csv -show_streams input.mp4 Flat (Key=Value) ffprobe -print_format flat -show_streams input.mp4 Advanced Use Cases 1. Batch Probing Multiple Files Using a loop in Windows Batch:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'example.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf58.76.100 Duration: 00:02:30.15, start: 0.000000, bitrate: 1024 kb/s Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 896 kb/s, 30 fps, 30 tbr, 15360 tbn (default) Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default) This tells you: container format, duration, bitrate, video codec (H.264), resolution (1080p), frame rate, audio codec (AAC), sample rate, and channels. 1. -show_format Displays container-level information: format name, duration, overall bitrate, number of streams, and format metadata. ffprobe -show_format input
ffprobe -show_streams input.mp4 Lists every single frame in the file (video, audio, subtitle). This can be extremely verbose. Use with -select_streams v to limit to video frames.
Introduction In the world of digital media processing, few tools are as powerful and ubiquitous as FFmpeg. But before you encode, stream, or edit a media file, you need to understand its inner workings. Enter ffprobe.exe – the often-overlooked but indispensable sibling of ffmpeg.exe . PowerShell Example: Get Video Info as Object $output
Create an alias or batch file called mediainfo that runs ffprobe -hide_banner -show_format -show_streams %1 to get a quick, readable summary anytime. Then explore deeper as needed.