diff options
author | garret <garret@airmail.cc> | 2021-04-10 22:56:04 +0100 |
---|---|---|
committer | garret <garret@airmail.cc> | 2021-04-10 22:56:04 +0100 |
commit | 2731b732871d522c87f838de8a5c286169352e2c (patch) | |
tree | 7824b85a32728db859e391d6beba88051ddb4b27 /audio-clipper.lua | |
parent | 53ce4e3bc5ea3f5596ccc58cde80ee40f9eadbd3 (diff) | |
download | aegisub-scripts-2731b732871d522c87f838de8a5c286169352e2c.tar.gz aegisub-scripts-2731b732871d522c87f838de8a5c286169352e2c.tar.bz2 aegisub-scripts-2731b732871d522c87f838de8a5c286169352e2c.zip |
[Audio Clipper] Make stream-copying work again
Diffstat (limited to 'audio-clipper.lua')
-rw-r--r-- | audio-clipper.lua | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/audio-clipper.lua b/audio-clipper.lua index 7da2311..6a834b4 100644 --- a/audio-clipper.lua +++ b/audio-clipper.lua @@ -1,7 +1,7 @@ script_name = "Audio Clipper" script_description = "Extracts audio from the selected line(s).\nNeeds ffmpeg." script_author = "garret" -script_version = "2021-04-06" +script_version = "2021-04-10" a = aegisub @@ -63,7 +63,7 @@ function extract_audio(in_path, start_time, end_time, out_path, name, extension, if copy == true then os.execute('ffmpeg -i "'..in_path..'" -codec copy -vn -ss '..start_time..'ms -to '..end_time..'ms "'..out_path..name..'.'..extension..'" -y') -- takes the video as input, copies the streams, but doesn't include video. sets it to start at the start of the selection, and end at the end of it. outputs to our chosen out path with our chosen name and extension. overwrites anything with the same name. - else + elseif copy == false then os.execute('ffmpeg -i "'..in_path..'" -vn -ss '..start_time..'ms -to '..end_time..'ms "'..out_path..name..'.'..extension..'" -y') -- same as above, but doesn't copy the stream (transcodes to flac) end @@ -105,15 +105,15 @@ function gui(subs, sel) if pressed == "Cancel" then a.cancel() elseif pressed == "OK" then - local do_copy = true + do_copy = true elseif pressed == "Just make it FLAC" then - local do_copy = false + do_copy = false end local extension = get_format(do_copy, results.format, results.custom) -- gets file extension local delay = results.delay in_path = results.in_path out_path = make_out_path(results.out_path) - loop(subs, sel, in_path, out_path, extension, copy, delay) + loop(subs, sel, in_path, out_path, extension, do_copy, delay) end function non_gui(subs, sel) -- no gui, so you can bind it to a hotkey |