Selecting bitrate for media recording

  • 0shared
  • 0Facebook
  • 0Twitter
  • 0VKontakte
  • 0Odnoklassniki

The realities of the modern economic situation are such that not all book lovers can afford to assemble a good library of printed publications, so, willy-nilly, they have to turn to more accessible sources, namely the Internet. Reading from a screen is not the best option, but you don’t need to spend money on expensive paper books. E-books are most often distributed in FB2, EBUP and MOBI formats, but there is a separate genre of literature that uses its own format. This genre is comics.

CBR - what is this format?

The content of comics is represented mainly by graphics, they practically do not use fonts, almost all comics are sets of images. It is clear that it is inconvenient to distribute them in this original form, so the CBR format was created for them. Actually, to be honest, CBR is not so much a format as it is an extension that tells the reader application how to process the file. CBR stands for Comic Book RAR Archive and is a regular renamed RAR archive, and if you open the CBR and RAR files with Notepad++, you will see that they have exactly the same headers.

Another popular comics format, CBZ, is “built” in a similar way, which is a renamed ZIP archive.

The contents of CBR and CBZ archives are a collection of JPEG, PNG or GIF images sorted in a specific order, which may be broken if the archive is unpacked. If you still need to extract, just rename the file extension CBR to RAR, and then open it with the WinRAR archiver.

To view comics, you need to use special reader programs that do not violate the order of the images. So, let's see how to open the CBR format.

General description of the CBR format

The CBR extension is a pseudo RAR archive format. Scanned comic magazine pages are saved in PNG or JPEG format. Such an archive contains additional information (metadata) in an XML file: information about the artist, embedded comments, author marks.

It is typical that images in such an archive are stored in a given order.

History of origin

The author of the format was the developer of the CDisplay program from Microsoft Windows, David Ayton. The program is used for cataloging comics, convenient sequential viewing of images in JPEG, PNG and static GIF formats.

Images are automatically arranged alphabetically and presented for viewing one or two at a time. To resize the image and maintain the quality of the original, Lanczos resampling is used.

If the archive contains a txt file, it displays the text content of the comic when you open the file.

Best Programs to Read CBR Files on Windows

There are a lot of applications for viewing files with the CBR extension, both running on Windows and Android. Let's get acquainted with the most convenient and functional ones.

ComicRack

This free CBR reader on your computer is great because it allows you to not only view CBR files, but also organize your libraries. The application supports opening comics in several separate tabs, viewing metadata, seven viewing modes, rotating and scaling images, auto-scrolling, creating bookmarks and workspaces, viewing comics in a separate window, using a virtual magnifying glass, changing the rating and type of pages, as well as exporting them to graphic file.

In addition, ComicRack boasts an impressive arsenal of various settings. In the reader settings, you can adjust the brightness, contrast and color of the image, control the behavior of the application while reading, and enable or disable the use of visual effects. Minus – support for the Russian language is partially implemented.

CDisplay Ex

Popular program for reading comics on Windows. Unlike ComicRack, it does not have such a wide range of functions, but it is more convenient. The program supports several reading modes, the Leap Motion function, auto-scrolling (slide show), displaying page thumbnails, automatic color correction, using a virtual magnifying glass, scaling using different algorithms, exporting pages to graphic files, creating bookmarks and printing. It is possible to view in full screen mode.

CDisplay Ex is equipped with a convenient interface in Russian; scrolling is done using the mouse wheel, arrow keys and buttons on the control panel, the contents of which can be changed in the general settings. The disadvantage of the application is that files cannot be opened in separate tabs.

YACReader

In terms of functionality, this program for reading comics and manga on Windows is similar to CDisplay Ex. It is just as simple and convenient, but it also has some features. For example, viewing page thumbnails in YACReader is implemented in 3D format (the function is called page flow). It supports scaling and rotating pages, saving them to a graphic file, creating bookmarks, there is a magnifying glass, and several viewing modes are available.

