HLS 将视频分成多个短片段 (.ts) 文件。这些段中的每一个都可以具有不同的元数据。因此,例如,您可以在视频中途更改分辨率,播放器可以适应这一点。我有不同纵横比(因此分辨率也不同)的视频,我想将它们拼接成一个 HLS 视频。请注意,我不想简单地对所有内容进行信箱处理并将其组合成具有一种分辨率的单个视频。
我目前正在使用 ffmpeg,因此首选使用它的解决方案。
最佳答案
RFC 8216 :
4.3.2.3. EXT-X-DISCONTINUITY
The EXT-X-DISCONTINUITY tag indicates a discontinuity between the Media Segment that follows it and the one that preceded it.
Its format is:
#EXT-X-DISCONTINUITY
The EXT-X-DISCONTINUITY tag MUST be present if there is a change in any of the following characteristics:
file format
number, type, and identifiers of tracks
timestamp sequence
The EXT-X-DISCONTINUITY tag SHOULD be present if there is a change in any of the following characteristics:
encoding parameters
encoding sequence
关于客户行为:
The encoding parameters for samples in a Media Segment and across multiple Media Segments in a Media Playlist SHOULD remain consistent. However, clients SHOULD deal with encoding changes as they are encountered, for example, by scaling video content to accommodate a resolution change. If the Variant Stream includes a RESOLUTION attribute, clients SHOULD display all video within a rectangle with the same proportions as that resolution.
关于ffmpeg - 如何将不同分辨率的视频组合成单个 HLS 视频?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64272606/