TVs. Consoles. Projectors and accessories. Technologies. Digital TV

How to compress data. How to archive a file in zip? It couldn't be simpler! How to compress a large file: detailed instructions

class="eliadunit">

Often in everyday life there is a need to compress files for the convenience of storing them, recording them on media and quickly exchanging them via social media, e-mail , file hosting services and other services on the global Internet. However, not all files are equally compressible. Text format files (txt, doc) are best compressed. Archive files (rar, zip, 7z, lha, tar, gz, jar, etc.), video (avi, mpeg, wmv, flv), music (mp3, wma, aac) and images (jpeg, jpg, gif , png) are slightly reduced in size because they are initially compressed files. This also includes Microsoft files Office with docx, xlsx extensions.

Specialized archiver programs, the most famous of which are WinRAR, 7zip and WinZip, compress (reduce the size) of files. We’ll talk about how to compress a file as much as possible in the WinRAR archiver.

To start packing files into an archive, your computer must have WinRAR archiver installed. To start the compression (archiving) operation, you need to select the files that you are going to compress. Then, by right-clicking on the selected area, call context menu, in which we select the line “Add to archive...”.

In the “Archive name and parameters” working window that appears, on the “General” tab, set the name of the future archive, and also select the format and compression method. For formats, we recommend choosing the publicly available ZIP format, since some operating systems have difficulty reading the RAR format. In the “Compression method” drop-down menu, select “Maximum” accordingly. Click OK.

class="eliadunit">

To set your own compression settings for the RAR format, go to the “Advanced” tab and click on the “Compression Settings” button in the “NTFS Settings” group. In the new dialog box, you can select specific parameters for text, audio and full-color graphics compression, select the main compression algorithm, etc.

For adding a new file to an existing archive with maximum compression, you need to open this archive and select the line “Add file to archive” in the “Commands” menu; it's even easier to drag and drop required file into the program window. This will automatically open a new Archive Name and Options dialog box. All you have to do is set the compression method to “Maximum” for the new file and click on the OK button.

I think reading the article did you good. Now questions about maximum compression in WinRar are a thing of the past, and if they arise or are forgotten, then our website will help in restoring computer knowledge!

Question from a user

Hello, Alexander. Is there any way to compress a video without losing quality? Not long ago I downloaded a program (about which they wrote something similar) and tried it - the video still looked worse, the quality dropped noticeably...

Hello!

In general, this is a fairly popular question, and beginner video enthusiasts often fall for this “bait” - you can compress any video, but there will almost always be a loss in quality! Another thing is that in some cases it is noticeable to the eye, in others even the experienced eye of a film fan is not able to see the difference!

In this article I want to talk in more detail about how to compress video, and how, and in what cases, to do it “without loss of quality” (note that I put the phrase in quotes).

A little theory: what you need to know for proper compression

Complex terms related to video processing have been deliberately removed from the article. The article is simplified as much as possible so that it can be understood by the most ordinary users who are faced with the problem of video conversion and compression.

In general, almost all videos (99.9%) that you find on the Internet (watch, download, etc.) are already compressed with some kind of codec. Uncompressed video - takes quite a bit big size on disk (for example, one high-quality movie can take up several terabytes!).

So, the key here is that different codecs use different algorithms and provide different degrees of file compression. Naturally, this determines how your file will be displayed later, after compression, and how much disk space the file will take up.

Thus, in order to be able to compress a video without losing quality, you need to proceed from 2 points:

  1. if the video was compressed with a “weak” codec(which provides far from maximum compression) - then it can be compressed and reduce the size of the video file, without compromising the quality of the picture (by the way, as a rule, in this case, you need a more powerful PC for viewing. For example, MPEG2 video can be watched on a weaker PC (without jerks and delays) than, say, MP4, well, I’ll say a few more words about this below);
  2. from the device on which you want to watch the video. For example, if you are watching a video on big screen with a low resolution, you simply won’t notice the difference in video quality (be it 1 GB or, say, 300 MB)! To see the difference, you need to open the video on some big TV screen.

