formats.texi 9.3 KB

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