FFmpeg dash 相关参数翻译

由于个人英文水平、以及在流媒体领域水平有限,有限翻译可能有误,请参照原文食用。


Muxers are configured elements in FFmpeg which allow writing multimedia streams to a particular type of file.

4.7 dash

Dynamic Adaptive Streaming over HTTP (DASH) muxer that creates segments and manifest files according to the MPEG-DASH standard ISO/IEC 23009-1:2014.

For more information see:

ISO DASH Specification: http://standards.iso.org/ittf/PubliclyAvailableStandards/c065274_ISO_IEC_23009-1_2014.zip
WebM DASH Specification: https://sites.google.com/a/webmproject.org/wiki/adaptive-streaming/webm-dash-specification
It creates a MPD manifest file and segment files for each stream.

The segment filename might contain pre-defined identifiers used with SegmentTemplate as defined in section 5.3.9.4.4 of the standard. Available identifiers are "$RepresentationID$", "$Number$", "$Bandwidth$" and "$Time$". In addition to the standard identifiers, an ffmpeg-specific "$ext$" identifier is also supported. When specified ffmpeg will replace $ext$ in the file name with muxing format’s extensions such as mp4, webm etc.,

SegmentTemplate 用到的 segment 文件名可能包含了在5.3.9.4.4节预先定义的标准标识符。可用的标识符为 "$RepresentationID$", "$Number$", "$Bandwidth$" 和 "$Time$"。除标准标识符之外,一个 ffmpeg 规格的 "$ext$" 也是支持的。 当这个值设置之后,ffmpeg 将会把$ext$ 替换为混流中的格式的扩展名,例如 mp4 , webm 等等。

ffmpeg -re -i <input> -map 0 -map 0 -c:a libfdk_aac -c:v libx264 \
-b:v:0 800k -b:v:1 300k -s:v:1 320x170 -profile:v:1 baseline \
-profile:v:0 main -bf 1 -keyint_min 120 -g 120 -sc_threshold 0 \
-b_strategy 0 -ar:a:1 22050 -use_timeline 1 -use_template 1 \
-window_size 5 -adaptation_sets "id=0,streams=v id=1,streams=a" \
-f dash /path/to/out.mpd
  • min_seg_duration microseconds
    This is a deprecated option to set the segment length in microseconds, use seg_duration instead.

这个选项用来设置 segment 长度,精度为毫秒,不建议使用。用 seg_duration 来替代

  • seg_duration duration
    Set the segment length in seconds (fractional value can be set). The value is treated as average segment duration when use_template is enabled and use_timeline is disabled and as minimum segment duration for all the other use cases.

设置 segment 长度,精度为秒(可以设置小数)。当 use_templateenable 状态,且 use_timelinedisable状态时,这个值会被当作 segment 的平均值。其他时候会被当作 segment 长度的最小值。

  • window_size size
    Set the maximum number of segments kept in the manifest.

设置保留在 manifestsegment 最大数量

  • extra_window_size size
    Set the maximum number of segments kept outside of the manifest before removing from disk.

设置从硬盘上删除之前 manifest 之外 segment 最大数量

  • remove_at_exit remove
    Enable (1) or disable (0) removal of all segments when finished.

enable (1) 或者 disable (0) 结束时删除所有 segments

  • use_template template
    Enable (1) or disable (0) use of SegmentTemplate instead of SegmentList.

Enable (1) 或者 disable (0) 使用 SegmentTemplate 替代 SegmentList.

  • use_timeline timeline
    Enable (1) or disable (0) use of SegmentTimeline in SegmentTemplate.

Enable (1) 或者 disable (0) 在 SegmentTemplate 中使用 SegmentTimeline .

  • single_file single_file
    Enable (1) or disable (0) storing all segments in one file, accessed using byte ranges.

Enable (1) 或者 disable (0) 将所有segments存储到一个文件中, accessed using byte ranges.
后半句有疑问

  • single_file_name file_name
    DASH-templated name to be used for baseURL. Implies single_file set to "1". In the template, "$ext$" is replaced with the file name extension specific for the segment format.

用于 baseURLDASH 模板名称。这意味着 single_file 设置为 “1”。在模板中,"$ext$" 将会被替换为 segment 格式指定的文件名扩展。

  1. $ext$ 这个参数用 ffmpeg34.1.3 尝试过,不生效
    -single_file_name "signame.\$Bandwidth\$.\$RepresentationID\$.\$Time\$.\$ext\$" --> signame.128000.1.0.$ext$
  • init_seg_name init_name
    DASH-templated name to used for the initialization segment. Default is "init-stream$RepresentationID$.$ext$". "$ext$" is replaced with the file name extension specific for the segment format.

用于初始segmentDASH模板名称。默认的 "init-stream$RepresentationID$.$ext$"。 "$ext$" 将会被替换为 segment 格式指定的文件名扩展。

  • media_seg_name segment_name
    DASH-templated name to used for the media segments. Default is "chunk-stream$RepresentationID$-$Number%05d$.$ext$". "$ext$" is replaced with the file name extension specific for the segment format.

用于媒体segmentDASH模板名称。默认为 "chunk-stream$RepresentationID$-$Number%05d$.$ext$"。"$ext$" 将会被替换为 segment 格式指定的文件名扩展。

  • utc_timing_url utc_url
    URL of the page that will return the UTC timestamp in ISO format. Example: "https://time.akamai.com/?iso"

能以 ISO 格式返回 UTC 时间戳的网页地址。例如 "https://time.akamai.com/?iso"

  • method method
    Use the given HTTP method to create output files. Generally set to PUT or POST.

用给定的 HTTP method 创建输出文件。通常设置为 PUT 或者 POST

  • http_user_agent user_agent
    Override User-Agent field in HTTP header. Applicable only for HTTP output.