That is, I think my message is clear: if you watch a video on a screen with a resolution of 1024x768 (or in such a “window” of Windows, and in the next one you work...), and your video quality is 1920x1080 - this video can be compressed to a lower resolution and with a more optimal codec.

By the way, we must not forget about one more parameter - bitrate (the number of bits used to store one second of multimedia content). The higher the video resolution, the higher the bitrate should be. If the bitrate is very high, then it can be reduced to reasonable limits when compressing the file. For example, the maximum bitrate when creating a Blu-Ray disc is 35 mbps. So, the difference between 30 and 35 is not easy to notice, but between 5 and 35 it will catch your eye...

Note: It’s now popular to download videos to your phone/tablet and then watch them somewhere on the go. So, such a video is not only possible, but even recommended, to be compressed and then downloaded to your mobile device.

Here's the thing: firstly, the compressed video will take up less space on your flash drive (and mobile devices don't have that much memory); and secondly, the video will not slow down (as often happens with unprepared video for downloading to mobile devices).

About codecs and containers: what is worth trying to compress and what not

There are dozens (if not hundreds) of video formats in which it is distributed. Each format has its own disadvantages and advantages, some of them are already outdated, others, on the contrary, have just appeared.

In this small subsection I want to dwell on the most popular formats that you come across, and also say a few words about the advisability of compressing a particular format.

Note: by the way, you should distinguish between the codec and the container. For example, the file format is AVI (this is a container), and it can be compressed using various codecs: Microsoft VC-1 or x.264 (for example).

About Codecs

Large selection of codecs for Windows -

x.264/ MPEG-4 AVC is probably the most common codec. Used in most video and photo cameras in which captured footage is stored on hard drives, memory cards, etc. x.264 is probably becoming the most popular codec. Adobe supports it in Flash movies, x.264 can be used with images in HTML 5.

MJPEG (Motion JPEG) . Old codec for video compression. Today it is outdated and rarely used.

MPEG-2. There is the MPEG-2 codec (known as x.262), and there is also the MPEG-2 container format. MPEG-2 is used for video on DVDs and signals transmitted over terrestrial television channels. In general, it provides optimal ratio quality/file size. Supported by almost all players.

Microsoft VC-1. Microsoft VC-1 is used as an alternative technology Adobe Flash, used in the Microsoft Silverlight Internet platform. Provides average compression quality.

MPEG-1. An outdated codec for video compression (replaced by MPEG2). Previously, such videos could be found on CDs. Nowadays it’s becoming less and less common, although if you like to watch old videos, you’ve probably come across it.

WMV. Eat Windows Media Video codec, and there is a container of the same name. Provides very high quality video compression, with a fairly good picture. Very popular and widespread.

DivX - video codec, different versions which comply with MPEG-4 part 2, MPEG-4 part 10 (MPEG-4 AVC, H.264) standards.

Xvid (formerly "XviD") is an MPEG-4 Part 2 video compression library. By the way, the compression methods used in MPEG-4 are patented, so using Xvid may be illegal in some countries.

About containers

There are now dozens of containers, each with its own pros and cons. Container, except compressed video some codec, they also contain sound (which is also compressed. Audio, as a rule, takes up quite a bit of space, so I don’t consider audio codecs, their influence on the file size is not significant) .

AVI (or Audio Video Interleave)– one of the most popular containers from Microsoft. Most often, video on a PC is found in this format. By the way, for some reason many people do not recommend compressing modern video into this format.

MP4. This container format was developed by Motion Pictures Expert Group. Many users call it MPEG-4. Typically, video in MP4 files is encoded with the x.264 codec, and audio with the AAC codec. Sometimes there may be other codecs in this container...

VOB and BDAV MPEG-2. Used for packaging videos on DVD and Blu-ray discs. Blu-ray discs (.m2ts) can contain video compressed with x.264 and VC-1 codecs.

ASF (Advanced Systems Format) – found in several extensions: .asf, .wma and .wmv. By the way, it is most likely that the file in the .wmv format is compressed with the WMV (Windows Media Video) codec, but the file itself is placed in an ASF container file.

