faq.html 61 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ -->
  4. <head>
  5. <meta charset="utf-8">
  6. <title>
  7. FFmpeg FAQ
  8. </title>
  9. <meta name="viewport" content="width=device-width,initial-scale=1.0">
  10. <link rel="stylesheet" type="text/css" href="bootstrap.min.css">
  11. <link rel="stylesheet" type="text/css" href="style.min.css">
  12. </head>
  13. <body>
  14. <div class="container">
  15. <h1>
  16. FFmpeg FAQ
  17. </h1>
  18. <div align="center">
  19. </div>
  20. <a name="SEC_Top"></a>
  21. <span id="SEC_Contents"></span>
  22. <h2 class="contents-heading">Table of Contents</h2>
  23. <div class="contents">
  24. <ul class="no-bullet">
  25. <li><a id="toc-General-Questions" href="#General-Questions">1 General Questions</a>
  26. <ul class="no-bullet">
  27. <li><a id="toc-Why-doesn_0027t-FFmpeg-support-feature-_005bxyz_005d_003f" href="#Why-doesn_0027t-FFmpeg-support-feature-_005bxyz_005d_003f">1.1 Why doesn&rsquo;t FFmpeg support feature [xyz]?</a></li>
  28. <li><a id="toc-FFmpeg-does-not-support-codec-XXX_002e-Can-you-include-a-Windows-DLL-loader-to-support-it_003f" href="#FFmpeg-does-not-support-codec-XXX_002e-Can-you-include-a-Windows-DLL-loader-to-support-it_003f">1.2 FFmpeg does not support codec XXX. Can you include a Windows DLL loader to support it?</a></li>
  29. <li><a id="toc-I-cannot-read-this-file-although-this-format-seems-to-be-supported-by-ffmpeg_002e" href="#I-cannot-read-this-file-although-this-format-seems-to-be-supported-by-ffmpeg_002e">1.3 I cannot read this file although this format seems to be supported by ffmpeg.</a></li>
  30. <li><a id="toc-Which-codecs-are-supported-by-Windows_003f" href="#Which-codecs-are-supported-by-Windows_003f">1.4 Which codecs are supported by Windows?</a></li>
  31. </ul></li>
  32. <li><a id="toc-Compilation" href="#Compilation">2 Compilation</a>
  33. <ul class="no-bullet">
  34. <li><a id="toc-error_003a-can_0027t-find-a-register-in-class-_0027GENERAL_005fREGS_0027-while-reloading-_0027asm_0027" href="#error_003a-can_0027t-find-a-register-in-class-_0027GENERAL_005fREGS_0027-while-reloading-_0027asm_0027">2.1 <code>error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'</code></a></li>
  35. <li><a id="toc-I-have-installed-this-library-with-my-distro_0027s-package-manager_002e-Why-does-configure-not-see-it_003f" href="#I-have-installed-this-library-with-my-distro_0027s-package-manager_002e-Why-does-configure-not-see-it_003f">2.2 I have installed this library with my distro&rsquo;s package manager. Why does <code>configure</code> not see it?</a></li>
  36. <li><a id="toc-How-do-I-make-pkg_002dconfig-find-my-libraries_003f" href="#How-do-I-make-pkg_002dconfig-find-my-libraries_003f">2.3 How do I make <code>pkg-config</code> find my libraries?</a></li>
  37. <li><a id="toc-How-do-I-use-pkg_002dconfig-when-cross_002dcompiling_003f" href="#How-do-I-use-pkg_002dconfig-when-cross_002dcompiling_003f">2.4 How do I use <code>pkg-config</code> when cross-compiling?</a></li>
  38. </ul></li>
  39. <li><a id="toc-Usage" href="#Usage">3 Usage</a>
  40. <ul class="no-bullet">
  41. <li><a id="toc-ffmpeg-does-not-work_003b-what-is-wrong_003f" href="#ffmpeg-does-not-work_003b-what-is-wrong_003f">3.1 ffmpeg does not work; what is wrong?</a></li>
  42. <li><a id="toc-How-do-I-encode-single-pictures-into-movies_003f" href="#How-do-I-encode-single-pictures-into-movies_003f">3.2 How do I encode single pictures into movies?</a></li>
  43. <li><a id="toc-How-do-I-encode-movie-to-single-pictures_003f" href="#How-do-I-encode-movie-to-single-pictures_003f">3.3 How do I encode movie to single pictures?</a></li>
  44. <li><a id="toc-Why-do-I-see-a-slight-quality-degradation-with-multithreaded-MPEG_002a-encoding_003f" href="#Why-do-I-see-a-slight-quality-degradation-with-multithreaded-MPEG_002a-encoding_003f">3.4 Why do I see a slight quality degradation with multithreaded MPEG* encoding?</a></li>
  45. <li><a id="toc-How-can-I-read-from-the-standard-input-or-write-to-the-standard-output_003f" href="#How-can-I-read-from-the-standard-input-or-write-to-the-standard-output_003f">3.5 How can I read from the standard input or write to the standard output?</a></li>
  46. <li><a id="toc-_002df-jpeg-doesn_0027t-work_002e" href="#g_t_002df-jpeg-doesn_0027t-work_002e">3.6 -f jpeg doesn&rsquo;t work.</a></li>
  47. <li><a id="toc-Why-can-I-not-change-the-frame-rate_003f" href="#Why-can-I-not-change-the-frame-rate_003f">3.7 Why can I not change the frame rate?</a></li>
  48. <li><a id="toc-How-do-I-encode-Xvid-or-DivX-video-with-ffmpeg_003f" href="#How-do-I-encode-Xvid-or-DivX-video-with-ffmpeg_003f">3.8 How do I encode Xvid or DivX video with ffmpeg?</a></li>
  49. <li><a id="toc-Which-are-good-parameters-for-encoding-high-quality-MPEG_002d4_003f" href="#Which-are-good-parameters-for-encoding-high-quality-MPEG_002d4_003f">3.9 Which are good parameters for encoding high quality MPEG-4?</a></li>
  50. <li><a id="toc-Which-are-good-parameters-for-encoding-high-quality-MPEG_002d1_002fMPEG_002d2_003f" href="#Which-are-good-parameters-for-encoding-high-quality-MPEG_002d1_002fMPEG_002d2_003f">3.10 Which are good parameters for encoding high quality MPEG-1/MPEG-2?</a></li>
  51. <li><a id="toc-Interlaced-video-looks-very-bad-when-encoded-with-ffmpeg_002c-what-is-wrong_003f" href="#Interlaced-video-looks-very-bad-when-encoded-with-ffmpeg_002c-what-is-wrong_003f">3.11 Interlaced video looks very bad when encoded with ffmpeg, what is wrong?</a></li>
  52. <li><a id="toc-How-can-I-read-DirectShow-files_003f" href="#How-can-I-read-DirectShow-files_003f">3.12 How can I read DirectShow files?</a></li>
  53. <li><a id="toc-How-can-I-join-video-files_003f" href="#How-can-I-join-video-files_003f">3.13 How can I join video files?</a></li>
  54. <li><a id="toc-How-can-I-concatenate-video-files_003f" href="#How-can-I-concatenate-video-files_003f">3.14 How can I concatenate video files?</a>
  55. <ul class="no-bullet">
  56. <li><a id="toc-Concatenating-using-the-concat-filter" href="#Concatenating-using-the-concat-filter">3.14.1 Concatenating using the concat <em>filter</em></a></li>
  57. <li><a id="toc-Concatenating-using-the-concat-demuxer" href="#Concatenating-using-the-concat-demuxer">3.14.2 Concatenating using the concat <em>demuxer</em></a></li>
  58. <li><a id="toc-Concatenating-using-the-concat-protocol-_0028file-level_0029" href="#Concatenating-using-the-concat-protocol-_0028file-level_0029">3.14.3 Concatenating using the concat <em>protocol</em> (file level)</a></li>
  59. <li><a id="toc-Concatenating-using-raw-audio-and-video" href="#Concatenating-using-raw-audio-and-video">3.14.4 Concatenating using raw audio and video</a></li>
  60. </ul></li>
  61. <li><a id="toc-Using-_002df-lavfi_002c-audio-becomes-mono-for-no-apparent-reason_002e" href="#Using-_002df-lavfi_002c-audio-becomes-mono-for-no-apparent-reason_002e">3.15 Using <samp>-f lavfi</samp>, audio becomes mono for no apparent reason.</a></li>
  62. <li><a id="toc-Why-does-FFmpeg-not-see-the-subtitles-in-my-VOB-file_003f" href="#Why-does-FFmpeg-not-see-the-subtitles-in-my-VOB-file_003f">3.16 Why does FFmpeg not see the subtitles in my VOB file?</a></li>
  63. <li><a id="toc-Why-was-the-ffmpeg-_002dsameq-option-removed_003f-What-to-use-instead_003f" href="#Why-was-the-ffmpeg-_002dsameq-option-removed_003f-What-to-use-instead_003f">3.17 Why was the <code>ffmpeg</code> <samp>-sameq</samp> option removed? What to use instead?</a></li>
  64. <li><a id="toc-I-have-a-stretched-video_002c-why-does-scaling-does-not-fix-it_003f" href="#I-have-a-stretched-video_002c-why-does-scaling-does-not-fix-it_003f">3.18 I have a stretched video, why does scaling does not fix it?</a></li>
  65. <li><a id="toc-How-do-I-run-ffmpeg-as-a-background-task_003f" href="#How-do-I-run-ffmpeg-as-a-background-task_003f">3.19 How do I run ffmpeg as a background task?</a></li>
  66. <li><a id="toc-How-do-I-prevent-ffmpeg-from-suspending-with-a-message-like-suspended-_0028tty-output_0029_003f" href="#How-do-I-prevent-ffmpeg-from-suspending-with-a-message-like-suspended-_0028tty-output_0029_003f">3.20 How do I prevent ffmpeg from suspending with a message like <em>suspended (tty output)</em>?</a></li>
  67. </ul></li>
  68. <li><a id="toc-Development" href="#Development">4 Development</a>
  69. <ul class="no-bullet">
  70. <li><a id="toc-Are-there-examples-illustrating-how-to-use-the-FFmpeg-libraries_002c-particularly-libavcodec-and-libavformat_003f" href="#Are-there-examples-illustrating-how-to-use-the-FFmpeg-libraries_002c-particularly-libavcodec-and-libavformat_003f">4.1 Are there examples illustrating how to use the FFmpeg libraries, particularly libavcodec and libavformat?</a></li>
  71. <li><a id="toc-Can-you-support-my-C-compiler-XXX_003f" href="#Can-you-support-my-C-compiler-XXX_003f">4.2 Can you support my C compiler XXX?</a></li>
  72. <li><a id="toc-Is-Microsoft-Visual-C_002b_002b-supported_003f" href="#Is-Microsoft-Visual-C_002b_002b-supported_003f">4.3 Is Microsoft Visual C++ supported?</a></li>
  73. <li><a id="toc-Can-you-add-automake_002c-libtool-or-autoconf-support_003f" href="#Can-you-add-automake_002c-libtool-or-autoconf-support_003f">4.4 Can you add automake, libtool or autoconf support?</a></li>
  74. <li><a id="toc-Why-not-rewrite-FFmpeg-in-object_002doriented-C_002b_002b_003f" href="#Why-not-rewrite-FFmpeg-in-object_002doriented-C_002b_002b_003f">4.5 Why not rewrite FFmpeg in object-oriented C++?</a></li>
  75. <li><a id="toc-Why-are-the-ffmpeg-programs-devoid-of-debugging-symbols_003f" href="#Why-are-the-ffmpeg-programs-devoid-of-debugging-symbols_003f">4.6 Why are the ffmpeg programs devoid of debugging symbols?</a></li>
  76. <li><a id="toc-I-do-not-like-the-LGPL_002c-can-I-contribute-code-under-the-GPL-instead_003f" href="#I-do-not-like-the-LGPL_002c-can-I-contribute-code-under-the-GPL-instead_003f">4.7 I do not like the LGPL, can I contribute code under the GPL instead?</a></li>
  77. <li><a id="toc-I_0027m-using-FFmpeg-from-within-my-C-application-but-the-linker-complains-about-missing-symbols-from-the-libraries-themselves_002e" href="#I_0027m-using-FFmpeg-from-within-my-C-application-but-the-linker-complains-about-missing-symbols-from-the-libraries-themselves_002e">4.8 I&rsquo;m using FFmpeg from within my C application but the linker complains about missing symbols from the libraries themselves.</a></li>
  78. <li><a id="toc-I_0027m-using-FFmpeg-from-within-my-C_002b_002b-application-but-the-linker-complains-about-missing-symbols-which-seem-to-be-available_002e" href="#I_0027m-using-FFmpeg-from-within-my-C_002b_002b-application-but-the-linker-complains-about-missing-symbols-which-seem-to-be-available_002e">4.9 I&rsquo;m using FFmpeg from within my C++ application but the linker complains about missing symbols which seem to be available.</a></li>
  79. <li><a id="toc-I_0027m-using-libavutil-from-within-my-C_002b_002b-application-but-the-compiler-complains-about-_0027UINT64_005fC_0027-was-not-declared-in-this-scope" href="#I_0027m-using-libavutil-from-within-my-C_002b_002b-application-but-the-compiler-complains-about-_0027UINT64_005fC_0027-was-not-declared-in-this-scope">4.10 I&rsquo;m using libavutil from within my C++ application but the compiler complains about &rsquo;UINT64_C&rsquo; was not declared in this scope</a></li>
  80. <li><a id="toc-I-have-a-file-in-memory-_002f-a-API-different-from-_002aopen_002f_002aread_002f-libc-how-do-I-use-it-with-libavformat_003f" href="#I-have-a-file-in-memory-_002f-a-API-different-from-_002aopen_002f_002aread_002f-libc-how-do-I-use-it-with-libavformat_003f">4.11 I have a file in memory / a API different from *open/*read/ libc how do I use it with libavformat?</a></li>
  81. <li><a id="toc-Where-is-the-documentation-about-ffv1_002c-msmpeg4_002c-asv1_002c-4xm_003f" href="#Where-is-the-documentation-about-ffv1_002c-msmpeg4_002c-asv1_002c-4xm_003f">4.12 Where is the documentation about ffv1, msmpeg4, asv1, 4xm?</a></li>
  82. <li><a id="toc-How-do-I-feed-H_002e263_002dRTP-_0028and-other-codecs-in-RTP_0029-to-libavcodec_003f" href="#How-do-I-feed-H_002e263_002dRTP-_0028and-other-codecs-in-RTP_0029-to-libavcodec_003f">4.13 How do I feed H.263-RTP (and other codecs in RTP) to libavcodec?</a></li>
  83. <li><a id="toc-AVStream_002er_005fframe_005frate-is-wrong_002c-it-is-much-larger-than-the-frame-rate_002e" href="#AVStream_002er_005fframe_005frate-is-wrong_002c-it-is-much-larger-than-the-frame-rate_002e">4.14 AVStream.r_frame_rate is wrong, it is much larger than the frame rate.</a></li>
  84. <li><a id="toc-Why-is-make-fate-not-running-all-tests_003f" href="#Why-is-make-fate-not-running-all-tests_003f">4.15 Why is <code>make fate</code> not running all tests?</a></li>
  85. <li><a id="toc-Why-is-make-fate-not-finding-the-samples_003f" href="#Why-is-make-fate-not-finding-the-samples_003f">4.16 Why is <code>make fate</code> not finding the samples?</a></li>
  86. </ul></li>
  87. </ul>
  88. </div>
  89. <a name="General-Questions"></a>
  90. <h2 class="chapter">1 General Questions<span class="pull-right"><a class="anchor hidden-xs" href="#General-Questions" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-General-Questions" aria-hidden="true">TOC</a></span></h2>
  91. <a name="Why-doesn_0027t-FFmpeg-support-feature-_005bxyz_005d_003f"></a>
  92. <h3 class="section">1.1 Why doesn&rsquo;t FFmpeg support feature [xyz]?<span class="pull-right"><a class="anchor hidden-xs" href="#Why-doesn_0027t-FFmpeg-support-feature-_005bxyz_005d_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Why-doesn_0027t-FFmpeg-support-feature-_005bxyz_005d_003f" aria-hidden="true">TOC</a></span></h3>
  93. <p>Because no one has taken on that task yet. FFmpeg development is
  94. driven by the tasks that are important to the individual developers.
  95. If there is a feature that is important to you, the best way to get
  96. it implemented is to undertake the task yourself or sponsor a developer.
  97. </p>
  98. <a name="FFmpeg-does-not-support-codec-XXX_002e-Can-you-include-a-Windows-DLL-loader-to-support-it_003f"></a>
  99. <h3 class="section">1.2 FFmpeg does not support codec XXX. Can you include a Windows DLL loader to support it?<span class="pull-right"><a class="anchor hidden-xs" href="#FFmpeg-does-not-support-codec-XXX_002e-Can-you-include-a-Windows-DLL-loader-to-support-it_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-FFmpeg-does-not-support-codec-XXX_002e-Can-you-include-a-Windows-DLL-loader-to-support-it_003f" aria-hidden="true">TOC</a></span></h3>
  100. <p>No. Windows DLLs are not portable, bloated and often slow.
  101. Moreover FFmpeg strives to support all codecs natively.
  102. A DLL loader is not conducive to that goal.
  103. </p>
  104. <a name="I-cannot-read-this-file-although-this-format-seems-to-be-supported-by-ffmpeg_002e"></a>
  105. <h3 class="section">1.3 I cannot read this file although this format seems to be supported by ffmpeg.<span class="pull-right"><a class="anchor hidden-xs" href="#I-cannot-read-this-file-although-this-format-seems-to-be-supported-by-ffmpeg_002e" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-I-cannot-read-this-file-although-this-format-seems-to-be-supported-by-ffmpeg_002e" aria-hidden="true">TOC</a></span></h3>
  106. <p>Even if ffmpeg can read the container format, it may not support all its
  107. codecs. Please consult the supported codec list in the ffmpeg
  108. documentation.
  109. </p>
  110. <a name="Which-codecs-are-supported-by-Windows_003f"></a>
  111. <h3 class="section">1.4 Which codecs are supported by Windows?<span class="pull-right"><a class="anchor hidden-xs" href="#Which-codecs-are-supported-by-Windows_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Which-codecs-are-supported-by-Windows_003f" aria-hidden="true">TOC</a></span></h3>
  112. <p>Windows does not support standard formats like MPEG very well, unless you
  113. install some additional codecs.
  114. </p>
  115. <p>The following list of video codecs should work on most Windows systems:
  116. </p><dl compact="compact">
  117. <dt><samp>msmpeg4v2</samp></dt>
  118. <dd><p>.avi/.asf
  119. </p></dd>
  120. <dt><samp>msmpeg4</samp></dt>
  121. <dd><p>.asf only
  122. </p></dd>
  123. <dt><samp>wmv1</samp></dt>
  124. <dd><p>.asf only
  125. </p></dd>
  126. <dt><samp>wmv2</samp></dt>
  127. <dd><p>.asf only
  128. </p></dd>
  129. <dt><samp>mpeg4</samp></dt>
  130. <dd><p>Only if you have some MPEG-4 codec like ffdshow or Xvid installed.
  131. </p></dd>
  132. <dt><samp>mpeg1video</samp></dt>
  133. <dd><p>.mpg only
  134. </p></dd>
  135. </dl>
  136. <p>Note, ASF files often have .wmv or .wma extensions in Windows. It should also
  137. be mentioned that Microsoft claims a patent on the ASF format, and may sue
  138. or threaten users who create ASF files with non-Microsoft software. It is
  139. strongly advised to avoid ASF where possible.
  140. </p>
  141. <p>The following list of audio codecs should work on most Windows systems:
  142. </p><dl compact="compact">
  143. <dt><samp>adpcm_ima_wav</samp></dt>
  144. <dt><samp>adpcm_ms</samp></dt>
  145. <dt><samp>pcm_s16le</samp></dt>
  146. <dd><p>always
  147. </p></dd>
  148. <dt><samp>libmp3lame</samp></dt>
  149. <dd><p>If some MP3 codec like LAME is installed.
  150. </p></dd>
  151. </dl>
  152. <a name="Compilation"></a>
  153. <h2 class="chapter">2 Compilation<span class="pull-right"><a class="anchor hidden-xs" href="#Compilation" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Compilation" aria-hidden="true">TOC</a></span></h2>
  154. <a name="error_003a-can_0027t-find-a-register-in-class-_0027GENERAL_005fREGS_0027-while-reloading-_0027asm_0027"></a>
  155. <h3 class="section">2.1 <code>error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'</code><span class="pull-right"><a class="anchor hidden-xs" href="#error_003a-can_0027t-find-a-register-in-class-_0027GENERAL_005fREGS_0027-while-reloading-_0027asm_0027" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-error_003a-can_0027t-find-a-register-in-class-_0027GENERAL_005fREGS_0027-while-reloading-_0027asm_0027" aria-hidden="true">TOC</a></span></h3>
  156. <p>This is a bug in gcc. Do not report it to us. Instead, please report it to
  157. the gcc developers. Note that we will not add workarounds for gcc bugs.
  158. </p>
  159. <p>Also note that (some of) the gcc developers believe this is not a bug or
  160. not a bug they should fix:
  161. <a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=11203">https://gcc.gnu.org/bugzilla/show_bug.cgi?id=11203</a>.
  162. Then again, some of them do not know the difference between an undecidable
  163. problem and an NP-hard problem...
  164. </p>
  165. <a name="I-have-installed-this-library-with-my-distro_0027s-package-manager_002e-Why-does-configure-not-see-it_003f"></a>
  166. <h3 class="section">2.2 I have installed this library with my distro&rsquo;s package manager. Why does <code>configure</code> not see it?<span class="pull-right"><a class="anchor hidden-xs" href="#I-have-installed-this-library-with-my-distro_0027s-package-manager_002e-Why-does-configure-not-see-it_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-I-have-installed-this-library-with-my-distro_0027s-package-manager_002e-Why-does-configure-not-see-it_003f" aria-hidden="true">TOC</a></span></h3>
  167. <p>Distributions usually split libraries in several packages. The main package
  168. contains the files necessary to run programs using the library. The
  169. development package contains the files necessary to build programs using the
  170. library. Sometimes, docs and/or data are in a separate package too.
  171. </p>
  172. <p>To build FFmpeg, you need to install the development package. It is usually
  173. called <samp>libfoo-dev</samp> or <samp>libfoo-devel</samp>. You can remove it after the
  174. build is finished, but be sure to keep the main package.
  175. </p>
  176. <a name="How-do-I-make-pkg_002dconfig-find-my-libraries_003f"></a>
  177. <h3 class="section">2.3 How do I make <code>pkg-config</code> find my libraries?<span class="pull-right"><a class="anchor hidden-xs" href="#How-do-I-make-pkg_002dconfig-find-my-libraries_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-do-I-make-pkg_002dconfig-find-my-libraries_003f" aria-hidden="true">TOC</a></span></h3>
  178. <p>Somewhere along with your libraries, there is a <samp>.pc</samp> file (or several)
  179. in a <samp>pkgconfig</samp> directory. You need to set environment variables to
  180. point <code>pkg-config</code> to these files.
  181. </p>
  182. <p>If you need to <em>add</em> directories to <code>pkg-config</code>&rsquo;s search list
  183. (typical use case: library installed separately), add it to
  184. <code>$PKG_CONFIG_PATH</code>:
  185. </p>
  186. <div class="example">
  187. <pre class="example">export PKG_CONFIG_PATH=/opt/x264/lib/pkgconfig:/opt/opus/lib/pkgconfig
  188. </pre></div>
  189. <p>If you need to <em>replace</em> <code>pkg-config</code>&rsquo;s search list
  190. (typical use case: cross-compiling), set it in
  191. <code>$PKG_CONFIG_LIBDIR</code>:
  192. </p>
  193. <div class="example">
  194. <pre class="example">export PKG_CONFIG_LIBDIR=/home/me/cross/usr/lib/pkgconfig:/home/me/cross/usr/local/lib/pkgconfig
  195. </pre></div>
  196. <p>If you need to know the library&rsquo;s internal dependencies (typical use: static
  197. linking), add the <code>--static</code> option to <code>pkg-config</code>:
  198. </p>
  199. <div class="example">
  200. <pre class="example">./configure --pkg-config-flags=--static
  201. </pre></div>
  202. <a name="How-do-I-use-pkg_002dconfig-when-cross_002dcompiling_003f"></a>
  203. <h3 class="section">2.4 How do I use <code>pkg-config</code> when cross-compiling?<span class="pull-right"><a class="anchor hidden-xs" href="#How-do-I-use-pkg_002dconfig-when-cross_002dcompiling_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-do-I-use-pkg_002dconfig-when-cross_002dcompiling_003f" aria-hidden="true">TOC</a></span></h3>
  204. <p>The best way is to install <code>pkg-config</code> in your cross-compilation
  205. environment. It will automatically use the cross-compilation libraries.
  206. </p>
  207. <p>You can also use <code>pkg-config</code> from the host environment by
  208. specifying explicitly <code>--pkg-config=pkg-config</code> to <code>configure</code>.
  209. In that case, you must point <code>pkg-config</code> to the correct directories
  210. using the <code>PKG_CONFIG_LIBDIR</code>, as explained in the previous entry.
  211. </p>
  212. <p>As an intermediate solution, you can place in your cross-compilation
  213. environment a script that calls the host <code>pkg-config</code> with
  214. <code>PKG_CONFIG_LIBDIR</code> set. That script can look like that:
  215. </p>
  216. <div class="example">
  217. <pre class="example">#!/bin/sh
  218. PKG_CONFIG_LIBDIR=/path/to/cross/lib/pkgconfig
  219. export PKG_CONFIG_LIBDIR
  220. exec /usr/bin/pkg-config &quot;$@&quot;
  221. </pre></div>
  222. <a name="Usage"></a>
  223. <h2 class="chapter">3 Usage<span class="pull-right"><a class="anchor hidden-xs" href="#Usage" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Usage" aria-hidden="true">TOC</a></span></h2>
  224. <a name="ffmpeg-does-not-work_003b-what-is-wrong_003f"></a>
  225. <h3 class="section">3.1 ffmpeg does not work; what is wrong?<span class="pull-right"><a class="anchor hidden-xs" href="#ffmpeg-does-not-work_003b-what-is-wrong_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-ffmpeg-does-not-work_003b-what-is-wrong_003f" aria-hidden="true">TOC</a></span></h3>
  226. <p>Try a <code>make distclean</code> in the ffmpeg source directory before the build.
  227. If this does not help see
  228. (<a href="https://ffmpeg.org/bugreports.html">https://ffmpeg.org/bugreports.html</a>).
  229. </p>
  230. <a name="How-do-I-encode-single-pictures-into-movies_003f"></a>
  231. <h3 class="section">3.2 How do I encode single pictures into movies?<span class="pull-right"><a class="anchor hidden-xs" href="#How-do-I-encode-single-pictures-into-movies_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-do-I-encode-single-pictures-into-movies_003f" aria-hidden="true">TOC</a></span></h3>
  232. <p>First, rename your pictures to follow a numerical sequence.
  233. For example, img1.jpg, img2.jpg, img3.jpg,...
  234. Then you may run:
  235. </p>
  236. <div class="example">
  237. <pre class="example">ffmpeg -f image2 -i img%d.jpg /tmp/a.mpg
  238. </pre></div>
  239. <p>Notice that &lsquo;<samp>%d</samp>&rsquo; is replaced by the image number.
  240. </p>
  241. <p><samp>img%03d.jpg</samp> means the sequence <samp>img001.jpg</samp>, <samp>img002.jpg</samp>, etc.
  242. </p>
  243. <p>Use the <samp>-start_number</samp> option to declare a starting number for
  244. the sequence. This is useful if your sequence does not start with
  245. <samp>img001.jpg</samp> but is still in a numerical order. The following
  246. example will start with <samp>img100.jpg</samp>:
  247. </p>
  248. <div class="example">
  249. <pre class="example">ffmpeg -f image2 -start_number 100 -i img%d.jpg /tmp/a.mpg
  250. </pre></div>
  251. <p>If you have large number of pictures to rename, you can use the
  252. following command to ease the burden. The command, using the bourne
  253. shell syntax, symbolically links all files in the current directory
  254. that match <code>*jpg</code> to the <samp>/tmp</samp> directory in the sequence of
  255. <samp>img001.jpg</samp>, <samp>img002.jpg</samp> and so on.
  256. </p>
  257. <div class="example">
  258. <pre class="example">x=1; for i in *jpg; do counter=$(printf %03d $x); ln -s &quot;$i&quot; /tmp/img&quot;$counter&quot;.jpg; x=$(($x+1)); done
  259. </pre></div>
  260. <p>If you want to sequence them by oldest modified first, substitute
  261. <code>$(ls -r -t *jpg)</code> in place of <code>*jpg</code>.
  262. </p>
  263. <p>Then run:
  264. </p>
  265. <div class="example">
  266. <pre class="example">ffmpeg -f image2 -i /tmp/img%03d.jpg /tmp/a.mpg
  267. </pre></div>
  268. <p>The same logic is used for any image format that ffmpeg reads.
  269. </p>
  270. <p>You can also use <code>cat</code> to pipe images to ffmpeg:
  271. </p>
  272. <div class="example">
  273. <pre class="example">cat *.jpg | ffmpeg -f image2pipe -c:v mjpeg -i - output.mpg
  274. </pre></div>
  275. <a name="How-do-I-encode-movie-to-single-pictures_003f"></a>
  276. <h3 class="section">3.3 How do I encode movie to single pictures?<span class="pull-right"><a class="anchor hidden-xs" href="#How-do-I-encode-movie-to-single-pictures_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-do-I-encode-movie-to-single-pictures_003f" aria-hidden="true">TOC</a></span></h3>
  277. <p>Use:
  278. </p>
  279. <div class="example">
  280. <pre class="example">ffmpeg -i movie.mpg movie%d.jpg
  281. </pre></div>
  282. <p>The <samp>movie.mpg</samp> used as input will be converted to
  283. <samp>movie1.jpg</samp>, <samp>movie2.jpg</samp>, etc...
  284. </p>
  285. <p>Instead of relying on file format self-recognition, you may also use
  286. </p><dl compact="compact">
  287. <dt><samp>-c:v ppm</samp></dt>
  288. <dt><samp>-c:v png</samp></dt>
  289. <dt><samp>-c:v mjpeg</samp></dt>
  290. </dl>
  291. <p>to force the encoding.
  292. </p>
  293. <p>Applying that to the previous example:
  294. </p><div class="example">
  295. <pre class="example">ffmpeg -i movie.mpg -f image2 -c:v mjpeg menu%d.jpg
  296. </pre></div>
  297. <p>Beware that there is no &quot;jpeg&quot; codec. Use &quot;mjpeg&quot; instead.
  298. </p>
  299. <a name="Why-do-I-see-a-slight-quality-degradation-with-multithreaded-MPEG_002a-encoding_003f"></a>
  300. <h3 class="section">3.4 Why do I see a slight quality degradation with multithreaded MPEG* encoding?<span class="pull-right"><a class="anchor hidden-xs" href="#Why-do-I-see-a-slight-quality-degradation-with-multithreaded-MPEG_002a-encoding_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Why-do-I-see-a-slight-quality-degradation-with-multithreaded-MPEG_002a-encoding_003f" aria-hidden="true">TOC</a></span></h3>
  301. <p>For multithreaded MPEG* encoding, the encoded slices must be independent,
  302. otherwise thread n would practically have to wait for n-1 to finish, so it&rsquo;s
  303. quite logical that there is a small reduction of quality. This is not a bug.
  304. </p>
  305. <a name="How-can-I-read-from-the-standard-input-or-write-to-the-standard-output_003f"></a>
  306. <h3 class="section">3.5 How can I read from the standard input or write to the standard output?<span class="pull-right"><a class="anchor hidden-xs" href="#How-can-I-read-from-the-standard-input-or-write-to-the-standard-output_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-can-I-read-from-the-standard-input-or-write-to-the-standard-output_003f" aria-hidden="true">TOC</a></span></h3>
  307. <p>Use <samp>-</samp> as file name.
  308. </p>
  309. <a name="g_t_002df-jpeg-doesn_0027t-work_002e"></a>
  310. <h3 class="section">3.6 -f jpeg doesn&rsquo;t work.<span class="pull-right"><a class="anchor hidden-xs" href="#_002df-jpeg-doesn_0027t-work_002e" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-_002df-jpeg-doesn_0027t-work_002e" aria-hidden="true">TOC</a></span></h3>
  311. <p>Try &rsquo;-f image2 test%d.jpg&rsquo;.
  312. </p>
  313. <a name="Why-can-I-not-change-the-frame-rate_003f"></a>
  314. <h3 class="section">3.7 Why can I not change the frame rate?<span class="pull-right"><a class="anchor hidden-xs" href="#Why-can-I-not-change-the-frame-rate_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Why-can-I-not-change-the-frame-rate_003f" aria-hidden="true">TOC</a></span></h3>
  315. <p>Some codecs, like MPEG-1/2, only allow a small number of fixed frame rates.
  316. Choose a different codec with the -c:v command line option.
  317. </p>
  318. <a name="How-do-I-encode-Xvid-or-DivX-video-with-ffmpeg_003f"></a>
  319. <h3 class="section">3.8 How do I encode Xvid or DivX video with ffmpeg?<span class="pull-right"><a class="anchor hidden-xs" href="#How-do-I-encode-Xvid-or-DivX-video-with-ffmpeg_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-do-I-encode-Xvid-or-DivX-video-with-ffmpeg_003f" aria-hidden="true">TOC</a></span></h3>
  320. <p>Both Xvid and DivX (version 4+) are implementations of the ISO MPEG-4
  321. standard (note that there are many other coding formats that use this
  322. same standard). Thus, use &rsquo;-c:v mpeg4&rsquo; to encode in these formats. The
  323. default fourcc stored in an MPEG-4-coded file will be &rsquo;FMP4&rsquo;. If you want
  324. a different fourcc, use the &rsquo;-vtag&rsquo; option. E.g., &rsquo;-vtag xvid&rsquo; will
  325. force the fourcc &rsquo;xvid&rsquo; to be stored as the video fourcc rather than the
  326. default.
  327. </p>
  328. <a name="Which-are-good-parameters-for-encoding-high-quality-MPEG_002d4_003f"></a>
  329. <h3 class="section">3.9 Which are good parameters for encoding high quality MPEG-4?<span class="pull-right"><a class="anchor hidden-xs" href="#Which-are-good-parameters-for-encoding-high-quality-MPEG_002d4_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Which-are-good-parameters-for-encoding-high-quality-MPEG_002d4_003f" aria-hidden="true">TOC</a></span></h3>
  330. <p>&rsquo;-mbd rd -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2 -g 300 -pass 1/2&rsquo;,
  331. things to try: &rsquo;-bf 2&rsquo;, &rsquo;-mpv_flags qp_rd&rsquo;, &rsquo;-mpv_flags mv0&rsquo;, &rsquo;-mpv_flags skip_rd&rsquo;.
  332. </p>
  333. <a name="Which-are-good-parameters-for-encoding-high-quality-MPEG_002d1_002fMPEG_002d2_003f"></a>
  334. <h3 class="section">3.10 Which are good parameters for encoding high quality MPEG-1/MPEG-2?<span class="pull-right"><a class="anchor hidden-xs" href="#Which-are-good-parameters-for-encoding-high-quality-MPEG_002d1_002fMPEG_002d2_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Which-are-good-parameters-for-encoding-high-quality-MPEG_002d1_002fMPEG_002d2_003f" aria-hidden="true">TOC</a></span></h3>
  335. <p>&rsquo;-mbd rd -trellis 2 -cmp 2 -subcmp 2 -g 100 -pass 1/2&rsquo;
  336. but beware the &rsquo;-g 100&rsquo; might cause problems with some decoders.
  337. Things to try: &rsquo;-bf 2&rsquo;, &rsquo;-mpv_flags qp_rd&rsquo;, &rsquo;-mpv_flags mv0&rsquo;, &rsquo;-mpv_flags skip_rd&rsquo;.
  338. </p>
  339. <a name="Interlaced-video-looks-very-bad-when-encoded-with-ffmpeg_002c-what-is-wrong_003f"></a>
  340. <h3 class="section">3.11 Interlaced video looks very bad when encoded with ffmpeg, what is wrong?<span class="pull-right"><a class="anchor hidden-xs" href="#Interlaced-video-looks-very-bad-when-encoded-with-ffmpeg_002c-what-is-wrong_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Interlaced-video-looks-very-bad-when-encoded-with-ffmpeg_002c-what-is-wrong_003f" aria-hidden="true">TOC</a></span></h3>
  341. <p>You should use &rsquo;-flags +ilme+ildct&rsquo; and maybe &rsquo;-flags +alt&rsquo; for interlaced
  342. material, and try &rsquo;-top 0/1&rsquo; if the result looks really messed-up.
  343. </p>
  344. <a name="How-can-I-read-DirectShow-files_003f"></a>
  345. <h3 class="section">3.12 How can I read DirectShow files?<span class="pull-right"><a class="anchor hidden-xs" href="#How-can-I-read-DirectShow-files_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-can-I-read-DirectShow-files_003f" aria-hidden="true">TOC</a></span></h3>
  346. <p>If you have built FFmpeg with <code>./configure --enable-avisynth</code>
  347. (only possible on MinGW/Cygwin platforms),
  348. then you may use any file that DirectShow can read as input.
  349. </p>
  350. <p>Just create an &quot;input.avs&quot; text file with this single line ...
  351. </p><div class="example">
  352. <pre class="example">DirectShowSource(&quot;C:\path to your file\yourfile.asf&quot;)
  353. </pre></div>
  354. <p>... and then feed that text file to ffmpeg:
  355. </p><div class="example">
  356. <pre class="example">ffmpeg -i input.avs
  357. </pre></div>
  358. <p>For ANY other help on AviSynth, please visit the
  359. <a href="http://www.avisynth.org/">AviSynth homepage</a>.
  360. </p>
  361. <a name="How-can-I-join-video-files_003f"></a>
  362. <h3 class="section">3.13 How can I join video files?<span class="pull-right"><a class="anchor hidden-xs" href="#How-can-I-join-video-files_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-can-I-join-video-files_003f" aria-hidden="true">TOC</a></span></h3>
  363. <p>To &quot;join&quot; video files is quite ambiguous. The following list explains the
  364. different kinds of &quot;joining&quot; and points out how those are addressed in
  365. FFmpeg. To join video files may mean:
  366. </p>
  367. <ul>
  368. <li> To put them one after the other: this is called to <em>concatenate</em> them
  369. (in short: concat) and is addressed
  370. <a href="#How-can-I-concatenate-video-files">in this very faq</a>.
  371. </li><li> To put them together in the same file, to let the user choose between the
  372. different versions (example: different audio languages): this is called to
  373. <em>multiplex</em> them together (in short: mux), and is done by simply
  374. invoking ffmpeg with several <samp>-i</samp> options.
  375. </li><li> For audio, to put all channels together in a single stream (example: two
  376. mono streams into one stereo stream): this is sometimes called to
  377. <em>merge</em> them, and can be done using the
  378. <a href="ffmpeg-filters.html#amerge"><code>amerge</code></a> filter.
  379. </li><li> For audio, to play one on top of the other: this is called to <em>mix</em>
  380. them, and can be done by first merging them into a single stream and then
  381. using the <a href="ffmpeg-filters.html#pan"><code>pan</code></a> filter to mix
  382. the channels at will.
  383. </li><li> For video, to display both together, side by side or one on top of a part of
  384. the other; it can be done using the
  385. <a href="ffmpeg-filters.html#overlay"><code>overlay</code></a> video filter.
  386. </li></ul>
  387. <span id="How-can-I-concatenate-video-files"></span><a name="How-can-I-concatenate-video-files_003f"></a>
  388. <h3 class="section">3.14 How can I concatenate video files?<span class="pull-right"><a class="anchor hidden-xs" href="#How-can-I-concatenate-video-files_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-can-I-concatenate-video-files_003f" aria-hidden="true">TOC</a></span></h3>
  389. <p>There are several solutions, depending on the exact circumstances.
  390. </p>
  391. <a name="Concatenating-using-the-concat-filter"></a>
  392. <h4 class="subsection">3.14.1 Concatenating using the concat <em>filter</em><span class="pull-right"><a class="anchor hidden-xs" href="#Concatenating-using-the-concat-filter" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Concatenating-using-the-concat-filter" aria-hidden="true">TOC</a></span></h4>
  393. <p>FFmpeg has a <a href="ffmpeg-filters.html#concat"><code>concat</code></a> filter designed specifically for that, with examples in the
  394. documentation. This operation is recommended if you need to re-encode.
  395. </p>
  396. <a name="Concatenating-using-the-concat-demuxer"></a>
  397. <h4 class="subsection">3.14.2 Concatenating using the concat <em>demuxer</em><span class="pull-right"><a class="anchor hidden-xs" href="#Concatenating-using-the-concat-demuxer" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Concatenating-using-the-concat-demuxer" aria-hidden="true">TOC</a></span></h4>
  398. <p>FFmpeg has a <a href="ffmpeg-formats.html#concat"><code>concat</code></a> demuxer which you can use when you want to avoid a re-encode and
  399. your format doesn&rsquo;t support file level concatenation.
  400. </p>
  401. <a name="Concatenating-using-the-concat-protocol-_0028file-level_0029"></a>
  402. <h4 class="subsection">3.14.3 Concatenating using the concat <em>protocol</em> (file level)<span class="pull-right"><a class="anchor hidden-xs" href="#Concatenating-using-the-concat-protocol-_0028file-level_0029" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Concatenating-using-the-concat-protocol-_0028file-level_0029" aria-hidden="true">TOC</a></span></h4>
  403. <p>FFmpeg has a <a href="ffmpeg-protocols.html#concat"><code>concat</code></a> protocol designed specifically for that, with examples in the
  404. documentation.
  405. </p>
  406. <p>A few multimedia containers (MPEG-1, MPEG-2 PS, DV) allow one to concatenate
  407. video by merely concatenating the files containing them.
  408. </p>
  409. <p>Hence you may concatenate your multimedia files by first transcoding them to
  410. these privileged formats, then using the humble <code>cat</code> command (or the
  411. equally humble <code>copy</code> under Windows), and finally transcoding back to your
  412. format of choice.
  413. </p>
  414. <div class="example">
  415. <pre class="example">ffmpeg -i input1.avi -qscale:v 1 intermediate1.mpg
  416. ffmpeg -i input2.avi -qscale:v 1 intermediate2.mpg
  417. cat intermediate1.mpg intermediate2.mpg &gt; intermediate_all.mpg
  418. ffmpeg -i intermediate_all.mpg -qscale:v 2 output.avi
  419. </pre></div>
  420. <p>Additionally, you can use the <code>concat</code> protocol instead of <code>cat</code> or
  421. <code>copy</code> which will avoid creation of a potentially huge intermediate file.
  422. </p>
  423. <div class="example">
  424. <pre class="example">ffmpeg -i input1.avi -qscale:v 1 intermediate1.mpg
  425. ffmpeg -i input2.avi -qscale:v 1 intermediate2.mpg
  426. ffmpeg -i concat:&quot;intermediate1.mpg|intermediate2.mpg&quot; -c copy intermediate_all.mpg
  427. ffmpeg -i intermediate_all.mpg -qscale:v 2 output.avi
  428. </pre></div>
  429. <p>Note that you may need to escape the character &quot;|&quot; which is special for many
  430. shells.
  431. </p>
  432. <p>Another option is usage of named pipes, should your platform support it:
  433. </p>
  434. <div class="example">
  435. <pre class="example">mkfifo intermediate1.mpg
  436. mkfifo intermediate2.mpg
  437. ffmpeg -i input1.avi -qscale:v 1 -y intermediate1.mpg &lt; /dev/null &amp;
  438. ffmpeg -i input2.avi -qscale:v 1 -y intermediate2.mpg &lt; /dev/null &amp;
  439. cat intermediate1.mpg intermediate2.mpg |\
  440. ffmpeg -f mpeg -i - -c:v mpeg4 -c:a libmp3lame output.avi
  441. </pre></div>
  442. <a name="Concatenating-using-raw-audio-and-video"></a>
  443. <h4 class="subsection">3.14.4 Concatenating using raw audio and video<span class="pull-right"><a class="anchor hidden-xs" href="#Concatenating-using-raw-audio-and-video" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Concatenating-using-raw-audio-and-video" aria-hidden="true">TOC</a></span></h4>
  444. <p>Similarly, the yuv4mpegpipe format, and the raw video, raw audio codecs also
  445. allow concatenation, and the transcoding step is almost lossless.
  446. When using multiple yuv4mpegpipe(s), the first line needs to be discarded
  447. from all but the first stream. This can be accomplished by piping through
  448. <code>tail</code> as seen below. Note that when piping through <code>tail</code> you
  449. must use command grouping, <code>{ ;}</code>, to background properly.
  450. </p>
  451. <p>For example, let&rsquo;s say we want to concatenate two FLV files into an
  452. output.flv file:
  453. </p>
  454. <div class="example">
  455. <pre class="example">mkfifo temp1.a
  456. mkfifo temp1.v
  457. mkfifo temp2.a
  458. mkfifo temp2.v
  459. mkfifo all.a
  460. mkfifo all.v
  461. ffmpeg -i input1.flv -vn -f u16le -c:a pcm_s16le -ac 2 -ar 44100 - &gt; temp1.a &lt; /dev/null &amp;
  462. ffmpeg -i input2.flv -vn -f u16le -c:a pcm_s16le -ac 2 -ar 44100 - &gt; temp2.a &lt; /dev/null &amp;
  463. ffmpeg -i input1.flv -an -f yuv4mpegpipe - &gt; temp1.v &lt; /dev/null &amp;
  464. { ffmpeg -i input2.flv -an -f yuv4mpegpipe - &lt; /dev/null | tail -n +2 &gt; temp2.v ; } &amp;
  465. cat temp1.a temp2.a &gt; all.a &amp;
  466. cat temp1.v temp2.v &gt; all.v &amp;
  467. ffmpeg -f u16le -c:a pcm_s16le -ac 2 -ar 44100 -i all.a \
  468. -f yuv4mpegpipe -i all.v \
  469. -y output.flv
  470. rm temp[12].[av] all.[av]
  471. </pre></div>
  472. <a name="Using-_002df-lavfi_002c-audio-becomes-mono-for-no-apparent-reason_002e"></a>
  473. <h3 class="section">3.15 Using <samp>-f lavfi</samp>, audio becomes mono for no apparent reason.<span class="pull-right"><a class="anchor hidden-xs" href="#Using-_002df-lavfi_002c-audio-becomes-mono-for-no-apparent-reason_002e" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Using-_002df-lavfi_002c-audio-becomes-mono-for-no-apparent-reason_002e" aria-hidden="true">TOC</a></span></h3>
  474. <p>Use <samp>-dumpgraph -</samp> to find out exactly where the channel layout is
  475. lost.
  476. </p>
  477. <p>Most likely, it is through <code>auto-inserted aresample</code>. Try to understand
  478. why the converting filter was needed at that place.
  479. </p>
  480. <p>Just before the output is a likely place, as <samp>-f lavfi</samp> currently
  481. only support packed S16.
  482. </p>
  483. <p>Then insert the correct <code>aformat</code> explicitly in the filtergraph,
  484. specifying the exact format.
  485. </p>
  486. <div class="example">
  487. <pre class="example">aformat=sample_fmts=s16:channel_layouts=stereo
  488. </pre></div>
  489. <a name="Why-does-FFmpeg-not-see-the-subtitles-in-my-VOB-file_003f"></a>
  490. <h3 class="section">3.16 Why does FFmpeg not see the subtitles in my VOB file?<span class="pull-right"><a class="anchor hidden-xs" href="#Why-does-FFmpeg-not-see-the-subtitles-in-my-VOB-file_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Why-does-FFmpeg-not-see-the-subtitles-in-my-VOB-file_003f" aria-hidden="true">TOC</a></span></h3>
  491. <p>VOB and a few other formats do not have a global header that describes
  492. everything present in the file. Instead, applications are supposed to scan
  493. the file to see what it contains. Since VOB files are frequently large, only
  494. the beginning is scanned. If the subtitles happen only later in the file,
  495. they will not be initially detected.
  496. </p>
  497. <p>Some applications, including the <code>ffmpeg</code> command-line tool, can only
  498. work with streams that were detected during the initial scan; streams that
  499. are detected later are ignored.
  500. </p>
  501. <p>The size of the initial scan is controlled by two options: <code>probesize</code>
  502. (default ~5 Mo) and <code>analyzeduration</code> (default 5,000,000 µs = 5 s). For
  503. the subtitle stream to be detected, both values must be large enough.
  504. </p>
  505. <a name="Why-was-the-ffmpeg-_002dsameq-option-removed_003f-What-to-use-instead_003f"></a>
  506. <h3 class="section">3.17 Why was the <code>ffmpeg</code> <samp>-sameq</samp> option removed? What to use instead?<span class="pull-right"><a class="anchor hidden-xs" href="#Why-was-the-ffmpeg-_002dsameq-option-removed_003f-What-to-use-instead_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Why-was-the-ffmpeg-_002dsameq-option-removed_003f-What-to-use-instead_003f" aria-hidden="true">TOC</a></span></h3>
  507. <p>The <samp>-sameq</samp> option meant &quot;same quantizer&quot;, and made sense only in a
  508. very limited set of cases. Unfortunately, a lot of people mistook it for
  509. &quot;same quality&quot; and used it in places where it did not make sense: it had
  510. roughly the expected visible effect, but achieved it in a very inefficient
  511. way.
  512. </p>
  513. <p>Each encoder has its own set of options to set the quality-vs-size balance,
  514. use the options for the encoder you are using to set the quality level to a
  515. point acceptable for your tastes. The most common options to do that are
  516. <samp>-qscale</samp> and <samp>-qmax</samp>, but you should peruse the documentation
  517. of the encoder you chose.
  518. </p>
  519. <a name="I-have-a-stretched-video_002c-why-does-scaling-does-not-fix-it_003f"></a>
  520. <h3 class="section">3.18 I have a stretched video, why does scaling does not fix it?<span class="pull-right"><a class="anchor hidden-xs" href="#I-have-a-stretched-video_002c-why-does-scaling-does-not-fix-it_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-I-have-a-stretched-video_002c-why-does-scaling-does-not-fix-it_003f" aria-hidden="true">TOC</a></span></h3>
  521. <p>A lot of video codecs and formats can store the <em>aspect ratio</em> of the
  522. video: this is the ratio between the width and the height of either the full
  523. image (DAR, display aspect ratio) or individual pixels (SAR, sample aspect
  524. ratio). For example, EGA screens at resolution 640×350 had 4:3 DAR and 35:48
  525. SAR.
  526. </p>
  527. <p>Most still image processing work with square pixels, i.e. 1:1 SAR, but a lot
  528. of video standards, especially from the analogic-numeric transition era, use
  529. non-square pixels.
  530. </p>
  531. <p>Most processing filters in FFmpeg handle the aspect ratio to avoid
  532. stretching the image: cropping adjusts the DAR to keep the SAR constant,
  533. scaling adjusts the SAR to keep the DAR constant.
  534. </p>
  535. <p>If you want to stretch, or “unstretch”, the image, you need to override the
  536. information with the
  537. <a href="ffmpeg-filters.html#setdar_002c-setsar"><code>setdar or setsar filters</code></a>.
  538. </p>
  539. <p>Do not forget to examine carefully the original video to check whether the
  540. stretching comes from the image or from the aspect ratio information.
  541. </p>
  542. <p>For example, to fix a badly encoded EGA capture, use the following commands,
  543. either the first one to upscale to square pixels or the second one to set
  544. the correct aspect ratio or the third one to avoid transcoding (may not work
  545. depending on the format / codec / player / phase of the moon):
  546. </p>
  547. <div class="example">
  548. <pre class="example">ffmpeg -i ega_screen.nut -vf scale=640:480,setsar=1 ega_screen_scaled.nut
  549. ffmpeg -i ega_screen.nut -vf setdar=4/3 ega_screen_anamorphic.nut
  550. ffmpeg -i ega_screen.nut -aspect 4/3 -c copy ega_screen_overridden.nut
  551. </pre></div>
  552. <span id="background-task"></span><a name="How-do-I-run-ffmpeg-as-a-background-task_003f"></a>
  553. <h3 class="section">3.19 How do I run ffmpeg as a background task?<span class="pull-right"><a class="anchor hidden-xs" href="#How-do-I-run-ffmpeg-as-a-background-task_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-do-I-run-ffmpeg-as-a-background-task_003f" aria-hidden="true">TOC</a></span></h3>
  554. <p>ffmpeg normally checks the console input, for entries like &quot;q&quot; to stop
  555. and &quot;?&quot; to give help, while performing operations. ffmpeg does not have a way of
  556. detecting when it is running as a background task.
  557. When it checks the console input, that can cause the process running ffmpeg
  558. in the background to suspend.
  559. </p>
  560. <p>To prevent those input checks, allowing ffmpeg to run as a background task,
  561. use the <a href="ffmpeg.html#stdin-option"><code>-nostdin</code> option</a>
  562. in the ffmpeg invocation. This is effective whether you run ffmpeg in a shell
  563. or invoke ffmpeg in its own process via an operating system API.
  564. </p>
  565. <p>As an alternative, when you are running ffmpeg in a shell, you can redirect
  566. standard input to <code>/dev/null</code> (on Linux and macOS)
  567. or <code>NUL</code> (on Windows). You can do this redirect either
  568. on the ffmpeg invocation, or from a shell script which calls ffmpeg.
  569. </p>
  570. <p>For example:
  571. </p>
  572. <div class="example">
  573. <pre class="example">ffmpeg -nostdin -i INPUT OUTPUT
  574. </pre></div>
  575. <p>or (on Linux, macOS, and other UNIX-like shells):
  576. </p>
  577. <div class="example">
  578. <pre class="example">ffmpeg -i INPUT OUTPUT &lt;/dev/null
  579. </pre></div>
  580. <p>or (on Windows):
  581. </p>
  582. <div class="example">
  583. <pre class="example">ffmpeg -i INPUT OUTPUT &lt;NUL
  584. </pre></div>
  585. <a name="How-do-I-prevent-ffmpeg-from-suspending-with-a-message-like-suspended-_0028tty-output_0029_003f"></a>
  586. <h3 class="section">3.20 How do I prevent ffmpeg from suspending with a message like <em>suspended (tty output)</em>?<span class="pull-right"><a class="anchor hidden-xs" href="#How-do-I-prevent-ffmpeg-from-suspending-with-a-message-like-suspended-_0028tty-output_0029_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-do-I-prevent-ffmpeg-from-suspending-with-a-message-like-suspended-_0028tty-output_0029_003f" aria-hidden="true">TOC</a></span></h3>
  587. <p>If you run ffmpeg in the background, you may find that its process suspends.
  588. There may be a message like <em>suspended (tty output)</em>. The question is how
  589. to prevent the process from being suspended.
  590. </p>
  591. <p>For example:
  592. </p>
  593. <div class="example">
  594. <pre class="example">% ffmpeg -i INPUT OUTPUT &amp;&gt; ~/tmp/log.txt &amp;
  595. [1] 93352
  596. %
  597. [1] + suspended (tty output) ffmpeg -i INPUT OUTPUT &amp;&gt;
  598. </pre></div>
  599. <p>The message &quot;tty output&quot; notwithstanding, the problem here is that
  600. ffmpeg normally checks the console input when it runs. The operating system
  601. detects this, and suspends the process until you can bring it to the
  602. foreground and attend to it.
  603. </p>
  604. <p>The solution is to use the right techniques to tell ffmpeg not to consult
  605. console input. You can use the
  606. <a href="ffmpeg.html#stdin-option"><code>-nostdin</code> option</a>,
  607. or redirect standard input with <code>&lt; /dev/null</code>.
  608. See FAQ
  609. <a href="#background-task"><em>How do I run ffmpeg as a background task?</em></a>
  610. for details.
  611. </p>
  612. <a name="Development"></a>
  613. <h2 class="chapter">4 Development<span class="pull-right"><a class="anchor hidden-xs" href="#Development" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Development" aria-hidden="true">TOC</a></span></h2>
  614. <a name="Are-there-examples-illustrating-how-to-use-the-FFmpeg-libraries_002c-particularly-libavcodec-and-libavformat_003f"></a>
  615. <h3 class="section">4.1 Are there examples illustrating how to use the FFmpeg libraries, particularly libavcodec and libavformat?<span class="pull-right"><a class="anchor hidden-xs" href="#Are-there-examples-illustrating-how-to-use-the-FFmpeg-libraries_002c-particularly-libavcodec-and-libavformat_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Are-there-examples-illustrating-how-to-use-the-FFmpeg-libraries_002c-particularly-libavcodec-and-libavformat_003f" aria-hidden="true">TOC</a></span></h3>
  616. <p>Yes. Check the <samp>doc/examples</samp> directory in the source
  617. repository, also available online at:
  618. <a href="https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples">https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples</a>.
  619. </p>
  620. <p>Examples are also installed by default, usually in
  621. <code>$PREFIX/share/ffmpeg/examples</code>.
  622. </p>
  623. <p>Also you may read the Developers Guide of the FFmpeg documentation. Alternatively,
  624. examine the source code for one of the many open source projects that
  625. already incorporate FFmpeg at (<a href="projects.html">projects.html</a>).
  626. </p>
  627. <a name="Can-you-support-my-C-compiler-XXX_003f"></a>
  628. <h3 class="section">4.2 Can you support my C compiler XXX?<span class="pull-right"><a class="anchor hidden-xs" href="#Can-you-support-my-C-compiler-XXX_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Can-you-support-my-C-compiler-XXX_003f" aria-hidden="true">TOC</a></span></h3>
  629. <p>It depends. If your compiler is C99-compliant, then patches to support
  630. it are likely to be welcome if they do not pollute the source code
  631. with <code>#ifdef</code>s related to the compiler.
  632. </p>
  633. <a name="Is-Microsoft-Visual-C_002b_002b-supported_003f"></a>
  634. <h3 class="section">4.3 Is Microsoft Visual C++ supported?<span class="pull-right"><a class="anchor hidden-xs" href="#Is-Microsoft-Visual-C_002b_002b-supported_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Is-Microsoft-Visual-C_002b_002b-supported_003f" aria-hidden="true">TOC</a></span></h3>
  635. <p>Yes. Please see the <a href="platform.html">Microsoft Visual C++</a>
  636. section in the FFmpeg documentation.
  637. </p>
  638. <a name="Can-you-add-automake_002c-libtool-or-autoconf-support_003f"></a>
  639. <h3 class="section">4.4 Can you add automake, libtool or autoconf support?<span class="pull-right"><a class="anchor hidden-xs" href="#Can-you-add-automake_002c-libtool-or-autoconf-support_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Can-you-add-automake_002c-libtool-or-autoconf-support_003f" aria-hidden="true">TOC</a></span></h3>
  640. <p>No. These tools are too bloated and they complicate the build.
  641. </p>
  642. <a name="Why-not-rewrite-FFmpeg-in-object_002doriented-C_002b_002b_003f"></a>
  643. <h3 class="section">4.5 Why not rewrite FFmpeg in object-oriented C++?<span class="pull-right"><a class="anchor hidden-xs" href="#Why-not-rewrite-FFmpeg-in-object_002doriented-C_002b_002b_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Why-not-rewrite-FFmpeg-in-object_002doriented-C_002b_002b_003f" aria-hidden="true">TOC</a></span></h3>
  644. <p>FFmpeg is already organized in a highly modular manner and does not need to
  645. be rewritten in a formal object language. Further, many of the developers
  646. favor straight C; it works for them. For more arguments on this matter,
  647. read <a href="https://web.archive.org/web/20111004021423/http://kernel.org/pub/linux/docs/lkml/#s15">&quot;Programming Religion&quot;</a>.
  648. </p>
  649. <a name="Why-are-the-ffmpeg-programs-devoid-of-debugging-symbols_003f"></a>
  650. <h3 class="section">4.6 Why are the ffmpeg programs devoid of debugging symbols?<span class="pull-right"><a class="anchor hidden-xs" href="#Why-are-the-ffmpeg-programs-devoid-of-debugging-symbols_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Why-are-the-ffmpeg-programs-devoid-of-debugging-symbols_003f" aria-hidden="true">TOC</a></span></h3>
  651. <p>The build process creates <code>ffmpeg_g</code>, <code>ffplay_g</code>, etc. which
  652. contain full debug information. Those binaries are stripped to create
  653. <code>ffmpeg</code>, <code>ffplay</code>, etc. If you need the debug information, use
  654. the *_g versions.
  655. </p>
  656. <a name="I-do-not-like-the-LGPL_002c-can-I-contribute-code-under-the-GPL-instead_003f"></a>
  657. <h3 class="section">4.7 I do not like the LGPL, can I contribute code under the GPL instead?<span class="pull-right"><a class="anchor hidden-xs" href="#I-do-not-like-the-LGPL_002c-can-I-contribute-code-under-the-GPL-instead_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-I-do-not-like-the-LGPL_002c-can-I-contribute-code-under-the-GPL-instead_003f" aria-hidden="true">TOC</a></span></h3>
  658. <p>Yes, as long as the code is optional and can easily and cleanly be placed
  659. under #if CONFIG_GPL without breaking anything. So, for example, a new codec
  660. or filter would be OK under GPL while a bug fix to LGPL code would not.
  661. </p>
  662. <a name="I_0027m-using-FFmpeg-from-within-my-C-application-but-the-linker-complains-about-missing-symbols-from-the-libraries-themselves_002e"></a>
  663. <h3 class="section">4.8 I&rsquo;m using FFmpeg from within my C application but the linker complains about missing symbols from the libraries themselves.<span class="pull-right"><a class="anchor hidden-xs" href="#I_0027m-using-FFmpeg-from-within-my-C-application-but-the-linker-complains-about-missing-symbols-from-the-libraries-themselves_002e" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-I_0027m-using-FFmpeg-from-within-my-C-application-but-the-linker-complains-about-missing-symbols-from-the-libraries-themselves_002e" aria-hidden="true">TOC</a></span></h3>
  664. <p>FFmpeg builds static libraries by default. In static libraries, dependencies
  665. are not handled. That has two consequences. First, you must specify the
  666. libraries in dependency order: <code>-lavdevice</code> must come before
  667. <code>-lavformat</code>, <code>-lavutil</code> must come after everything else, etc.
  668. Second, external libraries that are used in FFmpeg have to be specified too.
  669. </p>
  670. <p>An easy way to get the full list of required libraries in dependency order
  671. is to use <code>pkg-config</code>.
  672. </p>
  673. <div class="example">
  674. <pre class="example">c99 -o program program.c $(pkg-config --cflags --libs libavformat libavcodec)
  675. </pre></div>
  676. <p>See <samp>doc/example/Makefile</samp> and <samp>doc/example/pc-uninstalled</samp> for
  677. more details.
  678. </p>
  679. <a name="I_0027m-using-FFmpeg-from-within-my-C_002b_002b-application-but-the-linker-complains-about-missing-symbols-which-seem-to-be-available_002e"></a>
  680. <h3 class="section">4.9 I&rsquo;m using FFmpeg from within my C++ application but the linker complains about missing symbols which seem to be available.<span class="pull-right"><a class="anchor hidden-xs" href="#I_0027m-using-FFmpeg-from-within-my-C_002b_002b-application-but-the-linker-complains-about-missing-symbols-which-seem-to-be-available_002e" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-I_0027m-using-FFmpeg-from-within-my-C_002b_002b-application-but-the-linker-complains-about-missing-symbols-which-seem-to-be-available_002e" aria-hidden="true">TOC</a></span></h3>
  681. <p>FFmpeg is a pure C project, so to use the libraries within your C++ application
  682. you need to explicitly state that you are using a C library. You can do this by
  683. encompassing your FFmpeg includes using <code>extern &quot;C&quot;</code>.
  684. </p>
  685. <p>See <a href="http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html#faq-32.3">http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html#faq-32.3</a>
  686. </p>
  687. <a name="I_0027m-using-libavutil-from-within-my-C_002b_002b-application-but-the-compiler-complains-about-_0027UINT64_005fC_0027-was-not-declared-in-this-scope"></a>
  688. <h3 class="section">4.10 I&rsquo;m using libavutil from within my C++ application but the compiler complains about &rsquo;UINT64_C&rsquo; was not declared in this scope<span class="pull-right"><a class="anchor hidden-xs" href="#I_0027m-using-libavutil-from-within-my-C_002b_002b-application-but-the-compiler-complains-about-_0027UINT64_005fC_0027-was-not-declared-in-this-scope" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-I_0027m-using-libavutil-from-within-my-C_002b_002b-application-but-the-compiler-complains-about-_0027UINT64_005fC_0027-was-not-declared-in-this-scope" aria-hidden="true">TOC</a></span></h3>
  689. <p>FFmpeg is a pure C project using C99 math features, in order to enable C++
  690. to use them you have to append -D__STDC_CONSTANT_MACROS to your CXXFLAGS
  691. </p>
  692. <a name="I-have-a-file-in-memory-_002f-a-API-different-from-_002aopen_002f_002aread_002f-libc-how-do-I-use-it-with-libavformat_003f"></a>
  693. <h3 class="section">4.11 I have a file in memory / a API different from *open/*read/ libc how do I use it with libavformat?<span class="pull-right"><a class="anchor hidden-xs" href="#I-have-a-file-in-memory-_002f-a-API-different-from-_002aopen_002f_002aread_002f-libc-how-do-I-use-it-with-libavformat_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-I-have-a-file-in-memory-_002f-a-API-different-from-_002aopen_002f_002aread_002f-libc-how-do-I-use-it-with-libavformat_003f" aria-hidden="true">TOC</a></span></h3>
  694. <p>You have to create a custom AVIOContext using <code>avio_alloc_context</code>,
  695. see <samp>libavformat/aviobuf.c</samp> in FFmpeg and <samp>libmpdemux/demux_lavf.c</samp> in MPlayer or MPlayer2 sources.
  696. </p>
  697. <a name="Where-is-the-documentation-about-ffv1_002c-msmpeg4_002c-asv1_002c-4xm_003f"></a>
  698. <h3 class="section">4.12 Where is the documentation about ffv1, msmpeg4, asv1, 4xm?<span class="pull-right"><a class="anchor hidden-xs" href="#Where-is-the-documentation-about-ffv1_002c-msmpeg4_002c-asv1_002c-4xm_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Where-is-the-documentation-about-ffv1_002c-msmpeg4_002c-asv1_002c-4xm_003f" aria-hidden="true">TOC</a></span></h3>
  699. <p>see <a href="https://www.ffmpeg.org/~michael/">https://www.ffmpeg.org/~michael/</a>
  700. </p>
  701. <a name="How-do-I-feed-H_002e263_002dRTP-_0028and-other-codecs-in-RTP_0029-to-libavcodec_003f"></a>
  702. <h3 class="section">4.13 How do I feed H.263-RTP (and other codecs in RTP) to libavcodec?<span class="pull-right"><a class="anchor hidden-xs" href="#How-do-I-feed-H_002e263_002dRTP-_0028and-other-codecs-in-RTP_0029-to-libavcodec_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-How-do-I-feed-H_002e263_002dRTP-_0028and-other-codecs-in-RTP_0029-to-libavcodec_003f" aria-hidden="true">TOC</a></span></h3>
  703. <p>Even if peculiar since it is network oriented, RTP is a container like any
  704. other. You have to <em>demux</em> RTP before feeding the payload to libavcodec.
  705. In this specific case please look at RFC 4629 to see how it should be done.
  706. </p>
  707. <a name="AVStream_002er_005fframe_005frate-is-wrong_002c-it-is-much-larger-than-the-frame-rate_002e"></a>
  708. <h3 class="section">4.14 AVStream.r_frame_rate is wrong, it is much larger than the frame rate.<span class="pull-right"><a class="anchor hidden-xs" href="#AVStream_002er_005fframe_005frate-is-wrong_002c-it-is-much-larger-than-the-frame-rate_002e" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-AVStream_002er_005fframe_005frate-is-wrong_002c-it-is-much-larger-than-the-frame-rate_002e" aria-hidden="true">TOC</a></span></h3>
  709. <p><code>r_frame_rate</code> is NOT the average frame rate, it is the smallest frame rate
  710. that can accurately represent all timestamps. So no, it is not
  711. wrong if it is larger than the average!
  712. For example, if you have mixed 25 and 30 fps content, then <code>r_frame_rate</code>
  713. will be 150 (it is the least common multiple).
  714. If you are looking for the average frame rate, see <code>AVStream.avg_frame_rate</code>.
  715. </p>
  716. <a name="Why-is-make-fate-not-running-all-tests_003f"></a>
  717. <h3 class="section">4.15 Why is <code>make fate</code> not running all tests?<span class="pull-right"><a class="anchor hidden-xs" href="#Why-is-make-fate-not-running-all-tests_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Why-is-make-fate-not-running-all-tests_003f" aria-hidden="true">TOC</a></span></h3>
  718. <p>Make sure you have the fate-suite samples and the <code>SAMPLES</code> Make variable
  719. or <code>FATE_SAMPLES</code> environment variable or the <code>--samples</code>
  720. <code>configure</code> option is set to the right path.
  721. </p>
  722. <a name="Why-is-make-fate-not-finding-the-samples_003f"></a>
  723. <h3 class="section">4.16 Why is <code>make fate</code> not finding the samples?<span class="pull-right"><a class="anchor hidden-xs" href="#Why-is-make-fate-not-finding-the-samples_003f" aria-hidden="true">#</a> <a class="anchor hidden-xs"href="#toc-Why-is-make-fate-not-finding-the-samples_003f" aria-hidden="true">TOC</a></span></h3>
  724. <p>Do you happen to have a <code>~</code> character in the samples path to indicate a
  725. home directory? The value is used in ways where the shell cannot expand it,
  726. causing FATE to not find files. Just replace <code>~</code> by the full path.
  727. </p>
  728. <p style="font-size: small;">
  729. This document was generated using <a href="http://www.gnu.org/software/texinfo/"><em>makeinfo</em></a>.
  730. </p>
  731. </div>
  732. </body>
  733. </html>