Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old Yesterday, 00:42
_contextmodel _contextmodel is offline
Registered User
 
Join Date: Sep 2026
Location: Germany
Posts: 4
Thanks: 0
Thanked 11 Times in 2 Posts
_contextmodel is on a distinguished road
Lightbulb balrogg: lossless Vorbis/Opus recompressor

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

The source code (GPLv3) and binaries are available here: https://github.com/iczelia/balrogg.

Hopefully some find this useful. The Windows binaries are attached to the thread (64-bit, 32-bit modern Windows, 32-bit Windows 95 and newer).

Edit (05/09/26):
- v1.1 is now attached. It slightly improves compression and decompression speed and memory usage. It also accepts more valid Vorbis and Opus files. Until v2.0 is reached, the releases will be neither forwards- nor backwards-compatible
Attached Files
File Type: zip balrogg-1.1.zip (310.6 KB, 8 views)

Last edited by _contextmodel; Yesterday at 13:39.
Reply With Quote
The Following 9 Users Say Thank You to _contextmodel For This Useful Post:
DomoVoi_96 (Yesterday), Dunnowho69 (Yesterday), KaktoR (Yesterday), kj911 (Yesterday), Masquerade (Yesterday), Razor12911 (Yesterday), ScOOt3r (Yesterday), shazzla (Yesterday), Spinneret94 (Yesterday)
Sponsored Links
  #2  
Old Yesterday, 08:19
kj911 kj911 is offline
Registered User
 
Join Date: Apr 2010
Location: world
Posts: 246
Thanks: 163
Thanked 94 Times in 67 Posts
kj911 is on a distinguished road
Very good work!

In the case of the OGG container format, 5 different encoding profiles were tested (see sample files, description), where in the case of small >30s sample files, it processed the files flawlessly, while on a ~2 hour test file (different source material), it only partially succeeded, with various error messages or endless encoding loops. The memory usage was always between ~200,000KB and ~270,000KB, slowly increasing, over and over again, without writing an output file. Compared to OGGRE, it consumes 2-3-4* more memory, but often with better results. It also brought more than 10% size reduction on the tested OPUS file.
Attached Files
File Type: arc ogg_samples.arc (1.44 MB, 2 views)
File Type: txt opus.txt (1.5 KB, 5 views)
Reply With Quote
  #3  
Old Yesterday, 09:39
_contextmodel _contextmodel is offline
Registered User
 
Join Date: Sep 2026
Location: Germany
Posts: 4
Thanks: 0
Thanked 11 Times in 2 Posts
_contextmodel is on a distinguished road
kj911, thank you for the test. Would you mind sharing the corpus used, so that the failures can be pinned down? The high memory usage, among other issues that you observed, is unintended (unless working in parallel).

Last edited by _contextmodel; Yesterday at 09:44.
Reply With Quote
  #4  
Old Yesterday, 13:13
kj911 kj911 is offline
Registered User
 
Join Date: Apr 2010
Location: world
Posts: 246
Thanks: 163
Thanked 94 Times in 67 Posts
kj911 is on a distinguished road
The test corpus is a bit problematic (and the net too, up: <20kB/s!), at least in terms of public and copyright.

The small samples are from ESB, I'm now testing this quickly to see how the program reacts to converting the entire 2-hour file to OGG. (Source It's in 256kbps AC3.) The problematic cases written in TXT occurred on the ANH audio. (It's in PCM as part of a 10+ GB MKV file.) What is questionable is whether the error appears depending on the given audio and/or just the time length. I also tested it on a 100+ minute OPUS file, without error. (With audio copied from a WEBM video, taken from a video hosting site.)

The conversion/copying was done using XMedia Recode 3.2.7.1 x86 (last XP-compatible release).

UPD: Infinite loop again!

Source: ESB / 2hr / 256kbps AC3

128kbps, Vorbis/ABR OGG via l1: Works!
128kbps, Quality (q4) OGG via l9: Infinite compression loop. Level4 works. (watch longer than 2-4minutes times the Windows Process Explorer.)

The errors you experienced can be easily reconstructed if you have ~2 hours (SW, etc...) of audio files and test all the OGG encoding settings that XMediaRecode allows when encoding audio files to OGG.

UPD2: Infinite loop = Various compression methods used, forced it??

First 10minutes piece from ANH audio, encoded to 128kbps/q4 OGG file: Memory fluctuation are present it avg. 8-12 or upto times (~18-24MB), compression finished! Default cases, 100MB's OGG handled it 1-2minutes times. And one compression steps. Level5 only two memory fluctuation and finished it 17 seconds. (5.8MB's OGG) Level1 in less than 2sec.