QuickTime. The brainchild of Apple. The container supports many codecs for audio and video. Apple is a proponent of x.264, so QuickTime files (formats: .mov, .qt) most often contain video compressed with the x.264 codec.

Flash. The Flash container format from Adobe is quite popular, by the way.

Matroska (.mkv, .mk3d, .mka, .mks) is a very popular and in demand container today. Free, open - this is probably why it has become widespread. Many high-quality videos are distributed in this container.

DiVX. Very common both codecs and container. The format is also of the same name - .divx. By the way, the codec is of “pirated” origin, allowing you to get high quality video with strong compression. For some time, Divx was not recognized by “big” equipment manufacturers, however, today many already integrate DiVX hardware codecs into most equipment (if it weren’t for the popularity of video files of this format, nothing would probably have happened...).

Which codec and container to choose

  1. If you want to get maximum video compression, it is logical to choose the x.264 codec, which provides excellent compression with good quality. However, keep in mind that not all equipment (especially not the newest) allows you to view such files. If the video is very high resolution- then even modern low-power PCs will not be able to play it and show it without delays and freezes. By the way, if the video is not compressed by some variation of the x.264 codec (for example, it is in MPEG1, 2 or some other format), it can be compressed without loss of quality into a more “compact” codec (say, in Divx).
  2. If you plan to watch the files on DVD players, various devices ah, etc. - it is recommended to choose the MPEG2 codec and container - it is supported by almost all equipment;
  3. For various films, videos, cuts from finished videos, the MP4 container is perfect as a good compromise between compression ratio and quality.

Video compression step by step // 2 ways

First way

VideoMaster

I’ll show you an example of how to convert a video or movie.

  1. First, download and install the program (link given above). Next, run it and add the file you want to compress (screen below, “Add” button).

  2. Next, I recommend immediately pressing the button "Crop" and cut out all the excess that you don't need. In principle, there is nothing complicated in the operation itself: just find the area in the video that you do not need, then mark it with the sliders and cut it out. There can be many such fragments ().

  3. Then click the next button - effects.

    A window will open in which you can increase/decrease brightness, saturation, etc. You will also have access to the following tabs: framing(to change the video resolution size, picture position, and change the aspect ratio); text(you can add test fields to the video); improvements(for example, auto-contrast, noise reduction, defect elimination); turn(it will help if you need to rotate the video 90 degrees, which often happens when shooting video on a phone); speed(you can increase/decrease the file playback speed). In general, set the settings for yourself!

    Editing videos

  4. After which you need to indicate container and format (which was discussed a lot at the beginning of the article). To do this, click the button Format/AVI(by default, this is the format selected). Video Wizard offers to save videos in a wide variety of containers and codecs: AVI, MPEG4, MTS, WMV, ASF, MPEG 1, 2, etc. I chose the MP4 format for my video.

  5. Next, indicate video resolution and quality (bitrate). In general, the program is excellent in this regard: it allows you to manually set the size of the final file: this way you can immediately decide whether it’s good or not. poor quality, it will work out. In general, for example, I decided to fit the video to the size of a CD, so I manually specified the size as 701 MB.

  6. Next step: specify where will the resulting file be saved? , and actually start conversion . There is nothing complicated here, as shown in the screenshot below (the "Convert" button).

  7. The conversion process is quite lengthy and depends on many parameters: the power of the PC, the codec and container you chose, the source video, etc. In general, the task was completed!

Second way

Movie Shrink & Burn (Ashampoo)

I can’t help but mention this program from Ashampoo - an excellent and fast converter of various video files (supports more than several hundred formats). What’s also captivating: there is nothing superfluous in the program, the program is very easy to use, everything is done step by step (however, this is the case in almost all programs from this manufacturer).

Movie Shrink & Burn allows you to burn DVD/Blu-ray discs, record videos for various devices, and upload files to the cloud.

Supported mobile devices: Apple, Sony, Android, Microsoft, videos can be saved in a variety of quality: 720p, SD (high, low).

The program fully supports the Russian language and is compatible with all versions of Windows.

Perhaps, it is inferior to the first in only one thing: there is no way to trim the video, cut out something unnecessary from it, glue something together, or rotate it (i.e., there is no mini-editor).

