7zip Ultra LZMA2 compression
Asked Answered
D

5

48

How can I convert this settings into command?

enter image description here

Here are the results:

// Manual Compression (see the image above)
Compressed Size: 12,647,451 bytes

// Ultra
7z a -t7z Files.7z -mx9 -aoa
Compressed Size: 12,676,886 bytes

// LZMA2
7z a -t7z Files.7z -m9=LZMA2 -aoa
Compressed Size: 14,237,515 bytes  

I am looking here:
https://7-zip.opensource.jp/chm/cmdline/switches/method.htm

I am about to put this in a batch file.

Dromous answered 27/3, 2014 at 7:32 Comment(2)
may be, if run in development or debug mode, you could gather these options as command line arguments?Preconcert
-aoa is an extraction option. It means don't overwrite files that already exist on disk. It is ignored when compressing files to an archive.Mays
D
72

Your command line should be at least:

7z a -t7z Files.7z -m0=lzma2 -mx=9 -aoa

Note that you'll get better compression when using 1 or 2 threads, not 8. So, even closer to your GUI settings (ms : solid, d : dictionary size, mhe : encrypt header (file names), p : password)

7z a -t7z -m0=lzma2 -mx=9 -aoa -mfb=64 -md=32m -ms=on -d=1024m -mhe -pSECRET
Disobedient answered 12/2, 2015 at 10:19 Comment(5)
I'm not sure as of which 7z version it barfs on -d=1024m, but this works for version 16.04 on Windows: 7z.exe a -t7z -m0=lzma2:d1024m -mx=9 -aoa -mfb=64 -md=32m -ms=on. I also append ` -sdel` to the options for moving files to an archive.Program
Using 1, 2 or 3 threads uses the same amount of memory for compression which makes me think that they all share the same dictionary. Based on my tests, there's no drop in compression efficiency for up to 3 threads.Garonne
-aoa is an extraction option. It means don't overwrite files that already exist on disk. It is ignored when compressing files to an archive.Mays
What is the significance of -t7z?Orebro
@Nilesh: -t7z = archive type 7zDisobedient
D
11

It's hard to get the same result, but this is the best I can get so far:

7z a -t7z Files.7z -m0=BCJ2 -m1=LZMA2:d=1024m -aoa
Dromous answered 27/3, 2014 at 11:29 Comment(4)
did it provide better compression?Preconcert
there would be only less than 1MB difference compared to using GUI.Dromous
btw, on my test this simple 7z a -t7z -mx9 worked better, but in my case the file was too small and may not work the same for you... anyway kgb -9 won but is slow... (oh btw I am on linux..)Preconcert
My server ran out of memory when I ran this, just fyiHague
O
9

For those who are on unix system, this is how I achieved this.

7z a -t7z -m0=lzma2 -mx=9 -mfb=64 -md=1024m -ms=on destination.7z Source

My source: http://manpages.ubuntu.com/manpages/artful/man1/7z.1.html

Ocampo answered 22/5, 2018 at 11:19 Comment(0)
T
4

I think you are looking for a tool like this:

https://axelstudios.github.io/7z/#!/

In this online tool, you set your settings and then you get correspondent command line options and parameters.

Trouper answered 16/10, 2022 at 10:6 Comment(0)
P
3

This command is creating for me the same output like the ultra configuration with the ui. I have found it in the documentation under examples. 560MB to 29MB (binary data with a lot duplicate files)

7za.exe a output.7z ./input -mx
Plagiary answered 9/6, 2021 at 6:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.