You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

639 lines
24KB

  1. @chapter Muxers
  2. @c man begin MUXERS
  3. Muxers are configured elements in Libav which allow writing
  4. multimedia streams to a particular type of file.
  5. When you configure your Libav build, all the supported muxers
  6. are enabled by default. You can list all available muxers using the
  7. configure option @code{--list-muxers}.
  8. You can disable all the muxers with the configure option
  9. @code{--disable-muxers} and selectively enable / disable single muxers
  10. with the options @code{--enable-muxer=@var{MUXER}} /
  11. @code{--disable-muxer=@var{MUXER}}.
  12. The option @code{-formats} of the av* tools will display the list of
  13. enabled muxers.
  14. A description of some of the currently available muxers follows.
  15. @anchor{crc}
  16. @section crc
  17. CRC (Cyclic Redundancy Check) testing format.
  18. This muxer computes and prints the Adler-32 CRC of all the input audio
  19. and video frames. By default audio frames are converted to signed
  20. 16-bit raw audio and video frames to raw video before computing the
  21. CRC.
  22. The output of the muxer consists of a single line of the form:
  23. CRC=0x@var{CRC}, where @var{CRC} is a hexadecimal number 0-padded to
  24. 8 digits containing the CRC for all the decoded input frames.
  25. For example to compute the CRC of the input, and store it in the file
  26. @file{out.crc}:
  27. @example
  28. avconv -i INPUT -f crc out.crc
  29. @end example
  30. You can print the CRC to stdout with the command:
  31. @example
  32. avconv -i INPUT -f crc -
  33. @end example
  34. You can select the output format of each frame with @command{avconv} by
  35. specifying the audio and video codec and format. For example to
  36. compute the CRC of the input audio converted to PCM unsigned 8-bit
  37. and the input video converted to MPEG-2 video, use the command:
  38. @example
  39. avconv -i INPUT -c:a pcm_u8 -c:v mpeg2video -f crc -
  40. @end example
  41. See also the @ref{framecrc} muxer.
  42. @anchor{dash}
  43. @section dash
  44. Dynamic Adaptive Streaming over HTTP (DASH) muxer that creates segments
  45. and manifest files according to the MPEG-DASH standard ISO/IEC 23009-1:2014.
  46. For more information see:
  47. @itemize @bullet
  48. @item
  49. ISO DASH Specification: @url{http://standards.iso.org/ittf/PubliclyAvailableStandards/c065274_ISO_IEC_23009-1_2014.zip}
  50. @item
  51. WebM DASH Specification: @url{https://sites.google.com/a/webmproject.org/wiki/adaptive-streaming/webm-dash-specification}
  52. @end itemize
  53. It creates a MPD manifest file and segment files for each stream.
  54. The segment filename might contain pre-defined identifiers used with SegmentTemplate
  55. as defined in section 5.3.9.4.4 of the standard. Available identifiers are "$RepresentationID$",
  56. "$Number$", "$Bandwidth$" and "$Time$".
  57. @example
  58. avconv -re -i <input> -map 0 -map 0 -c:a libfdk_aac -c:v libx264
  59. -b:v:0 800k -b:v:1 300k -s:v:1 320x170 -profile:v:1 baseline
  60. -profile:v:0 main -bf 1 -keyint_min 120 -g 120 -sc_threshold 0
  61. -b_strategy 0 -ar:a:1 22050 -use_timeline 1 -use_template 1
  62. -window_size 5 -adaptation_sets "id=0,streams=v id=1,streams=a"
  63. -f dash /path/to/out.mpd
  64. @end example
  65. @table @option
  66. @item -min_seg_duration @var{microseconds}
  67. Set the segment length in microseconds.
  68. @item -window_size @var{size}
  69. Set the maximum number of segments kept in the manifest.
  70. @item -extra_window_size @var{size}
  71. Set the maximum number of segments kept outside of the manifest before removing from disk.
  72. @item -remove_at_exit @var{remove}
  73. Enable (1) or disable (0) removal of all segments when finished.
  74. @item -use_template @var{template}
  75. Enable (1) or disable (0) use of SegmentTemplate instead of SegmentList.
  76. @item -use_timeline @var{timeline}
  77. Enable (1) or disable (0) use of SegmentTimeline in SegmentTemplate.
  78. @item -single_file @var{single_file}
  79. Enable (1) or disable (0) storing all segments in one file, accessed using byte ranges.
  80. @item -single_file_name @var{file_name}
  81. DASH-templated name to be used for baseURL. Implies @var{single_file} set to "1".
  82. @item -init_seg_name @var{init_name}
  83. DASH-templated name to used for the initialization segment. Default is "init-stream$RepresentationID$.m4s"
  84. @item -media_seg_name @var{segment_name}
  85. DASH-templated name to used for the media segments. Default is "chunk-stream$RepresentationID$-$Number%05d$.m4s"
  86. @item -utc_timing_url @var{utc_url}
  87. URL of the page that will return the UTC timestamp in ISO format. Example: "https://time.akamai.com/?iso"
  88. @item -adaptation_sets @var{adaptation_sets}
  89. Assign streams to AdaptationSets. Syntax is "id=x,streams=a,b,c id=y,streams=d,e" with x and y being the IDs
  90. of the adaptation sets and a,b,c,d and e are the indices of the mapped streams.
  91. To map all video (or audio) streams to an AdaptationSet, "v" (or "a") can be used as stream identifier instead of IDs.
  92. When no assignment is defined, this defaults to an AdaptationSet for each stream.
  93. @end table
  94. @anchor{framecrc}
  95. @section framecrc
  96. Per-frame CRC (Cyclic Redundancy Check) testing format.
  97. This muxer computes and prints the Adler-32 CRC for each decoded audio
  98. and video frame. By default audio frames are converted to signed
  99. 16-bit raw audio and video frames to raw video before computing the
  100. CRC.
  101. The output of the muxer consists of a line for each audio and video
  102. frame of the form: @var{stream_index}, @var{frame_dts},
  103. @var{frame_size}, 0x@var{CRC}, where @var{CRC} is a hexadecimal
  104. number 0-padded to 8 digits containing the CRC of the decoded frame.
  105. For example to compute the CRC of each decoded frame in the input, and
  106. store it in the file @file{out.crc}:
  107. @example
  108. avconv -i INPUT -f framecrc out.crc
  109. @end example
  110. You can print the CRC of each decoded frame to stdout with the command:
  111. @example
  112. avconv -i INPUT -f framecrc -
  113. @end example
  114. You can select the output format of each frame with @command{avconv} by
  115. specifying the audio and video codec and format. For example, to
  116. compute the CRC of each decoded input audio frame converted to PCM
  117. unsigned 8-bit and of each decoded input video frame converted to
  118. MPEG-2 video, use the command:
  119. @example
  120. avconv -i INPUT -c:a pcm_u8 -c:v mpeg2video -f framecrc -
  121. @end example
  122. See also the @ref{crc} muxer.
  123. @anchor{hls}
  124. @section hls
  125. Apple HTTP Live Streaming muxer that segments MPEG-TS according to
  126. the HTTP Live Streaming specification.
  127. It creates a playlist file and numbered segment files. The output
  128. filename specifies the playlist filename; the segment filenames
  129. receive the same basename as the playlist, a sequential number and
  130. a .ts extension.
  131. Make sure to require a closed GOP when encoding and to set the GOP
  132. size to fit your segment time constraint.
  133. @example
  134. avconv -i in.mkv -c:v h264 -flags +cgop -g 30 -hls_time 1 out.m3u8
  135. @end example
  136. @table @option
  137. @item -hls_time @var{seconds}
  138. Set the segment length in seconds.
  139. @item -hls_list_size @var{size}
  140. Set the maximum number of playlist entries.
  141. @item -hls_wrap @var{wrap}
  142. Set the number after which index wraps.
  143. @item -start_number @var{number}
  144. Start the sequence from @var{number}.
  145. @item -hls_base_url @var{baseurl}
  146. Append @var{baseurl} to every entry in the playlist.
  147. Useful to generate playlists with absolute paths.
  148. @item -hls_allow_cache @var{allowcache}
  149. Explicitly set whether the client MAY (1) or MUST NOT (0) cache media segments
  150. @item -hls_version @var{version}
  151. Set the protocol version. Enables or disables version-specific features
  152. such as the integer (version 2) or decimal EXTINF values (version 3).
  153. @item -hls_enc @var{enc}
  154. Enable (1) or disable (0) the AES128 encryption.
  155. When enabled every segment generated is encrypted and the encryption key
  156. is saved as @var{playlist name}.key.
  157. @item -hls_enc_key @var{key}
  158. Use the specified hex-coded 16byte key to encrypt the segments, by default it
  159. is randomly generated.
  160. @item -hls_enc_key_url @var{keyurl}
  161. If set, @var{keyurl} is prepended instead of @var{baseurl} to the key filename
  162. in the playlist.
  163. @item -hls_enc_iv @var{iv}
  164. Use a specified hex-coded 16byte initialization vector for every segment instead
  165. of the autogenerated ones.
  166. @end table
  167. @anchor{image2}
  168. @section image2
  169. Image file muxer.
  170. The image file muxer writes video frames to image files.
  171. The output filenames are specified by a pattern, which can be used to
  172. produce sequentially numbered series of files.
  173. The pattern may contain the string "%d" or "%0@var{N}d", this string
  174. specifies the position of the characters representing a numbering in
  175. the filenames. If the form "%0@var{N}d" is used, the string
  176. representing the number in each filename is 0-padded to @var{N}
  177. digits. The literal character '%' can be specified in the pattern with
  178. the string "%%".
  179. If the pattern contains "%d" or "%0@var{N}d", the first filename of
  180. the file list specified will contain the number 1, all the following
  181. numbers will be sequential.
  182. The pattern may contain a suffix which is used to automatically
  183. determine the format of the image files to write.
  184. For example the pattern "img-%03d.bmp" will specify a sequence of
  185. filenames of the form @file{img-001.bmp}, @file{img-002.bmp}, ...,
  186. @file{img-010.bmp}, etc.
  187. The pattern "img%%-%d.jpg" will specify a sequence of filenames of the
  188. form @file{img%-1.jpg}, @file{img%-2.jpg}, ..., @file{img%-10.jpg},
  189. etc.
  190. The following example shows how to use @command{avconv} for creating a
  191. sequence of files @file{img-001.jpeg}, @file{img-002.jpeg}, ...,
  192. taking one image every second from the input video:
  193. @example
  194. avconv -i in.avi -vsync 1 -r 1 -f image2 'img-%03d.jpeg'
  195. @end example
  196. Note that with @command{avconv}, if the format is not specified with the
  197. @code{-f} option and the output filename specifies an image file
  198. format, the image2 muxer is automatically selected, so the previous
  199. command can be written as:
  200. @example
  201. avconv -i in.avi -vsync 1 -r 1 'img-%03d.jpeg'
  202. @end example
  203. Note also that the pattern must not necessarily contain "%d" or
  204. "%0@var{N}d", for example to create a single image file
  205. @file{img.jpeg} from the input video you can employ the command:
  206. @example
  207. avconv -i in.avi -f image2 -frames:v 1 img.jpeg
  208. @end example
  209. @table @option
  210. @item -start_number @var{number}
  211. Start the sequence from @var{number}.
  212. @item -update @var{number}
  213. If @var{number} is nonzero, the filename will always be interpreted as just a
  214. filename, not a pattern, and this file will be continuously overwritten with new
  215. images.
  216. @end table
  217. @section matroska
  218. Matroska container muxer.
  219. This muxer implements the matroska and webm container specs.
  220. The recognized metadata settings in this muxer are:
  221. @table @option
  222. @item title=@var{title name}
  223. Name provided to a single track
  224. @end table
  225. @table @option
  226. @item language=@var{language name}
  227. Specifies the language of the track in the Matroska languages form
  228. @end table
  229. @table @option
  230. @item STEREO_MODE=@var{mode}
  231. Stereo 3D video layout of two views in a single video track
  232. @table @option
  233. @item mono
  234. video is not stereo
  235. @item left_right
  236. Both views are arranged side by side, Left-eye view is on the left
  237. @item bottom_top
  238. Both views are arranged in top-bottom orientation, Left-eye view is at bottom
  239. @item top_bottom
  240. Both views are arranged in top-bottom orientation, Left-eye view is on top
  241. @item checkerboard_rl
  242. Each view is arranged in a checkerboard interleaved pattern, Left-eye view being first
  243. @item checkerboard_lr
  244. Each view is arranged in a checkerboard interleaved pattern, Right-eye view being first
  245. @item row_interleaved_rl
  246. Each view is constituted by a row based interleaving, Right-eye view is first row
  247. @item row_interleaved_lr
  248. Each view is constituted by a row based interleaving, Left-eye view is first row
  249. @item col_interleaved_rl
  250. Both views are arranged in a column based interleaving manner, Right-eye view is first column
  251. @item col_interleaved_lr
  252. Both views are arranged in a column based interleaving manner, Left-eye view is first column
  253. @item anaglyph_cyan_red
  254. All frames are in anaglyph format viewable through red-cyan filters
  255. @item right_left
  256. Both views are arranged side by side, Right-eye view is on the left
  257. @item anaglyph_green_magenta
  258. All frames are in anaglyph format viewable through green-magenta filters
  259. @item block_lr
  260. Both eyes laced in one Block, Left-eye view is first
  261. @item block_rl
  262. Both eyes laced in one Block, Right-eye view is first
  263. @end table
  264. @end table
  265. For example a 3D WebM clip can be created using the following command line:
  266. @example
  267. avconv -i sample_left_right_clip.mpg -an -c:v libvpx -metadata STEREO_MODE=left_right -y stereo_clip.webm
  268. @end example
  269. This muxer supports the following options:
  270. @table @option
  271. @item reserve_index_space
  272. By default, this muxer writes the index for seeking (called cues in Matroska
  273. terms) at the end of the file, because it cannot know in advance how much space
  274. to leave for the index at the beginning of the file. However for some use cases
  275. -- e.g. streaming where seeking is possible but slow -- it is useful to put the
  276. index at the beginning of the file.
  277. If this option is set to a non-zero value, the muxer will reserve a given amount
  278. of space in the file header and then try to write the cues there when the muxing
  279. finishes. If the available space does not suffice, muxing will fail. A safe size
  280. for most use cases should be about 50kB per hour of video.
  281. Note that cues are only written if the output is seekable and this option will
  282. have no effect if it is not.
  283. @end table
  284. @section mov, mp4, ismv
  285. The mov/mp4/ismv muxer supports fragmentation. Normally, a MOV/MP4
  286. file has all the metadata about all packets stored in one location
  287. (written at the end of the file, it can be moved to the start for
  288. better playback using the @command{qt-faststart} tool). A fragmented
  289. file consists of a number of fragments, where packets and metadata
  290. about these packets are stored together. Writing a fragmented
  291. file has the advantage that the file is decodable even if the
  292. writing is interrupted (while a normal MOV/MP4 is undecodable if
  293. it is not properly finished), and it requires less memory when writing
  294. very long files (since writing normal MOV/MP4 files stores info about
  295. every single packet in memory until the file is closed). The downside
  296. is that it is less compatible with other applications.
  297. Fragmentation is enabled by setting one of the AVOptions that define
  298. how to cut the file into fragments:
  299. @table @option
  300. @item -movflags frag_keyframe
  301. Start a new fragment at each video keyframe.
  302. @item -frag_duration @var{duration}
  303. Create fragments that are @var{duration} microseconds long.
  304. @item -frag_size @var{size}
  305. Create fragments that contain up to @var{size} bytes of payload data.
  306. @item -movflags frag_custom
  307. Allow the caller to manually choose when to cut fragments, by
  308. calling @code{av_write_frame(ctx, NULL)} to write a fragment with
  309. the packets written so far. (This is only useful with other
  310. applications integrating libavformat, not from @command{avconv}.)
  311. @item -min_frag_duration @var{duration}
  312. Don't create fragments that are shorter than @var{duration} microseconds long.
  313. @end table
  314. If more than one condition is specified, fragments are cut when
  315. one of the specified conditions is fulfilled. The exception to this is
  316. @code{-min_frag_duration}, which has to be fulfilled for any of the other
  317. conditions to apply.
  318. Additionally, the way the output file is written can be adjusted
  319. through a few other options:
  320. @table @option
  321. @item -movflags empty_moov
  322. Write an initial moov atom directly at the start of the file, without
  323. describing any samples in it. Generally, an mdat/moov pair is written
  324. at the start of the file, as a normal MOV/MP4 file, containing only
  325. a short portion of the file. With this option set, there is no initial
  326. mdat atom, and the moov atom only describes the tracks but has
  327. a zero duration.
  328. This option is implicitly set when writing ismv (Smooth Streaming) files.
  329. @item -movflags separate_moof
  330. Write a separate moof (movie fragment) atom for each track. Normally,
  331. packets for all tracks are written in a moof atom (which is slightly
  332. more efficient), but with this option set, the muxer writes one moof/mdat
  333. pair for each track, making it easier to separate tracks.
  334. This option is implicitly set when writing ismv (Smooth Streaming) files.
  335. @item -movflags faststart
  336. Run a second pass moving the index (moov atom) to the beginning of the file.
  337. This operation can take a while, and will not work in various situations such
  338. as fragmented output, thus it is not enabled by default.
  339. @item -movflags disable_chpl
  340. Disable Nero chapter markers (chpl atom). Normally, both Nero chapters
  341. and a QuickTime chapter track are written to the file. With this option
  342. set, only the QuickTime chapter track will be written. Nero chapters can
  343. cause failures when the file is reprocessed with certain tagging programs.
  344. @item -movflags omit_tfhd_offset
  345. Do not write any absolute base_data_offset in tfhd atoms. This avoids
  346. tying fragments to absolute byte positions in the file/streams.
  347. @item -movflags default_base_moof
  348. Similarly to the omit_tfhd_offset, this flag avoids writing the
  349. absolute base_data_offset field in tfhd atoms, but does so by using
  350. the new default-base-is-moof flag instead. This flag is new from
  351. 14496-12:2012. This may make the fragments easier to parse in certain
  352. circumstances (avoiding basing track fragment location calculations
  353. on the implicit end of the previous track fragment).
  354. @end table
  355. Smooth Streaming content can be pushed in real time to a publishing
  356. point on IIS with this muxer. Example:
  357. @example
  358. avconv -re @var{<normal input/transcoding options>} -movflags isml+frag_keyframe -f ismv http://server/publishingpoint.isml/Streams(Encoder1)
  359. @end example
  360. @section mp3
  361. The MP3 muxer writes a raw MP3 stream with the following optional features:
  362. @itemize @bullet
  363. @item
  364. An ID3v2 metadata header at the beginning (enabled by default). Versions 2.3 and
  365. 2.4 are supported, the @code{id3v2_version} private option controls which one is
  366. used (3 or 4). Setting @code{id3v2_version} to 0 disables the ID3v2 header
  367. completely.
  368. The muxer supports writing attached pictures (APIC frames) to the ID3v2 header.
  369. The pictures are supplied to the muxer in form of a video stream with a single
  370. packet. There can be any number of those streams, each will correspond to a
  371. single APIC frame. The stream metadata tags @var{title} and @var{comment} map
  372. to APIC @var{description} and @var{picture type} respectively. See
  373. @url{http://id3.org/id3v2.4.0-frames} for allowed picture types.
  374. Note that the APIC frames must be written at the beginning, so the muxer will
  375. buffer the audio frames until it gets all the pictures. It is therefore advised
  376. to provide the pictures as soon as possible to avoid excessive buffering.
  377. @item
  378. A Xing/LAME frame right after the ID3v2 header (if present). It is enabled by
  379. default, but will be written only if the output is seekable. The
  380. @code{write_xing} private option can be used to disable it. The frame contains
  381. various information that may be useful to the decoder, like the audio duration
  382. or encoder delay.
  383. @item
  384. A legacy ID3v1 tag at the end of the file (disabled by default). It may be
  385. enabled with the @code{write_id3v1} private option, but as its capabilities are
  386. very limited, its usage is not recommended.
  387. @end itemize
  388. Examples:
  389. Write an mp3 with an ID3v2.3 header and an ID3v1 footer:
  390. @example
  391. avconv -i INPUT -id3v2_version 3 -write_id3v1 1 out.mp3
  392. @end example
  393. Attach a picture to an mp3:
  394. @example
  395. avconv -i input.mp3 -i cover.png -c copy -metadata:s:v title="Album cover"
  396. -metadata:s:v comment="Cover (Front)" out.mp3
  397. @end example
  398. Write a "clean" MP3 without any extra features:
  399. @example
  400. avconv -i input.wav -write_xing 0 -id3v2_version 0 out.mp3
  401. @end example
  402. @section mpegts
  403. MPEG transport stream muxer.
  404. This muxer implements ISO 13818-1 and part of ETSI EN 300 468.
  405. The muxer options are:
  406. @table @option
  407. @item -mpegts_original_network_id @var{number}
  408. Set the original_network_id (default 0x0001). This is unique identifier
  409. of a network in DVB. Its main use is in the unique identification of a
  410. service through the path Original_Network_ID, Transport_Stream_ID.
  411. @item -mpegts_transport_stream_id @var{number}
  412. Set the transport_stream_id (default 0x0001). This identifies a
  413. transponder in DVB.
  414. @item -mpegts_service_id @var{number}
  415. Set the service_id (default 0x0001) also known as program in DVB.
  416. @item -mpegts_pmt_start_pid @var{number}
  417. Set the first PID for PMT (default 0x1000, max 0x1f00).
  418. @item -mpegts_start_pid @var{number}
  419. Set the first PID for data packets (default 0x0100, max 0x0f00).
  420. @item -muxrate @var{number}
  421. Set a constant muxrate (default VBR).
  422. @item -pcr_period @var{numer}
  423. Override the default PCR retransmission time (default 20ms), ignored
  424. if variable muxrate is selected.
  425. @end table
  426. The recognized metadata settings in mpegts muxer are @code{service_provider}
  427. and @code{service_name}. If they are not set the default for
  428. @code{service_provider} is "Libav" and the default for
  429. @code{service_name} is "Service01".
  430. @example
  431. avconv -i file.mpg -c copy \
  432. -mpegts_original_network_id 0x1122 \
  433. -mpegts_transport_stream_id 0x3344 \
  434. -mpegts_service_id 0x5566 \
  435. -mpegts_pmt_start_pid 0x1500 \
  436. -mpegts_start_pid 0x150 \
  437. -metadata service_provider="Some provider" \
  438. -metadata service_name="Some Channel" \
  439. -y out.ts
  440. @end example
  441. @section null
  442. Null muxer.
  443. This muxer does not generate any output file, it is mainly useful for
  444. testing or benchmarking purposes.
  445. For example to benchmark decoding with @command{avconv} you can use the
  446. command:
  447. @example
  448. avconv -benchmark -i INPUT -f null out.null
  449. @end example
  450. Note that the above command does not read or write the @file{out.null}
  451. file, but specifying the output file is required by the @command{avconv}
  452. syntax.
  453. Alternatively you can write the command as:
  454. @example
  455. avconv -benchmark -i INPUT -f null -
  456. @end example
  457. @section nut
  458. @table @option
  459. @item -syncpoints @var{flags}
  460. Change the syncpoint usage in nut:
  461. @table @option
  462. @item @var{default} use the normal low-overhead seeking aids.
  463. @item @var{none} do not use the syncpoints at all, reducing the overhead but making the stream non-seekable;
  464. @item @var{timestamped} extend the syncpoint with a wallclock field.
  465. @end table
  466. The @var{none} and @var{timestamped} flags are experimental.
  467. @end table
  468. @example
  469. avconv -i INPUT -f_strict experimental -syncpoints none - | processor
  470. @end example
  471. @section ogg
  472. Ogg container muxer.
  473. @table @option
  474. @item -page_duration @var{duration}
  475. Preferred page duration, in microseconds. The muxer will attempt to create
  476. pages that are approximately @var{duration} microseconds long. This allows the
  477. user to compromise between seek granularity and container overhead. The default
  478. is 1 second. A value of 0 will fill all segments, making pages as large as
  479. possible. A value of 1 will effectively use 1 packet-per-page in most
  480. situations, giving a small seek granularity at the cost of additional container
  481. overhead.
  482. @item -serial_offset @var{value}
  483. Serial value from which to set the streams serial number.
  484. Setting it to different and sufficiently large values ensures that the produced
  485. ogg files can be safely chained.
  486. @end table
  487. @section segment
  488. Basic stream segmenter.
  489. The segmenter muxer outputs streams to a number of separate files of nearly
  490. fixed duration. Output filename pattern can be set in a fashion similar to
  491. @ref{image2}.
  492. Every segment starts with a video keyframe, if a video stream is present.
  493. The segment muxer works best with a single constant frame rate video.
  494. Optionally it can generate a flat list of the created segments, one segment
  495. per line.
  496. @table @option
  497. @item segment_format @var{format}
  498. Override the inner container format, by default it is guessed by the filename
  499. extension.
  500. @item segment_time @var{t}
  501. Set segment duration to @var{t} seconds.
  502. @item segment_list @var{name}
  503. Generate also a listfile named @var{name}.
  504. @item segment_list_type @var{type}
  505. Select the listing format.
  506. @table @option
  507. @item @var{flat} use a simple flat list of entries.
  508. @item @var{hls} use a m3u8-like structure.
  509. @end table
  510. @item segment_list_size @var{size}
  511. Overwrite the listfile once it reaches @var{size} entries.
  512. @item segment_list_entry_prefix @var{prefix}
  513. Prepend @var{prefix} to each entry. Useful to generate absolute paths.
  514. @item segment_wrap @var{limit}
  515. Wrap around segment index once it reaches @var{limit}.
  516. @end table
  517. Make sure to require a closed GOP when encoding and to set the GOP
  518. size to fit your segment time constraint.
  519. @example
  520. avconv -i in.mkv -c hevc -flags +cgop -g 60 -map 0 -f segment -list out.list out%03d.nut
  521. @end example
  522. @c man end MUXERS