Documentation
¶
Index ¶
- func ConvertImageForOCR(ctx context.Context, path string) (string, error)
- func DecodeFullScan(ctx context.Context, path string) (float64, error)
- func DecodeQuickScan(ctx context.Context, path string, scans []float64, scanDuration float64) float64
- func ExtractImageTextFromComicArchive(ctx context.Context, path, ocrEngine string) ([]db.InsertCaptionParams, error)
- func ExtractSpeechToText(ctx context.Context, path, engine string) ([]db.InsertCaptionParams, error)
- func ParseFPS(s string) float64
- type Chapter
- type ComicPageParams
- type ExtractOptions
- type FFProbeOutput
- type Format
- type MediaMetadata
- type Stream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertImageForOCR ¶ added in v0.0.38
ConvertImageForOCR converts images to PNG format for better OCR compatibility. Tesseract and PaddleOCR work best with PNG/TIFF. This function converts problematic formats (webp, bmp, gif, tiff) to PNG using ffmpeg or ImageMagick. Returns the path to the converted image, or the original path if no conversion needed.
func DecodeQuickScan ¶
func ExtractImageTextFromComicArchive ¶ added in v0.0.38
func ExtractImageTextFromComicArchive(ctx context.Context, path, ocrEngine string) ([]db.InsertCaptionParams, error)
ExtractImageTextFromComicArchive extracts text from images in CBZ/CBR archives using OCR. Returns captions with page numbers as timestamps (page 1 = 0s, page 2 = 1s, etc.)
func ExtractSpeechToText ¶ added in v0.0.38
func ExtractSpeechToText(ctx context.Context, path, engine string) ([]db.InsertCaptionParams, error)
ExtractSpeechToText extracts speech-to-text from audio/video files
Types ¶
type ComicPageParams ¶ added in v0.0.38
type ComicPageParams struct {
Reader *zip.ReadCloser
ImageFile imageFile
OCREngine string
ArchivePath string
}
ComicPageParams contains the context needed to process a single comic page
type ExtractOptions ¶ added in v0.0.36
type ExtractOptions struct {
ScanSubtitles bool
ExtractText bool
OCR bool
OCREngine string
SpeechRecognition bool
SpeechRecEngine string
ProbeImages bool
}
ExtractOptions contains options for metadata extraction
type FFProbeOutput ¶
type MediaMetadata ¶
type MediaMetadata struct {
Media db.UpsertMediaParams
Captions []db.InsertCaptionParams
ContainerFormat *string // From ffprobe format_name, used for transcoding decisions
}
func Extract ¶
func Extract(ctx context.Context, path string, opts ExtractOptions) (*MediaMetadata, error)
type Stream ¶
type Stream struct {
CodecType string `json:"codec_type"`
CodecName string `json:"codec_name"`
Profile string `json:"profile"`
PixFmt string `json:"pix_fmt"`
Width int `json:"width"`
Height int `json:"height"`
AvgFrameRate string `json:"avg_frame_rate"`
RFrameRate string `json:"r_frame_rate"`
SampleRate string `json:"sample_rate"`
Channels int `json:"channels"`
Duration string `json:"duration"`
Tags map[string]string `json:"tags"`
Disposition map[string]int `json:"disposition"`
}