mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 12:54:38 +03:00
Marker previews should respect preview audio setting (#2101)
This commit is contained in:
committed by
GitHub
parent
310f181317
commit
9a8f05d826
@@ -10,9 +10,22 @@ type SceneMarkerOptions struct {
|
|||||||
Seconds int
|
Seconds int
|
||||||
Width int
|
Width int
|
||||||
OutputPath string
|
OutputPath string
|
||||||
|
Audio bool
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *Encoder) SceneMarkerVideo(probeResult VideoFile, options SceneMarkerOptions) error {
|
func (e *Encoder) SceneMarkerVideo(probeResult VideoFile, options SceneMarkerOptions) error {
|
||||||
|
|
||||||
|
argsAudio := []string{
|
||||||
|
"-c:a", "aac",
|
||||||
|
"-b:a", "64k",
|
||||||
|
}
|
||||||
|
|
||||||
|
if !options.Audio {
|
||||||
|
argsAudio = []string{
|
||||||
|
"-an",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
args := []string{
|
args := []string{
|
||||||
"-v", "error",
|
"-v", "error",
|
||||||
"-ss", strconv.Itoa(options.Seconds),
|
"-ss", strconv.Itoa(options.Seconds),
|
||||||
@@ -29,11 +42,10 @@ func (e *Encoder) SceneMarkerVideo(probeResult VideoFile, options SceneMarkerOpt
|
|||||||
"-threads", "4",
|
"-threads", "4",
|
||||||
"-vf", fmt.Sprintf("scale=%v:-2", options.Width),
|
"-vf", fmt.Sprintf("scale=%v:-2", options.Width),
|
||||||
"-sws_flags", "lanczos",
|
"-sws_flags", "lanczos",
|
||||||
"-c:a", "aac",
|
|
||||||
"-b:a", "64k",
|
|
||||||
"-strict", "-2",
|
"-strict", "-2",
|
||||||
options.OutputPath,
|
|
||||||
}
|
}
|
||||||
|
args = append(args, argsAudio...)
|
||||||
|
args = append(args, options.OutputPath)
|
||||||
_, err := e.run(probeResult.Path, args, nil)
|
_, err := e.run(probeResult.Path, args, nil)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -117,6 +117,7 @@ func (t *GenerateMarkersTask) generateMarker(videoFile *ffmpeg.VideoFile, scene
|
|||||||
ScenePath: scene.Path,
|
ScenePath: scene.Path,
|
||||||
Seconds: seconds,
|
Seconds: seconds,
|
||||||
Width: 640,
|
Width: 640,
|
||||||
|
Audio: instance.Config.GetPreviewAudio(),
|
||||||
}
|
}
|
||||||
|
|
||||||
encoder := instance.FFMPEG
|
encoder := instance.FFMPEG
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
* Added plugin hook for Tag merge operation. ([#2010](https://github.com/stashapp/stash/pull/2010))
|
* Added plugin hook for Tag merge operation. ([#2010](https://github.com/stashapp/stash/pull/2010))
|
||||||
|
|
||||||
### 🐛 Bug fixes
|
### 🐛 Bug fixes
|
||||||
|
* Don't include audio in marker previews if Include Audio option is unchecked. ([#2101](https://github.com/stashapp/stash/pull/2101))
|
||||||
* Include performer aliases when scraping from stash-box. ([#2091](https://github.com/stashapp/stash/pull/2091/files))
|
* Include performer aliases when scraping from stash-box. ([#2091](https://github.com/stashapp/stash/pull/2091/files))
|
||||||
* Remove empty folder-based galleries during clean. ([#1954](https://github.com/stashapp/stash/pull/1954))
|
* Remove empty folder-based galleries during clean. ([#1954](https://github.com/stashapp/stash/pull/1954))
|
||||||
* Select first scene result in scene tagger where possible. ([#2051](https://github.com/stashapp/stash/pull/2051))
|
* Select first scene result in scene tagger where possible. ([#2051](https://github.com/stashapp/stash/pull/2051))
|
||||||
|
|||||||
Reference in New Issue
Block a user