From patchwork Sat Jan 20 12:53:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Sabatini X-Patchwork-Id: 45675 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:a402:b0:199:de12:6fa6 with SMTP id z2csp426324pzk; Sat, 20 Jan 2024 04:53:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IH+PLMsD5o65ioFsgac9GyxGXzPDKq/NK2r7FS1lWo+TOGpbHwfzau+R/GtCK/U0sRlFWpY X-Received: by 2002:a05:600c:3b08:b0:40e:89e8:107a with SMTP id m8-20020a05600c3b0800b0040e89e8107amr1896995wms.3.1705755223663; Sat, 20 Jan 2024 04:53:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705755223; cv=none; d=google.com; s=arc-20160816; b=Xcb2OXKOMFuk265PA1mThwoXZ8tAj5GmEK5Ha9bNfPJeZ8kkkoY+Sm6rontcyl25bX RdTXnEQd7ACUWYVd5EKKdaeftqYVP+DKCNCJAhdpE2bKv6WHvOtbZYNTmAk5AAGRANSw ZM915SI6WGPkHRWWXJ9j2ipvLjllgjmhr6YDfpc2SjntgcH9hzec65ZITbxtAclUGA2Q 8XUK9wnqq8Lw603CCt7rwXm1/qFeMloY03FzzzSQ0femnqDJsd8SFRdCk++T2LEuEDio t1qbFfbq2t8ZriwdANyOPYhCcgnh0Eq5uIWVzEtJ8lbTf9M7j1bsqbD+5Eb/fPA872oy ZfFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :dkim-signature:delivered-to; bh=7yGldPEBcJ+xXn4JzDNLcLVlTtZgewgWxMCmbVXv4aU=; fh=QdWxt2OToL83TTnLQn0lGhLakV7i1QyAJdC8te7qN0E=; b=dRs/CRLtFkodnDpERxdVdVz82mKpIX/+a6V3+jP1EazYR0UaLjgr78hULcbvYvRLI+ o5SfJ4dpYdaN58y7+Fn798ZICc0LMd9k4XQrgL7XZnpy74VSRMd4Rx1H25weX2nZwIwH u+FJnpummSzGacMW6lpxacbEV6+RUpMX7MnDPOXnuAUx2FFCztkmMpbMQ8YxjhiikP8c 7P/OuTDvhcAVNOMf9jkp9GJFvZER2hZy6Lq8fHd2Tp956d3/SbAOszMEL+Dnx5A4HGdC jUR7Rb2HO5H2r1nO/K6l4PeDb5/oiHCrUBXPoN8Sg3lMdw6RDzCmHIWP7GusITNj3dLc R9zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=SHGTG2G6; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id c14-20020aa7c98e000000b0055a45a3cd2dsi2207297edt.643.2024.01.20.04.53.43; Sat, 20 Jan 2024 04:53:43 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=SHGTG2G6; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A3F4968D08E; Sat, 20 Jan 2024 14:53:30 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 18E3868C905 for ; Sat, 20 Jan 2024 14:53:21 +0200 (EET) Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-a2c375d2430so186674766b.1 for ; Sat, 20 Jan 2024 04:53:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705755200; x=1706360000; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=W32IlSLjufM/x2qn3TLKjpH8GS6uNiWfnfULpG/KNJ4=; b=SHGTG2G6ADrFVPUfDs/nlYuQbHX9T2l3njkUMh7AJyhLoQAcFoPNOutj0s3nPKDsu5 jsjzGUqfv7mfc+x6W/pv48NwARdZYJ0UOUrl68HOyreEkMAcAVAPKhEo9wOTwA8o58fh PobhIVDFsYisT786Vm+egx3aCu0TCcvgPmD+eCo4cPR/8tRauNwXcfRY6KDUQx/R2rot 4mBgwpY2fdDYoZ5HD/twEI29LN+PzYfQfGFlJ0Spr01udgTq6mcSK04SvX59NIoMfUqD 6AME6RFg5FOQPZyLquMEeVurfW1C4FKlfV2ADdQZCAjgxWSE/kiBwxgcOmj1VZsrBvI+ cNow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705755200; x=1706360000; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=W32IlSLjufM/x2qn3TLKjpH8GS6uNiWfnfULpG/KNJ4=; b=hwlJw/C8UcDssWpohgvZEUypDpuOzUppozgxagC2U19TAJO0/8SMH0ljlE8hNc5mqx nWyi2oYgaSdqV/9IHQC+zeo9veRZyh4a4sdRcPCgRCIswrBunhQwpYrOFDEt72tDjvHX ga0K0ZSZsdK3S5IDXYPrPVkKNnprUPnda7Wjt1OQCtwejJ+FAn59mcJyMxpMn8C/F2r7 WcfqkSYQ3da4EV1cFEq5zQl0STLQ3tfRftrTF/kTeA0JTVJcjDWyOexc4YEEjLlCl8Um o/LvG0jgZCGv7beUZemAQOxC027nAR8I4dIyIvb1Fk67f4qn+d5mugmPtwSfqdEKqVv1 GWdA== X-Gm-Message-State: AOJu0YwsbkIuWgdXgWntKImpuaqCvsJrWJFsZaVo/dhm4w4XHCnBmiyp ib/eTIrItadxjwCZkl2CIVt1C2Yij+19WG7eNdHDO6dQ40feP5i+XSRu9jBg X-Received: by 2002:a17:906:a2c5:b0:a2d:dfd:7ece with SMTP id by5-20020a170906a2c500b00a2d0dfd7ecemr657433ejb.114.1705755199865; Sat, 20 Jan 2024 04:53:19 -0800 (PST) Received: from mariano (dynamic-adsl-84-220-189-10.clienti.tiscali.it. [84.220.189.10]) by smtp.gmail.com with ESMTPSA id i13-20020a170906090d00b00a2c11a438a8sm11400244ejd.25.2024.01.20.04.53.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Jan 2024 04:53:19 -0800 (PST) Received: by mariano (Postfix, from userid 1000) id 8BA6DBFCDC; Sat, 20 Jan 2024 13:53:18 +0100 (CET) From: Stefano Sabatini To: FFmpeg development discussions and patches Date: Sat, 20 Jan 2024 13:53:17 +0100 Message-Id: <20240120125318.597024-1-stefasab@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] lavf/dascenc: sort options by name X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Stefano Sabatini Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: puIEZNhpJXTS --- libavformat/dashenc.c | 68 +++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c index 2f5394c308..4a92863f22 100644 --- a/libavformat/dashenc.c +++ b/libavformat/dashenc.c @@ -2362,50 +2362,50 @@ static int dash_check_bitstream(AVFormatContext *s, AVStream *st, #define E AV_OPT_FLAG_ENCODING_PARAM static const AVOption options[] = { { "adaptation_sets", "Adaptation sets. Syntax: id=0,streams=0,1,2 id=1,streams=3,4 and so on", OFFSET(adaptation_sets), AV_OPT_TYPE_STRING, { 0 }, 0, 0, AV_OPT_FLAG_ENCODING_PARAM }, - { "window_size", "number of segments kept in the manifest", OFFSET(window_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, E }, + { "dash_segment_type", "set dash segment files type", OFFSET(segment_type_option), AV_OPT_TYPE_INT, {.i64 = SEGMENT_TYPE_AUTO }, 0, SEGMENT_TYPE_NB - 1, E, "segment_type"}, + { "auto", "select segment file format based on codec", 0, AV_OPT_TYPE_CONST, {.i64 = SEGMENT_TYPE_AUTO }, 0, UINT_MAX, E, "segment_type"}, + { "mp4", "make segment file in ISOBMFF format", 0, AV_OPT_TYPE_CONST, {.i64 = SEGMENT_TYPE_MP4 }, 0, UINT_MAX, E, "segment_type"}, + { "webm", "make segment file in WebM format", 0, AV_OPT_TYPE_CONST, {.i64 = SEGMENT_TYPE_WEBM }, 0, UINT_MAX, E, "segment_type"}, { "extra_window_size", "number of segments kept outside of the manifest before removing from disk", OFFSET(extra_window_size), AV_OPT_TYPE_INT, { .i64 = 5 }, 0, INT_MAX, E }, - { "seg_duration", "segment duration (in seconds, fractional value can be set)", OFFSET(seg_duration), AV_OPT_TYPE_DURATION, { .i64 = 5000000 }, 0, INT_MAX, E }, + { "format_options","set list of options for the container format (mp4/webm) used for dash", OFFSET(format_options), AV_OPT_TYPE_DICT, {.str = NULL}, 0, 0, E}, { "frag_duration", "fragment duration (in seconds, fractional value can be set)", OFFSET(frag_duration), AV_OPT_TYPE_DURATION, { .i64 = 0 }, 0, INT_MAX, E }, { "frag_type", "set type of interval for fragments", OFFSET(frag_type), AV_OPT_TYPE_INT, {.i64 = FRAG_TYPE_NONE }, 0, FRAG_TYPE_NB - 1, E, "frag_type"}, - { "none", "one fragment per segment", 0, AV_OPT_TYPE_CONST, {.i64 = FRAG_TYPE_NONE }, 0, UINT_MAX, E, "frag_type"}, - { "every_frame", "fragment at every frame", 0, AV_OPT_TYPE_CONST, {.i64 = FRAG_TYPE_EVERY_FRAME }, 0, UINT_MAX, E, "frag_type"}, - { "duration", "fragment at specific time intervals", 0, AV_OPT_TYPE_CONST, {.i64 = FRAG_TYPE_DURATION }, 0, UINT_MAX, E, "frag_type"}, - { "pframes", "fragment at keyframes and following P-Frame reordering (Video only, experimental)", 0, AV_OPT_TYPE_CONST, {.i64 = FRAG_TYPE_PFRAMES }, 0, UINT_MAX, E, "frag_type"}, - { "remove_at_exit", "remove all segments when finished", OFFSET(remove_at_exit), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, E }, - { "use_template", "Use SegmentTemplate instead of SegmentList", OFFSET(use_template), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, E }, - { "use_timeline", "Use SegmentTimeline in SegmentTemplate", OFFSET(use_timeline), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, E }, - { "single_file", "Store all segments in one file, accessed using byte ranges", OFFSET(single_file), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, E }, - { "single_file_name", "DASH-templated name to be used for baseURL. Implies storing all segments in one file, accessed using byte ranges", OFFSET(single_file_name), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E }, - { "init_seg_name", "DASH-templated name to used for the initialization segment", OFFSET(init_seg_name), AV_OPT_TYPE_STRING, {.str = "init-stream$RepresentationID$.$ext$"}, 0, 0, E }, - { "media_seg_name", "DASH-templated name to used for the media segments", OFFSET(media_seg_name), AV_OPT_TYPE_STRING, {.str = "chunk-stream$RepresentationID$-$Number%05d$.$ext$"}, 0, 0, E }, - { "utc_timing_url", "URL of the page that will return the UTC timestamp in ISO format", OFFSET(utc_timing_url), AV_OPT_TYPE_STRING, { 0 }, 0, 0, E }, - { "method", "set the HTTP method", OFFSET(method), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E }, - { "http_user_agent", "override User-Agent field in HTTP header", OFFSET(user_agent), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E}, - { "http_persistent", "Use persistent HTTP connections", OFFSET(http_persistent), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, E }, - { "hls_playlist", "Generate HLS playlist files(master.m3u8, media_%d.m3u8)", OFFSET(hls_playlist), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, E }, - { "hls_master_name", "HLS master playlist name", OFFSET(hls_master_name), AV_OPT_TYPE_STRING, {.str = "master.m3u8"}, 0, 0, E }, - { "streaming", "Enable/Disable streaming mode of output. Each frame will be moof fragment", OFFSET(streaming), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, E }, - { "timeout", "set timeout for socket I/O operations", OFFSET(timeout), AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT_MAX, .flags = E }, - { "index_correction", "Enable/Disable segment index correction logic", OFFSET(index_correction), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, E }, - { "format_options","set list of options for the container format (mp4/webm) used for dash", OFFSET(format_options), AV_OPT_TYPE_DICT, {.str = NULL}, 0, 0, E}, + { "none", "one fragment per segment", 0, AV_OPT_TYPE_CONST, {.i64 = FRAG_TYPE_NONE }, 0, UINT_MAX, E, "frag_type"}, + { "every_frame", "fragment at every frame", 0, AV_OPT_TYPE_CONST, {.i64 = FRAG_TYPE_EVERY_FRAME }, 0, UINT_MAX, E, "frag_type"}, + { "duration", "fragment at specific time intervals", 0, AV_OPT_TYPE_CONST, {.i64 = FRAG_TYPE_DURATION }, 0, UINT_MAX, E, "frag_type"}, + { "pframes", "fragment at keyframes and following P-Frame reordering (Video only, experimental)", 0, AV_OPT_TYPE_CONST, {.i64 = FRAG_TYPE_PFRAMES }, 0, UINT_MAX, E, "frag_type"}, { "global_sidx", "Write global SIDX atom. Applicable only for single file, mp4 output, non-streaming mode", OFFSET(global_sidx), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, E }, - { "dash_segment_type", "set dash segment files type", OFFSET(segment_type_option), AV_OPT_TYPE_INT, {.i64 = SEGMENT_TYPE_AUTO }, 0, SEGMENT_TYPE_NB - 1, E, "segment_type"}, - { "auto", "select segment file format based on codec", 0, AV_OPT_TYPE_CONST, {.i64 = SEGMENT_TYPE_AUTO }, 0, UINT_MAX, E, "segment_type"}, - { "mp4", "make segment file in ISOBMFF format", 0, AV_OPT_TYPE_CONST, {.i64 = SEGMENT_TYPE_MP4 }, 0, UINT_MAX, E, "segment_type"}, - { "webm", "make segment file in WebM format", 0, AV_OPT_TYPE_CONST, {.i64 = SEGMENT_TYPE_WEBM }, 0, UINT_MAX, E, "segment_type"}, + { "hls_master_name", "HLS master playlist name", OFFSET(hls_master_name), AV_OPT_TYPE_STRING, {.str = "master.m3u8"}, 0, 0, E }, + { "hls_playlist", "Generate HLS playlist files(master.m3u8, media_%d.m3u8)", OFFSET(hls_playlist), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, E }, + { "http_opts", "HTTP protocol options", OFFSET(http_opts), AV_OPT_TYPE_DICT, { .str = NULL }, 0, 0, E }, + { "http_persistent", "Use persistent HTTP connections", OFFSET(http_persistent), AV_OPT_TYPE_BOOL, {.i64 = 0 }, 0, 1, E }, + { "http_user_agent", "override User-Agent field in HTTP header", OFFSET(user_agent), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E}, { "ignore_io_errors", "Ignore IO errors during open and write. Useful for long-duration runs with network output", OFFSET(ignore_io_errors), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, E }, - { "lhls", "Enable Low-latency HLS(Experimental). Adds #EXT-X-PREFETCH tag with current segment's URI", OFFSET(lhls), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, E }, + { "index_correction", "Enable/Disable segment index correction logic", OFFSET(index_correction), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, E }, + { "init_seg_name", "DASH-templated name to used for the initialization segment", OFFSET(init_seg_name), AV_OPT_TYPE_STRING, {.str = "init-stream$RepresentationID$.$ext$"}, 0, 0, E }, { "ldash", "Enable Low-latency dash. Constrains the value of a few elements", OFFSET(ldash), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, E }, + { "lhls", "Enable Low-latency HLS(Experimental). Adds #EXT-X-PREFETCH tag with current segment's URI", OFFSET(lhls), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, E }, { "master_m3u8_publish_rate", "Publish master playlist every after this many segment intervals", OFFSET(master_publish_rate), AV_OPT_TYPE_INT, {.i64 = 0}, 0, UINT_MAX, E}, - { "write_prft", "Write producer reference time element", OFFSET(write_prft), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, E}, + { "max_playback_rate", "Set desired maximum playback rate", OFFSET(max_playback_rate), AV_OPT_TYPE_RATIONAL, { .dbl = 1.0 }, 0.5, 1.5, E }, + { "media_seg_name", "DASH-templated name to used for the media segments", OFFSET(media_seg_name), AV_OPT_TYPE_STRING, {.str = "chunk-stream$RepresentationID$-$Number%05d$.$ext$"}, 0, 0, E }, + { "method", "set the HTTP method", OFFSET(method), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, E }, + { "min_playback_rate", "Set desired minimum playback rate", OFFSET(min_playback_rate), AV_OPT_TYPE_RATIONAL, { .dbl = 1.0 }, 0.5, 1.5, E }, { "mpd_profile", "Set profiles. Elements and values used in the manifest may be constrained by them", OFFSET(profile), AV_OPT_TYPE_FLAGS, {.i64 = MPD_PROFILE_DASH }, 0, UINT_MAX, E, "mpd_profile"}, - { "dash", "MPEG-DASH ISO Base media file format live profile", 0, AV_OPT_TYPE_CONST, {.i64 = MPD_PROFILE_DASH }, 0, UINT_MAX, E, "mpd_profile"}, - { "dvb_dash", "DVB-DASH profile", 0, AV_OPT_TYPE_CONST, {.i64 = MPD_PROFILE_DVB }, 0, UINT_MAX, E, "mpd_profile"}, - { "http_opts", "HTTP protocol options", OFFSET(http_opts), AV_OPT_TYPE_DICT, { .str = NULL }, 0, 0, E }, + { "dash", "MPEG-DASH ISO Base media file format live profile", 0, AV_OPT_TYPE_CONST, {.i64 = MPD_PROFILE_DASH }, 0, UINT_MAX, E, "mpd_profile"}, + { "dvb_dash", "DVB-DASH profile", 0, AV_OPT_TYPE_CONST, {.i64 = MPD_PROFILE_DVB }, 0, UINT_MAX, E, "mpd_profile"}, + { "remove_at_exit", "remove all segments when finished", OFFSET(remove_at_exit), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, E }, + { "seg_duration", "segment duration (in seconds, fractional value can be set)", OFFSET(seg_duration), AV_OPT_TYPE_DURATION, { .i64 = 5000000 }, 0, INT_MAX, E }, + { "single_file", "Store all segments in one file, accessed using byte ranges", OFFSET(single_file), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, E }, + { "single_file_name", "DASH-templated name to be used for baseURL. Implies storing all segments in one file, accessed using byte ranges", OFFSET(single_file_name), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E }, + { "streaming", "Enable/Disable streaming mode of output. Each frame will be moof fragment", OFFSET(streaming), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, E }, { "target_latency", "Set desired target latency for Low-latency dash", OFFSET(target_latency), AV_OPT_TYPE_DURATION, { .i64 = 0 }, 0, INT_MAX, E }, - { "min_playback_rate", "Set desired minimum playback rate", OFFSET(min_playback_rate), AV_OPT_TYPE_RATIONAL, { .dbl = 1.0 }, 0.5, 1.5, E }, - { "max_playback_rate", "Set desired maximum playback rate", OFFSET(max_playback_rate), AV_OPT_TYPE_RATIONAL, { .dbl = 1.0 }, 0.5, 1.5, E }, + { "timeout", "set timeout for socket I/O operations", OFFSET(timeout), AV_OPT_TYPE_DURATION, { .i64 = -1 }, -1, INT_MAX, .flags = E }, { "update_period", "Set the mpd update interval", OFFSET(update_period), AV_OPT_TYPE_INT64, {.i64 = 0}, 0, INT64_MAX, E}, + { "use_template", "Use SegmentTemplate instead of SegmentList", OFFSET(use_template), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, E }, + { "use_timeline", "Use SegmentTimeline in SegmentTemplate", OFFSET(use_timeline), AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, E }, + { "utc_timing_url", "URL of the page that will return the UTC timestamp in ISO format", OFFSET(utc_timing_url), AV_OPT_TYPE_STRING, { 0 }, 0, 0, E }, + { "window_size", "number of segments kept in the manifest", OFFSET(window_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, E }, + { "write_prft", "Write producer reference time element", OFFSET(write_prft), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, E}, { NULL }, }; From patchwork Sat Jan 20 12:53:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Sabatini X-Patchwork-Id: 45674 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:a402:b0:199:de12:6fa6 with SMTP id z2csp426283pzk; Sat, 20 Jan 2024 04:53:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IGEoE7Iw86PWQriQjQagDWBcwKDxuuMaK47Hu0JZRD0OwRtufYgZhya2xKfNsdEtXaEWXpR X-Received: by 2002:a05:600c:1f92:b0:40e:46f5:e5ef with SMTP id je18-20020a05600c1f9200b0040e46f5e5efmr529100wmb.21.1705755214515; Sat, 20 Jan 2024 04:53:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705755214; cv=none; d=google.com; s=arc-20160816; b=e0xqQqinmxT32j0KjdiAQb1ZtsEr+/gfqtyRunDpQi6vP/Ea8NHkOMeYdoSxunyw6W sjhaxMV+YbQC8ObwIWlFGaLCd1irLAbebb+exyxWn0ah1mIWjtEtXGSMfZRleLQpxs69 DPrxAgrmAU4wFXK33drwpCT/iANqrdenUNhv5WSdHNvq1U1lBO7+dJYVm3E/vJcYb2OM NSs6Re/zyrP6fhFNJWvL2D2VIz8giltcFRdbyYggxVe9u0If0jKk3LSqqQncEvgHv2ta ykV5cdrdAYHXkLwRaLz+6SEO3el36ZGhHFW3fDnsmZBv4Y2sV8TwFhqRemlRBBGBOtO6 KMHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=hFJ8tukDRDe8tPHCsas+XYcxY++gqo23/flDudb7Hp8=; fh=QdWxt2OToL83TTnLQn0lGhLakV7i1QyAJdC8te7qN0E=; b=xKaetBkVvmsIzwT72+ImhAnXaVlP0tOiQby6p4Xr1qKMgwr9gd8JJgSH6M8HbbrigO noDGKyccIG1vq4u9WycvGo4GxMmI+UEhArf+aRfdWU44P6vms3pqaTWU5pifwd6+32Gc unq/aoKnWQtwacXiVB0n0rlHknJj6/ZmteOchvwALYcjpBcJkjlWBtLKY1q0aVb6XsF3 GxobC9XKnYcFUPsblebsEtlK2i9sYvOfbri5gnF0Mjm7PL7Vff/NcckkOLh3F5oV4b0y 6Owfb8bgFsQ3LHVdwO1CT5pAJhAt3gvGOepKZcBEuY8Qtkl6/FGX0eJdYFGxeji+WfD6 ydEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=KkfkfXz8; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id t15-20020aa7d4cf000000b0055a34e06c03si2466278edr.611.2024.01.20.04.53.33; Sat, 20 Jan 2024 04:53:34 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=KkfkfXz8; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 750B568CE11; Sat, 20 Jan 2024 14:53:29 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1A98E68CDFB for ; Sat, 20 Jan 2024 14:53:22 +0200 (EET) Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a28cc85e6b5so197072566b.1 for ; Sat, 20 Jan 2024 04:53:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705755201; x=1706360001; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wSCNVfcbQCpU/8SuH1FcUPatirZOW+7kYtLAAbYvKJ8=; b=KkfkfXz8lBFQky6EXCSIUPK5gvnm+aKymJH5doX9WzBQuLQzCZBDgUETu5i7tc910/ R8f9R8RuG9vxdQAEvk3l9iKTlZFEMIDTXqlAKR6dgaUmRjDSk5Nrkja0kxdtyz/aVG+2 /S7kraeJ4BtsOt7tW7/bUlBNybIBkRgZdHwVFy9Kqh8SH/dyWomKxxwt5o0nbQtpuQUp QdmFRfjaf4dLYgtRuu93PPeO05WwJCmTui3BrQ59YA8E5hUVQkgw042UMvE6rd0CyhXZ jPaFGp2k8kYvwZMaStY0dMEqXHu4Lb7UQ07B8pkitoE4EJS6YAqhghDjYCx6nxfxy7Sn y2Vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705755201; x=1706360001; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wSCNVfcbQCpU/8SuH1FcUPatirZOW+7kYtLAAbYvKJ8=; b=EbCHnnKYx2CNCAgFYoas+HRBGJ24e9zrEjngMq9LBM/fNj01qvt0kFktpH1AUd3NZh wM7FzR4vnx6tXRTrUJ/3K5Z/5L9UTnwo2sOGu9o4Y5QYZbzfjbyOrAPX59g+vrtpRy9Y MyJooYDKSVPdtNlncQqlaFmM9XAjKDx7uCsZIKJyM05RtNu9eBxMZjbLyRs7lmJkH/hx SZoAfiiitDl7pmWUTuJX1DsEfMWfjYU99n6e8aIxNFFPmRY1VqyWjx/qMTKfb/fVxkfZ rNcfZo0NfDjUaZd3Tj/p+CNV4a3Ej9x+fZ962LNd+czJvzeMIpilob0tekxtLLkdmKe1 GH4Q== X-Gm-Message-State: AOJu0YzxF2L3LNEPuhn1t38XQSIaS/nRJZEbs2U7SLnn60WsgGT98P9G CS1xn5IgiC6E4/hUGzYYhGGIzW9D5EjOgPRa//fbHEmm0L/qJeUvxpH4pxqP X-Received: by 2002:a17:906:a005:b0:a2b:11f2:eee with SMTP id p5-20020a170906a00500b00a2b11f20eeemr522648ejy.87.1705755200317; Sat, 20 Jan 2024 04:53:20 -0800 (PST) Received: from mariano (dynamic-adsl-84-220-189-10.clienti.tiscali.it. [84.220.189.10]) by smtp.gmail.com with ESMTPSA id ce8-20020a170906b24800b00a2d7f7617d1sm8370914ejb.13.2024.01.20.04.53.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 20 Jan 2024 04:53:20 -0800 (PST) Received: by mariano (Postfix, from userid 1000) id 8EE2CBFCE0; Sat, 20 Jan 2024 13:53:18 +0100 (CET) From: Stefano Sabatini To: FFmpeg development discussions and patches Date: Sat, 20 Jan 2024 13:53:18 +0100 Message-Id: <20240120125318.597024-2-stefasab@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240120125318.597024-1-stefasab@gmail.com> References: <20240120125318.597024-1-stefasab@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] doc/muxers/dash: review documentation X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Stefano Sabatini Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: V4eMD84rL4uw Sort options by name, review formatting, apply consistency fixes and fill the gaps (e.g. missing value for constants or flags), and review and extend content. --- doc/muxers.texi | 418 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 293 insertions(+), 125 deletions(-) diff --git a/doc/muxers.texi b/doc/muxers.texi index b1716d7a6b..a49853daf2 100644 --- a/doc/muxers.texi +++ b/doc/muxers.texi @@ -971,12 +971,13 @@ ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f crc - @anchor{dash} @section dash +Dynamic Adaptive Streaming over HTTP (DASH) muxer. -Dynamic Adaptive Streaming over HTTP (DASH) muxer that creates segments -and manifest files according to the MPEG-DASH standard ISO/IEC 23009-1:2014. +This muxer creates segments and manifest files according to the +MPEG-DASH standard ISO/IEC 23009-1:2014 and following standard +updates. For more information see: - @itemize @bullet @item ISO DASH Specification: @url{http://standards.iso.org/ittf/PubliclyAvailableStandards/c065274_ISO_IEC_23009-1_2014.zip} @@ -984,166 +985,333 @@ ISO DASH Specification: @url{http://standards.iso.org/ittf/PubliclyAvailableStan WebM DASH Specification: @url{https://sites.google.com/a/webmproject.org/wiki/adaptive-streaming/webm-dash-specification} @end itemize -It creates a MPD manifest file and segment files for each stream. +This muxer creates an MPD (Media Presentation Description) manifest +file and segment files for each stream. Segment files are placed in +the same directory of the MPD manifest file. + +The segment filename might contain pre-defined identifiers used in the +manifest @code{SegmentTemplate} section as defined in section +5.3.9.4.4 of the standard. + +Available identifiers are @code{$RepresentationID$}, @code{$Number$}, +@code{$Bandwidth$}, and @code{$Time$}. In addition to the standard +identifiers, an ffmpeg-specific @code{$ext$} identifier is also +supported. When specified, @command{ffmpeg} will replace @code{$ext$} +in the file name with muxing format's extensions such as @code{mp4}, +@code{webm} etc. + +@subsection Options +@table @option +@item adaptation_sets @var{adaptation_sets} +Assign streams to adaptation sets, specified in the MPD manifest +@code{AdaptationSets} section. -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., +An adaptation set contains a set of one or more streams accessed as a +single subset, e.g. corresponding streams encoded at different size +selectable by the user depending on the available bandwidth, or to +different audio streams with a different language. +Each adaptation set is specified with the syntax: @example -ffmpeg -re -i -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 +id=@var{index},streams=@var{streams} @end example +where @var{index} must be a numerical index, and @var{streams} is a +sequence of @code{,}-separated stream indices. Multiple adaptation +sets can be specified, separated by spaces. + +To map all video (or audio) streams to an adaptation set, @code{v} (or +@code{a}) can be used as stream identifier instead of IDs. + +When no assignment is defined, this defaults to an adaptation set for +each stream. + +The following optional fields can also be specified: + @table @option -@item seg_duration @var{duration} -Set the segment length in seconds (fractional value can be set). The value is -treated as average segment duration when @var{use_template} is enabled and -@var{use_timeline} is disabled and as minimum segment duration for all the other -use cases. -@item frag_duration @var{duration} -Set the length in seconds of fragments within segments (fractional value can be set). -@item frag_type @var{type} -Set the type of interval for fragmentation. -@item window_size @var{size} -Set the maximum number of segments kept in the manifest. -@item extra_window_size @var{size} -Set the maximum number of segments kept outside of the manifest before removing from disk. -@item remove_at_exit @var{remove} -Enable (1) or disable (0) removal of all segments when finished. -@item use_template @var{template} -Enable (1) or disable (0) use of SegmentTemplate instead of SegmentList. -@item use_timeline @var{timeline} -Enable (1) or disable (0) use of SegmentTimeline in SegmentTemplate. -@item single_file @var{single_file} -Enable (1) or disable (0) storing all segments in one file, accessed using byte ranges. -@item single_file_name @var{file_name} -DASH-templated name to be used for baseURL. Implies @var{single_file} set to "1". In the template, "$ext$" is replaced with the file name extension specific for the segment format. -@item init_seg_name @var{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. -@item media_seg_name @var{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. -@item utc_timing_url @var{utc_url} -URL of the page that will return the UTC timestamp in ISO format. Example: "https://time.akamai.com/?iso" -@item method @var{method} -Use the given HTTP method to create output files. Generally set to PUT or POST. -@item http_user_agent @var{user_agent} -Override User-Agent field in HTTP header. Applicable only for HTTP output. -@item http_persistent @var{http_persistent} -Use persistent HTTP connections. Applicable only for HTTP output. -@item hls_playlist @var{hls_playlist} -Generate HLS playlist files as well. The master playlist is generated with the filename @var{hls_master_name}. -One media playlist file is generated for each stream with filenames media_0.m3u8, media_1.m3u8, etc. -@item hls_master_name @var{file_name} -HLS master playlist name. Default is "master.m3u8". -@item streaming @var{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. -@item adaptation_sets @var{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. +@item descriptor +Define the descriptor as defined by ISO/IEC 23009-1:2014/Amd.2:2015. -To map all video (or audio) streams to an AdaptationSet, "v" (or "a") can be used as stream identifier instead of IDs. +For example: +@example + +@end example -When no assignment is defined, this defaults to an AdaptationSet for each stream. +The descriptor string should be a self-closing XML tag. -Optional syntax is "id=x,seg_duration=x,frag_duration=x,frag_type=type,descriptor=descriptor_string,streams=a,b,c id=y,seg_duration=y,frag_type=type,streams=d,e" and so on, -descriptor is useful to the scheme defined by ISO/IEC 23009-1:2014/Amd.2:2015. -For example, -adaptation_sets "id=0,descriptor=,streams=v". -Please note that descriptor string should be a self-closing xml tag. -seg_duration, frag_duration and frag_type override the global option values for each adaptation set. -For example, -adaptation_sets "id=0,seg_duration=2,frag_duration=1,frag_type=duration,streams=v id=1,seg_duration=2,frag_type=none,streams=a" -type_id marks an adaptation set as containing streams meant to be used for Trick Mode for the referenced adaptation set. -For example, -adaptation_sets "id=0,seg_duration=2,frag_type=none,streams=0 id=1,seg_duration=10,frag_type=none,trick_id=0,streams=1" -@item timeout @var{timeout} -Set timeout for socket I/O operations. Applicable only for HTTP output. -@item index_correction @var{index_correction} -Enable (1) or Disable (0) segment index correction logic. Applicable only when -@var{use_template} is enabled and @var{use_timeline} is disabled. +@item frag_duration +Override the global fragment duration specified with the +@option{frag_duration} option. + +@item frag_type +Override the global fragment type specified with the +@option{frag_type} option. + +@item seg_duration +Override the global segment duration specified with the +@option{seg_duration} option. + +@item trick_id +Mark an adaptation set as containing streams meant to be used for +Trick Mode for the referenced adaptation set. +@end table + +A few examples of possible values for the @option{adaptation_sets} +option follow: +@example +id=0,seg_duration=2,frag_duration=1,frag_type=duration,streams=v id=1,seg_duration=2,frag_type=none,streams=a +@end example + +@example +id=0,seg_duration=2,frag_type=none,streams=0 id=1,seg_duration=10,frag_type=none,trick_id=0,streams=1 +@end example -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. +@item dash_segment_type @var{type} +Set DASH segment files type. + +Possible values: +@table @samp +@item auto +The dash segment files format will be selected based on the stream +codec. This is the default mode. +@item mp4 +the dash segment files will be in ISOBMFF/MP4 format +@item webm +the dash segment files will be in WebM format +@end table + +@item extra_window_size @var{size} +Set the maximum number of segments kept outside of the manifest before +removing from disk. -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. @item format_options @var{options_list} -Set container format (mp4/webm) options using a @code{:} separated list of +Set container format (mp4/webm) options using a @code{:}-separated list of key=value parameters. Values containing @code{:} special characters must be escaped. -@item global_sidx @var{global_sidx} -Write global SIDX atom. Applicable only for single file, mp4 output, non-streaming mode. +@item frag_duration @var{duration} +Set the length in seconds of fragments within segments, fractional +value can also be set. + +@item frag_type @var{type} +Set the type of interval for fragmentation. -@item dash_segment_type @var{dash_segment_type} Possible values: -@table @option +@table @samp @item auto -If this flag is set, the dash segment files format will be selected based on the stream codec. This is the default mode. +set one fragment per segment -@item mp4 -If this flag is set, the dash segment files will be in in ISOBMFF format. +@item every_frame +fragment at every frame -@item webm -If this flag is set, the dash segment files will be in in WebM format. +@item duration +fragment at specific time intervals + +@item pframes +fragment at keyframes and following P-Frame reordering (Video only, +experimental) @end table -@item ignore_io_errors @var{ignore_io_errors} -Ignore IO errors during open and write. Useful for long-duration runs with network output. +@item global_sidx @var{bool} +Write global @code{SIDX} atom. Applicable only for single file, mp4 +output, non-streaming mode. + +@item hls_master_name @var{file_name} +HLS master playlist name. Default is @file{master.m3u8}. + +@item hls_playlist @var{bool} +Generate HLS playlist files. The master playlist is generated with +filename specified by the @option{hls_master_name} option. One media +playlist file is generated for each stream with filenames +@file{media_0.m3u8}, @file{media_1.m3u8}, etc. + +@item http_opts @var{http_opts} +Specify a list of @code{:}-separated key=value options to pass to the +underlying HTTP protocol. Applicable only for HTTP output. + +@item http_persistent @var{bool} +Use persistent HTTP connections. Applicable only for HTTP output. + +@item http_user_agent @var{user_agent} +Override User-Agent field in HTTP header. Applicable only for HTTP +output. + +@item ignore_io_errors @var{bool} +Ignore IO errors during open and write. Useful for long-duration runs +with network output. This is disabled by default. + +@item index_correction @var{bool} +Enable or disable segment index correction logic. Applicable only when +@option{use_template} is enabled and @option{use_timeline} is +disabled. This is disabled by default. + +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. -@item lhls @var{lhls} -Enable Low-latency HLS(LHLS). Adds #EXT-X-PREFETCH tag with current segment's URI. -hls.js player folks are trying to standardize an 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 tries to comply with the above open spec. -It enables @var{streaming} and @var{hls_playlist} options automatically. +@item init_seg_name @var{init_name} +DASH-templated name to use for the initialization segment. Default is +@code{init-stream$RepresentationID$.$ext$}. @code{$ext$} is replaced +with the file name extension specific for the segment format. + +@item ldash @var{bool} +Enable Low-latency Dash by constraining the presence and values of +some elements. This is disabled by default. + +@item lhls @var{bool} +Enable Low-latency HLS (LHLS). Add @code{#EXT-X-PREFETCH} tag with +current segment's URI. hls.js player folks are trying to standardize +an open LHLS spec. The draft spec is available at +@url{https://github.com/video-dev/hlsjs-rfcs/blob/lhls-spec/proposals/0001-lhls.md}. + +This option tries to comply with the above open spec. It enables +@option{streaming} and @option{hls_playlist} options automatically. This is an experimental feature. -Note: This is not Apple's version LHLS. See @url{https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis} +Note: This is not Apple's version LHLS. See +@url{https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis} -@item ldash @var{ldash} -Enable Low-latency Dash by constraining the presence and values of some elements. +@item master_m3u8_publish_rate @var{segment_intervals_count} +Publish master playlist repeatedly every after specified number of +segment intervals. -@item master_m3u8_publish_rate @var{master_m3u8_publish_rate} -Publish master playlist repeatedly every after specified number of segment intervals. +@item max_playback_rate @var{rate} +Set the maximum playback rate indicated as appropriate for the +purposes of automatically adjusting playback latency and buffer +occupancy during normal playback by clients. -@item write_prft @var{write_prft} -Write Producer Reference Time elements on supported streams. This also enables writing -prft boxes in the underlying muxer. Applicable only when the @var{utc_url} option is enabled. -It's set to auto by default, in which case the muxer will attempt to enable it only in modes -that require it. +@item media_seg_name @var{segment_name} +DASH-templated name to use for the media segments. Default is +@code{chunk-stream$RepresentationID$-$Number%05d$.$ext$}. @code{$ext$} +is replaced with the file name extension specific for the segment +format. -@item mpd_profile @var{mpd_profile} -Set one or more manifest profiles. +@item method @var{method} +Use the given HTTP method to create output files. Generally set to @code{PUT} +or @code{POST}. -@item http_opts @var{http_opts} -A :-separated list of key=value options to pass to the underlying HTTP -protocol. Applicable only for HTTP output. +@item min_playback_rate @var{rate} +Set the minimum playback rate indicated as appropriate for the +purposes of automatically adjusting playback latency and buffer +occupancy during normal playback by clients. + +@item mpd_profile @var{flags} +Set one or more MPD manifest profiles. + +Possible values: +@table @samp +@item dash +MPEG-DASH ISO Base media file format live profile +@item dvb_dash +DVB-DASH profile +@end table + +Default value is @code{dash}. + +@item remove_at_exit @var{bool} +Enable or disable removal of all segments when finished. This is +disabled by default. + +@item seg_duration @var{duration} +Set the segment length in seconds (fractional value can be set). The +value is treated as average segment duration when the +@option{use_template} option is enabled and the @option{use_timeline} +option is disabled and as minimum segment duration for all the other +use cases. + +Default value is @code{5}. + +@item single_file @var{bool} +Enable or disable storing all segments in one file, accessed using +byte ranges. This is disabled by default. + +The name of the single file can be specified with the +@option{single_file_name} option, if not specified assume the basename +of the manifest file with the output format extension. + +@item single_file_name @var{file_name} +DASH-templated name to use for the manifest @code{baseURL} +element. Imply that the @option{single_file} option is set to +@var{true}. In the template, @code{$ext$} is replaced with the file +name extension specific for the segment format. + +@item streaming @var{bool} +Enable or disable chunk streaming mode of output. In chunk streaming +mode, each frame will be a @code{moof} fragment which forms a +chunk. This is disabled by default. @item target_latency @var{target_latency} -Set an intended target latency in seconds (fractional value can be set) for serving. Applicable only when @var{streaming} and @var{write_prft} options are enabled. -This is an informative fields clients can use to measure the latency of the service. +Set an intended target latency in seconds for serving (fractional +value can be set). Applicable only when the @option{streaming} and +@option{write_prft} options are enabled. This is an informative fields +clients can use to measure the latency of the service. -@item min_playback_rate @var{min_playback_rate} -Set the minimum playback rate indicated as appropriate for the purposes of automatically -adjusting playback latency and buffer occupancy during normal playback by clients. +@item timeout @var{timeout} +Set timeout for socket I/O operations expressed in seconds (fractional +value can be set). Applicable only for HTTP output. + +@item update_period @var{period} +Set the MPD update period, for dynamic content. The unit is +second. If set to @code{0}, the period is automatically computed. + +Default value is @code{0}. -@item max_playback_rate @var{max_playback_rate} -Set the maximum playback rate indicated as appropriate for the purposes of automatically -adjusting playback latency and buffer occupancy during normal playback by clients. +@item use_template @var{bool} +Enable or disable use of @code{SegmentTemplate} instead of +@code{SegmentList} in the manifest. This is enabled by default. -@item update_period @var{update_period} - Set the mpd update period ,for dynamic content. - The unit is second. +@item use_timeline @var{bool} +Enable or disable use of @code{SegmentTimeline} within the +@code{SegmentTemplate} manifest section. This is enabled by default. +@item utc_timing_url @var{url} +URL of the page that will return the UTC timestamp in ISO +format, for example @code{https://time.akamai.com/?iso} + +@item window_size @var{size} +Set the maximum number of segments kept in the manifest, discard the +oldest one. This is useful for live streaming. + +If the value is @code{0}, all segments are kept in the +manifest. Default value is @code{0}. + +@item write_prft @var{write_prft} +Write Producer Reference Time elements on supported streams. This also +enables writing prft boxes in the underlying muxer. Applicable only +when the @var{utc_url} option is enabled. It is set to @var{auto} by +default, in which case the muxer will attempt to enable it only in +modes that require it. @end table +@subsection Example +Generate a DASH output reading from an input source in realtime using +@command{ffmpeg}. + +Two multimedia streams are generated from the input file, both +containing a video stream encoded through @samp{libx264}, and an audio +stream encoded with @samp{libfdk_aac}. The first multimedia stream +contains video with a bitrate of 800k and audio at the default rate, +the second with video scaled to 320x170 pixels at 300k and audio +resampled at 22005 Hz. + +The @option{window_size} option keeps only the latest 5 segments with +the default duration of 5 seconds. + +@example +ffmpeg -re -i -map 0 -map 0 -c:a libfdk_aac -c:v libx264 \ +-b:v:0 800k -profile:v:0 main \ +-b:v:1 300k -s:v:1 320x170 -profile:v:1 baseline -ar:a:1 22050 \ +-bf 1 -keyint_min 120 -g 120 -sc_threshold 0 -b_strategy 0 \ +-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 +@end example + @anchor{fifo} @section fifo