Among the additional functions, it is worth noting the presence of a built-in translator. In the viewer settings, you can specify the path to the folder with comics, replace the background color, select a mode for the page flow function, adjust image parameters, and set hot keys. As in CDisplay Ex, you can only open files in separate windows; working with tabs is not supported.

What is CBR, ABR, VBR?

Author: Alexander Radzishevsky (Alex Y. Radzishevsky) Copyright (C) 1998-2007, Alex Y. Radzishevsky
What are CBR and VBR?
As is known, the result of encoding a signal using an algorithm such as MPEG-1 Layer III (MP3) (and many other algorithms) is a bit stream with a frame (block) structure. This is explained by the fact that the encoding of the source stream is not carried out entirely, but in parts. That is, in fact, the source stream is divided into blocks of a certain fixed length, then each block (frame) is individually encoded and the result (encoded block of information) is sent to the resulting stream (be it a file or a data stream).

CBR (Constant Bit Rate) is a method of encoding a source audio stream in which all its blocks (frames) are encoded with the same parameters (with the same bitrate). In other words, the bitrate over the entire length (all frames) of the resulting stream is constant.

VBR (Variable Bit Rate) is a method of encoding a source audio stream in which each individual block (frame) is encoded with its own bitrate. The selection of the bitrate that is optimal for encoding a given frame is carried out by the encoder itself by analyzing the “signal complexity” in each individual frame.

What are the differences between CBR, VBR and ABR modes in relation to the Lame encoder?

Before we start the conversation, let's clarify two details:

1. Encoding in MP3 occurs block by block: the encoded file is divided into frames (frames) with the same interval, each frame is encoded and recorded in the output stream; thus, the output stream also has a frame structure.

2. Frames can be encoded not at any bitrate, but only at one of the standard MPEG1 Layer III bitrates included in the table: 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320. Encoding at any intermediate bitrates (“freeformat”) is not provided for by the standard.

Introduction

People who use VBR in Lame usually argue with the phrase: “I want constant quality, not constant bitrate.” Indeed, in music there are simple passages for which 128 Kbps is enough (for example, pauses between songs), and there are also complex ones, in which a person with good hearing, a good audio card and other audio equipment will hear compression defects even at 320 Kbps /sec. In fact, such an argument is not entirely valid.

CBR

Even in CBR mode, the mp3 encoder can redistribute bits over time, allocating more or fewer bits during complex or simple passages, resulting in overall better sound quality. This redistribution of bits is done through the so-called bit reservoir: when encoding simple passages, the encoder does not spend the entire user-specified bitrate on them, but only about 90%, about 10% is saved in the reservoir for encoding complex passages (initially the reservoir is empty). When encoding complex passages, the encoder will use 100% of the specified bitrate and add additional bits from the reservoir (if any, that is, if the reservoir is not empty). Unfortunately, according to the standard, the tank size is limited. This means that if a simple signal continues long enough, the reservoir accumulates its volume to certain maximum permissible limits and then encoding proceeds using 100% of the bitrate. And the opposite situation: if a complex signal continues long enough, all the saved bits are (gradually) taken from the reservoir and then encoding proceeds using 100% of the bitrate.

ABR: Explanation

One could say that the reservoir copes well with its main responsibility - accumulating “extra” bits during simple passages and releasing them as additional ones when encoding complex passages, if not for one “but”: it has a finite and, moreover, very limited size, which means that you can accumulate it only to certain limits, and, accordingly, remove it too, until the reservoir is empty. It is in order to remove this main drawback of the tank that ABR was developed.

The main difference between ABR and CBR is that in CBR all frames must be the same size (that is, the bitrate for all frames must be the same), but in ABR this restriction is removed; accordingly, it is possible to use an almost infinite reservoir instead of a standard very limited in size "virtual" tank. It looks something like this:

ABR: Mechanism

