Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab2b8b798f | ||
|
|
3378ab4663 |
@@ -309,7 +309,7 @@ local function export_both()
|
||||
end
|
||||
|
||||
for i, j in ipairs(jobs) do
|
||||
mp.command_native({
|
||||
mp.command_native_async({
|
||||
name = "subprocess", args = j.args,
|
||||
playback_only = false, capture_stdout = false, capture_stderr = false,
|
||||
}, function(success, result, err)
|
||||
|
||||
@@ -238,7 +238,7 @@ local function export_loop()
|
||||
-- Only normal (no adjustments — skip making an identical duplicate)
|
||||
osd_msg(string.format("Exporting loop (normal) ..."), 2)
|
||||
|
||||
mp.command_native({
|
||||
mp.command_native_async({
|
||||
name = "subprocess", args = normal_args,
|
||||
playback_only = false, capture_stdout = false, capture_stderr = false,
|
||||
}, function(success, result, err)
|
||||
@@ -289,7 +289,7 @@ local function export_loop()
|
||||
for i = 1, 2 do
|
||||
local idx = i
|
||||
local args = (idx == 1) and normal_args or modified_args
|
||||
mp.command_native({
|
||||
mp.command_native_async({
|
||||
name = "subprocess", args = args,
|
||||
playback_only = false, capture_stdout = false, capture_stderr = false,
|
||||
}, function(success, result, err)
|
||||
|
||||
@@ -142,7 +142,7 @@ local function capture_pair()
|
||||
print(string.format("[screenshot-duo] Normal: %s", normal_path))
|
||||
print(string.format("[screenshot-duo] Modified: %s", modified_path))
|
||||
|
||||
mp.command_native({
|
||||
mp.command_native_async({
|
||||
name = "subprocess",
|
||||
args = ffmpeg_args,
|
||||
playback_only = false,
|
||||
|
||||
@@ -60,13 +60,19 @@ local function transcribe()
|
||||
local transcriber = os.getenv("HOME") .. "/.local/bin/transcribe-video"
|
||||
mp.osd_message("Transcribing subtitles ...", 1)
|
||||
|
||||
local shell_cmd = "export LD_LIBRARY_PATH=/opt/cuda/targets/x86_64-linux/lib; "
|
||||
.. transcriber .. " --srt \"" .. abs_path .. "\" \"" .. srt_path .. "\" &>/dev/null &"
|
||||
|
||||
-- Silence the transcriber's output like the old `&>/dev/null` did, but WITHOUT handing a
|
||||
-- shell an interpolated path: the command string below is a constant, and the paths travel
|
||||
-- as positional parameters ($1, $2), so a filename can never be parsed as shell syntax.
|
||||
mp.command_native({
|
||||
name = "subprocess",
|
||||
args = { "bash", "-c", shell_cmd },
|
||||
args = {
|
||||
"sh", "-c",
|
||||
"exec \"$0\" --srt \"$1\" \"$2\" >/dev/null 2>&1",
|
||||
transcriber, abs_path, srt_path,
|
||||
},
|
||||
env = { "LD_LIBRARY_PATH=/opt/cuda/targets/x86_64-linux/lib" },
|
||||
playback_only = false,
|
||||
detach = true,
|
||||
})
|
||||
|
||||
poll_srt(srt_path, 0, 900)
|
||||
|
||||
Reference in New Issue
Block a user