formats.texi 9.1 KB

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