Keyframes for moving images


Free Download Mp4Gain
picture

Keyframes for moving images

Bitrate vs Resolution

In a moving image, things move or change significantly in a short time. Therefore, inserting keyframes at short intervals improves the reproducibility of small movements.

Bitrate

There is also the advantage that the search is smoother for images with many keyframes. The reason is that the search is based on keyframes, so the more keyframes you have, the easier it is to stop at the target scene. If the position where the search stops is not a keyframe but a difference information frame, the information is fetched to a nearby keyframe, but that time is short.
However, if you increase the number of keyframes too much, the keyframe bit rate will be taken over and the overall video quality will deteriorate, so be careful.
For moving images, the keyframe is approximately once every 3 seconds.

■ Keyframes for images with little movement

Since there is little difference information in a video with little motion, you won’t notice much difference in change even if there are few keyframes. However, if you insert keyframes for too long, search may not work properly and playback may take a long time to start. This is the opposite of the case where there are many keyframes, and if the rewind position is far from the keyframes, it will take time to read.
For those with little movement, the guideline for keyframes is approximately once every 6 to 8 seconds.

So far, “What is the encoding mechanism? Five points to consider for encoding HD video [Part 1]”, “Understanding the appropriate bit rate for the resolution you want to distribute”, motion oriented or image quality I explained three points how to change the “frame rate” and “how to insert keyframes” depending on whether it is important. In [Part 2], we will explain “the advantages and disadvantages of bitrate setting (CBR / VBR), proper usage” and “correct aspect ratio and interlaced processing”.


Free Download Mp4Gain
picture


Mp4Gain Main Window
picture


Mp4Gain Features
picture


Free Download Mp4Gain
picture

Learn a suitable bit rate guideline for resolution

Learn a suitable bit rate guideline for resolution

video bitrate

This is because the amount of data allocated per pixel is reduced, resulting in poor image quality.

Video Bitrate or Resolution

The same phenomenon can be said of the videos. Bit rate is the amount of data allocated per second and affects the image quality of the video. If you want to display a video on a large screen, such as full screen display on a computer or TV monitor, you need a sufficient bit rate according to the resolution. On the other hand, when displayed at a small resolution, the roughness is not as noticeable even if the bit rate is reduced. On the contrary, even if you encode at a high bit rate, you will not notice the difference in image quality, and in many cases the file size will only increase.

Below is a list of the appropriate resolutions and bit rates commonly used for Internet video distribution.

<< Estimated resolution and suitable bitrate >>
* Figures are based on 30 fps assumption and based on our opinions as of June 2021.
* The appropriate bit rate may vary slightly depending on the video content.

resolution Video with little movement Video with a lot of movement
SD (720 x 480 px) 500 kps-1 Mbps 1 Mbps-2 Mbps
HD (1280 x 720 px) 2.4 Mbps-4.5 Mbps 4.5 Mbps-9 Mbps
Full HD (1920 x 1080px) 4.5 Mbps-9 Mbps 9 Mbps-18 Mbps
4K (4096 x 2160 px) 25 Mbps-35 Mbps 35 Mbps ~ 70 Mbps
However, in the case of moving images, the image quality at the time of encoding will differ depending on whether the video material has a lot of movement or the video material has little movement, even if the bit rate is the same. Therefore, it is necessary to thoroughly judge and encode not only the bit rate, but also the frame rate and keyframe settings, which will be explained later, according to the video material. I hope you understand that “there is a relationship between resolution and proper bit rate” as a determining factor for high definition.

Point 2: Increase the frame rate if motion is important and lower the frame rate if image quality is important.
The frame rate (number of frames) is set at 29.97 fps for televisions and 24 fps for movies, while the frame rate is freely configurable for Internet video encoding. A video is a collection of continuous images (frames) like a flip book. The more frames per second, the smoother the movement.

In video encoding, the bit rate per second is fixed, so if you increase the frame rate, the number of images in the flip book will increase and the movement will be smoother, but the amount of data allocated per frame will decrease, so the image quality will be better to fall.
On the other hand, if you reduce the number of frames, the number of images in the flip book will decrease and the smoothness of the movement will be a little slower, but the image quality will improve because a large amount of data will be allocated to each frame.

