From 674afd81a235a2d35f66b81062cca18242db97cf Mon Sep 17 00:00:00 2001 From: Tangent Date: Sat, 13 Jan 2024 15:55:15 -0700 Subject: [PATCH] imported bulk webm conversion script --- 2webm.lua | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 2webm.lua diff --git a/2webm.lua b/2webm.lua new file mode 100644 index 0000000..4175fd2 --- /dev/null +++ b/2webm.lua @@ -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")