覆盖 HTTP headerUser-Agent字段。只适用于 HTTP 输出。

  • http_persistent http_persistent
    Use persistent HTTP connections. Applicable only for HTTP output.

使用持久HTTP连接。只适用于 HTTP 输出。

  • hls_playlist hls_playlist
    Generate HLS playlist files as well. The master playlist is generated with the filename master.m3u8. One media playlist file is generated for each stream with filenames media_0.m3u8, media_1.m3u8, etc.

同时生成 HLS 播放清单文件。生成的主播放清单文件名为 master.m3u8。每lu

  • streaming streaming
    Enable (1) or disable (0) chunk streaming mode of output. In chunk streaming mode, each frame will be a moof fragment which forms a chunk.

Enable (1) 或者 disable (0) 分块流模式输出。在分块流模式中,每一帧将会以 moof 片段的形式形成一个块。
moof movie segment,是分段形式解析,如同 hls 中的 ts 分片一样。

  • adaptation_sets adaptation_sets
    Assign streams to AdaptationSets. Syntax is "id=x,streams=a,b,c id=y,streams=d,e" with x and y being the IDs of the adaptation sets and a,b,c,d and e are the indices of the mapped streams.To map all video (or audio) streams to an AdaptationSet, "v" (or "a") can be used as stream identifier instead of IDs.When no assignment is defined, this defaults to an AdaptationSet for each stream.

分配 streamsAdaptationSets。语法是 "id=x,streams=a,b,c id=y,streams=d,e", x,yadaptation sets 的 ID,a,b,c,d,e 是映射到各路流的索引。
为了将所有视频(或音频)流映射到一个 AdaptationSetv(或者a)可以被用作流标识符来替代 ID。没有定义分配时,默认会将所有流放到一个 AdaptationSet 中(???)。

  • timeout timeout
    Set timeout for socket I/O operations. Applicable only for HTTP output.

设置 socket I/O 操作超时时间。只适用于 HTTP 输出。

  • index_correction index_correction
    Enable (1) or Disable (0) segment index correction logic. Applicable only when use_template is enabled and use_timeline is disabled.When enabled, the logic monitors the flow of segment indexes. If a streams’s segment index value is not at the expected real time position, then the logic corrects that index value.Typically this logic is needed in live streaming use cases. The network bandwidth fluctuations are common during long run streaming. Each fluctuation can cause the segment indexes fall behind the expected real time position.

enable (1) 或者 disable (0) segment 索引纠正逻辑。只适用于 use_template 开启,且use_timeline关闭时。
当这个参数开启时,这个逻辑会监控segment的索引流动(增量??)。如果一个流的 segment 索引值不在期望的真是时间位置,那么这个逻辑就会纠正索引值。
通常来说直播流情况下需要这个逻辑。在长时间直播时网络带宽通常会有波动。每次波动都有可能造成 segment 索引落后于期望的真是时间位置。

  • format_options options_list
    Set container format (mp4/webm) options using a : separated list of key=value parameters. Values containing : special characters must be escaped.

设置容器格式(mp4/webm)选项用一个 : 来分隔一系列 key=value 参数。Values 中包含的 : 特殊字符必须被转义。(The use of the word "escape" really means to temporarily escape out of parsing the text and into a another mode where the subsequent character is treated differently.)

  • global_sidx global_sidx
    Write global SIDX atom. Applicable only for single file, mp4 output, non-streaming mode.

写全局 SIDX atom。只适用于单文件,mp4输出,非流模式下。

  • dash_segment_type dash_segment_type
    Possible values:

    • auto
      If this flag is set, the dash segment files format will be selected based on the stream codec. This is the default mode.

    如果这个标志被设定,dash segment 文件格式将基于流格式。这个是默认模式。

    • mp4
      If this flag is set, the dash segment files will be in in ISOBMFF format.

    如果这个标志被设定,dash segment 文件将采用 ISOBMFF 格式。

    • webm
      If this flag is set, the dash segment files will be in in WebM format.

    如果这个标志被设定,dash segment 文件将采用 WebM 格式。

  • ignore_io_errors ignore_io_errors
    Ignore IO errors during open and write. Useful for long-duration runs with network output.

忽略 I/O 打开且在写时发生的错误。在长时间的网络输出中有用。

  • lhls lhls
    Enable Low-latency HLS(LHLS). Adds #EXT-X-PREFETCH tag with current segment’s URI. Apple doesn’t have an official spec for LHLS. Meanwhile hls.js player folks are trying to standardize a open LHLS spec. The draft spec is available in https://github.com/video-dev/hlsjs-rfcs/blob/lhls-spec/proposals/0001-lhls.md This option will also try to comply with the above open spec, till Apple’s spec officially supports it. Applicable only when streaming and hls_playlist options are enabled. This is an experimental feature.

开启低延迟 HLS(LHLS)。给 #EXT-X-PREFETCH 标签增加当前的 segmentURI。 Apple 没有官方的 LHLS 规格。然而 hls.js播放器的人们正在尝试推行一个标准化的开放 LHLS 规格。规格草案在https://github.com/video-dev/hlsjs-rfcs/blob/lhls-spec/proposals/0001-lhls.md可以看到。这个选项将会尝试遵循上面的公开规格,直到 Apple 有官方支持的规格。 只适用于 streaminghls_playlist 选项都开启时。这是个实验特性。

  • master_m3u8_publish_rate master_m3u8_publish_rate
    Publish master playlist repeatedly every after specified number of segment intervals.

特定的segment间隔数目后,重复输出主playlist

标签: none
返回文章列表 文章二维码
本页链接的二维码
打赏二维码