Restructure ffmpeg (#2392)

* 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
This commit is contained in:
WithoutPants
2022-04-18 10:50:10 +10:00
committed by GitHub
parent cdaa191155
commit aacf07feef
89 changed files with 3208 additions and 2004 deletions

View File

@@ -37,9 +37,11 @@ type singleton struct {
Paths *paths.Paths
FFMPEG ffmpeg.Encoder
FFMPEG ffmpeg.FFMpeg
FFProbe ffmpeg.FFProbe
ReadLockManager *fsutil.ReadLockManager
SessionStore *session.Store
JobManager *job.Manager
@@ -77,10 +79,11 @@ func Initialize() *singleton {
initProfiling(cfg.GetCPUProfilePath())
instance = &singleton{
Config: cfg,
Logger: l,
DownloadStore: NewDownloadStore(),
PluginCache: plugin.NewCache(cfg),
Config: cfg,
Logger: l,
ReadLockManager: fsutil.NewReadLockManager(),
DownloadStore: NewDownloadStore(),
PluginCache: plugin.NewCache(cfg),
TxnManager: sqlite.NewTransactionManager(),
@@ -218,7 +221,7 @@ func initFFMPEG(ctx context.Context) error {
}
}
instance.FFMPEG = ffmpeg.Encoder(ffmpegPath)
instance.FFMPEG = ffmpeg.FFMpeg(ffmpegPath)
instance.FFProbe = ffmpeg.FFProbe(ffprobePath)
}