Preface: summary of some basic problems in audio and video, haha, can leave a message below, a word, prove that you are in contact with audio and video development. Here are some of my finishing and finishing in the work, not necessarily all right, can be boldly pointed out. I can study and learn.


1. What are the two major systems of video coding standards?


There are two major systems of video coding standards: MPEG and ITU-T, as follows

Video coding standard

MPEG standards are formulated by MPEG

MPEG-1 | MPEG-2 | (MPEG-3) | MPEG-4 | MPEG-7 | MPEG-21

Itu-t standards are developed by the VCEG

H.261 | (H.262) | H.263 | H.263v2 | H.264


2, what is audio and video coding format? What is audio and video package format?

Common AVI, RMVB, MKV, ASF, WMV, MP4, 3GP, FLV and other files can only be regarded as a packaging standard.

A complete video file is composed of audio and video parts. H264 and Xvid are video encoding formats, while MP3 and AAC are audio encoding formats.

For example: an Xvid video encoding file and an MP3 video encoding file according to AVI packaging standard encapsulation, you get a AVI suffix video file, this is our common AVI video file.

Since many kinds of video encoding files and audio encoding files meet AVI packaging requirements, it means that even the AVI suffix may be different in the specific encoding format. As a result, AVI files appear on a number of devices, some of which work and some of which don’t.

The same applies to other container formats. Even RMVB, WMV and so on are no exception. In fact, many packaging containers put the combination of audio coding and video coding very open, such as AVI can also use H.264+AAC combination, you can experience in the concrete use. Especially MKV packaging container, basically no matter what kind of combination can! However, the most commonly used MKV is H.264+AAC combination, which has the smallest file volume and the highest definition. So a lot of MKV video online is in high definition.

Therefore, the essence of the Settings required for video conversion is: A sets the required video encoding, B sets the required audio encoding, and C chooses the required container packaging. A complete video conversion setup includes at least the above three steps.

3, usually said soft solution and hard solution, what is specific?

Hard solution is hardware decoding, refers to the use of GPU to partially replace CPU decoding, soft solution is software decoding, refers to the use of software to let THE CPU to decode. The specific differences between the two are as follows:


Hard to decode: Is all to the CPU to process the original part of the video data to the GPU to do, much higher than that of CPU and GPU parallel computing power, it can greatly reduce the CPU load, CPU utilization rate is low after can run at the same time some other program, of course, for a better processor, such as the i5 2320, Or for any of AMD’s quad-core processors, the difference between hardware and software is a matter of personal preference.


Soft decoding: let the CPU decode the video through software; And hard decoding: refers to without the help of CPU, and through special sub-card equipment to independently complete the video decoding task. Once the VCD/DVD decompression card, video compression card and so on all belong to the category of hard decoding. And now, to complete hd decoding has no need for additional sub-cards, because the hard decoding module has been integrated into the graphics card GPU interior, so the current mainstream graphics cards (display) can support hard decoding technology.


4. What is live streaming? What is on-demand?

Live: is a three-way interaction (host, server, audience), this interactive real-time! Although there will be some latency depending on the protocol chosen, we still consider it live! –> The host locally sends audio and video to the server (push stream), and the audience watches and listens to the audio and video sent to the server (live broadcast content) from the server decoding in real time (pull stream). Live is on-demand that can’t be fast-forward: First must be clear, on demand there is no flow in this process, you are your flow has already pushed to the server, or say that is wrong, should be your audio and video have been uploaded to the server, you just need to watch online audience, because of your audio and video uploaded to the server, the audience can through fast forward, fast rewind, adjustment in the form of a progress bar and watch!


5. Describe the working process of pushing and pulling flow?


Push flow: in the broadcast, the direction of the server sends the request, the server push themselves are broadcast live data, and the content in this process pushed to the server is passed in the form of “flow”, this is the “flow”, push the audio and video data to flow through or uploaded to the server process is the “flow”! Push stream side audio and video are often very large, in the process of push stream first in accordance with aAC audio – coding and H264 video frequency – coding standards to push the audio and video compression, and then merged into MP4 or FLV format, and then according to the live packaging protocol, Finally, it is passed to the server to complete the process of pushing the stream.


