func Probe(src string, r *ProbeResult) error {
	c := exec.Command("ffprobe", "-v", "quiet", "-print_format", "json", "-show_format", "-show_streams", "-show_chapters", src)
	raw, err := c.CombinedOutput()
	if err != nil {
		return fmt.Errorf("Probe(%s): %v\n%s", src, err, raw)
	}
	if err = json.Unmarshal(raw, r); err != nil {
		return fmt.Errorf("Probe(%s): %v", src, err)
	}
	return err
}
Probe runs ffprobe on a file and returns the typed output.
package ffmpeg
import (
	"encoding/json"
	"fmt"
	"log"
	"net"
	"net/http"
	"os/exec"
	"strconv"
	"strings"
)
type Stream struct {
	Index          int
	CodecName      string `json:"codec_name"`
	CodecLongName  string `json:"codec_long_name"`
	Profile        string
	CodecType      string `json:"codec_type"`
	CodecTimeBase  string `json:"codec_time_base"`
	CodecTagString string `json:"codec_tag_string"`
	CodecTag       string `json:"codec_tag"`
	RFrameRate   string `json:"r_frame_rate"`
	AvgFrameRate string `json:"avg_frame_rate"`
	TimeBase     string `json:"time_base"`
	StartPts     int    `json:"start_pts"`
	StartTime    string `json:"start_time"`
	DurationTs   int    `json:"duration_ts"`
	Duration     string
	BitRate      string `json:"bit_rate"`
	NbFrames     string `json:"nb_frames"`
	Disposition  map[string]int
	Tags         map[string]string
	Width              int
	Height             int
	CodecWidth         int    `json:"codec_width"`
	CodecHeight        int    `json:"codec_height"`
	HasBFrames         int    `json:"has_b_frames"`
	SampleAspectRatio  string `json:"sample_aspect_ratio"`
	DisplayAspectRatio string `json:"display_aspect_ratio"`
	PixFmt             string `json:"pix_fmt"`
	Level              int
	ChromaLocation     string `json:"chroma_location"`
	FieldOrder         string `json:"field_order"`
	Refs               int
	IsAvc              string `json:"is_avc"`
	NalLengthSize      string `json:"nal_length_size"`
	BitsPerRawSample   string `json:"bits_per_raw_sample"`
	SampleFmt     string `json:"sample_fmt"`
	SampleRate    string `json:"sample_rate"`
	Channels      int
	ChannelLayout string `json:"channel_layout"`
	BitsPerSample int    `json:"bits_per_sample"`
	DmixMode      string `json:"dmix_mode"`
	LtrtCmixlev   string `json:"ltrt_cmixlev"`
	LtrtSurmixlev string `json:"ltrt_surmixlev"`
	LoroCmixlev   string `json:"loro_cmixlev"`
	LoroSurmixlev string `json:"loro_surmixlev"`
	MaxBitRate    string `json:"max_bit_rate"`
}
type Format struct {
	Filename       string
	NbStreams      int    `json:"nb_streams"`
	NbPrograms     int    `json:"nb_programs"`
	FormatName     string `json:"format_name"`
	FormatLongName string `json:"format_long_name"`
	StartTime      string `json:"start_time"`
	Duration       string
	Size           string
	BitRate        string `json:"bit_rate"`
	ProbeScore     int    `json:"probe_score"`
	Tags           map[string]string
}
type Chapter struct {
	ID        int
	TimeBase  string `json:"time_base"`
	Start     int
	StartTime string `json:"start_time"`
	End       int
	EndTime   string `json:"end_time"`
	Tags      map[string]string
}
type ProbeResult struct {
	Streams  []Stream
	Chapters []Chapter
	Format   Format
}