16 posts in this topic

Posted

Hello,

If I've a folder includes 10 .mp4 files.

I'd like to compress these 10 files using 7z, so I right click each file and do the process to add to archive.

The result is 10 compressed .7z files.

I do not want to compress all files into one big archive.

My question is how to comprress each file of these 10 .avi seperately once into .7z, or in other word in one step instead of re-do the process for 10 times?

If there is any other tool to do the job it will be good as well.

Share this post


Link to post
Share on other sites

Posted

Can't see an option to do that with 7zip. It's there in WinRAR though.

Edit: http://notepad.pathe...-line-examples/

Share this post


Link to post
Share on other sites

Posted

but how to apply these commands lines?

Share this post


Link to post
Share on other sites

Posted

drag-and-drop onto batch file

http://dropcanvas.com/w7u6a/1


@echo off

rem 7z.exe path

set sevenzip=

if [%1]==[] echo file not found&pause&exit

if "%sevenzip%"=="" if exist "%ProgramFiles(x86)%\7-zip\7z.exe" set sevenzip=%ProgramFiles(x86)%\7-zip\7z.exe

if "%sevenzip%"=="" if exist "%ProgramFiles%\7-zip\7z.exe" set sevenzip=%ProgramFiles%\7-zip\7z.exe

if "%sevenzip%"=="" echo 7-zip not found&pause&exit

cd /d %~dp1||(echo ERROR&pause&exit)

echo %~dp1

echo %~x1

pause

for %%a in (*%~x1) do "%sevenzip%" a "%%~na.7z" "%%a"

pause

Share this post


Link to post
Share on other sites

Posted

OziZtl.jpg

PgO0Cl.jpg

This is the folder I want to compress files included into seperated files.

When I run the batch file I get this error that file not found, and when I press any key to continue I found it close itself.

Please help.

Share this post


Link to post
Share on other sites

Posted

http://dropcanvas.com/w7u6a/3


@echo off

cd /d %~dp0

rem 7z.exe path

set sevenzip=

if "%sevenzip%"=="" if exist "%ProgramFiles(x86)%\7-zip\7z.exe" set sevenzip=%ProgramFiles(x86)%\7-zip\7z.exe

if "%sevenzip%"=="" if exist "%ProgramFiles%\7-zip\7z.exe" set sevenzip=%ProgramFiles%\7-zip\7z.exe

if "%sevenzip%"=="" echo 7-zip not found&pause&exit

set extension=.mp4

for %%a in (*%extension%) do "%sevenzip%" a "%%~na.7z" "%%a"

pause

1 person likes this

Share this post


Link to post
Share on other sites

Posted

http://dropcanvas.com/w7u6a/3


@echo off

cd /d %~dp0

rem 7z.exe path

set sevenzip=

if "%sevenzip%"=="" if exist "%ProgramFiles(x86)%\7-zip\7z.exe" set sevenzip=%ProgramFiles(x86)%\7-zip\7z.exe

if "%sevenzip%"=="" if exist "%ProgramFiles%\7-zip\7z.exe" set sevenzip=%ProgramFiles%\7-zip\7z.exe

if "%sevenzip%"=="" echo 7-zip not found&pause&exit

set extension=.mp4

for %%a in (*%extension%) do "%sevenzip%" a "%%~na.7z" "%%a"

pause

Amazing you are the man and thanks a lot.

Please one last thing, please in this little script may you tell me what is the setting for the 7z to get the most maximum compression?

Thanks a lot.

Share this post


Link to post
Share on other sites

Posted

for %%a in (*%extension%) do "%sevenzip%" a "%%~na.7z" "%%a"

->

for %%a in (*%extension%) do "%sevenzip%" a -mx "%%~na.7z" "%%a"

have fun :)

Share this post


Link to post
Share on other sites

Posted

In the future, just:

  1. Select the files or folders
  2. Right click (assuming you enabled 7z shell integration)
  3. Go to7-zip
  4. Click add to archive
  5. Change archive format to 7z
  6. Choose a file size in the section "split to volume, bytes"
  7. Press OK

Seeing as you want 10 files, just divide the total uncompressed file size in a Google search like this:

49.75 megabytes in bytes (Or whatever the size your file selection is)

Then just divide the number by 10 or whatever amount of files you want and enter this into "Split to volumes, bytes"

Share this post


Link to post
Share on other sites

Posted

for %%a in (*%extension%) do "%sevenzip%" a "%%~na.7z" "%%a"

->

for %%a in (*%extension%) do "%sevenzip%" a -mx "%%~na.7z" "%%a"

have fun :)

what does -mx means?

In the future, just:

  1. Select the files or folders
  2. Right click (assuming you enabled 7z shell integration)
  3. Go to7-zip
  4. Click add to archive
  5. Change archive format to 7z
  6. Choose a file size in the section "split to volume, bytes"
  7. Press OK

Seeing as you want 10 files, just divide the total uncompressed file size in a Google search like this:

49.75 megabytes in bytes (Or whatever the size your file selection is)

Then just divide the number by 10 or whatever amount of files you want and enter this into "Split to volumes, bytes"

But I do not want to split anything at all and want to make it each file compressed seperated.

Share this post


Link to post
Share on other sites

Posted

http://sevenzip.sour...d.htm#SevenZipX

-mx=5 normal compression

-mx=7 maximum compression

-mx=9 ultra compression

-mx is identical to -mx=9

edit:

i ran some tests

Path = mx5.7z

Method = LZMA2:24 BCJ

Physical Size = 6591553

Path = mx7.7z

Method = LZMA2:24m BCJ

Physical Size = 6567395

Path = mx9.7z

Method = LZMA2:24m LZMA:20 BCJ2

Physical Size = 6443632

Path = mx.7z

Method = LZMA2:24m LZMA:20 BCJ2

Physical Size = 6443632

1 person likes this

Share this post


Link to post
Share on other sites

Posted

http://sevenzip.sour...d.htm#SevenZipX

-mx=5 normal compression

-mx=7 maximum compression

-mx=9 ultra compression

-mx is identical to -mx=9

thanks

Share this post


Link to post
Share on other sites

Posted

Not sure I understand the point of this exercise.. Mp4 files rarely compress much at all, no matter what setting you tell your compression software to use.

I just did a test setting to ultra, and the 7z is actually bigger ;)

post-14624-0-28569400-1354972586.png

Share this post


Link to post
Share on other sites

Posted

You can also use PeaZip. It supports .7z and has an option to compress each file into a separate archive.

Share this post


Link to post
Share on other sites

Posted

Thanks and i will test it.

Share this post


Link to post
Share on other sites

Posted

So how much compression are you getting - this exercise seems completely pointless to me if what your saving is a few kb.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.