aboutsummaryrefslogtreecommitdiffstats
path: root/macros/audio-clipper.lua
diff options
context:
space:
mode:
authorgarret <garret@airmail.cc>2021-12-15 19:45:50 +0000
committergarret <garret@airmail.cc>2021-12-15 19:49:59 +0000
commit37de70000ec5bd76ceaa436cd05d57f201e29b33 (patch)
tree061cb1fa8a4a0b53796cc8af1c95a7136eb3a072 /macros/audio-clipper.lua
parent472fc5337dc41abc9545256720f3265f466f9b16 (diff)
downloadaegisub-scripts-37de70000ec5bd76ceaa436cd05d57f201e29b33.tar.gz
aegisub-scripts-37de70000ec5bd76ceaa436cd05d57f201e29b33.tar.bz2
aegisub-scripts-37de70000ec5bd76ceaa436cd05d57f201e29b33.zip
use -ss and -to "properly"
this way just seeks to the bit you need and _then_ extracts it, instead of decoding everything and chucking away the bits we didn't ask for. massive performance increase, should've rtfm'd earlier
Diffstat (limited to 'macros/audio-clipper.lua')
-rw-r--r--macros/audio-clipper.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/macros/audio-clipper.lua b/macros/audio-clipper.lua
index 8576688..fbab298 100644
--- a/macros/audio-clipper.lua
+++ b/macros/audio-clipper.lua
@@ -60,10 +60,10 @@ end
function extract_audio(in_path, start_time, end_time, out_path, name, extension, copy)
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')
+ os.execute('ffmpeg -ss '..start_time..'ms -to '..end_time..'ms -i "'..in_path..'" -codec copy -vn "'..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.
elseif copy == false then
- os.execute('ffmpeg -i "'..in_path..'" -vn -ss '..start_time..'ms -to '..end_time..'ms "'..out_path..name..'.'..extension..'" -y')
+ os.execute('ffmpeg -ss '..start_time..'ms -to '..end_time..'ms -i "'..in_path..'" -vn "'..out_path..name..'.'..extension..'" -y')
-- same as above, but doesn't copy the stream (transcodes to flac)
end
end