Balrogg:恶魔级压缩(最高 15%)的无损 Vorbis/Opus 重压缩工具
Balrogg: Demonically compacting (up to 15%) lossless Vorbis/Opus recompressor

原始链接: https://github.com/iczelia/balrogg

**balrogg** 是一款专为 Ogg Vorbis 和 Opus 音频文件进行无损重压缩而设计的命令行工具。它通过使用 .blr 文件格式,可以显著节省存储空间——通常 Vorbis 可节省 8–12%,Opus 可节省 3–8%。 主要特性包括: * **性能:** 提供九种压缩等级。较高的等级(最高 -9)会增加编码时的搜索时间,但仍能保持快速且一致的解码速度。 * **批量处理:** 支持多线程执行以处理大型音频库,并可选择显示进度报告。 * **可移植性与安全性:** 使用 C99 编写,具有极高的可移植性,经证实支持 Windows(包括 Win95 目标平台)和 MS-DOS。它会对输入文件进行严格校验,拒绝任何无法被精确还原的数据,以确保比特级的完整性。 * **易于使用:** 简洁的命令语法(`e` 用于编码,`d` 用于解码),便于无缝集成。 该工具采用 GNU GPLv3 协议授权,源代码和二进制文件可在 [GitHub](https://github.com/iczelia/balrogg) 获取。该工具设计轻量,仅依赖标准 C 库和数学库,是实现高效、可靠且与平台无关的音频存档的稳健选择。

抱歉。
相关文章

原文

balrogg losslessly recompresses Ogg Vorbis and Opus files. Archives are typically 8-12% smaller than .ogg files and 3-8% smaller than .opus files.

balrogg is licensed under GNU GPL version 3. See COPYING. Report issues to Kamila Szewczyk [email protected]. The project is hosted at https://github.com/iczelia/balrogg.

balrogg e music.ogg music.blr
balrogg d music.blr music.ogg
balrogg -b e *.ogg *.opus
balrogg --progress -9 e music.ogg music.blr

e compresses and d expands. balrogg detects the codec. With -b, every remaining path is processed using the available cores and memory. Encoding appends .blr; decoding removes it. Larger inputs run first.

-p or --progress displays a progress bar on stderr for encoding and decoding, with each Vorbis tuning trial identified separately. Use --progress-lines for logs. Batch progress uses separate lines labeled with the input filename.

Use your package manager or download a binary from GitHub Releases. To build a release tarball, run

./configure
make
sudo make install

The project uses C99 and only the C and math libraries. The Opus parser under src/opus is derived from libopus.

Configure option Effect
--enable-sanitizers Enable ASan and UBSan for tests
--disable-simd Build the portable mixer only
--with-windows-target=win95 Target Windows 95 on an i486 (MinGW, 32-bit)

Run ./bootstrap first when building from a Git checkout. It requires autoconf and automake.

-1 through -9 select effort; the default is -9. Through -4, each level adds a residue-model stage and affects decoding. Higher levels only expand the parameter search, so -4 through -9 decode at the same speed. Vorbis tuning evaluates the complete file at each selected setting. The best candidate is retained in the destination file, with at most the best and current candidate present during a trial.

Results for a five-megabyte music file follow.

Level Vorbis Opus
-1 8.3 percent smaller at 6.4 MB/s 4.0 percent smaller at 4.2 MB/s
-9 9.8 percent smaller at 2.9 MB/s 4.8 percent smaller at 2.4 MB/s

The encoder refuses files it cannot reproduce exactly, including files with bad checksums, invalid page sequences, unsupported Vorbis features, or no final end-of-stream page.

Vorbis packets with extra padding or alternative floor subclass choices retain normal floor and residue compression. Classword corrections and padding are modeled separately. Shortened packets (packet peeling) use an adaptive byte model.

Opus support is limited to one mono or stereo logical stream with channel mapping family 0. Packets, including OpusHead and OpusTags, are limited to 61,440 bytes; extended frame headers and padding are supported within that limit. Chained and multichannel Opus files are refused. Refusals produce a diagnostic and exit status 1.

Code Meaning
0 Success
1 Malformed, unsupported, or unrecognized input
2 Usage error
3 File access error
4 Internal error

Batch mode returns the highest nonzero status reported by any file.

Performance and portability

Each file uses one thread and requires seekable input and output files. Vorbis model pages are allocated only when used, without relying on deferred OS allocation.

Supported hosts apply a 2 GiB process memory cap to reject unreasonable allocations. Set BLR_MEMCAP to another size in MiB, or to 0 to disable the cap.

Archives are portable across hosts. Windows builds use MinGW as follows:

./configure --host=x86_64-w64-mingw32 CC=x86_64-w64-mingw32-gcc LDFLAGS=-static
make

A Windows 95 build uses a small KERNEL32 runtime and targets i486.

./configure --host=i686-w64-mingw32 --with-windows-target=win95 \
            CC=i686-w64-mingw32-gcc LDFLAGS=-static
make && make win95-check

win95-check verifies the loader baseline, PE flags, and KERNEL32 imports. An MS-DOS build uses DJGPP and needs an i386 with a DPMI host such as CWSDPMI.

./configure --host=i586-pc-msdosdjgpp CC=i586-pc-msdosdjgpp-gcc
make

DOS batch mode replaces the extension and runs serially. song.ogg becomes song.blr, then expands to song.ogg or song.opu for Opus.

联系我们 contact @ memedata.com