]> git.sesse.net Git - ffmpeg/blobdiff - doc/muxers.texi
avformat/dashenc: add descriptor which is useful to the scheme defined by ISO/IEC...
[ffmpeg] / doc / muxers.texi
index 50147c4d203e536e447a15a8e78fcaa66c180b51..bc38cf602975c9aed23405f2261faab51672f46a 100644 (file)
@@ -220,64 +220,68 @@ In addition to the standard identifiers, an ffmpeg-specific "$ext$" identifier i
 When specified ffmpeg will replace $ext$ in the file name with muxing format's extensions such as mp4, webm etc.,
 
 @example
-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"
+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
 @end example
 
 @table @option
-@item -min_seg_duration @var{microseconds}
+@item min_seg_duration @var{microseconds}
 This is a deprecated option to set the segment length in microseconds, use @var{seg_duration} instead.
-@item -seg_duration @var{duration}
+@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 -window_size @var{size}
+@item window_size @var{size}
 Set the maximum number of segments kept in the manifest.
-@item -extra_window_size @var{size}
+@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}
+@item remove_at_exit @var{remove}
 Enable (1) or disable (0) removal of all segments when finished.
-@item -use_template @var{template}
+@item use_template @var{template}
 Enable (1) or disable (0) use of SegmentTemplate instead of SegmentList.
-@item -use_timeline @var{timeline}
+@item use_timeline @var{timeline}
 Enable (1) or disable (0) use of SegmentTimeline in SegmentTemplate.
-@item -single_file @var{single_file}
+@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}
+@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}
+@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}
+@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}
+@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}
+@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}
+@item http_persistent @var{http_persistent}
 Use persistent HTTP connections. Applicable only for HTTP output.
-@item -hls_playlist @var{hls_playlist}
+@item hls_playlist @var{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.
-@item -streaming @var{streaming}
+@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}
+@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.
 
 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.
-@item -timeout @var{timeout}
+
+Optional syntax is "id=x,descriptor=descriptor_string,streams=a,b,c id=y,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=<SupplementalProperty schemeIdUri=\"urn:mpeg:dash:srd:2014\" value=\"0,0,0,1,1,2,2\"/>,streams=v".
+Please note that descriptor string should be a self-closing xml tag.
+@item timeout @var{timeout}
 Set timeout for socket I/O operations. Applicable only for HTTP output.
-@item -index_correction @var{index_correction}
+@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.
 
@@ -288,16 +292,17 @@ 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 -format_options @var{options_list}
+@item format_options @var{options_list}
 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}
+@item global_sidx @var{global_sidx}
 Write global SIDX atom. Applicable only for single file, mp4 output, non-streaming mode.
 
-@item -dash_segment_type @var{dash_segment_type}
+@item dash_segment_type @var{dash_segment_type}
 Possible values:
+@table @option
 @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.
 
@@ -306,11 +311,12 @@ If this flag is set, the dash segment files will be in in ISOBMFF format.
 
 @item webm
 If this flag is set, the dash segment files will be in in WebM format.
+@end table
 
-@item -ignore_io_errors @var{ignore_io_errors}
+@item ignore_io_errors @var{ignore_io_errors}
 Ignore IO errors during open and write. Useful for long-duration runs with network output.
 
-@item -lhls @var{lhls}
+@item lhls @var{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
@@ -318,7 +324,7 @@ This option will also try to comply with the above open spec, till Apple's spec
 Applicable only when @var{streaming} and @var{hls_playlist} options are enabled.
 This is an experimental feature.
 
-@item -master_m3u8_publish_rate @var{master_m3u8_publish_rate}
+@item master_m3u8_publish_rate @var{master_m3u8_publish_rate}
 Publish master playlist repeatedly every after specified number of segment intervals.
 
 @end table
@@ -656,7 +662,8 @@ This example will produce the playlists segment file sets:
 @file{file_1_000.ts}, @file{file_1_001.ts}, @file{file_1_002.ts}, etc.
 
 The string "%v" may be present in the filename or in the last directory name
-containing the file. If the string is present in the directory name, then
+containing the file, but only in one of them. (Additionally, %v may appear multiple times in the last
+sub-directory or filename.) If the string %v is present in the directory name, then
 sub-directories are created after expanding the directory name pattern. This
 enables creation of segments corresponding to different variant streams in
 subdirectories.
@@ -892,7 +899,11 @@ This will produce segments like this:
 @item temp_file
 Write segment data to filename.tmp and rename to filename only once the segment is complete. A webserver
 serving up segments can be configured to reject requests to *.tmp to prevent access to in-progress segments
-before they have been added to the m3u8 playlist.
+before they have been added to the m3u8 playlist. This flag also affects how m3u8 playlist files are created.
+If this flag is set, all playlist files will written into temporary file and renamed after they are complete, similarly as segments are handled.
+But playlists with @code{file} protocol and with type (@code{hls_playlist_type}) other than @code{vod}
+are always written into temporary file regardles of this flag. Master playlist files (@code{master_pl_name}), if any, with @code{file} protocol,
+are always written into temporary file regardles of this flag if @code{master_pl_publish_rate} value is other than zero.
 
 @end table
 
@@ -943,7 +954,21 @@ This example creates two hls variant streams. The first variant stream will
 contain video stream of bitrate 1000k and audio stream of bitrate 64k and the
 second variant stream will contain video stream of bitrate 256k and audio
 stream of bitrate 32k. Here, two media playlist with file names out_0.m3u8 and
-out_1.m3u8 will be created.
+out_1.m3u8 will be created. If you want something meaningful text instead of indexes
+in result names, you may specify names for each or some of the variants
+as in the following example.
+
+
+@example
+ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k -b:a:1 32k \
+  -map 0:v -map 0:a -map 0:v -map 0:a -f hls -var_stream_map "v:0,a:0,name:my_hd v:1,a:1,name:my_sd" \
+  http://example.com/live/out_%v.m3u8
+@end example
+
+This example creates two hls variant streams as in the previous one.
+But here, the two media playlist with file names out_my_hd.m3u8 and
+out_my_sd.m3u8 will be created.
+
 @example
 ffmpeg -re -i in.ts -b:v:0 1000k -b:v:1 256k -b:a:0 64k \
   -map 0:v -map 0:a -map 0:v -f hls -var_stream_map "v:0 a:0 v:1" \
@@ -1074,6 +1099,9 @@ Set timeout for socket I/O operations. Applicable only for HTTP output.
 @item -ignore_io_errors
 Ignore IO errors during open, write and delete. Useful for long-duration runs with network output.
 
+@item headers
+Set custom HTTP headers, can override built in default headers. Applicable only for HTTP output.
+
 @end table
 
 @anchor{ico}