ws-video: bench block (whole pipeline fps for MJPEG AVI / MPEG-1 TS / VP8 WebM / Y4M at 320x240 and 640x480, y4m -> MJPEG AVI), docs/video.md (API, layers, how a codec plugs into the registry), NOTICE row for mpegts-luau
This commit is contained in:
1 parent
26f4e0cb60
commit
0c9094d28a
4 files changed
+139
No files matched your search
@@ -0,0 +1,27 @@
|
||||
# Video bench inputs (tools/fixtures.py, for tools/bench.luau): 1 s of testsrc2 at 320x240 and 640x480, 25 fps, as
|
||||
# MJPEG AVI, MPEG-1 TS, VP8 WebM (libvpx) and 8 frames of 320x240 Y4M.
|
||||
# tests/gen/videobench.luau { { name, size, data } }
|
||||
import importlib.util, os, tempfile
|
||||
|
||||
_spec = importlib.util.spec_from_file_location("_video_helpers", os.path.join(os.path.dirname(os.path.abspath(__file__)), "_video.py"))
|
||||
V = importlib.util.module_from_spec(_spec)
|
||||
_spec.loader.exec_module(V)
|
||||
|
||||
INPUTS = ["tools/fixtures/_video.py"]
|
||||
|
||||
|
||||
def generate(ctx):
|
||||
tmp = tempfile.mkdtemp(prefix="videobench_")
|
||||
out = []
|
||||
for size in ("320x240", "640x480"):
|
||||
src = ["-f", "lavfi", "-i", "testsrc2=size=%s:rate=25" % size, "-t", "1"]
|
||||
for name, args in (("mjpeg.avi", ["-c:v", "mjpeg", "-q:v", "4"]),
|
||||
("mpeg1.ts", ["-c:v", "mpeg1video", "-b:v", "2M", "-bf", "2", "-f", "mpegts"]),
|
||||
("vp8.webm", ["-c:v", "libvpx", "-b:v", "1M", "-g", "50"]),
|
||||
("raw.y4m", ["-pix_fmt", "yuv420p", "-frames:v", "8"])):
|
||||
if name == "raw.y4m" and size == "640x480":
|
||||
continue
|
||||
path = os.path.join(tmp, size + "_" + name)
|
||||
V.ffmpeg(src + args + [path])
|
||||
out.append({"name": name, "size": size, "data": open(path, "rb").read()})
|
||||
ctx.emit("videobench", out)
|
||||
Reference in new issue
Block a user