mirror of
https://github.com/TangentFoxy/.lua-files.git
synced 2024-11-20 21:34:23 +00:00
imported bulk webm conversion script
This commit is contained in:
parent
72f059506c
commit
674afd81a2
24
2webm.lua
Normal file
24
2webm.lua
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#!/usr/bin/env luajit
|
||||||
|
-- any2webm.lua
|
||||||
|
-- Requires ffmpeg
|
||||||
|
-- Place in a directory with video files and they will all slowly be converted to webm files.
|
||||||
|
|
||||||
|
-- OS must be detected to choose list command
|
||||||
|
local ls
|
||||||
|
if package.config:sub(1,1) == "\\" then
|
||||||
|
ls = "dir /w /b > files.txt"
|
||||||
|
else
|
||||||
|
ls = "ls -1 > files.txt"
|
||||||
|
end
|
||||||
|
|
||||||
|
os.execute(ls)
|
||||||
|
|
||||||
|
os.execute("mkdir any2webm-output")
|
||||||
|
|
||||||
|
for line in io.lines("files.txt") do
|
||||||
|
if line:find("%.") and line ~= "files.txt" and line ~= "any2webm.lua" then
|
||||||
|
os.execute("ffmpeg -threads 1 -i \"" .. line .. "\" -threads 1 \"any2webm-output/" .. line .. ".webm\"")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
os.execute("rm files.txt")
|
Loading…
Reference in New Issue
Block a user