preface

Not long ago, I did a video-related project, and I was always confused about the three concepts (protocol/codec/format), especially the coding and format are always confused, so I will summarize and sort them out here.

  • Video streaming protocol
  • codec
  • Video format

1. Video transmission protocol

Streaming media Transfer protocol (RTP/RTCP/RTSP/RTMP/HLS)

Streaming media refers to a technology that compresses a stream of data and sends it over the Internet in segments for instant viewing of audio and video. By using the Streaming Media technology, users can play files without downloading them to the local PC. Because the media is sent in a continuous stream of data, it can be played when the media arrives. It can be paused, fast-forward, or retracted just like a downloaded file. The streaming protocol is a standardized delivery method for breaking video into chunks and sending it to a video player, who reassembs it for playback.

2. Codec

Codec refers to video compression technology, that is, compressor/decompressor. Encoding is different from container, which refers to the format of the actual storage of video data, i.e., video format, which is equivalent to the box in which the data is placed. Codec is like the instructions for unpacking and packaging the box. For example, H.264/AVC, H.263, H.265/HEVC are encoding, mp4, MOV, avi are containers.

2.1 Why use codec

Take ultra-high-definition (UHD) video, which has a resolution of 3840×2160 pixels and a frame rate of 60 (i.e., 60 images per second), The amount of data in uncompressed 1-second video is more than 11.94 billion bits (3840×2160 pixels/image ×24bits/ pixel ×60 images/second). With such a huge amount of data, it is almost impossible to transmit and store video signals directly without compression. Video coding technology makes it possible to play remote video signal smoothly and clearly.

2.2 Evolution history of video coding

The H.262/MPEG-2 standard has promoted the transformation from analog TV to digital TV, H.264/AVC has promoted the wide promotion of HIGH-DEFINITION video and Internet video, and H.265/HEVC has successfully promoted the popularization of 4K ultra high definition video. H.266/VVC has better support for new video types such as 8K ultra HD, screen, high dynamic and 360-degree panoramic video, as well as applications such as streaming media and real-time communication with adaptive bandwidth and resolution.

The above nouns: frame, frame rate, resolution are as follows:

  • Frame: The screen displayed each time the switch is called a frame.
  • Frame rate: The number of frames per second. FPS: 60 frames per second
  • Resolution: The number of pixels per frame, expressed as the number of horizontal pixels × the number of vertical pixels, e.g
  • 720p = 1280 × 720 is a common resolution.
  • Bit rate: The number of bits contained in the length of video per second
  • 2K: 1920*1080 resolution
  • 4K: 3480*2160 4x HD
  • 8K: 7680*4320 16 times HD pixel over 33 million

3. Video format

Video format Refers to the video file format. Video data can be stored on the device only after being sorted in a predefined format. In the formulation of format, two types of information are mainly saved namely video metadata and video subject data. Metadata contains some description information about the subject data, including the size and resolution of the recorded video, and the encoding scheme of the audio and video.

Common video formats include MP4, AVI, MOV and so on. The file format is just a box, which contains video files, audio files and metadata. Mp4 is generally selected as the container format, which is widely supported by various systems and devices.

conclusion

Ok, here it is also many study sums up three concepts, for an example of a more abstract image shows conclude: if you are a wholesaler, need the batch transportation clothes (video), codec is the machine packaged clothes compression to save space, the container format is compressed in the container, agreement is to be sent to the destination of transportation, light.