I'll look at an example of converting a regular video file step by step.


That's all for me, high-quality and compact videos for everyone.

PDF files with lots of graphic elements look nice, but transmitting them over e-mail– sheer torment due to the large size of such documents. There is no need to wait long for the file to be attached to the letter, because you can reduce its size with virtually no loss of quality. Fortunately, there are plenty of ways to do this - choose whichever you want.

It is worth noting, however, that half of the methods listed below are only possible using Acrobat DC from Adobe installed on your PC. This is a paid product, but the 30-day trial version is completely free. It is available on the official Adobe Systems website.

Using CutePDF or another PDF converter

You can reduce the size of a PDF file using one of the converters, for example, CutePDF. It allows you to convert files from any printable format to PDF, as well as change the document size, increasing or decreasing the quality of images and text. When you install this product, a virtual printer, which instead of printing documents converts them to PDF format.

1. Download CutePDF from the official website (free) and install. Don’t forget to install the converter along with it, otherwise nothing will happen after clicking the “Print” button.

2. Open the file in a program that supports its format and has the ability to print documents. If it's a PDF file, you can open it in Adobe Reader; and if the file is in doc or docx format, it will do Microsoft Word. Click on the “File” menu item and select “Print”.

3. When the printing settings window opens, select CutePDF Writer from the list of printers.

4. Click on the “Printer Properties” button, in the window that opens, click on the “Advanced” button and select the content display quality. To compress the file to the desired size, select a quality lower than the original quality.

5. Click the “Print” button and save the file to the desired location. Only PDF is available for saving, regardless of what format the document was originally in.

Using online tools

If you don’t want to download and install anything, then you can compress the PDF file online. Compressing and converting documents online is fast and convenient.

1. Find a suitable tool on the Internet, such as Smallpdf. Unlike other similar online tools, here the user is not limited in the size and number of documents he can upload.

2. Once you visit the site, upload it required document. This can be done by clicking on the inscription and selecting the file using Explorer, or by dragging the file with the left mouse button and dropping it into desired area. You can also add a document from Dropbox or from " Google Drive A".

3. When the process is complete, click on the “You can save the file” button and select a location on your PC for it. To upload a compressed document to Google Drive or Dropbox, click the corresponding icon on the right side of the button.

In addition to Smallpdf, there are many other online compressors on the Internet: Compress PDF, Online2pdf, PDFzipper and others. Some allow you to upload files up to 50 MB in size, others - up to 100 MB, others have no restrictions at all, but they perform their work at approximately the same level.

In Adobe Acrobat

Compress PDF file You can do it in Adobe Acrobat DC, but not in the free Adobe Reader.

1. Having opened the document in Acrobat, click on the “File” menu item, then select “Save as another” and click on the line “Reduced PDF file”.

2. Click in the drop-down list on the version of the program with which your document should be compatible. Having chosen the most new version, you can compress the file as much as possible, but there is a risk that it will become inaccessible in previous versions"Acrobat".

3. Click on the “Ok” button, wait for the compression process to complete and save the compressed document to the desired location.

Another PDF compression method in Adobe Acrobat DC

If you have Adobe Acrobat installed and need to compress a document located on your PC, it is much more advisable to use the previous method. The same method can be used when the desired file is uploaded, say, to Google Drive, and you need to download it, simultaneously reducing its size.

1. Log into Google Drive from your account, double-click the PDF file you want to compress, and click the printer icon to open the print screen.

2. In the window that opens, click on the drop-down list and select the Adobe PDF line.

3. By clicking on the “Properties” button, you will open another window where you need to select the “Paper and Print Quality” tab, and then click on the “Advanced” button at the bottom of the window.

4. In the drop-down list (see screenshot below), select the desired document quality, at the bottom of the window click on the “Ok” button, then in the next two windows also click on “Ok”.

5. Save the reduced file on your PC.

Using Adobe Acrobat and Microsoft Word

The essence of this method PDF compression-documents is that you first convert a file from one format to another, and then do the reverse conversion.

