formats.texi 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  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 max_probe_packets @var{integer} (@emph{input})
  25. Set the maximum number of buffered packets when probing a codec.
  26. Default is 2500 packets.
  27. @item packetsize @var{integer} (@emph{output})
  28. Set packet size.
  29. @item fflags @var{flags}
  30. Set format flags. Some are implemented for a limited number of formats.
  31. Possible values for input files:
  32. @table @samp
  33. @item discardcorrupt
  34. Discard corrupted packets.
  35. @item fastseek
  36. Enable fast, but inaccurate seeks for some formats.
  37. @item genpts
  38. Generate missing PTS if DTS is present.
  39. @item igndts
  40. Ignore DTS if PTS is set. Inert when nofillin is set.
  41. @item ignidx
  42. Ignore index.
  43. @item nobuffer
  44. Reduce the latency introduced by buffering during initial input streams analysis.
  45. @item nofillin
  46. Do not fill in missing values in packet fields that can be exactly calculated.
  47. @item noparse
  48. Disable AVParsers, this needs @code{+nofillin} too.
  49. @item sortdts
  50. Try to interleave output packets by DTS. At present, available only for AVIs with an index.
  51. @end table
  52. Possible values for output files:
  53. @table @samp
  54. @item autobsf
  55. Automatically apply bitstream filters as required by the output format. Enabled by default.
  56. @item bitexact
  57. Only write platform-, build- and time-independent data.
  58. This ensures that file and data checksums are reproducible and match between
  59. platforms. Its primary use is for regression testing.
  60. @item flush_packets
  61. Write out packets immediately.
  62. @item shortest
  63. Stop muxing at the end of the shortest stream.
  64. It may be needed to increase max_interleave_delta to avoid flushing the longer
  65. streams before EOF.
  66. @end table
  67. @item seek2any @var{integer} (@emph{input})
  68. Allow seeking to non-keyframes on demuxer level when supported if set to 1.
  69. Default is 0.
  70. @item analyzeduration @var{integer} (@emph{input})
  71. Specify how many microseconds are analyzed to probe the input. A
  72. higher value will enable detecting more accurate information, but will
  73. increase latency. It defaults to 5,000,000 microseconds = 5 seconds.
  74. @item cryptokey @var{hexadecimal string} (@emph{input})
  75. Set decryption key.
  76. @item indexmem @var{integer} (@emph{input})
  77. Set max memory used for timestamp index (per stream).
  78. @item rtbufsize @var{integer} (@emph{input})
  79. Set max memory used for buffering real-time frames.
  80. @item fdebug @var{flags} (@emph{input/output})
  81. Print specific debug info.
  82. Possible values:
  83. @table @samp
  84. @item ts
  85. @end table
  86. @item max_delay @var{integer} (@emph{input/output})
  87. Set maximum muxing or demuxing delay in microseconds.
  88. @item fpsprobesize @var{integer} (@emph{input})
  89. Set number of frames used to probe fps.
  90. @item audio_preload @var{integer} (@emph{output})
  91. Set microseconds by which audio packets should be interleaved earlier.
  92. @item chunk_duration @var{integer} (@emph{output})
  93. Set microseconds for each chunk.
  94. @item chunk_size @var{integer} (@emph{output})
  95. Set size in bytes for each chunk.
  96. @item err_detect, f_err_detect @var{flags} (@emph{input})
  97. Set error detection flags. @code{f_err_detect} is deprecated and
  98. should be used only via the @command{ffmpeg} tool.
  99. Possible values:
  100. @table @samp
  101. @item crccheck
  102. Verify embedded CRCs.
  103. @item bitstream
  104. Detect bitstream specification deviations.
  105. @item buffer
  106. Detect improper bitstream length.
  107. @item explode
  108. Abort decoding on minor error detection.
  109. @item careful
  110. Consider things that violate the spec and have not been seen in the
  111. wild as errors.
  112. @item compliant
  113. Consider all spec non compliancies as errors.
  114. @item aggressive
  115. Consider things that a sane encoder should not do as an error.
  116. @end table
  117. @item max_interleave_delta @var{integer} (@emph{output})
  118. Set maximum buffering duration for interleaving. The duration is
  119. expressed in microseconds, and defaults to 10000000 (10 seconds).
  120. To ensure all the streams are interleaved correctly, libavformat will
  121. wait until it has at least one packet for each stream before actually
  122. writing any packets to the output file. When some streams are
  123. "sparse" (i.e. there are large gaps between successive packets), this
  124. can result in excessive buffering.
  125. This field specifies the maximum difference between the timestamps of the
  126. first and the last packet in the muxing queue, above which libavformat
  127. will output a packet regardless of whether it has queued a packet for all
  128. the streams.
  129. If set to 0, libavformat will continue buffering packets until it has
  130. a packet for each stream, regardless of the maximum timestamp
  131. difference between the buffered packets.
  132. @item use_wallclock_as_timestamps @var{integer} (@emph{input})
  133. Use wallclock as timestamps if set to 1. Default is 0.
  134. @item avoid_negative_ts @var{integer} (@emph{output})
  135. Possible values:
  136. @table @samp
  137. @item make_non_negative
  138. Shift timestamps to make them non-negative.
  139. Also note that this affects only leading negative timestamps, and not
  140. non-monotonic negative timestamps.
  141. @item make_zero
  142. Shift timestamps so that the first timestamp is 0.
  143. @item auto (default)
  144. Enables shifting when required by the target format.
  145. @item disabled
  146. Disables shifting of timestamp.
  147. @end table
  148. When shifting is enabled, all output timestamps are shifted by the
  149. same amount. Audio, video, and subtitles desynching and relative
  150. timestamp differences are preserved compared to how they would have
  151. been without shifting.
  152. @item skip_initial_bytes @var{integer} (@emph{input})
  153. Set number of bytes to skip before reading header and frames if set to 1.
  154. Default is 0.
  155. @item correct_ts_overflow @var{integer} (@emph{input})
  156. Correct single timestamp overflows if set to 1. Default is 1.
  157. @item flush_packets @var{integer} (@emph{output})
  158. Flush the underlying I/O stream after each packet. Default is -1 (auto), which
  159. means that the underlying protocol will decide, 1 enables it, and has the
  160. effect of reducing the latency, 0 disables it and may increase IO throughput in
  161. some cases.
  162. @item output_ts_offset @var{offset} (@emph{output})
  163. Set the output time offset.
  164. @var{offset} must be a time duration specification,
  165. see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
  166. The offset is added by the muxer to the output timestamps.
  167. Specifying a positive offset means that the corresponding streams are
  168. delayed bt the time duration specified in @var{offset}. Default value
  169. is @code{0} (meaning that no offset is applied).
  170. @item format_whitelist @var{list} (@emph{input})
  171. "," separated list of allowed demuxers. By default all are allowed.
  172. @item dump_separator @var{string} (@emph{input})
  173. Separator used to separate the fields printed on the command line about the
  174. Stream parameters.
  175. For example, to separate the fields with newlines and indentation:
  176. @example
  177. ffprobe -dump_separator "
  178. " -i ~/videos/matrixbench_mpeg2.mpg
  179. @end example
  180. @item max_streams @var{integer} (@emph{input})
  181. Specifies the maximum number of streams. This can be used to reject files that
  182. would require too many resources due to a large number of streams.
  183. @item skip_estimate_duration_from_pts @var{bool} (@emph{input})
  184. Skip estimation of input duration when calculated using PTS.
  185. At present, applicable for MPEG-PS and MPEG-TS.
  186. @item strict, f_strict @var{integer} (@emph{input/output})
  187. Specify how strictly to follow the standards. @code{f_strict} is deprecated and
  188. should be used only via the @command{ffmpeg} tool.
  189. Possible values:
  190. @table @samp
  191. @item very
  192. strictly conform to an older more strict version of the spec or reference software
  193. @item strict
  194. strictly conform to all the things in the spec no matter what consequences
  195. @item normal
  196. @item unofficial
  197. allow unofficial extensions
  198. @item experimental
  199. allow non standardized experimental things, experimental
  200. (unfinished/work in progress/not well tested) decoders and encoders.
  201. Note: experimental decoders can pose a security risk, do not use this for
  202. decoding untrusted input.
  203. @end table
  204. @end table
  205. @c man end FORMAT OPTIONS
  206. @anchor{Format stream specifiers}
  207. @section Format stream specifiers
  208. Format stream specifiers allow selection of one or more streams that
  209. match specific properties.
  210. The exact semantics of stream specifiers is defined by the
  211. @code{avformat_match_stream_specifier()} function declared in the
  212. @file{libavformat/avformat.h} header and documented in the
  213. @ref{Stream specifiers,,Stream specifiers section in the ffmpeg(1) manual,ffmpeg}.
  214. @ifclear config-writeonly
  215. @include demuxers.texi
  216. @end ifclear
  217. @ifclear config-readonly
  218. @include muxers.texi
  219. @end ifclear
  220. @include metadata.texi