From 9cc089e2d6e841879e430b01d2f3d92c8820523e Mon Sep 17 00:00:00 2001 From: metamuffin Date: Wed, 19 Mar 2025 14:06:38 +0100 Subject: rename files, clear readme --- bv1/tools/d-disp | 2 -- bv1/tools/d-dispd | 2 -- bv1/tools/d-save | 2 -- bv1/tools/d-saved | 2 -- bv1/tools/d4k-disp | 2 -- bv1/tools/d4k-dispd | 2 -- bv1/tools/decode-display | 2 ++ bv1/tools/decode-display-debug | 2 ++ bv1/tools/decode-save | 2 ++ bv1/tools/decode-save-debug | 2 ++ bv1/tools/e | 2 -- bv1/tools/e4k | 2 -- bv1/tools/encode | 2 ++ readme.md | 21 +++++++++------------ 14 files changed, 19 insertions(+), 28 deletions(-) delete mode 100755 bv1/tools/d-disp delete mode 100755 bv1/tools/d-dispd delete mode 100755 bv1/tools/d-save delete mode 100755 bv1/tools/d-saved delete mode 100755 bv1/tools/d4k-disp delete mode 100755 bv1/tools/d4k-dispd create mode 100755 bv1/tools/decode-display create mode 100755 bv1/tools/decode-display-debug create mode 100755 bv1/tools/decode-save create mode 100755 bv1/tools/decode-save-debug delete mode 100755 bv1/tools/e delete mode 100755 bv1/tools/e4k create mode 100755 bv1/tools/encode diff --git a/bv1/tools/d-disp b/bv1/tools/d-disp deleted file mode 100755 index d7b8feb..0000000 --- a/bv1/tools/d-disp +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/fish -cargo run --release -- -W 1920 -H 1080 decode | ffplay -loglevel quiet -video_size 1920x1080 -pixel_format rgb24 -f rawvideo pipe:0 \ No newline at end of file diff --git a/bv1/tools/d-dispd b/bv1/tools/d-dispd deleted file mode 100755 index 97a2b90..0000000 --- a/bv1/tools/d-dispd +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/fish -cargo run --release -- -W 1920 -H 1080 decode --debug | ffplay -loglevel quiet -video_size 1920x1080 -pixel_format rgb24 -f rawvideo pipe:0 \ No newline at end of file diff --git a/bv1/tools/d-save b/bv1/tools/d-save deleted file mode 100755 index 1f19994..0000000 --- a/bv1/tools/d-save +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/fish -cargo run --release -- -W 1920 -H 1080 decode | ffmpeg -pixel_format rgb24 -video_size 1920x1080 -framerate 30 -f rawvideo -i pipe:0 -i $argv[1] -map '0:v' -map '1:a' -c:v libsvtav1 -y data/output.webm diff --git a/bv1/tools/d-saved b/bv1/tools/d-saved deleted file mode 100755 index 16de45a..0000000 --- a/bv1/tools/d-saved +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/fish -cargo run --release -- -W 1920 -H 1080 decode --debug | ffmpeg -pixel_format rgb24 -video_size 1920x1080 -framerate 30 -f rawvideo -i pipe:0 -i $argv[1] -map '0:v' -map '1:a' -c:v libsvtav1 -y data/output-debug.webm diff --git a/bv1/tools/d4k-disp b/bv1/tools/d4k-disp deleted file mode 100755 index 1103cc2..0000000 --- a/bv1/tools/d4k-disp +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/fish -cargo run --release -- -W 4096 -H 2160 decode | ffplay -loglevel quiet -video_size 4096x2160 -pixel_format rgb24 -f rawvideo pipe:0 diff --git a/bv1/tools/d4k-dispd b/bv1/tools/d4k-dispd deleted file mode 100755 index 9ac3433..0000000 --- a/bv1/tools/d4k-dispd +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/fish -cargo run --release -- -W 4096 -H 2160 decode --debug | ffplay -loglevel quiet -video_size 4096x2160 -pixel_format rgb24 -f rawvideo pipe:0 diff --git a/bv1/tools/decode-display b/bv1/tools/decode-display new file mode 100755 index 0000000..d7b8feb --- /dev/null +++ b/bv1/tools/decode-display @@ -0,0 +1,2 @@ +#!/bin/fish +cargo run --release -- -W 1920 -H 1080 decode | ffplay -loglevel quiet -video_size 1920x1080 -pixel_format rgb24 -f rawvideo pipe:0 \ No newline at end of file diff --git a/bv1/tools/decode-display-debug b/bv1/tools/decode-display-debug new file mode 100755 index 0000000..97a2b90 --- /dev/null +++ b/bv1/tools/decode-display-debug @@ -0,0 +1,2 @@ +#!/bin/fish +cargo run --release -- -W 1920 -H 1080 decode --debug | ffplay -loglevel quiet -video_size 1920x1080 -pixel_format rgb24 -f rawvideo pipe:0 \ No newline at end of file diff --git a/bv1/tools/decode-save b/bv1/tools/decode-save new file mode 100755 index 0000000..1f19994 --- /dev/null +++ b/bv1/tools/decode-save @@ -0,0 +1,2 @@ +#!/bin/fish +cargo run --release -- -W 1920 -H 1080 decode | ffmpeg -pixel_format rgb24 -video_size 1920x1080 -framerate 30 -f rawvideo -i pipe:0 -i $argv[1] -map '0:v' -map '1:a' -c:v libsvtav1 -y data/output.webm diff --git a/bv1/tools/decode-save-debug b/bv1/tools/decode-save-debug new file mode 100755 index 0000000..16de45a --- /dev/null +++ b/bv1/tools/decode-save-debug @@ -0,0 +1,2 @@ +#!/bin/fish +cargo run --release -- -W 1920 -H 1080 decode --debug | ffmpeg -pixel_format rgb24 -video_size 1920x1080 -framerate 30 -f rawvideo -i pipe:0 -i $argv[1] -map '0:v' -map '1:a' -c:v libsvtav1 -y data/output-debug.webm diff --git a/bv1/tools/e b/bv1/tools/e deleted file mode 100755 index a85a767..0000000 --- a/bv1/tools/e +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/fish -ffmpeg -loglevel quiet -i $argv[1] -vf format=rgb24 -f rawvideo pipe:1 | cargo run --release -- -W 1920 -H 1080 encode $argv[2..] diff --git a/bv1/tools/e4k b/bv1/tools/e4k deleted file mode 100755 index 58e0b10..0000000 --- a/bv1/tools/e4k +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/fish -ffmpeg -loglevel quiet -i $argv[1] -vf format=rgb24 -f rawvideo pipe:1 | cargo run --release -- -W 4096 -H 2160 encode $argv[2..] diff --git a/bv1/tools/encode b/bv1/tools/encode new file mode 100755 index 0000000..abab962 --- /dev/null +++ b/bv1/tools/encode @@ -0,0 +1,2 @@ +#!/bin/fish +ffmpeg -loglevel quiet -i $argv[1] -vf scale=1920x1080,format=rgb24 -f rawvideo pipe:1 | cargo run --release -- -W 1920 -H 1080 encode $argv[2..] diff --git a/readme.md b/readme.md index a32a8a1..c1287b9 100644 --- a/readme.md +++ b/readme.md @@ -2,22 +2,19 @@ My experiments on lossy video compression. -## `bv1` - -A somewhat minimal video codec that is able to achieve quality comparable to -H.264. - ## Other codecs +- `bv1` A somewhat minimal video codec that is also the best one i could come up + with. - `evc` is my first proper attempt at video compression. features motion compensation and broken dct. -- `vgcodec` approximates images by drawing circles (on the GPU). +- `vgcodec` approximates images by drawing circles (on the GPU) (which doesnt + work well). - (`dhwt-codec` tries to compress using a discrete haar wavelet across all three - dimensions. that doesnt work well) + dimensions. which doesnt work well either) -## the test framework +## Trying it out -| Variable | Description | -| ---------- | ------------ | -| `V_WIDTH` | Video width | -| `V_HEIGHT` | Video height | +- `cd bv1` +- Run `./tools/encode sample-video.mkv | ./tools/decode-display` (or + decode-display-debug to show debug overlay) -- cgit v1.2.3-70-g09d2