Ffprobe.exe Review
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.
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.exe
While FFmpeg is the workhorse for converting and manipulating audio and video, ffprobe.exe is the analyst. It doesn't change a single byte of your media. Instead, it reads media files and displays their internal structure, metadata, and stream characteristics with surgical precision. For developers, quality assurance engineers, content archivists, and video enthusiasts, ffprobe is the first and most important tool in the diagnostic toolkit. Start with simple -show_streams commands, then graduate to
for %%f in (*.mp4) do ( ffprobe -v error -show_entries format=filename,duration -of default=noprint_wrappers=1 "%%f" ) ffprobe -v error -show_frames corrupted_video.mkv 2> error_log.txt If frames are corrupt, ffprobe will print errors to stderr. 3. Find Exact Frame Count ffprobe -v error -select_streams v:0 -count_frames -show_entries stream=nb_read_frames input.mov 4. Extregate Thumbnail Generation Info Before generating a thumbnail, you might want the exact timestamp of a keyframe: Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'example
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 .
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:
ffprobe -show_frames -select_streams v input.mp4 Displays packet-level information (PTS, DTS, duration, size, flags). Useful for analyzing streaming issues or container structure. 5. -print_format (or -of ) Specifies output format. Essential for scripting. Supported formats: default , compact , csv , flat , ini , json , xml , old .
