You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: generator.go
    path of file: ./repos/stash/internal/manager
    
    the code of the file until where you have to start completion: package manager

import (
	"context"
	"fmt"
	"math"
	"strconv"

	"github.com/stashapp/stash/pkg/ffmpeg"
	"github.com/stashapp/stash/pkg/fsutil"
	"github.com/
    
func (g *generatorInfo) configure() error {
	videoStream := g.VideoFile.VideoStream
	if videoStream == nil {
		return fmt.Errorf("missing video stream")
	}

	if err := g.calculateFrameRate(videoStream); err != nil {
		return err
	}

	// #2250 - ensure ChunkCount is valid
	if g.ChunkCount < 1 {
		logger.Warnf("[generator] Segment count (%d) must be > 0. Using 1 instead.", g.ChunkCount)
		g.ChunkCount = 1
	}

	g.NthFrame = g.NumberOfFrames / g.ChunkCount

	return nil
}