Pull stream: on the contrary to push stream, pull stream is the user from the server to get push stream to the server’s audio and video process, this is “pull stream”! Pull stream first aAC audio – decoding and H.264 video frequency – decoding internal push the audio and video decompressed, and then synthesized MP4 or FLV format, and then unpacked, and finally to our client to interact with the audience.


6. What are the common live broadcast protocols? What’s the difference?


Common live broadcast protocols include RTMP, HLS, and FLV.

  • 1, the RTMP: Real Time Messaging Protocol ~ Real-time transmission protocol, RTMP protocol is relatively versatile, which can be used for both push and live broadcast. Its core idea is to “cut up” large video and audio frames, and then transmit them on the Internet in the form of small packets, and support encryption. Therefore, the privacy is relatively ideal, but the process of unpacking and grouping packages is complicated, so it is easy to have some unexpected stability problems in the case of massive concurrency.

  • 2. FLV: The FLV protocol is mainly promoted by Adobe. The format of FLV is extremely simple, just adding some tag header information in large video frames and audio and video headers. The only downside is that it has very limited support in mobile browsers, but it works well as a mobile APP live protocol.

  • 3. HLS: Apple native: HTTP Live Streaming, following the HTTP hypertext transfer protocol, port number 8080, divides the video into small video fragments of 5-10 seconds, and then manages the video with m3U8 index table. As all the videos downloaded by the client are complete data of 5-10 seconds, the video has good smoothness. But it also introduces a lot of latency (typically around 10-30s for HLS).


7. What are the main data transmission protocols in VOD?


Common vod protocols: HLS, HTTP

What is Nginx? What are the characteristics?


Nginx is an HTTP compliant server! Small memory footprint, strong concurrency! And so on the advantages of Google


What is Homebrew? What have you installed with it? What are the common commands?


Homebrew is a unique suite manager for Mac system, I need to broadcast, RTMP and nginx, a separate installation is very complicated, just enter a simple installation of the corresponding suite command terminal to complete the installation, complex process is bypass by Homebrew! I’ve used it to install a lot of things, like nginx for streaming servers. Common commands: brew install, brew uninstall, brew search, brew list, brew update, brew help, etc

10. What is FFmpeg?


FFmpeg is an open source computer program for recording and converting digital audio and video, and streaming it. Pull flow and push flow without the help of FFmpeg!


11. What is the default port number for RTMP and HLS?


RTMP port number: 1935

HLS port number: 8080


What is the composition of M3U8? How do M3U8 and TS update in real time during live broadcast?


M3u8 playlist (index file) and N more than.ts files are generated by slicing local XXX.mp4 through FFmpeg, and put them (M3U8, N TS) in the specified directory of the local webServer server. I can get a real-time playback of the URL, we copy this M3U8 address to VLC can watch in real time! Under the current of HLS, the local video is divided into small slices one by one, usually one for 10 seconds. These small slices are managed by M3U8 and updated in real time with the command of FFmpeg of the terminal to pull the local stream. The movie progress is updated with the progress of the pull stream. Until the file is played or stopped, the TS slice will be deleted accordingly, the stream will stop, the movie will not stop immediately, the movie will lag behind the pull stream for a period of time.


13. Explain how to set up a local live broadcast server on Mac.


See my article:

http://blog.csdn.net/hejjunlin/article/details/54425531

PS: FFmpeg push stream to Nginx: can push two kinds of streams: RTMP stream, push stream to rTMplive; HLS flow, push flow to HLS; Among them, HLS stream performance is more obvious, in the temporary directory of Nginx, can be seen intuitively M3U8 index files and N more than. Ts files. The m3U8 list is updated in real time and changes the current play index slice (.ts) dynamically. This real-time update mechanism does not cause. Ts files to remain on the Nginx server for a long time, and when the push ends, the contents of the directory will be wiped out, which virtually relieves the pressure on the Nginx server. In addition, it also explains the reason why HLS streaming media playback has a higher delay than RTMP.


14. Tell me about the optimization work you do during the broadcast


Preloading, weak network optimization, playback error retry mechanism, slow start due to carrier hijacking, high CPU usage of Mediaserver, resulting in playback lag. To start a broadcast, only the playback process is reserved and other processes are killed.


The first time to get blog updates, as well as more Android, source code analysis, the latest open source project recommendation, more valuable thinking, welcome to pay attention to my wechat public number, scan the qr code below or long press to identify the QR code