Other bugs, not easily reproducible. (packet ends/unpaired bits or any.)

Last edited by kj911; Yesterday at 13:53.
Reply With Quote
  #5  
Old Yesterday, 13:40
_contextmodel _contextmodel is offline
Registered User
 
Join Date: Sep 2026
Location: Germany
Posts: 4
Thanks: 0
Thanked 11 Times in 2 Posts
_contextmodel is on a distinguished road
Can you try v1.1 with the progress tracking enabled, and re-measure the encoding/decoding time and memory usage? I have done some tests on larger and more complex Vorbis files.
Reply With Quote
  #6  
Old Yesterday, 14:25
kj911 kj911 is offline
Registered User
 
Join Date: Apr 2010
Location: world
Posts: 246
Thanks: 163
Thanked 94 Times in 67 Posts
kj911 is on a distinguished road
Recreating problematic files again (few hours ago deleted it):

Encoding times avg. 13-15min per file from Xeon PC..

First test "packet ends" errors via v1.1 are fixed! (128kbps ABR Vorbis OGG case) ~25% reductions! (level1)

The "18 unparsed audio bits" error has also been fixed!

It looks like the error reported as "infinite loop" was most likely a mistake!
Running v1.1 once at level 9 on a 2-hour OGG file took about 20 minutes, if not longer, to compress.

The resulting file sizes, where I compared them, are a few hundred bytes larger for v1.1 than for files compressed by v1.0. (if this was the price of the bug fix, then OK!)

The circumstances of the following case in the first test are a bit confusing:

"128kbps Quality Vorbis OGG:
balrogg-i686.exe -1 e track3.ogg track3.blr
Works! Level 5 to 9 infinite looping compress, no output file. (not finished in below 5min)"

There is such a line in the first TXT: "89 206 180 track3.ogg"

For this file, it did not appear, it finished with it quickly. (both v1.0/v1.1 tested)

Maybe this was "75 731 994 track4.ogg" that problematic file??? I have not managed to reproduce it byte-by-byte so far.

I have not tested the OPUS file now.
Attached Files
File Type: txt ogg_test2.txt (2.7 KB, 3 views)

Last edited by kj911; Yesterday at 16:04. Reason: Added attachment and many infos.
Reply With Quote
  #7  
Old Today, 02:47
KaktoR's Avatar
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 4,735
Thanks: 1,113
Thanked 7,397 Times in 2,867 Posts
KaktoR is on a distinguished road
Looks like --jobs=N does not have any effect? Or how is it supposed to be used?

Edit: Here are some files for which balrogg does not work. They are ogg vorbis but something is off with them. You can check them out if you want.
https://pixeldrain.com/u/TD8wjGrG

Edit: Never mind, I used it wrong. --jobs=N is working.
__________________
Haters gonna hate

Last edited by KaktoR; Today at 03:11.
Reply With Quote
  #8  
Old Today, 03:18
KaktoR's Avatar
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 4,735
Thanks: 1,113
Thanked 7,397 Times in 2,867 Posts
KaktoR is on a distinguished road
Looks like -5 is the sweet spot here, at least for vorbis set I have.

Input 90.419.200 Bytes
Setting --jobs=6 -b e
Code:
-1
Clock Time       :           2.907s
Output 81.047.039 Bytes

-5
Clock Time       :          25.681s
Output 79.436.915 Bytes

-9
Clock Time       :         109.501s
Output 79.430.984 Bytes
__________________
Haters gonna hate

Last edited by KaktoR; Today at 03:20.
Reply With Quote
The Following User Says Thank You to KaktoR For This Useful Post:
shazzla (Today)
  #9  
