formats.texi 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. @chapter Format Options
  2. @c man begin FORMAT OPTIONS
  3. The libavformat library provides some generic global options, which
  4. can be set on all the muxers and demuxers. In addition each muxer or
  5. demuxer may support so-called private options, which are specific for
  6. that component.
  7. Options may be set by specifying -@var{option} @var{value} in the
  8. FFmpeg tools, or by setting the value explicitly in the
  9. @code{AVFormatContext} options or using the @file{libavutil/opt.h} API
  10. for programmatic use.
  11. The list of supported options follows:
  12. @table @option
  13. @item avioflags @var{flags} (@emph{input/output})
  14. Possible values:
  15. @table @samp
  16. @item direct
  17. Reduce buffering.
  18. @end table
  19. @item probesize @var{integer} (@emph{input})
  20. Set probing size in bytes, i.e. the size of the data to analyze to get
  21. stream information. A higher value will enable detecting more
  22. information in case it is dispersed into the stream, but will increase
  23. latency. Must be an integer not lesser than 32. It is 5000000 by default.
  24. @item packetsize @var{integer} (@emph{output})
  25. Set packet size.
  26. @item fflags @var{flags} (@emph{input/output})
  27. Set format flags.
  28. Possible values:
  29. @table @samp
  30. @item ignidx
  31. Ignore index.
  32. @item fastseek
  33. Enable fast, but inaccurate seeks for some formats.
  34. @item genpts
  35. Generate PTS.
  36. @item nofillin
  37. Do not fill in missing values that can be exactly calculated.
  38. @item noparse
  39. Disable AVParsers, this needs @code{+nofillin} too.
  40. @item igndts
  41. Ignore DTS.
  42. @item discardcorrupt
  43. Discard corrupted frames.
  44. @item sortdts
  45. Try to interleave output packets by DTS.
  46. @item keepside
  47. Do not merge side data.
  48. @item latm
  49. Enable RTP MP4A-LATM payload.
  50. @item nobuffer
  51. Reduce the latency introduced by optional buffering
  52. @item bitexact
  53. Only write platform-, build- and time-independent data.
  54. This ensures that file and data checksums are reproducible and match between
  55. platforms. Its primary use is for regression testing.
  56. @item shortest
  57. Stop muxing at the end of the shortest stream.
  58. It may be needed to increase max_interleave_delta to avoid flushing the longer
  59. streams before EOF.
  60. @end table
  61. @item seek2any @var{integer} (@emph{input})
  62. Allow seeking to non-keyframes on demuxer level when supported if set to 1.
  63. Default is 0.
  64. @item analyzeduration @var{integer} (@emph{input})
  65. Specify how many microseconds are analyzed to probe the input. A
  66. higher value will enable detecting more accurate information, but will
  67. increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
  68. @item cryptokey @var{hexadecimal string} (@emph{input})
  69. Set decryption key.
  70. @item indexmem @var{integer} (@emph{input})
  71. Set max memory used for timestamp index (per stream).
  72. @item rtbufsize @var{integer} (@emph{input})
  73. Set max memory used for buffering real-time frames.
  74. @item fdebug @var{flags} (@emph{input/output})
  75. Print specific debug info.
  76. Possible values:
  77. @table @samp
  78. @item ts
  79. @end table
  80. @item max_delay @var{integer} (@emph{input/output})
  81. Set maximum muxing or demuxing delay in microseconds.
  82. @item fpsprobesize @var{integer} (@emph{input})
  83. Set number of frames used to probe fps.
  84. @item audio_preload @var{integer} (@emph{output})
  85. Set microseconds by which audio packets should be interleaved earlier.
  86. @item chunk_duration @var{integer} (@emph{output})
  87. Set microseconds for each chunk.
  88. @item chunk_size @var{integer} (@emph{output})
  89. Set size in bytes for each chunk.
  90. @item err_detect, f_err_detect @var{flags} (@emph{input})
  91. Set error detection flags. @code{f_err_detect} is deprecated and
  92. should be used only via the @command{ffmpeg} tool.
  93. Possible values:
  94. @table @samp
  95. @item crccheck
  96. Verify embedded CRCs.
  97. @item bitstream
  98. Detect bitstream specification deviations.
  99. @item buffer
  100. Detect improper bitstream length.
  101. @item explode
  102. Abort decoding on minor error detection.
  103. @item careful
  104. Consider things that violate the spec and have not been seen in the
  105. wild as errors.
  106. @item compliant
  107. Consider all spec non compliancies as errors.
  108. @item aggressive
  109. Consider things that a sane encoder should not do as an error.
  110. @end table
  111. @item max_interleave_delta @var{integer} (@emph{output})
  112. Set maximum buffering duration for interleaving. The duration is
  113. expressed in microseconds, and defaults to 1000000 (1 second).
  114. To ensure all the streams are interleaved correctly, libavformat will
  115. wait until it has at least one packet for each stream before actually
  116. writing any packets to the output file. When some streams are
  117. "sparse" (i.e. there are large gaps between successive packets), this
  118. can result in excessive buffering.
  119. This field specifies the maximum difference between the timestamps of the
  120. first and the last packet in the muxing queue, above which libavformat
  121. will output a packet regardless of whether it has queued a packet for all
  122. the streams.
  123. If set to 0, libavformat will continue buffering packets until it has
  124. a packet for each stream, regardless of the maximum timestamp
  125. difference between the buffered packets.
  126. @item use_wallclock_as_timestamps @var{integer} (@emph{input})
  127. Use wallclock as timestamps if set to 1. Default is 0.
  128. @item avoid_negative_ts @var{integer} (@emph{output})
  129. Possible values:
  130. @table @samp
  131. @item make_non_negative
  132. Shift timestamps to make them non-negative.
  133. Also note that this affects only leading negative timestamps, and not
  134. non-monotonic negative timestamps.
  135. @item make_zero
  136. Shift timestamps so that the first timestamp is 0.
  137. @item auto (default)
  138. Enables shifting when required by the target format.
  139. @item disabled
  140. Disables shifting of timestamp.
  141. @end table
  142. When shifting is enabled, all output timestamps are shifted by the
  143. same amount. Audio, video, and subtitles desynching and relative
  144. timestamp differences are preserved compared to how they would have
  145. been without shifting.
  146. @item skip_initial_bytes @var{integer} (@emph{input})
  147. Set number of bytes to skip before reading header and frames if set to 1.
  148. Default is 0.
  149. @item correct_ts_overflow @var{integer} (@emph{input})
  150. Correct single timestamp overflows if set to 1. Default is 1.
  151. @item flush_packets @var{integer} (@emph{output})
  152. Flush the underlying I/O stream after each packet. Default 1 enables it, and
  153. has the effect of reducing the latency; 0 disables it and may slightly
  154. increase performance in some cases.
  155. @item output_ts_offset @var{offset} (@emph{output})
  156. Set the output time offset.
  157. @var{offset} must be a time duration specification,
  158. see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
  159. The offset is added by the muxer to the output timestamps.
  160. Specifying a positive offset means that the corresponding streams are
  161. delayed bt the time duration specified in @var{offset}. Default value
  162. is @code{0} (meaning that no offset is applied).
  163. @item format_whitelist @var{list} (@emph{input})
  164. "," separated list of allowed demuxers. By default all are allowed.
  165. @item dump_separator @var{string} (@emph{input})
  166. Separator used to separate the fields printed on the command line about the
  167. Stream parameters.
  168. For example to separate the fields with newlines and indention:
  169. @example
  170. ffprobe -dump_separator "
  171. " -i ~/videos/matrixbench_mpeg2.mpg
  172. @end example
  173. @item max_streams @var{integer} (@emph{input})
  174. Specifies the maximum number of streams. This can be used to reject files that
  175. would require too many resources due to a large number of streams.
  176. @end table
  177. @c man end FORMAT OPTIONS
  178. @anchor{Format stream specifiers}
  179. @section Format stream specifiers
  180. Format stream specifiers allow selection of one or more streams that
  181. match specific properties.
  182. Possible forms of stream specifiers are:
  183. @table @option
  184. @item @var{stream_index}
  185. Matches the stream with this index.
  186. @item @var{stream_type}[:@var{stream_index}]
  187. @var{stream_type} is one of following: 'v' for video, 'a' for audio,
  188. 's' for subtitle, 'd' for data, and 't' for attachments. If
  189. @var{stream_index} is given, then it matches the stream number
  190. @var{stream_index} of this type. Otherwise, it matches all streams of
  191. this type.
  192. @item p:@var{program_id}[:@var{stream_index}]
  193. If @var{stream_index} is given, then it matches the stream with number
  194. @var{stream_index} in the program with the id
  195. @var{program_id}. Otherwise, it matches all streams in the program.
  196. @item #@var{stream_id}
  197. Matches the stream by a format-specific ID.
  198. @end table
  199. The exact semantics of stream specifiers is defined by the
  200. @code{avformat_match_stream_specifier()} function declared in the
  201. @file{libavformat/avformat.h} header.
  202. @ifclear config-writeonly
  203. @include demuxers.texi
  204. @end ifclear
  205. @ifclear config-readonly
  206. @include muxers.texi
  207. @end ifclear
  208. @include metadata.texi