If you want to emphasize the smoothness of motion in a video with a lot of motion, increase the frame rate (video demo 1). On the other hand, if the video has little movement, it is not necessary to increase the number of frames as much (depending on the degree), so it is effective to lower the frame rate and give priority to improving the image quality (Video Demo 2 ).

Point 3: insert “keyframes” at short intervals for moving images
A keyframe is a frame that exists as a single still image (an image that is not compressed between frames) and is the starting point for difference information. Depending on the encoder settings, the keyframes are inserted when there is a scene change and the difference information is inserted at regular intervals, such as XX frames and once every XX seconds.

What is the encryption mechanism? 5 Points to Consider for HD Video Encoding [Part 1]

What is the encryption mechanism? 5 Points to Consider for HD Video Encoding [Part 1]

sample rate

Encode

Sample Rate

The image quality of Internet videos is almost proportional to the bit rate. However, if the bit rate increases unnecessarily, the file size will increase. “Keep bit rate low”, “Reduce file size” and “Reduce load time” are linked, and there is nothing to say if you can encode in high definition while keeping the bit rate low.
Also, at the beginning, I wrote that “image quality is almost proportional to bit rate”, but I think some of you may have experienced that “I increased the bit rate and encoded, but I am not satisfied with the quality of the image. “So, this time, I will explain five points that are often used to do high definition video encoding.

” Table of Contents ”

Encoding Mechanism
Point 1: learn a suitable bit rate guideline for resolution
Point 2: Increase the frame rate if motion is important and lower the frame rate if image quality is important.
Point 3: insert “keyframes” at short intervals for moving images
* You can read the second part (Point 4, Point 5) here.

Encoding Mechanism
First, I will briefly explain the encoding mechanism.
An image is a collection of continuous images (frames), and by changing this in a short time like a flip book, it appears that you are visually moving. Japanese television images are 29.97 frames per second (short for 29.97 fps / frame per second) and most movies and animations have a standard of 24 fps. Since a large number of frames are required for video, the amount of data is also huge. Therefore, data compression is indispensable for distributing videos on the Internet.

When coding

“Prediction in frame” that compresses data within a frame
“Prediction between frames” that compresses data into consecutive frames
Information is reduced and data is compressed within the range that does not affect the visual sense.

■ What is in-frame prediction?
There are various methodologies for data compression, so I will skip the details here, but the basic idea of ​​within-frame prediction is to divide a frame into small blocks called cells and the colors adjacent to each other in the block. they are the same or similar, they are compressed together.
For example, if there is information “blue blue blue blue blue blue blue blue blue blue red red yellow yellow yellow” in the divided block, the amount of data can be reduced by combining this with “blue 11, red 2, yellow 3”. It’s an image.

An example of data compression in in-frame prediction (image)

■ What is cross-frame prediction?
However, in the case of video with a time axis, the number of frames is large, so there is a limit to the overall weight reduction based solely on the prediction within the frame. On the other hand, in the prediction between frames, based on the idea that “the contents are similar before and after the consecutive frames”, the cells that do not change from the previous frame reduce the amount of data by reusing information and the cells that change It becomes data as difference information.

Prediction between frames (image)

From here, I’ll explain five specific code points.

What format do you choose when copying? AIFF, ALAC, AAC … Check the sound quality of each one by “appearance” Part 2

What format do you choose when copying? AIFF, ALAC, AAC … Check the sound quality of each one by “appearance” Part 2

Sample Rate

The “lossless compression” method, to which Apple Lossless and FLAC belong, is a method that can completely restore the original audio data during playback, at the cost of a low compression rate.

Sample Rate

The file size is large, but the sound quality is equivalent to that of a CD. The bit rate fluctuates automatically according to the content of the audio data, and the compression rate is not constant accordingly.

AIFF and WAV are “uncompressed” methods. Extract the original audio data and create a file as is. It does not compress, so it has a lot of capacity, but the sound quality is perfect.

Let’s take a closer look at the table.

■ Don’t say it again … Considering the playback environment, the format selection criteria for copying are as follows: As

You can see from the “Compression rate” and “Sound quality” items in the table, both are highly rated. It has around “AAC / 256kbps” and “MP3 / 192kbps”, which is a Rossy format with a higher bit rate. While ensuring good sound quality, the file size can also be reduced. It also has an excellent balance with the capacity of the integrated SSD / HDD of PC, iOS devices, smartphones, etc.