Let's assume that the user has specified the ABR mode and a certain bitrate B (the user can specify absolutely any bitrate from 32 to 320, even not from the standard bitrate grid, for example, you can specify 129 as the desired average bitrate). The encoder receives a piece of audio (frame) that needs to be encoded. In the same way as in CBR, it determines its complexity (we will talk about this below). If the passage is complex, then the encoder also takes more bits for it, but not from the reservoir (as in CBR), but simply by simply increasing the bitrate by the required number of steps (the selected bitrate must be included in the grid of standard ones), thus creating a “virtual reservoir” "(you can raise the bitrate here - this is not CBR). What does "virtual tank" mean? It’s simple: we assumed that the bitrate B specified by the user is not enough for the encoder, he needs K bits (K > B), then the encoder selects such a minimum standard bitrate N that it fulfills: N >= K (we call this choice of bitrate “virtual storage tank"). Then the taken piece of audio is encoded using K bits. However, N >= K, that is, we used fewer bits than are in the taken frame, so let’s not throw away these extra bits? We write these extra bits into a real reservoir. Since ABR has the ability to use a “virtual reservoir,” it doesn’t make sense to build a standard reservoir, so when the next piece of audio arrives, the bits from the reservoir will be used to encode it first, and then the encoder will decide what bitrate is needed next. In other words, if in CBR the encoder always tries to accumulate as many bits as possible in the reservoir, then in ABR the encoder, on the contrary, tries to get rid of bits in the reservoir, since there is no need to accumulate them - you can simply increase the bitrate.

Simple passages are encoded with fewer bits, they take approximately 95% of the specified bitrate B, but now the remainder is not deposited in the reservoir, the encoder simply takes a frame with a lower bitrate. The resulting difference (the remaining bits) is written to a standard reservoir (do not throw away the remaining bits...). Example. Let’s say a “simple” passage has arrived. Then the encoder takes all the bits (if any) in the reservoir (the real one), then looks for the nearest standard bitrate at which the total number of bits obtained for this frame (all bits from the reservoir + the taken bitrate) will be 95% of the user-specified bitrate B , performs encoding, and stores the extra bits (if any) in the reservoir again.

ABR: Summary

Thus, the use of reservoir in ABR is different from CBR. In CBR, the bitrate cannot be changed and the reservoir is specially saved by storing there the bits that remained (were saved) from encoding the frame at a given initially fixed bitrate during a simple passage; if bits are needed for encoding and the reservoir is empty, then it is empty, nothing can be done about it, and encoding simply proceeds at the specified bitrate to the detriment of quality. In ABR, the bitrate is variable and a standard reservoir is actually not needed, however, since raising (lowering) the bitrate necessarily occurs to a certain table value, which may be higher than the number of bits required by the encoder, the extra bits, of course, are not thrown away, but stored in the reservoir. In other words, in CBR, accumulating a standard reservoir is the main task, while in ABR there is an unlimited “virtual reservoir” and the standard one is used only to store extra bits resulting from the difference between the tabulated bitrate values ​​and the actually required bitrate.

VBR

VBR - variable bitrate. The user specifies the desired quality. Lame, relying on its psychoacoustic model, allocates for each frame exactly the number of bits that are necessary to achieve a given quality. In the output stream, frames accordingly have different bitrates (which always fall into the table of standard bitrates). Using the reservoir in VBR is absolutely identical to ABR - only unused tails of frames go there.

Methods for assessing signal complexity

Thus, the main difference between CBR, ABR and VBR, as you probably already understood from the above, is the use of different methods for calculating the number of bits required to encode each frame.

Methods for assessing signal complexity: method 1 (VBR)

The first method is based on the calculation of "psychoacoustic masking" and "encoding error". This method is used in VBR and theoretically should give maximum quality if Lame's psychoacoustic model were ideal. This method is based on a very simple idea: the minimum number of bits required to satisfy the condition: [coding_error] < [masking_threshold] is allocated for encoding (that is, encoding defects must be masked by the main signal and should not be audible).

