Get video stream details like codec and resolution

inspection

// what it does

This narrows ffprobe to the first video stream via `-select_streams v:0` and asks only for codec, dimensions, and frame rate with `-show_entries stream=...`. `-of csv=p=0` prints them as a bare comma-separated line with no field names, and `-v error` suppresses everything but real errors — ideal for feeding width/height/fps into a script. Use it to branch logic on resolution or codec before deciding how to transcode.

// shell

$ ffprobe -v error -select_streams v:0 -show_entries stream=codec_name,width,height,r_frame_rate -of csv=p=0 input.mp4

// gotcha

r_frame_rate comes back as a fraction like `30000/1001`, not a decimal, and FFmpeg documents it as just a guess at the stream's base frame rate — for a variable-frame-rate file the true average is in avg_frame_rate instead.