mirror of
https://github.com/stashapp/stash.git
synced 2025-12-06 08:26:00 +01:00
* Refactor transcode generation * Move phash generation into separate package * Refactor image thumbnail generation * Move JSONTime to separate package * Ffmpeg refactoring * Refactor live transcoding * Refactor scene marker preview generation * Refactor preview generation * Refactor screenshot generation * Refactor sprite generation * Change ffmpeg.IsStreamable to return error * Move frame rate calculation into ffmpeg * Refactor file locking * Refactor title set during scan * Add missing lockmanager instance * Return error instead of logging in MatchContainer
43 lines
981 B
Go
43 lines
981 B
Go
package ffmpeg
|
|
|
|
// Format represents the input/output format for ffmpeg.
|
|
type Format string
|
|
|
|
// Args converts the Format to a slice of arguments to be passed to ffmpeg.
|
|
func (f Format) Args() []string {
|
|
if f == "" {
|
|
return nil
|
|
}
|
|
|
|
return []string{"-f", string(f)}
|
|
}
|
|
|
|
var (
|
|
FormatConcat Format = "concat"
|
|
FormatImage2 Format = "image2"
|
|
FormatRawVideo Format = "rawvideo"
|
|
FormatMpegTS Format = "mpegts"
|
|
FormatMP4 Format = "mp4"
|
|
FormatWebm Format = "webm"
|
|
FormatMatroska Format = "matroska"
|
|
)
|
|
|
|
// ImageFormat represents the input format for an image for ffmpeg.
|
|
type ImageFormat string
|
|
|
|
// Args converts the ImageFormat to a slice of arguments to be passed to ffmpeg.
|
|
func (f ImageFormat) Args() []string {
|
|
if f == "" {
|
|
return nil
|
|
}
|
|
|
|
return []string{"-f", string(f)}
|
|
}
|
|
|
|
var (
|
|
ImageFormatJpeg ImageFormat = "mjpeg"
|
|
ImageFormatPng ImageFormat = "png_pipe"
|
|
ImageFormatWebp ImageFormat = "webp_pipe"
|
|
|
|
ImageFormatImage2Pipe ImageFormat = "image2pipe"
|
|
)
|