Explanation about camouflage.8-) The bulk of “lossy audio compressors” use the features of human hearing to compress an audio signal (in contrast, there are audio compressors that use the features of sound production), namely its not ideality. We can point out several main “defects” of hearing used in audio compression: 1) limited dynamic range. A person does not hear weak signals, or in other words, there is a certain threshold of audibility. 2) loud signals (especially noise, and not tonal) have a masking effect, both in the time and frequency domains (if someone “fired” from a gun, you can completely lose your hearing ), i.e. any powerful signal, especially a noise signal of a certain frequency, masks a fairly weak signal, especially if it lies in a close frequency range and such a masked signal need not be encoded, because a person cannot hear it. The masking threshold can be increased by several decibels by reducing the encoding quality (explanation for this: the worse the encoding quality, the more artifacts and interference there are in the sound, and the more powerful the signal is needed to mask this interference).

The advantage of this method: theoretically maximum quality. Disadvantages: low speed and also the fact that due to the non-ideal psychoacoustic model in Lame, the bitrate is constantly underestimated, accordingly it is not recommended to use it without a fixed lower limit of about 112-128 kB/s, and therefore the VBR mode is not recommended to be used at all at low medium bitrates. The reservoir in VBR is minimized, and therefore it is not recommended to use a bitrate limit from above (explanation: since there is practically no reservoir in VBR, if you limit the bitrate from above, then some frames with “complex” music may not have enough bits for audio encoding, since there is nowhere to get additional bits - there is no reservoir and the bitrate is limited; such frames will be encoded only with the number of bits that are available - that is, at the maximum allowable bitrate, which can lead to poor encoding quality).

Methods for assessing signal complexity: method 2 (ABR / CBR)

The second method is based on the calculation of Perceptual Entropy (PE), which characterizes the complexity of the encoded signal (the more complex the signal, the greater the PE). This method is used for CBR and ABR encoding. The mechanism for calculating signal complexity using PE is completely different from the mechanism used in VBR. Without going deeply into details, it should be said that if in the first method the signal complexity was calculated based on the masking properties, then in this method the complexity of the signal is assessed by attempting to predict it: the more complex the signal (the envelope behaves chaotically), the more difficult it is to predict and , accordingly, the more bits are required to encode the signal. During encoding, the encoder tries to predict the signal, then compares the predicted signal with the original, the less the predicted signal matches the original, the more bits it takes to encode. It is very important to note that the methods used to calculate signal complexity fundamentally affect the differences in the mechanisms that use them. Thus, the fundamental difference between ABR/CBR (using the described method) and VBR (which uses method 1, described above) is also that the choice of bitrate in ABR/CBR lies not with the encoder, but with the user, while Lame only adds/subtracts a small number of bits during encoding of complex/simple places, respectively (which is what PE is calculated for). In other words, depending on the calculated PE, the required number of bits is added (or subtracted from it) to the user-selected bitrate, which is implemented using a mechanism for working with a reservoir (virtual or real). Thus, when using the second method, it is the user who chooses the bitrate (when in VBR the encoder decides the bitrate itself), PE only adjusts it using a reservoir depending on the complexity of the music. It happens approximately as follows.

CBR

. For each frame, a “main”, constant number of bits is allocated, 90% of the specified bitrate, and an “additional”, variable number. Simple passages are encoded using this 90 percent, and the remaining 10% percent accumulates in the bit reservoir (as described at the beginning), until it is full, after which the entire bitrate is spent on encoding simple passages (since there is nowhere to save bits). Complex passages are encoded using the full bitrate, plus additional bits are removed from the reservoir if there are still bits left in it. Pros: compatibility, cons: due to the small size of the reservoir, you often need extra bits to encode complex places.

ABR