The default setting for iTunes is AAC / 256kbps, and the specifications for music files sold on the iTunes Store are the same. You can tell that the current standard is around here. In terms of playback compatibility, AAC and MP3 are widespread, and no matter which one you choose, you don’t have to worry about the playback environment.

On the other hand, it is the lossless format that Apple Lossless and FLAC belong to that can reduce the file size to some extent while maintaining the best sound quality equivalent to that of a CD. If you want to give the highest priority to sound quality from an audio point of view, I would like to select this. It will be a bit difficult to balance it with the capacity of SSD / HDD, smartphone, etc. from the PC, but if it can be erased, it is convenient to use this format.

For example, if you don’t have that many CDs, creating a library in a lossless format will not put too much pressure on your PC’s SSD / HDD and you will be able to sync all the songs on your iOS device. Alternatively, you can deal with this by coming up with sync settings for iOS devices, etc. (I’ll explain later). If so, it is better to have a lossless format that can maintain the best sound quality, and there are few errors in the long run.

Just keep in mind that Apple Lossless and FLAC are a bit difficult to choose in terms of the playback environment. Until now, iTunes and iOS devices do not support FLAC, and many other devices and software do not support Apple Lossless. As of June 2012, at the time of writing, many network players only support FLAC. However, with Apple Lossless opening font in October 2011, support for the same format is expanding, so I’d like to keep an eye out for this trend as well.

AIFF and WAV are uncompressed formats. Of course, the sound quality remains the same as that of a CD. However, the data capacity is not compressed at all. In other words, the uncompressed format “has the same sound quality as the lossless format and has a larger file size than the lossless format.” In that sense, there is no reason to choose it unless you are particular about it.

Well finally the highlight of this era. Let’s review the “appearance” of “what is the actual deterioration in sound quality for each compression format?”

What format do you choose when copying? AIFF, ALAC, AAC … Check the sound quality of each by “appearance”

What format do you choose when copying? AIFF, ALAC, AAC … Check the sound quality of each by “appearance”

Bit Rate

Music files are the mainstream of Imadoki’s audio playback sources.

bitrate

Except when purchased from an online distribution, the sound quality of the music files used here is largely related to the work of reading audio data from a CD to a PC, the so-called “ripping” setting. This time I would like to review that part in a little more detail.

The first half of this article describes the basics of the extraction format for those who want to know what sound quality to choose when extracting. Perhaps this first half is common information to many file and web readers.

However, the highlights are beyond that. “Really Terrifying Audio Compression” … So, in the second half of the article, “How much does the compressed file actually deteriorate the sound?” And “How much does the sound quality change depending on the bit rate value?” you will check with (→ Visually check the sound quality of AIFF, ALAC, AAC!). I would like you to stay with us until the end.

■ Don’t say it’s time to change … First, let’s review the basics

The scheme of the options for copying is “compression format (file format)” and “bit rate”. These two determine the sound quality and file size, which is another important factor.

“Compressed format (file format)” refers to formats such as AAC, MP3, Apple Lossless, and FLAC. This selection determines the sound quality, file size, and playback environment.

The “bit rate” is the amount of data allocated per second of audio. The higher the value (kbps), the higher the sound quality, but the larger the file size.

In the case of iTunes, call this screen “Load Settings” from the environment settings and configure the extraction.

Please refer to the following table based on that. We have summarized the characteristics of typical compression formats and bit rate settings.

The item “Sample Bitrate Settings” in the table is quoted from the default settings provided in iTunes (* iTunes does not support FLAC)

First of all, pay attention to the second item from the left of the table. Compression formats can be broadly classified into “lossy compression”, “lossless compression” and “uncompressed”.

The “lossy compression” method, to which AAC and MP3 belong, achieves a high compression rate = a significant reduction in file capacity by reducing some of the data when compressing audio data. In contrast, the original audio data cannot be fully restored during playback and deterioration in sound quality is inevitable. The degree of deterioration in sound quality changes depending on the bit rate setting. The lower the value of the bit rate, the greater the deterioration in sound quality and, conversely, the higher the value of the bit rate, the more mitigated.

Frame rate

Frame rate

Frame Rate

Frame rate is an important setting factor that affects the “smoothness” and file size of a video.

