File tree Expand file tree Collapse file tree 2 files changed +13
-8
lines changed
Expand file tree Collapse file tree 2 files changed +13
-8
lines changed Original file line number Diff line number Diff line change 33import sys
44import json
55from pathlib import Path
6- import os
6+ import subprocess
77
88settings = {"hash_type" : "oshash" , "transcodes_dir" : "/generated/transcodes/" }
99
@@ -18,12 +18,18 @@ def run_ffmpeg(file, hash):
1818 dest ,
1919 )
2020 )
21- command = (
22- "ffmpeg -f lavfi -i color=c=blue:s=1280x720 -i %s -shortest -fflags +shortest %s"
23- % (file , dest )
24- )
21+ command = [
22+ "ffmpeg" ,
23+ "-loglevel" , "error" ,
24+ "-f" , "lavfi" ,
25+ "-i" , "color=c=blue:s=1280x720" ,
26+ "-i" , file ,
27+ "-shortest" ,
28+ "-fflags" , "+shortest" ,
29+ dest ,
30+ ]
2531 log .debug ("about to run command: %s " % (command ,))
26- os . system (command )
32+ subprocess . run (command )
2733 else :
2834 log .debug (
2935 "transcode already exists %s - %s"
@@ -59,7 +65,6 @@ def processAll():
5965stash = StashInterface (FRAGMENT_SERVER )
6066config = stash .get_configuration ()
6167
62- log .debug (config )
6368settings ["transcodes_dir" ] = config ["general" ]["generatedPath" ]
6469settings ["hash_type" ] = config ["general" ]["videoFileNamingAlgorithm" ].lower ()
6570log .debug (settings )
Original file line number Diff line number Diff line change 11name : audio-transcodes
22description : Generate a transcode video from an audio file
3- version : 0.1
3+ version : 0.2
44url : https://github.com/stashapp/CommunityScripts/
55exec :
66 - python
You can’t perform that action at this time.
0 commit comments