iczelia/balrogg

demonically compacting (up to 15%) lossless Vorbis/Opus recompressor

83

stars

18

commits

C

primary language

Sep 10, 2026

updated

README

balrogg

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 k@iczelia.net. The project is hosted at https://github.com/iczelia/balrogg.

Quick start

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

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.

Installation

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 optionEffect
--enable-sanitizersEnable ASan and UBSan for tests
--disable-simdBuild the portable mixer only
--with-windows-target=win95Target Windows 95 on an i486 (MinGW, 32-bit)

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

Effort

-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.

Results for a five-megabyte music file follow.

LevelVorbisOpus
-18.3 percent smaller at 6.4 MB/s4.0 percent smaller at 4.2 MB/s
-99.8 percent smaller at 2.9 MB/s4.8 percent smaller at 2.4 MB/s

Caveats

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.

Opus support is limited to one mono or stereo logical stream with channel mapping family 0. Chained and multichannel Opus files are refused. Refusals produce a diagnostic and exit status 1.

Exit status

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

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

Performance and portability

Each file uses one thread, with its input and archive held in memory. A 5 MB Vorbis file uses about 40 MB at -4 and 70 MB at -9. Small files are slower per byte because of model setup.

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.

Contributors

iczelia

18 commits

iczelia/balrogg

demonically compacting (up to 15%) lossless Vorbis/Opus recompressor

83

stars

18

commits

C

primary language

Sep 10, 2026

updated

README

balrogg

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 k@iczelia.net. The project is hosted at https://github.com/iczelia/balrogg.

Quick start

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

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.

Installation

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 optionEffect
--enable-sanitizersEnable ASan and UBSan for tests
--disable-simdBuild the portable mixer only
--with-windows-target=win95Target Windows 95 on an i486 (MinGW, 32-bit)

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

Effort

-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.

Results for a five-megabyte music file follow.

LevelVorbisOpus
-18.3 percent smaller at 6.4 MB/s4.0 percent smaller at 4.2 MB/s
-99.8 percent smaller at 2.9 MB/s4.8 percent smaller at 2.4 MB/s

Caveats

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.

Opus support is limited to one mono or stereo logical stream with channel mapping family 0. Chained and multichannel Opus files are refused. Refusals produce a diagnostic and exit status 1.

Exit status

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

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

Performance and portability

Each file uses one thread, with its input and archive held in memory. A 5 MB Vorbis file uses about 40 MB at -4 and 70 MB at -9. Small files are slower per byte because of model setup.

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.

Contributors

iczelia

18 commits

Languages

C

87.0%

Shell

3.6%

M4

3.4%

Perl

2.7%

Python

1.7%

Makefile

1.1%