frame rate

The unit is fps (frames / second). You can also tell how many still image frames are embedded per second.

A moving image uses the image persistence phenomenon of the human eye to display still images continuously so that they can be recognized as a moving image. It is said that the ability of the human eye can recognize up to 60 fps. So if you create a video at 60fps, you can tell that the video doesn’t look jerky.
On the other hand, this frame rate has a great effect on file size. Since it is necessary to save 60 still images in 1 second at 60 fps and 1 still image in 1 second at 1 fps, the file size varies greatly depending on the frame rate.
Generally, TVs and DVDs use 30 fps (29.97 fps) and most of them are set to 30 fps (29.97 fps) or less.
Unless you really need to reduce the file size, specify 30 fps (29.97 fps).
For reference when setting less than 30fps (29.97fps), the movie is 24fps and the 1Seg TV is 15fps. It is said that it can be lowered to 15 fps for videos with little movement, such as a person sitting and talking. If you set it to 10fps or less, it will no longer be a video but a slideshow level, and it will definitely look jerky. The minimum line for video is around 15 fps.

On the other hand, for videos with a lot of motion, such as sports and action, you may feel that 30 fps (29.97 fps) at the TV or DVD level is not enough. The file size will be large and it will be difficult to send and receive it over the Internet, but if image quality is prioritized, it is worth setting it to 60fps.
Current playback devices that support 120 fps are still rare, but next-gen TV streaming standards, 4K and 8K streams are specified up to 120 fps.
2. 2. Resolution (angle of view)
It can also be said that it is the size of the area to display videos. In terms of TV streaming,
1Seg → SD → HD → Full HD → 2K → 4K → 8K How much
The higher the resolution, the larger the rendering area, so naturally the video file size will increase accordingly.

Resolution (angle of view) TV broadcast Compatible storage devices
SD (720 px x 480 px) Analog broadcast DVD
HD (1280px x 720px) HDTV broadcast
* mainly in Europe —
Full HD (1920px x 1080px) High definition transmission
* Japan, strictly speaking,
High Definition BS: 1920px x 1080px Transmission
digital terrestrial: 1440px x 1080px Blu-ray Disc
(BD)
4K UHD (3840px x 2160px) 4K UHD streaming means Ultra HD.
Streaming started on December 1, 2018 with the Next Generation Streaming Standard. Ultra HD Blu-ray Disc
(UHD BD)
8K UHD (7680px x 4320px) 8K Transmission As with
4K, streaming started on December 1, 2018. Unknown current status

When considering Internet video usage, YouTube’s maximum resolution is Full HD (HD1080). With reference to this, if resolution is prioritized, it is set to Full HD, and if file size is prioritized, it is set to SD or less.

aspect ratio
It is the aspect ratio of the resolution (angle of view). 16: 9 is the standard for televisions, and 16: 9 monitors have become mainstream for personal computers, but there are still products with aspect ratios such as 16:10 and 4: 3, iPhone 3: 2, and Andoroid 16. : is not unified like 9.
Therefore, if the prepared video file has an aspect ratio of 16: 9 and the aspect ratio of the playback device is different, it will be played back by adjusting, expanding or contracting it on the side of the playback device.
When uploaded to YouTube, videos other than 16: 9 are automatically rendered with black frames at the top, bottom, left, and right.
For those who create and prepare videos, it is very kind to prepare video files with every aspect ratio, but if you can’t take the trouble, it’s usually fine to just create a 16: 9 aspect ratio.

Video Compression: Bit rate

Video Compression: Bit rate

Video Bitrates

It is not good to increase the bitrate too much
Bit rate = it is useless to rise above a certain level
It does not mean that you need to increase the bit rate.

Video Bitrate

For example, even if you encode a video with an original image quality of 100 at an ultra-high bit rate, the image quality will not exceed 100. (If possible, 99, etc.)

It is often the case that the image quality is 95 at a 5 Mbps bit rate, but the image quality is only 96 even if a 10 Mbps bit rate is assigned.

In such cases, it is useless to assign a bit rate of 10 Mbps.

The bit rate is to maintain the image and sound quality of the original video. It is not intended to raise the bottom.

High bit rate = high playback load
The higher the bitrate, the more playback load will be placed on the PC.