1. Open a PDF document using Adobe Acrobat, go to the "File" menu and select "Save As".

2. Click on the “Select another folder” button, then select the file type “Word Document (*.docx)” and save location. Click on "Save".

3. Having opened the document in Microsoft Word, click on the “File” item and select the “Save as Adobe PDF” sub-item.

Using PDF Optimizer

This method of reducing the size of PDF files also requires the use of software from Adobe Systems.

1. Open the document you want to reduce using Adobe Acrobat. Next, go to the “File” menu, click on the “Save as Other” line and select “Optimized PDF File” to launch the PDF document optimizer.

2. In the “PDF Optimization” window that opens, click on the “Estimate space usage” button to understand which elements take up how much space in the file (in bytes and percentage).

3. Having assessed what can be reduced and what does not make sense to compress, close the window by clicking on the “Ok” button and set the necessary compression parameters. To do this, in the left part of the window, left-click on one or another item, and in the right part, change the parameters.

4. You can delete images, change them from color to black and white, compress them, change resolution, change built-in fonts, etc. Having “played enough” with the parameters, click on the “Ok” button and save the optimized file to the desired directory.

A way to compress PDF files on Mac OS X

PDF documents created operating system Mac OS X is noticeably larger in size than files with the same content created by Adobe Help Acrobat. If you are a Mac OS X user and want to reduce the size of the PDF file you create, do the following:

  1. Open the TextEdit application, then click on “File” in the program menu, and then select “Print”.
  2. In the lower left corner of the window that opens, you will see a button called PDF. Click on it, and then on the line “Compress PDF” in the drop-down list. The result is a more compact PDF file.

Archiving a file

To ensure that the document takes up less space on your computer, you can archive it using one of the archivers, for example, 7Zip or WinRAR. Both programs are quite popular, but the first is distributed free of charge, and the cost of using the second is over a limited period. trial version, you'll have to pay.

To compress a document using the 7Zip archiver, right-click on the file, then with the left mouse button, first click on the 7Zip line, and then on the inscription “Add to “file_name”. Then the archive will be created automatically.

If you want to set certain parameters before archiving, select the “Add to archive” line. Then a window like the one in the screenshot below will open.

By using an archiver, you can significantly reduce the size of a document, as well as create an archive consisting of several files, compressed and combined with each other. This will make it much easier to store and transmit them via email. Just before sending an archived PDF file, make sure that the recipient also has an archiver installed, otherwise he will not be able to open the archive.

Note: Adobe Acrobat and Adobe Reader are not the same thing. Reader is free, but its feature set for editing PDF files is extremely limited, so you can only reduce the size of documents in Acrobat. However, Adobe Acrobat is a paid program. And if you don’t have it and don’t want to buy it, use other options for compressing PDF documents that are not associated with it.

Answers:

Khailov Konstantin Yurievich:
Well, you bent it. If this were possible, films would be sold on 2 floppy disks.

Victor:
What video format? If it's already a compressed avi, then no compression will help. If in another MPEG-2, DV, etc., then you can try to compress the virtual with oak, but the output quality with the parameters you specified, when you want to cram 250 mb into 1.5 mb, will be simply disgusting. And you don’t need WinRar in this matter at all, because it’s useless. It can only be used to transfer large films that do not fit on 1 CD. You need to create an archive without compression and specify the size of the output files as 700 mb, and after transferring the files to another computer, indicate to WinRar the first of the received files and it will completely unpack everything. I don’t see any other use of WinRar in the video field.

Shurovik:
No way. The video is probably already compressed with a codec. But re-compression will have no effect.

D.A.E.M.O.N.:
Winrar won't help here. You can't compress a 250 MB video to that size.

Big_Aziz:
Well, you bent. There’s no way to compress it all. Yes, even if you compress it, it won’t be a film, but something that will only make you sick. Fantastic. If only all this could be compressed into acceptable quality. I wish everyone good luck in their experiments!

