func (f *FFProbe) GetReadFrameCount(path string) (int64, error) {
	args := []string{"-v", "quiet", "-print_format", "json", "-count_frames", "-show_format", "-show_streams", "-show_error", path}
	out, err := exec.Command(string(*f), args...).Output()

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

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

	fc, err := parse(path, probeJSON)
	return fc.FrameCount, err
}
// GetReadFrameCount counts the actual frames of the video file.
// Used when the frame count is missing or incorrect.
GetReadFrameCount counts the actual frames of the video file.
Used when the frame count is missing or incorrect.
// GetReadFrameCount counts the actual frames of the video file . // Used when the frame count is missing or incorrect .
func (f *FFProbe) GetReadFrameCount(path string) (int64, error) {
	args := []string{"-v", "quiet", "-print_format", "json", "-count_frames", "-show_format", "-show_streams", "-show_error", path}
	out, err := exec.Command(string(*f), args...).Output()
	if err != nil {
		return 0, fmt.Errorf("FFProbe encountered an error with <%s>.\nError JSON:\n%s\nError: %s", path, string(out), err.Error())
	}
	probeJSON := &FFProbeJSON{}
	if err := json.Unmarshal(out, probeJSON); err != nil {
		return 0, fmt.Errorf("error unmarshalling video data for <%s>: %s", path, err.Error())
	}
	fc, err := parse(path, probeJSON)
	return fc.FrameCount, err
}
func ( f * FFProbe ) GetReadFrameCount ( path string ) ( int64 , error ) { args := [ ] string { " " , " " , " " , " " , " " , " " , " " , " " , path } out , err := exec . Command ( string ( * f ) , args ... ) . Output ( ) if err != nil { return 0 , fmt . Errorf ( " \n \n \n " , path , string ( out ) , err . Error ( ) ) } probeJSON := & FFProbeJSON { } if err := json . Unmarshal ( out , probeJSON ) ; err != nil { return 0 , fmt . Errorf ( " " , path , err . Error ( ) ) } fc , err := parse ( path , probeJSON ) return fc . FrameCount , err }
GetReadFrameCount counts the actual frames of the video file.
GetReadFrameCount counts the actual frames of the video file .