. When encoding ABR, the use of the reservoir is minimized; it is simply not needed, because in ABR we can use frames with different bitrates and, accordingly, do not accumulate bits in the reservoir (the mechanism of operation of ABR is explained in the example above). After calculating PE and the required “extra number” of bits, Lame simply selects the minimum bitrate that fits the full required number of bits (the bitrate is selected from the table). The remaining bits are not thrown away, but accumulated in a reservoir.

Note: it would be wrong to think that CBR and ABR do not use psychoacoustics at all - of course this is not the case. Such a thing as the redistribution of bits allocated for frame encoding between all frequency bands lies precisely in psychoacoustics.

Conclusion

So, briefly. CBR/ABR and VBR in Lame differ in different methods for calculating the number of bits required for encoding and, as a result, in different “philosophies” of using the reservoir. In CBR and ABR, the main number of bits allocated for frame encoding is determined by the user when starting the program: with the -b or -abr switches for CBR or ABR, respectively. The number of additional bits needed to encode complex places is calculated using the same formula based on the PE calculation. The only difference between CBR and ABR is that in CBR mode the bitrate is constant and the encoder’s ability to use additional bits from the reservoir is greatly limited by the size of the reservoir, while in ABR mode the encoder has the ability to change the bitrate, as if using a “virtual reservoir” of unlimited size, and the actual tank is only used to store unclaimed bits.

VBR uses a completely different method. The user sets the quality, and LAME independently, based on a psychoacoustic model (sometimes not perfect), calculates the number of bits required to encode each individual frame with a given quality. Reservoir handling is the same in ABR and VBR.

Thus, in VBR mode, the encoder itself selects the bitrate for frames; in ABR/CBR, the encoder selects only an additional number of bits to the user-specified bitrate.

Author: Alexander Radzishevsky (Alex Y. Radzishevsky) Copyright (C) 1998-2007, Alex Y. Radzishevsky

How to open CBR format on Android

Perfect Viewer

One of the most popular CBR reading programs for Android. It also supports CBZ, CB7 and LZH formats and has a wide range of functions. When you first launch the application, you are prompted to perform basic settings - select reading and display modes, specify the reading direction and folder with comics, configure general behavior, and decide on gesture control zones. These zones represent separate areas of the screen, by touching which you can control scrolling, calling up menus, etc., each zone can be configured individually.

Perfect Viewer supports the use of anti-aliasing filters, color correction, brightness, contrast and color adjustments, and automatic scrolling. There are a lot of settings, you can quickly switch between them. The reader is free, does not contain advertising, but there is also a donate version with additional functions.

ComicScreen – Comic Viewer

A simpler application for reading comics on Android than Perfect Viewer. In addition to viewing CBR and CBZ files, the program supports color correction, inverting colors, cropping individual pages, adjusting brightness, capturing screenshots and scaling. There are several viewing modes - full screen, image arrangement in width or height. Among the advantages of the application, we can note a well-developed gesture control system; among the disadvantages is the display of advertising banners, which can only be gotten rid of by switching to the paid version.

That's all for now. You now know how and how to open a CBR file, choose the method that is most convenient for you. In our opinion, the best option would be to use simple reader applications like YACReader for Windows and Comic Viewer for Android. These programs are simple, but at the same time have all the necessary functions and settings to ensure comfortable reading of comics. Of course, you can do without third-party applications by changing the CBR archive extension to RAR and unpacking it, but in this case no one can guarantee you that the order of the pages will not be broken.

  • 0shared
  • 0Facebook
  • 0Twitter
  • 0VKontakte
  • 0Odnoklassniki

Reading CBR on Andro >

To read comics in CBR format on Android and iOS mobile devices, there are dozens of applications that differ in functions, interface, and sometimes are not free.

Of those that are free, available in the official application stores Play Market and App Store, and which can be recommended first:

    Andro >If these applications do not suit you for some reason, you can easily find others using the search in the application store (using the keywords CBR or Comics).

Rating
( 1 rating, average 5 out of 5 )
Did you like the article? Share with friends:
For any suggestions regarding the site: [email protected]
Для любых предложений по сайту: [email protected]