Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marker previews should respect preview audio setting #2101

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions pkg/ffmpeg/encoder_marker.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,22 @@ type SceneMarkerOptions struct {
Seconds int
Width int
OutputPath string
Audio bool
}

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{
"-v", "error",
"-ss", strconv.Itoa(options.Seconds),
Expand All @@ -29,11 +42,10 @@ func (e *Encoder) SceneMarkerVideo(probeResult VideoFile, options SceneMarkerOpt
"-threads", "4",
"-vf", fmt.Sprintf("scale=%v:-2", options.Width),
"-sws_flags", "lanczos",
"-c:a", "aac",
"-b:a", "64k",
"-strict", "-2",
options.OutputPath,
}
args = append(args, argsAudio...)
args = append(args, options.OutputPath)
_, err := e.run(probeResult.Path, args, nil)
return err
}
Expand Down
1 change: 1 addition & 0 deletions pkg/manager/task_generate_markers.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ func (t *GenerateMarkersTask) generateMarker(videoFile *ffmpeg.VideoFile, scene
ScenePath: scene.Path,
Seconds: seconds,
Width: 640,
Audio: instance.Config.GetPreviewAudio(),
}

encoder := instance.FFMPEG
Expand Down
1 change: 1 addition & 0 deletions ui/v2.5/src/components/Changelog/versions/v0120.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Added plugin hook for Tag merge operation. ([#2010](https://github.com/stashapp/stash/pull/2010))

### 🐛 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))
* 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))
Expand Down