Old Today, 03:57
kj911 kj911 is offline
Registered User
 
Join Date: Apr 2010
Location: world
Posts: 246
Thanks: 163
Thanked 94 Times in 67 Posts
kj911 is on a distinguished road
Kaktor: Does OGGRE process the problematic files? Have you tested the program on OPUS files (compressed or not)?

A more general question, regarding games...

Since you are the main tester of the forum, you have already tested many games: How common is it in games of the last 20 years (ex: GTA: SA) and are there any examples of it, that OGG or OPUS audio files of 1-2 CDs (or even more) are found? Which is the most glaring case?

_contextmodel: Would it be possible to add streaming/stdio support in the later ones, so that they can be used like, say, OGGRE, via FreeArc? Can the files be unpacked with CLS? (without writing temporary files)
Reply With Quote
  #10  
Old Today, 04:04
_contextmodel _contextmodel is offline
Registered User
 
Join Date: Sep 2026
Location: Germany
Posts: 4
Thanks: 0
Thanked 11 Times in 2 Posts
_contextmodel is on a distinguished road
kj911, KaktoR,

I am working on v1.2 (to make the tool a bit faster, work better on Windows, and so on). In principle due to the specifics of how OGG files work, without seekable stream support, they have to be buffered. Perhaps there is a way around this. I have never used FreeArc and I don't know what CLS is.
Reply With Quote
The Following 2 Users Say Thank You to _contextmodel For This Useful Post:
KaktoR (Today), kj911 (Today)
  #11  
Old Today, 04:06
KaktoR's Avatar
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 4,735
Thanks: 1,113
Thanked 7,397 Times in 2,867 Posts
KaktoR is on a distinguished road
Quote:
Originally Posted by kj911 View Post
Kaktor: Does OGGRE process the problematic files? Have you tested the program on OPUS files (compressed or not)?

A more general question, regarding games...

Since you are the main tester of the forum, you have already tested many games: How common is it in games of the last 20 years (ex: GTA: SA) and are there any examples of it, that OGG or OPUS audio files of 1-2 CDs (or even more) are found? Which is the most glaring case?


Oggre does not work on them either.

I already tested opus and it works.

I think vorbis is more common than opus.

Test on the attachment. It is opus.
Attached Files
File Type: 7z 000000001260098B_ogg.7z (2.14 MB, 4 views)
__________________
Haters gonna hate

Last edited by KaktoR; Today at 04:09.
Reply With Quote
  #12  
Old Today, 05:35
kj911 kj911 is offline
Registered User
 
Join Date: Apr 2010
Location: world
Posts: 246
Thanks: 163
Thanked 94 Times in 67 Posts
kj911 is on a distinguished road
Quote:
Originally Posted by _contextmodel View Post
In principle due to the specifics of how OGG files work, without seekable stream support, they have to be buffered. Perhaps there is a way around this. I have never used FreeArc and I don't know what CLS is.
Here in this post, there is a small archive that you can use to test in practical conditions how to use OGGRE with FreeArc when repackaging games.

Also study the DiskSpan GUI tool, you will find a lot of interesting things.
Reply With Quote
  #13  
Old Today, 05:46
KaktoR's Avatar
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 4,735
Thanks: 1,113
Thanked 7,397 Times in 2,867 Posts
KaktoR is on a distinguished road
It already works with freearc. However it looks like you have to use solid=0, therefore you cannot use --jobs option I guess.

Code:
[External compressor:balrogg]
header    = 0
solid      = 0
packcmd   = balrogg64.exe -1 e $$arcdatafile$$.ogg $$arcdatafile$$.blr
unpackcmd = balrogg64.exe d $$arcdatafile$$.blr $$arcdatafile$$.ogg
datafile   = $$arcdatafile$$.ogg
packedfile = $$arcdatafile$$.blr
__________________
Haters gonna hate

Last edited by KaktoR; Today at 05:55.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
AFR (Anvil Forge Recompressor) oltjon Conversion Tutorials 39 08-05-2023 04:45
ZREC - Yet another zlib recompressor 78372 Software 0 24-08-2020 09:44



All times are GMT -7. The time now is 09:11.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com