mirror of
https://github.com/stashapp/CommunityScripts.git
synced 2026-02-04 01:52:30 -06:00
[audio-transcodes] Fix paths with spaces and ffmpeg stderr flood (#581)
This commit is contained in:
parent
6e350eadbb
commit
41978e3378
@ -3,7 +3,7 @@ from stashapi.stashapp import StashInterface
|
||||
import sys
|
||||
import json
|
||||
from pathlib import Path
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
settings = {"hash_type": "oshash", "transcodes_dir": "/generated/transcodes/"}
|
||||
|
||||
@ -18,12 +18,18 @@ def run_ffmpeg(file, hash):
|
||||
dest,
|
||||
)
|
||||
)
|
||||
command = (
|
||||
"ffmpeg -f lavfi -i color=c=blue:s=1280x720 -i %s -shortest -fflags +shortest %s"
|
||||
% (file, dest)
|
||||
)
|
||||
command = [
|
||||
"ffmpeg",
|
||||
"-loglevel", "error",
|
||||
"-f", "lavfi",
|
||||
"-i", "color=c=blue:s=1280x720",
|
||||
"-i", file,
|
||||
"-shortest",
|
||||
"-fflags", "+shortest",
|
||||
dest,
|
||||
]
|
||||
log.debug("about to run command: %s " % (command,))
|
||||
os.system(command)
|
||||
subprocess.run(command)
|
||||
else:
|
||||
log.debug(
|
||||
"transcode already exists %s - %s"
|
||||
@ -59,7 +65,6 @@ FRAGMENT_SERVER = json_input["server_connection"]
|
||||
stash = StashInterface(FRAGMENT_SERVER)
|
||||
config = stash.get_configuration()
|
||||
|
||||
log.debug(config)
|
||||
settings["transcodes_dir"] = config["general"]["generatedPath"]
|
||||
settings["hash_type"] = config["general"]["videoFileNamingAlgorithm"].lower()
|
||||
log.debug(settings)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
name: audio-transcodes
|
||||
description: Generate a transcode video from an audio file
|
||||
version: 0.1
|
||||
version: 0.2
|
||||
url: https://github.com/stashapp/CommunityScripts/
|
||||
exec:
|
||||
- python
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user