MP4 Box Introduction


Free Download Mp4Gain
picture

MP4 Box Introduction

MP4 Normalizer

A box consists of two parts: the box header and the box body.

Mp4 Normalizer

box header: the box metadata, such as the type and size of the box.
frame body: the data part of the frame, the actual content stored is related to the frame type, such as the media data stored in the body part of mdat.
In the box header, only type and size are required fields. When size==0, there is a large field. In some boxes, there are also version fields and flags, these boxes are called Full Boxes. When other boxes are nested in the body of the box, the box is called a containing box.

box header
The fields are defined as follows:

type: frame type, including “default type” and “custom extension type”, occupying 4 bytes;
Predefined types: such as ftyp, moov, mdat, and other predefined types;
Custom Extension Type: If type==uuid, it means this is a custom extension type. size (or large size) followed by 16 bytes, the value of the custom type (extended_type)
size – The size of the entire frame, including the frame header, in bytes. When the size is 0 or 1, special handling is required:
size equals 0: the size of the frame is determined by the subsequent large size (generally only the mdat frame that loads media data will use the large size);
size equal to 1: the current frame is the last frame in the file, usually contained in the mdat frame;
largesize: the size of the box, occupying 8 bytes;
extended_type: type of custom extension, which occupies 16 bytes;
The Box pseudocode is as follows:

aligned(8) class Box (unsigned int(32) boxtype, optional unsigned int(8)[16] extended_type) {
unsigned int(32) size;
unsigned int(32) type = boxtype;
if (size==1) {
unsigned int(64) largesize;
} else if (size==0) {
// box extends to end of file
}
if (boxtype==’uuid’) {
unsigned int(8)[16] usertype = extended_type;
}
}
box body
The data body of the table, different tables contain different content, you need to refer to the definition of the specific table. Some box bodies are very simple, like ftyp. Some boxes are more complex and may have other nested boxes, like moov.

Box vs Full Box
Based on Box, the FullBox type is extended. Compared to Box, FullBox has more version fields and flags.

version: The version of the current box, ready for expansion, occupies 1 byte;
flags: flag bits, occupying 24 bits, the meaning is defined by the specific box itself;


Free Download Mp4Gain
picture


Mp4Gain Main Window
picture


Mp4Gain Features
picture


Free Download Mp4Gain
picture

Getting started with the MP4 file format

Getting started with the MP4 file format

Mp4 Normalizer

The main content of this article includes what is MP4, the basic structure of MP4 files, the basic structure of Box, the introduction of common and important boxes, the difference between ordinary MP4 and fMP4, and how to parse MP4 files through code.

MP4 Normalizer

Writing Background: Recently, I often answer questions on live streams and short videos from teammates, such as “flv.js implementation principle”, “Why the mp4 file provided by the design partner cannot be played in the browser, but can be played normally locally”, “MP4 compatibility is very good, can be used for live streaming”, etc.

In the response process, it is found that the introduction of the MP4 protocol is often involved. I briefly understood and took notes on this article before. I’ll tidy it up a bit here, and by the way, it will be used as a reference document for the team. If there are any errors or omissions, please point them out.

What is MP4?
First, the package format is presented. Multimedia encapsulation format (also called container format) refers to placing video data, audio data, etc. in a file according to certain rules. Common MKV, AVI and MP4 presented in this article are all package formats.

MP4 is one of the most common package formats and is widely used due to its cross-platform nature. The suffix for MP4 files is .mp4 and basically all major players and browsers support the MP4 format.

MP4 file format is mainly defined by MPEG-4 Part 12 and MPEG-4 Part 14. Among them, MPEG-4 Part 12 defines the ISO basic media file format for storing time-based media content. MPEG-4 Part 14 actually defines the MP4 file format and expands on the basis of MPEG-4 Part 12.

For students involved in work related to live broadcasts, audio and video, an understanding of the MP4 format is necessary. Below is a brief introduction.

MP4 File Format Overview
MP4 files are made up of multiple frames, each frame stores different information, and there is a tree structure between the frames, as shown in the figure below.

There are many types of boxes, the following are 3 most important top level boxes:

ftyp: file type box, which describes the MP4 specification and the version with which the file complies;
moov: Movie Box, the media metadata information, there is only one.
mdat: Media data box, which stores the actual media data, usually there are several;

Although there are many types of boxes, the basic structure is the same. The next section will first introduce the box structure and then explain common boxes in more detail.

Mp4 Normalizer

Mp4 Normalizer

Mp4 Normalizer

Mp4 normalizer and normalize other video formats

Fix MP4 volume

Mp4Gain is a powerful and advanced loudness normalizer that does not limit normalize mp3, like most normalizers.

