func (f *FFProbe) NewVideoFile(videoPath string) (*VideoFile, error) {
	args := []string{"-v", "quiet", "-print_format", "json", "-show_format", "-show_streams", "-show_error", videoPath}
	cmd := exec.Command(string(*f), args...)
	out, err := cmd.Output()

	if err != nil {
		return nil, fmt.Errorf("FFProbe encountered an error with <%s>.\nError JSON:\n%s\nError: %s", videoPath, string(out), err.Error())
	}

	probeJSON := &FFProbeJSON{}
	if err := json.Unmarshal(out, probeJSON); err != nil {
		return nil, fmt.Errorf("error unmarshalling video data for <%s>: %s", videoPath, err.Error())
	}

	return parse(videoPath, probeJSON)
}
// NewVideoFile runs ffprobe on the given path and returns a VideoFile.
NewVideoFile runs ffprobe on the given path and returns a VideoFile.
// NewVideoFile runs ffprobe on the given path and returns a VideoFile .
func (f *FFProbe) NewVideoFile(videoPath string) (*VideoFile, error) {
	args := []string{"-v", "quiet", "-print_format", "json", "-show_format", "-show_streams", "-show_error", videoPath}
	cmd := exec.Command(string(*f), args...)
	out, err := cmd.Output()
	if err != nil {
		return nil, fmt.Errorf("FFProbe encountered an error with <%s>.\nError JSON:\n%s\nError: %s", videoPath, string(out), err.Error())
	}
	probeJSON := &FFProbeJSON{}
	if err := json.Unmarshal(out, probeJSON); err != nil {
		return nil, fmt.Errorf("error unmarshalling video data for <%s>: %s", videoPath, err.Error())
	}
	return parse(videoPath, probeJSON)
}
func ( f * FFProbe ) NewVideoFile ( videoPath string ) ( * VideoFile , error ) { args := [ ] string { " " , " " , " " , " " , " " , " " , " " , videoPath } cmd := exec . Command ( string ( * f ) , args ... ) out , err := cmd . Output ( ) if err != nil { return nil , fmt . Errorf ( " \n \n \n " , videoPath , string ( out ) , err . Error ( ) ) } probeJSON := & FFProbeJSON { } if err := json . Unmarshal ( out , probeJSON ) ; err != nil { return nil , fmt . Errorf ( " " , videoPath , err . Error ( ) ) } return parse ( videoPath , probeJSON ) }
NewVideoFile runs ffprobe on the given path and returns a VideoFile.
NewVideoFile runs ffprobe on the given path and returns a VideoFile .