Two ways of video segmentation

MP4 is just a package format. MP4 can exist in two ways:
One is to put all Meta in the file header, and all subsequent media data as a whole. In this way, although buffering and playback can also be achieved after streaming, due to the large Meta volume of MP4, there may be a long buffering time before playback (especially when the video time is very long).

The other is to encapsulate multiple pieces of media data in one MP4, and each piece of media data has its own independent Meta, so that the effect of progressive download + fast buffering can be achieved, which is also achieved by Youtube.

In addition, HLS is generally not used for on-demand services. Because m3u8 is just an index file, after the user requests to call m3u8, the streaming media server will continue to request the TS file of the entity to the storage, resulting in too frequent requests, which puts a lot of pressure on storage, and cannot allow the streaming media server to achieve large-scale concurrency. support.

And almost all the video-on-demand services of video websites use MP4 fragments, because the streaming media server does not need to frequently request data from the storage, it can be called once, and it can even be cached to the front-end Transfer or local hard disk, which is far more efficient than using HLS. On-demand higher.

HLS is used for live broadcast services, mainly to solve the problem of timeliness (the timeliness of recording it locally and then encapsulating it into MP4 cannot meet the timeliness of live broadcast services).

Note: ffmpeg can slice mp4 into ts files and generate m3u8 list files

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324498203&siteId=291194637