ffmpeg - 如何将不同分辨率的视频组合成单个 HLS 视频?

标签 ffmpeg video-streaming http-live-streaming

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/

相关文章:

javascript - Fluent-ffmpeg : merging video and audio = wrong frames

calayer - 同时在两个 View 上显示 AVPlayer 内容

iphone - 适用于 iPhone 和 HTTP 直播的实时视频聊天

safari - HTML 视频 : Is it possible to fallback to HLS for lack of DASH/Webm-VP9 support on Safari, 或者我如何在 DASH 上同时支持 Webm 和 H264?

ffmpeg - 合并后如何获得高质量的视频

video - FFMPEG 图像到视频缩放起始位置

visual-studio-2008 - 将 ffmpeg 连接到 Visual Studio 2008

javascript - 如何播放/服务/流式传输视频到本地 html 站点? vlc/ffmpeg?

javascript - 等待事件未触发

silverlight - 使用 Azure 配置视频流以进行 H 264 流传输?