Mp4Gain is innovative because it offers the possibility of making volume booster (volume enhancer) to the most well-known and used audio and video formats. You can even extract the audio from a video, normalize it and generate an audio file in any of the many formats that Mp4Gain handles (mp3, flac, ogg, m4a, etc)

Any video and audio file is made up of thousands of frames and Mp4Gain analyzes frame by frame (usually there are between 44100 and 48 thousand samples per second) and optimizes and maximizes the volume. In this way, the user will no longer perceive that their different audio or video files have different volume levels compared to the rest.

Mp4Gain also offers an advanced volume leveling capacity, because although for the common user it will be enough to click a button and with that they will be able to maximize the volume level, very advanced users can optimize the settings to their liking, they can even add ReplayGain , if you want or choose the output db level, etc.

In case the user, by mistake, mistakenly moves a setting, it is easy to reset and return them to their initial configuration, although for the home user it is not necessary to modify the settings.

The program is very intuitive in its use, all you have to do is load the audio or video file (or several files, since it can process hundreds or thousands) and click on the button and with that this user will obtain the desired result.

Mp4Gain maintains the data (tags) that each format is capable of storing.

We advise you to download Mp4Gain and try it on your computer to enjoy the results.

Mpeg-4, start the countdown in Europe

Countdown to a double shutdown, which will force millions of Europeans to change their television or mount a special decoder. In fact, the first (small) television revolution is eight months away: as of January 1, digital terrestrial broadcasts will use only Mpeg-4 encoding, abandoning the now-old Mpeg-2.

 MPEG-2  MPEG-4

As of July 2022 the second (major) revolution: all transmissions will go in Dvb-t2 (the second digital terrestrial transmission standard), with Hevc encoding (which allows greater compression than simple Mpeg-4 and therefore more channels and / or better quality). A double revolution made necessary by the arrival of 5G, which from 2022 will also use the 700 Mhz frequencies that televisions now use.

video quality

It is good to arrive prepared for these dates, taking into account everything that is at stake. On the one hand, the risk not only of not being able to see terrestrial digital but also of not being able to enjoy the advantages of Hevc, soon adopted by other platforms (such as Netflix, which has already announced it).

On the other hand, the possibility of being able to have state incentives for switching to a suitable television or decoder: 25 euros per hour provided only for a small audience of users (over 75, exempt from the Rai rate and with a maximum income of 8 thousand euros per year), but in the future perhaps extendable by means of new decrees to a greater number of users. The earliest deadline: January 2020 Mpeg-4 Mpeg-4 is the normal encoding that we are used to having on internet videos since the early days of broadband, while Mpeg-2 dates back to the days of DVD. AND

He first manages to bring more content in the same space (disk or radio) and therefore even thanks to this step it will be possible to start releasing some frequencies for 5G of the 700 MHz band. The good news is that for more than one Europeans of the decade have MPEG-4, but according to Mise’s estimates there are around 10 million still stationary on MPEG-2.

Please note that the change in frequencies will be gradual, from January 2020 to December 2021, in the various regions of Italy (according to a roadmap defined by the Government). Two years in which it could also happen that, apart from the Mpeg-4 issue, due to this move it will be necessary to intervene in the condominium system for a readjustment. To understand if our TV (now prehistoric) fits into these, simply connect to the HD channels of digital terrestrial (from 501 onwards): if an error message appears and we cannot see the signal, it means that we do not have the MPEG-4.

They are high definition channels precisely because the best compression allows you to increase the amount of usable data for the same amount of space. Or to occupy less while maintaining the same amount of data (that is, the same number of channels with standard quality), which is precisely the advantage of being able to release frequencies of 700 MHz for 5G. It is enough to take a very cheap “zapper” decoder to adapt TV to MPEG-4, but perhaps it could be an opportunity for a more substantial upgrade, which looks to the future.

Second deadline: July 2022 After just over two years, in fact, we will already need support for DVBT-2 and Hevc codecs, which make signal transmission and compression even more efficient. Which means the possibility both of saving other frequencies and, above all, of changing many of the current channels to 4K. Since January 2017, all televisions integrate the two technologies by law. If we have a TV released before this date, it will be good to do an internet search to read if its specs include Dvbt-2 and Hevc.

However, if not, it may be helpful to wait a little longer before switching to a new model. Until July 2020 we do not need those two technologies for digital terrestrial; If we still do not perceive our TV as obsolete, for our uses, we must wait. If nothing else, in this way we can save money by buying a television that by then will not be so recent but will already be equipped with DVBT-2 and Hevc. It is also possible that the Government will slightly expand the audience of the beneficiaries of the television bonus . if we find, on a deadline, with several families that are not yet equipped with compatible devices. One reason to accelerate the switch to Hevc could be the adoption of Netflix. That thanks to the new codec it will be possible to give 4K even to those who have a line that is not really ultra-broadband and offer 8K content to a wider audience of people.