If you use a unnecessarily high bit rate, you will end up with the worst video, “Although the image quality is normal, the playback load is extremely high and the file size is a huge waste.”

So if you want to encode it for your own storage,

Video resolution
Video content
Let’s think about the bitrate to be assigned.

Related: How to Calculate Video Bitrate [Ratio to File Size]

However, if you want to post to Youtube, it will be encoded on the Youtube side and set to a suitable bitrate, so it’s okay if you encode at an ultra-high bitrate for now.

Related: Enco conditions and methods for videos published on Youtube

 

Video Compression: Relationship to Resolution

Video Compression: Relationship to Resolution

Video Bitrate

Higher resolution videos require higher bit rates. (Because it increases the amount of information per frame / second)

Video Bitrate

For example

Video “1280 x 720”
Video “1920 x 1080”
If you have two videos, the latter requires more bitrate. “1280 x 720” may be sufficient bit rate, but “1920 x 1080” is not sufficient.

For “Recommended bit rate” for “Resolution”, see Youtube recommended bit rate.

Recommended encoding settings for uploaded videos (details) – YouTube Help
→ https://support.google.com/youtube/answer/1722171?hl=ja

Relationship to frame rate
If the frame rate doubles, the bit rate will inevitably double.

This is because “the number of frames per second” is doubled.

For example

30 fps (2 Mbps)
60 fps (2 Mbps)
If there are two videos,

For 60 fps, “60 sheets at 2 Mbps” should be displayed, while

For 30fps, you only need to display “30 sheets at 2Mbps”, so the bitrate is actually half.

Reference: What is the frame rate? Difference between VFR (variable) and CFR (fixed)

It is not good to increase the bitrate too much
Bit rate = it is useless to rise above a certain level
It does not mean that you need to increase the bit rate.

For example, even if you encode a video with an original image quality of 100 at an ultra-high bit rate, the image quality will not exceed 100. (If possible, 99, etc.)

It is often the case that the image quality is 95 at a 5 Mbps bit rate, but the image quality is only 96 even if a 10 Mbps bit rate is assigned.

In such cases, it is useless to assign a bit rate of 10 Mbps.

The bit rate is to maintain the image and sound quality of the original video. It is not intended to raise the bottom.

High bit rate = high playback load
The higher the bitrate, the more playback load will be placed on the PC.

If you use a unnecessarily high bit rate, you will end up with the worst video, “Although the image quality is normal, the playback load is extremely high and the file size is a huge waste.”

So if you want to encode it for your own storage,

Video resolution
Video content
Let’s think about the bitrate to be assigned.

Related: How to Calculate Video Bitrate [Ratio to File Size]

However, if you want to post to Youtube, it will be encoded on the Youtube side and set to a suitable bitrate, so it’s okay if you encode at an ultra-high bitrate for now.

Related: Enco conditions and methods for videos published on Youtube

Resume
In short, it looks like the following.

If you want to make a video that emphasizes the quality of the image
→ Increase the video bit rate

If you want to make a video that emphasizes the sound quality
→ Increase the audio bit rate (increase the sample rate and bit depth)

When you want to make a video that emphasizes movement (smoothness)
→ Increase the frame rate of the video (simply doubling the frame rate requires doubling the bit rate)

Reference: What is the frame rate? Difference between VFR (variable) and CFR (fixed)
Reference: How to Change the Frame Rate (fps) of a Video

By the way, it is a bit rate encoding method.

CBR
Vbr
APR
The “image quality” and the “sound quality” also depend on this, so be careful with this as well.

Reference: Difference between CBR (fixed), VBR (variable) and ABR (average) [bit rate]

 

Video compression: Relationship to codec

Video compression: Relationship to codec

Video Bitrate

I mentioned earlier that “the higher the bit rate, the better the image quality and sound quality”, but the image quality and sound quality are closely related to the “codec”.

A “codec” is something like a “compression algorithm” for compressing “video” and “audio”.

Reference: What is video format? Codec difference

For example, the video codec “H.264” It is a very famous codec that is also used on Youtube and Nico Nico Douga,

(Addendum: Not used now …)

There is a codec called “H.265” that improves the “image quality per file size” of “H.264”.

“H.265” is “H.264 at about half the bit rate of”, “H.264 will get the equivalent of image quality and”. (The compression rate is double)

For example