Alexeyslav:
Scientifically speaking, the information redundancy of such a file should be simply fantastic! (compression 166 times). However, this situation can only happen if there is one dot on the screen and the file is in RAW format (not compressed). This option is also in doubt. The maximum compression ratio for Winrar under ideal conditions is about 30-40 times and depends on the block size used in the compression algorithm. and here you need to compress it by 166 times, this is simply unthinkable... any mathematician would turn over in his grave upon hearing such numbers.

Oleg:
And if you meant “split into pieces the size of a floppy disk,” then simply indicate the size in the “Archive name and parameters” window at the bottom left “Split into volumes...”. I just can’t believe that the question is so... incorrect.

Vengant:
No way. This level of video compression does not exist.

Kolesnikov Valery:
I advise you to read literature on this topic in order to have an idea about these things and not ask such questions.

Sokol:
Friends, no matter how paradoxical it may be, I recently downloaded a video archive in rar format from the Internet, which weighed 2.5 MB. I thought it was a phone video. No matter how it is! I unzipped it, and there was a 10-minute video with amazing resolution. The unzipped video, in AVI format, weighed 102 megabytes. So I was wondering how this could be...

Virtual_Jack:
I'm also interested in the answer. I have a 4 Giga video, compressed into a 100-meter archive, without loss of quality.

Hello Habr!
This article is devoted to how to properly and maximally compress files into ZIP archives. I decided to write this article for the reason that many applications package their formats in ZIP. In this article, we will look at ZIP compression methods, ZIP compression applications, and how compression can be improved.

ZIP compression method

To begin with, I propose to look at the fact that ZIP supports different compression methods (Copy, Deflate, Deflate64, BZip2, LZMA, PPMd), but we will consider only one compression method - Deflate, for the reason that this method use by most applications that package their formats in ZIP. Here is a small list of file formats that are actually ZIP archives - open-file.ru (enter the ASCII header descriptor - PK in the search). Let me make a reservation right away: this is only a small list of files.

Deflate compression method

Today there are several libraries based on the Deflate compression method:
Deflate Library Operation speed Compression ratio Applications
Zlib High Low
7-zip Average Average 7-zip
Kzip Low High kzip
So before choosing an archiver for ZIP, we need to understand what result we need and how much time we are willing to spend to get it. Deflate is characterized by the higher the compression ratio, the more time it will take.

ZIP archivers

In this section, we will only consider those applications that are free to use.
7-zip algorithm
Here we will talk about two programs that implement the 7-zip algorithm: 7-zip and advzip.
When creating a zip archive using 7-zip, I use the following parameters

R -mm=Deflate -y -tzip -mpass=15 -mfb=258 -mx9
The peculiarity of advzip is that it already works with ready-made zip archives, i.e. you simply specify the path to the archive, and it itself tries to compress it. It can be convenient when you already have a ready-made archive, and you don’t need to unpack and archive again.

kzip algorithm
The kzip algorithm was implemented in the kzip application, the application is extremely slow, but almost always gives the best result. It has settings (/s, /n, /b) that can improve/worse the ZIP compression ratio. Here I wanted to give some recommendations on how to get the best compression ratio (recommendations are based on personal experience):
  • If you are archiving files and there are ZIP archives, I recommend decompressing these archives (for convenience, you can use advzip with the /z0 parameter). This is because the Deflate method does not support continuous archives, i.e. it turns out that when the Deflate method tries to compress a decompressed archive, the decompressed archive in this case appears as one whole file and its contents are compressed as a continuous archive.
  • If you want to get the maximum compression effect, you can use the zipmix application. Let's say you created two identical in content zip archive using kzip, but different settings, and as a result we received archives of different sizes. But this does not mean that all the files that you compressed in the first archive are individually smaller in compressed form than in the second archive. For these purposes you need zipmix; it creates a third archive from two archives, with a smaller size, because it compares each file individually and selects the one with the smaller size. zipmix works not only with kzip archives.

Practice

And so I decided to show how it all works. For example, I took the game for iPad - Angry Birds HD version 2.0.0. The original game size is 13,547,363 bytes.

As you can see, zipmix can't improve the compression ratio much. Personally, when I need to get the maximum, I simply combine all three (kzip + advzip + 7-zip) results into one. This is much better than trying to sort through the parameters in kzip.

Related publications