mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Fix windows ffmpeg concat path (#2425)
This commit is contained in:
@@ -2,7 +2,9 @@ package ffmpeg
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ScenePreviewChunkOptions struct {
|
type ScenePreviewChunkOptions struct {
|
||||||
@@ -91,11 +93,19 @@ func (e *Encoder) ScenePreviewVideoChunk(probeResult VideoFile, options ScenePre
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// fixWindowsPath replaces \ with / in the given path because the \ isn't recognized as valid on windows ffmpeg
|
||||||
|
func fixWindowsPath(str string) string {
|
||||||
|
if runtime.GOOS == "windows" {
|
||||||
|
return strings.ReplaceAll(str, `\`, "/")
|
||||||
|
}
|
||||||
|
return str
|
||||||
|
}
|
||||||
|
|
||||||
func (e *Encoder) ScenePreviewVideoChunkCombine(probeResult VideoFile, concatFilePath string, outputPath string) error {
|
func (e *Encoder) ScenePreviewVideoChunkCombine(probeResult VideoFile, concatFilePath string, outputPath string) error {
|
||||||
args := []string{
|
args := []string{
|
||||||
"-v", "error",
|
"-v", "error",
|
||||||
"-f", "concat",
|
"-f", "concat",
|
||||||
"-i", concatFilePath,
|
"-i", fixWindowsPath(concatFilePath),
|
||||||
"-y",
|
"-y",
|
||||||
"-c", "copy",
|
"-c", "copy",
|
||||||
outputPath,
|
outputPath,
|
||||||
|
|||||||
Reference in New Issue
Block a user