Using “2Mbps” video bit rate with “H.264 codec”
Video with a bit rate of “2 Mbps” with the codec “H.265”
If there are two videos, the image quality of “H.265” is twice as beautiful even though the bit rate (file size) is the same.

s-25-11-2015_14h09_08
▲ Image comparing H.264 and H.265
(the character part etc. is quite different)
In addition, there is an almost four times difference in picture quality between videos using the “MPEG-2” codec used in DVDs and videos using “H.265”.

Also, the image quality is almost eight times different from that of “MPEG-1”, which is the predecessor of “MPEG-2”.

In other words, if you want to achieve the same image quality as “H.265” video with “MPEG-1”, you need 8 times the bit rate of “H.265”.

By the way, the video in unzipped state without using the codec
Uncompressed video
Uncompressed video
Is named. (Also called “raw video”)

The intro has gotten long, but what I mean after all is

“If you use a codec with a good compression rate, you can maintain reasonable picture and sound quality even at low bit rates.”

That’s why

In other words, the picture and sound quality are good.

Image quality (sound quality) = high bit rate x codec type
It is decided by the formula.

Reference: Different from the type of video codec (H.264, VP9, ​​MPEG, Xvid, DivX, WMV, etc.)

Reference: Different from the type of voice codec (MP3, AAC, WMA, WAV, Vorbis, FLAC, etc.)

Reference: Difference Between Lossy Compression and Lossless Compression [codec]

What is a bit rate?

What is a bit rate?

Video Bitrate

The bit rate in a video is “how much information is packed in one second”.

What if the bit rate is high?
Basically, the higher the bit rate, the better the picture and sound quality.

* Although it is closely related to the “codec” described later, it will basically improve.

There are two types of bit rates
Bit rates are assigned separately for “video” and “audio”.

The higher the bitrate assigned to “video”, the better the “image quality”.
The higher the bit rate assigned to “voice”, the better the “sound quality”.
Also, the sum of the two bit rates is called the “oval bit rate (total bit rate)”. (This oval bit rate is called “video bit rate”)

screenshot_2952
▲ If you open the video file properties and open the “Details” tab, you can see “What is the bit rate?”

(However, this Windows function is unreliable, so it is better to use video analysis software like MediaInfo)

In other words

Oval bit rate = video bit rate + audio bit rate
It becomes the calculation formula.

So even if it says “bit rate is high!”, It may mean “bit rate of video is high” and “bit rate of audio is not high”.

In other words, in such a case, the video will be “Image quality is good, but sound quality is not good …”.

Basically, the file size of “audio” is much smaller than that of “video”, so even if you increase the bit rate of “audio” significantly, the overall size of the file will not change as much.

Therefore, “speech” is often encoded uncompressed (linear PCM).

Relationship to image quality
The higher the “video” bit rate, the more accurate the color information that can be assigned to all pixels.

as a result

High bit rates improve image quality and
If the bit rate is low, the image quality will deteriorate.
koubittore-to
teibittore-to-to
▲ High bit rate (12 Mbps, 2.57 MB) ▲ Low bit rate (90 kbps, 20 KB)
* Actually, it is a gif video, so the bit rate is not accurate.

Bit rate difference

Also, in the case of a low bitrate, if you allocate bits evenly to all pixels, you will run out of bits, so in scenes where similar colors are continuous (such as a scene where the blue sky stretches without end), etc. Try to reduce the bits preferably.

As a result, “block noise” ↓ is likely to occur in such scenes.

Block noise
▲ Example of block noise (block noise)

Relationship to sound quality
The audio bit rate is

Sampling rate (Hz) x bit depth (bit) = bit rate (bps)
It can be expressed by the formula.

For example, when recording sound as digital data

How often do you record (= sample rate)
How much data is stored per interval (= bit depth)
Decide and register.

For example

Sampling rate: 44000Hz
Bit depth: 24 bit
If so, the sound is divided and recorded 44,000 times per second, and the sound is recorded using 24 bits for every 44,000 times.

In other words, if you want to improve the sound quality, you can increase the “sample rate” or the “bit depth”.

Increase the sample rate → Soft sound
Increase the bit depth → Increase the expressiveness of the sound, such as finesse and volume
Reference: Meaning and Relationship of Sample Rate, Bit Depth, and Bit Rate