/usr/share/doc/libav/faq.html is in libav-tools 6:11.12-1~deb8u1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 | <!DOCTYPE html>
<html>
<!-- Created on February 18, 2018 by texi2html 1.82 -->
<!--
texi2html was written by:
Lionel Cons <Lionel.Cons@cern.ch> (original author)
Karl Berry <karl@freefriends.org>
Olaf Bachmann <obachman@mathematik.uni-kl.de>
and many others.
Maintained by: Many creative people.
Send bugs and suggestions to <texi2html-bug@nongnu.org>
-->
<head>
<title>Libav documentation : Libav FAQ: </title>
<meta name="description" content="Libav FAQ: ">
<meta name="keywords" content="Libav documentation : Libav FAQ: ">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="texi2html 1.82">
<style type="text/css">
<!--
.container {
margin-right: auto;
margin-left: auto;
width: 1070px;
}
body {
font-size: 14px;
line-height: 20px;
color: #333333;
background-color: #ffffff;
}
a {
color: #0088cc;
text-decoration: none;
}
a:hover {
color: #005580;
text-decoration: underline;
}
p {
margin: 0 0 10px;
}
h2,
h3,
h4 {
margin: 10px 0;
font-family: inherit;
font-weight: bold;
line-height: 1;
border-color: #D6E9C6;
color: #468847;
border-style: solid;
border-width: 0 0 1px;
padding-left: 0.5em;
}
h1 a,
h2 a,
h3 a,
h4 a {
color: inherit;
}
h1 {
font-size: 30px;
line-height: 40px;
}
h2 {
font-size: 20px;
line-height: 40px;
}
h3 {
font-size: 18px;
line-height: 40px;
}
code,
pre {
padding: 0 3px 2px;
font-family: monospace;
font-size: 12px;
color: #333333;
border-radius: 3px;
}
pre {
display: block;
padding: 9.5px;
margin: 0 0 10px;
font-size: 13px;
line-height: 20px;
word-break: break-all;
word-wrap: break-word;
white-space: pre;
white-space: pre-wrap;
background-color: #f5f5f5;
border: 1px solid #ccc;
border-radius: 4px;
}
code {
padding: 2px 4px;
color: #d14;
background-color: #f7f7f9;
border: 1px solid #e1e1e8;
}
pre code {
padding: 0;
color: inherit;
background-color: transparent;
border: 0;
}
.alert {
padding: 8px 35px 8px 14px;
margin-bottom: 20px;
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
background-color: #fcf8e3;
border: 1px solid #fbeed5;
border-radius: 4px;
color: #c09853;
}
.alert-danger,
.alert-error {
background-color: #f2dede;
border-color: #eed3d7;
color: #b94a48;
}
.alert-info {
background-color: #d9edf7;
border-color: #bce8f1;
color: #3a87ad;
}
ul.toc {
list-style-type: none;
}
-->
</style>
<link rel="icon" href="favicon.png" type="image/png" />
</head>
<body>
<div class="container">
<a name="SEC_Top"></a>
<h1 class="settitle">Libav FAQ</h1>
<a name="SEC_Contents"></a>
<h1>Table of Contents</h1>
<div class="contents">
<ul class="toc">
<li><a name="toc-General-Questions" href="#General-Questions">1. General Questions</a>
<ul class="toc">
<li><a name="toc-Why-doesn_0027t-Libav-support-feature-_005bxyz_005d_003f" href="#Why-doesn_0027t-Libav-support-feature-_005bxyz_005d_003f">1.1 Why doesn’t Libav support feature [xyz]?</a></li>
<li><a name="toc-Libav-does-not-support-codec-XXX_002e-Can-you-include-a-Windows-DLL-loader-to-support-it_003f" href="#Libav-does-not-support-codec-XXX_002e-Can-you-include-a-Windows-DLL-loader-to-support-it_003f">1.2 Libav does not support codec XXX. Can you include a Windows DLL loader to support it?</a></li>
<li><a name="toc-I-cannot-read-this-file-although-this-format-seems-to-be-supported-by-avconv_002e" href="#I-cannot-read-this-file-although-this-format-seems-to-be-supported-by-avconv_002e">1.3 I cannot read this file although this format seems to be supported by avconv.</a></li>
<li><a name="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>
</ul></li>
<li><a name="toc-Compilation" href="#Compilation">2. Compilation</a>
<ul class="toc">
<li><a name="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>
</ul></li>
<li><a name="toc-Usage" href="#Usage">3. Usage</a>
<ul class="toc">
<li><a name="toc-How-do-I-encode-single-pictures-into-movies_003f" href="#How-do-I-encode-single-pictures-into-movies_003f">3.1 How do I encode single pictures into movies?</a></li>
<li><a name="toc-How-do-I-encode-movie-to-single-pictures_003f" href="#How-do-I-encode-movie-to-single-pictures_003f">3.2 How do I encode movie to single pictures?</a></li>
<li><a name="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.3 Why do I see a slight quality degradation with multithreaded MPEG* encoding?</a></li>
<li><a name="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.4 How can I read from the standard input or write to the standard output?</a></li>
<li><a name="toc-_002df-jpeg-doesn_0027t-work_002e" href="#g_t_002df-jpeg-doesn_0027t-work_002e">3.5 -f jpeg doesn’t work.</a></li>
<li><a name="toc-Why-can-I-not-change-the-framerate_003f" href="#Why-can-I-not-change-the-framerate_003f">3.6 Why can I not change the framerate?</a></li>
<li><a name="toc-How-do-I-encode-Xvid-or-DivX-video-with-avconv_003f" href="#How-do-I-encode-Xvid-or-DivX-video-with-avconv_003f">3.7 How do I encode Xvid or DivX video with avconv?</a></li>
<li><a name="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.8 Which are good parameters for encoding high quality MPEG-4?</a></li>
<li><a name="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.9 Which are good parameters for encoding high quality MPEG-1/MPEG-2?</a></li>
<li><a name="toc-Interlaced-video-looks-very-bad-when-encoded-with-avconv_002c-what-is-wrong_003f" href="#Interlaced-video-looks-very-bad-when-encoded-with-avconv_002c-what-is-wrong_003f">3.10 Interlaced video looks very bad when encoded with avconv, what is wrong?</a></li>
<li><a name="toc-How-can-I-read-DirectShow-files_003f" href="#How-can-I-read-DirectShow-files_003f">3.11 How can I read DirectShow files?</a></li>
<li><a name="toc-How-can-I-join-video-files_003f" href="#How-can-I-join-video-files_003f">3.12 How can I join video files?</a></li>
<li><a name="toc-_002dprofile-option-fails-when-encoding-H_002e264-video-with-AAC-audio" href="#g_t_002dprofile-option-fails-when-encoding-H_002e264-video-with-AAC-audio">3.13 -profile option fails when encoding H.264 video with AAC audio</a></li>
</ul></li>
<li><a name="toc-Development" href="#Development">4. Development</a>
<ul class="toc">
<li><a name="toc-Are-there-examples-illustrating-how-to-use-the-Libav-libraries_002c-particularly-libavcodec-and-libavformat_003f" href="#Are-there-examples-illustrating-how-to-use-the-Libav-libraries_002c-particularly-libavcodec-and-libavformat_003f">4.1 Are there examples illustrating how to use the Libav libraries, particularly libavcodec and libavformat?</a></li>
<li><a name="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>
<li><a name="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>
<li><a name="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>
<li><a name="toc-Why-not-rewrite-Libav-in-object_002doriented-C_002b_002b_003f" href="#Why-not-rewrite-Libav-in-object_002doriented-C_002b_002b_003f">4.5 Why not rewrite Libav in object-oriented C++?</a></li>
<li><a name="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.6 I do not like the LGPL, can I contribute code under the GPL instead?</a></li>
<li><a name="toc-I_0027m-using-Libav-from-within-my-C_002b_002b-application-but-the-linker-complains-about-missing-symbols-which-seem-to-be-available_002e" href="#I_0027m-using-Libav-from-within-my-C_002b_002b-application-but-the-linker-complains-about-missing-symbols-which-seem-to-be-available_002e">4.7 I’m using Libav from within my C++ application but the linker complains about missing symbols which seem to be available.</a></li>
<li><a name="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.8 I’m using libavutil from within my C++ application but the compiler complains about ’UINT64_C’ was not declared in this scope</a></li>
<li><a name="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.9 I have a file in memory / a API different from *open/*read/ libc how do I use it with libavformat?</a></li>
<li><a name="toc-Why-is-make-fate-not-running-all-tests_003f" href="#Why-is-make-fate-not-running-all-tests_003f">4.10 Why is <code>make fate</code> not running all tests?</a></li>
<li><a name="toc-Why-is-make-fate-not-finding-the-samples_003f" href="#Why-is-make-fate-not-finding-the-samples_003f">4.11 Why is <code>make fate</code> not finding the samples?</a></li>
</ul>
</li>
</ul>
</div>
<a name="General-Questions"></a>
<h1 class="chapter"><a href="faq.html#toc-General-Questions">1. General Questions</a></h1>
<a name="Why-doesn_0027t-Libav-support-feature-_005bxyz_005d_003f"></a>
<h2 class="section"><a href="faq.html#toc-Why-doesn_0027t-Libav-support-feature-_005bxyz_005d_003f">1.1 Why doesn’t Libav support feature [xyz]?</a></h2>
<p>Because no one has taken on that task yet. Libav development is
driven by the tasks that are important to the individual developers.
If there is a feature that is important to you, the best way to get
it implemented is to undertake the task yourself or sponsor a developer.
</p>
<a name="Libav-does-not-support-codec-XXX_002e-Can-you-include-a-Windows-DLL-loader-to-support-it_003f"></a>
<h2 class="section"><a href="faq.html#toc-Libav-does-not-support-codec-XXX_002e-Can-you-include-a-Windows-DLL-loader-to-support-it_003f">1.2 Libav does not support codec XXX. Can you include a Windows DLL loader to support it?</a></h2>
<p>No. Windows DLLs are not portable, bloated and often slow.
Moreover Libav strives to support all codecs natively.
A DLL loader is not conducive to that goal.
</p>
<a name="I-cannot-read-this-file-although-this-format-seems-to-be-supported-by-avconv_002e"></a>
<h2 class="section"><a href="faq.html#toc-I-cannot-read-this-file-although-this-format-seems-to-be-supported-by-avconv_002e">1.3 I cannot read this file although this format seems to be supported by avconv.</a></h2>
<p>Even if avconv can read the container format, it may not support all its
codecs. Please consult the supported codec list in the avconv
documentation.
</p>
<a name="Which-codecs-are-supported-by-Windows_003f"></a>
<h2 class="section"><a href="faq.html#toc-Which-codecs-are-supported-by-Windows_003f">1.4 Which codecs are supported by Windows?</a></h2>
<p>Windows does not support standard formats like MPEG very well, unless you
install some additional codecs.
</p>
<p>The following list of video codecs should work on most Windows systems:
</p><dl compact="compact">
<dt> ‘<samp>msmpeg4v2</samp>’</dt>
<dd><p>.avi/.asf
</p></dd>
<dt> ‘<samp>msmpeg4</samp>’</dt>
<dd><p>.asf only
</p></dd>
<dt> ‘<samp>wmv1</samp>’</dt>
<dd><p>.asf only
</p></dd>
<dt> ‘<samp>wmv2</samp>’</dt>
<dd><p>.asf only
</p></dd>
<dt> ‘<samp>mpeg4</samp>’</dt>
<dd><p>Only if you have some MPEG-4 codec like ffdshow or Xvid installed.
</p></dd>
<dt> ‘<samp>mpeg1video</samp>’</dt>
<dd><p>.mpg only
</p></dd>
</dl>
<p>Note, ASF files often have .wmv or .wma extensions in Windows. It should also
be mentioned that Microsoft claims a patent on the ASF format, and may sue
or threaten users who create ASF files with non-Microsoft software. It is
strongly advised to avoid ASF where possible.
</p>
<p>The following list of audio codecs should work on most Windows systems:
</p><dl compact="compact">
<dt> ‘<samp>adpcm_ima_wav</samp>’</dt>
<dt> ‘<samp>adpcm_ms</samp>’</dt>
<dt> ‘<samp>pcm_s16le</samp>’</dt>
<dd><p>always
</p></dd>
<dt> ‘<samp>libmp3lame</samp>’</dt>
<dd><p>If some MP3 codec like LAME is installed.
</p></dd>
</dl>
<a name="Compilation"></a>
<h1 class="chapter"><a href="faq.html#toc-Compilation">2. Compilation</a></h1>
<a name="error_003a-can_0027t-find-a-register-in-class-_0027GENERAL_005fREGS_0027-while-reloading-_0027asm_0027"></a>
<h2 class="section"><a href="faq.html#toc-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></h2>
<p>This is a bug in gcc. Do not report it to us. Instead, please report it to
the gcc developers. Note that we will not add workarounds for gcc bugs.
</p>
<p>Also note that (some of) the gcc developers believe this is not a bug or
not a bug they should fix:
<a href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11203">http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11203</a>.
Then again, some of them do not know the difference between an undecidable
problem and an NP-hard problem...
</p>
<a name="Usage"></a>
<h1 class="chapter"><a href="faq.html#toc-Usage">3. Usage</a></h1>
<a name="How-do-I-encode-single-pictures-into-movies_003f"></a>
<h2 class="section"><a href="faq.html#toc-How-do-I-encode-single-pictures-into-movies_003f">3.1 How do I encode single pictures into movies?</a></h2>
<p>First, rename your pictures to follow a numerical sequence.
For example, img1.jpg, img2.jpg, img3.jpg,...
Then you may run:
</p>
<table><tr><td> </td><td><pre class="example"> avconv -f image2 -i img%d.jpg /tmp/a.mpg
</pre></td></tr></table>
<p>Notice that ‘<samp>%d</samp>’ is replaced by the image number.
</p>
<p>‘<tt>img%03d.jpg</tt>’ means the sequence ‘<tt>img001.jpg</tt>’, ‘<tt>img002.jpg</tt>’, etc...
</p>
<p>If you have large number of pictures to rename, you can use the
following command to ease the burden. The command, using the bourne
shell syntax, symbolically links all files in the current directory
that match <code>*jpg</code> to the ‘<tt>/tmp</tt>’ directory in the sequence of
‘<tt>img001.jpg</tt>’, ‘<tt>img002.jpg</tt>’ and so on.
</p>
<table><tr><td> </td><td><pre class="example"> x=1; for i in *jpg; do counter=$(printf %03d $x); ln -s "$i" /tmp/img"$counter".jpg; x=$(($x+1)); done
</pre></td></tr></table>
<p>If you want to sequence them by oldest modified first, substitute
<code>$(ls -r -t *jpg)</code> in place of <code>*jpg</code>.
</p>
<p>Then run:
</p>
<table><tr><td> </td><td><pre class="example"> avconv -f image2 -i /tmp/img%03d.jpg /tmp/a.mpg
</pre></td></tr></table>
<p>The same logic is used for any image format that avconv reads.
</p>
<a name="How-do-I-encode-movie-to-single-pictures_003f"></a>
<h2 class="section"><a href="faq.html#toc-How-do-I-encode-movie-to-single-pictures_003f">3.2 How do I encode movie to single pictures?</a></h2>
<p>Use:
</p>
<table><tr><td> </td><td><pre class="example"> avconv -i movie.mpg movie%d.jpg
</pre></td></tr></table>
<p>The ‘<tt>movie.mpg</tt>’ used as input will be converted to
‘<tt>movie1.jpg</tt>’, ‘<tt>movie2.jpg</tt>’, etc...
</p>
<p>Instead of relying on file format self-recognition, you may also use
</p><dl compact="compact">
<dt> ‘<samp>-c:v ppm</samp>’</dt>
<dt> ‘<samp>-c:v png</samp>’</dt>
<dt> ‘<samp>-c:v mjpeg</samp>’</dt>
</dl>
<p>to force the encoding.
</p>
<p>Applying that to the previous example:
</p><table><tr><td> </td><td><pre class="example"> avconv -i movie.mpg -f image2 -c:v mjpeg menu%d.jpg
</pre></td></tr></table>
<p>Beware that there is no "jpeg" codec. Use "mjpeg" instead.
</p>
<a name="Why-do-I-see-a-slight-quality-degradation-with-multithreaded-MPEG_002a-encoding_003f"></a>
<h2 class="section"><a href="faq.html#toc-Why-do-I-see-a-slight-quality-degradation-with-multithreaded-MPEG_002a-encoding_003f">3.3 Why do I see a slight quality degradation with multithreaded MPEG* encoding?</a></h2>
<p>For multithreaded MPEG* encoding, the encoded slices must be independent,
otherwise thread n would practically have to wait for n-1 to finish, so it’s
quite logical that there is a small reduction of quality. This is not a bug.
</p>
<a name="How-can-I-read-from-the-standard-input-or-write-to-the-standard-output_003f"></a>
<h2 class="section"><a href="faq.html#toc-How-can-I-read-from-the-standard-input-or-write-to-the-standard-output_003f">3.4 How can I read from the standard input or write to the standard output?</a></h2>
<p>Use ‘<tt>-</tt>’ as file name.
</p>
<a name="g_t_002df-jpeg-doesn_0027t-work_002e"></a>
<h2 class="section"><a href="faq.html#toc-_002df-jpeg-doesn_0027t-work_002e">3.5 -f jpeg doesn’t work.</a></h2>
<p>Try ’-f image2 test%d.jpg’.
</p>
<a name="Why-can-I-not-change-the-framerate_003f"></a>
<h2 class="section"><a href="faq.html#toc-Why-can-I-not-change-the-framerate_003f">3.6 Why can I not change the framerate?</a></h2>
<p>Some codecs, like MPEG-1/2, only allow a small number of fixed framerates.
Choose a different codec with the -c:v command line option.
</p>
<a name="How-do-I-encode-Xvid-or-DivX-video-with-avconv_003f"></a>
<h2 class="section"><a href="faq.html#toc-How-do-I-encode-Xvid-or-DivX-video-with-avconv_003f">3.7 How do I encode Xvid or DivX video with avconv?</a></h2>
<p>Both Xvid and DivX (version 4+) are implementations of the ISO MPEG-4
standard (note that there are many other coding formats that use this
same standard). Thus, use ’-c:v mpeg4’ to encode in these formats. The
default fourcc stored in an MPEG-4-coded file will be ’FMP4’. If you want
a different fourcc, use the ’-vtag’ option. E.g., ’-vtag xvid’ will
force the fourcc ’xvid’ to be stored as the video fourcc rather than the
default.
</p>
<a name="Which-are-good-parameters-for-encoding-high-quality-MPEG_002d4_003f"></a>
<h2 class="section"><a href="faq.html#toc-Which-are-good-parameters-for-encoding-high-quality-MPEG_002d4_003f">3.8 Which are good parameters for encoding high quality MPEG-4?</a></h2>
<p>’-mbd rd -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2 -g 300 -pass 1/2’,
things to try: ’-bf 2’, ’-flags qprd’, ’-flags mv0’, ’-flags skiprd’.
</p>
<a name="Which-are-good-parameters-for-encoding-high-quality-MPEG_002d1_002fMPEG_002d2_003f"></a>
<h2 class="section"><a href="faq.html#toc-Which-are-good-parameters-for-encoding-high-quality-MPEG_002d1_002fMPEG_002d2_003f">3.9 Which are good parameters for encoding high quality MPEG-1/MPEG-2?</a></h2>
<p>’-mbd rd -trellis 2 -cmp 2 -subcmp 2 -g 100 -pass 1/2’
but beware the ’-g 100’ might cause problems with some decoders.
Things to try: ’-bf 2’, ’-flags qprd’, ’-flags mv0’, ’-flags skiprd.
</p>
<a name="Interlaced-video-looks-very-bad-when-encoded-with-avconv_002c-what-is-wrong_003f"></a>
<h2 class="section"><a href="faq.html#toc-Interlaced-video-looks-very-bad-when-encoded-with-avconv_002c-what-is-wrong_003f">3.10 Interlaced video looks very bad when encoded with avconv, what is wrong?</a></h2>
<p>You should use ’-flags +ilme+ildct’ and maybe ’-flags +alt’ for interlaced
material, and try ’-top 0/1’ if the result looks really messed-up.
</p>
<a name="How-can-I-read-DirectShow-files_003f"></a>
<h2 class="section"><a href="faq.html#toc-How-can-I-read-DirectShow-files_003f">3.11 How can I read DirectShow files?</a></h2>
<p>If you have built Libav with <code>./configure --enable-avisynth</code>
(only possible on MinGW/Cygwin platforms),
then you may use any file that DirectShow can read as input.
</p>
<p>Just create an "input.avs" text file with this single line ...
</p><table><tr><td> </td><td><pre class="example"> DirectShowSource("C:\path to your file\yourfile.asf")
</pre></td></tr></table>
<p>... and then feed that text file to avconv:
</p><table><tr><td> </td><td><pre class="example"> avconv -i input.avs
</pre></td></tr></table>
<p>For ANY other help on AviSynth, please visit the
<a href="http://www.avisynth.org/">AviSynth homepage</a>.
</p>
<a name="How-can-I-join-video-files_003f"></a>
<h2 class="section"><a href="faq.html#toc-How-can-I-join-video-files_003f">3.12 How can I join video files?</a></h2>
<p>A few multimedia containers (MPEG-1, MPEG-2 PS, DV) allow to join video files by
merely concatenating them.
</p>
<p>Hence you may concatenate your multimedia files by first transcoding them to
these privileged formats, then using the humble <code>cat</code> command (or the
equally humble <code>copy</code> under Windows), and finally transcoding back to your
format of choice.
</p>
<table><tr><td> </td><td><pre class="example">avconv -i input1.avi intermediate1.mpg
avconv -i input2.avi intermediate2.mpg
cat intermediate1.mpg intermediate2.mpg > intermediate_all.mpg
avconv -i intermediate_all.mpg output.avi
</pre></td></tr></table>
<p>Notice that you should set a reasonably high bitrate for your intermediate and
output files, if you want to preserve video quality.
</p>
<p>Also notice that you may avoid the huge intermediate files by taking advantage
of named pipes, should your platform support it:
</p>
<table><tr><td> </td><td><pre class="example">mkfifo intermediate1.mpg
mkfifo intermediate2.mpg
avconv -i input1.avi -y intermediate1.mpg < /dev/null &
avconv -i input2.avi -y intermediate2.mpg < /dev/null &
cat intermediate1.mpg intermediate2.mpg |\
avconv -f mpeg -i - -c:v mpeg4 -acodec libmp3lame output.avi
</pre></td></tr></table>
<p>Similarly, the yuv4mpegpipe format, and the raw video, raw audio codecs also
allow concatenation, and the transcoding step is almost lossless.
When using multiple yuv4mpegpipe(s), the first line needs to be discarded
from all but the first stream. This can be accomplished by piping through
<code>tail</code> as seen below. Note that when piping through <code>tail</code> you
must use command grouping, <code>{ ;}</code>, to background properly.
</p>
<p>For example, let’s say we want to join two FLV files into an output.flv file:
</p>
<table><tr><td> </td><td><pre class="example">mkfifo temp1.a
mkfifo temp1.v
mkfifo temp2.a
mkfifo temp2.v
mkfifo all.a
mkfifo all.v
avconv -i input1.flv -vn -f u16le -acodec pcm_s16le -ac 2 -ar 44100 - > temp1.a < /dev/null &
avconv -i input2.flv -vn -f u16le -acodec pcm_s16le -ac 2 -ar 44100 - > temp2.a < /dev/null &
avconv -i input1.flv -an -f yuv4mpegpipe - > temp1.v < /dev/null &
{ avconv -i input2.flv -an -f yuv4mpegpipe - < /dev/null | tail -n +2 > temp2.v ; } &
cat temp1.a temp2.a > all.a &
cat temp1.v temp2.v > all.v &
avconv -f u16le -acodec pcm_s16le -ac 2 -ar 44100 -i all.a \
-f yuv4mpegpipe -i all.v \
-y output.flv
rm temp[12].[av] all.[av]
</pre></td></tr></table>
<a name="g_t_002dprofile-option-fails-when-encoding-H_002e264-video-with-AAC-audio"></a>
<h2 class="section"><a href="faq.html#toc-_002dprofile-option-fails-when-encoding-H_002e264-video-with-AAC-audio">3.13 -profile option fails when encoding H.264 video with AAC audio</a></h2>
<p><code>avconv</code> prints an error like
</p>
<table><tr><td> </td><td><pre class="example">Undefined constant or missing '(' in 'baseline'
Unable to parse option value "baseline"
Error setting option profile to value baseline.
</pre></td></tr></table>
<p>Short answer: write ‘<samp>-profile:v</samp>’ instead of ‘<samp>-profile</samp>’.
</p>
<p>Long answer: this happens because the ‘<samp>-profile</samp>’ option can apply to both
video and audio. Specifically the AAC encoder also defines some profiles, none
of which are named <var>baseline</var>.
</p>
<p>The solution is to apply the ‘<samp>-profile</samp>’ option to the video stream only
by using <a href="http://libav.org/avconv.html#Stream-specifiers-1">Stream specifiers</a>.
Appending <code>:v</code> to it will do exactly that.
</p>
<a name="Development"></a>
<h1 class="chapter"><a href="faq.html#toc-Development">4. Development</a></h1>
<a name="Are-there-examples-illustrating-how-to-use-the-Libav-libraries_002c-particularly-libavcodec-and-libavformat_003f"></a>
<h2 class="section"><a href="faq.html#toc-Are-there-examples-illustrating-how-to-use-the-Libav-libraries_002c-particularly-libavcodec-and-libavformat_003f">4.1 Are there examples illustrating how to use the Libav libraries, particularly libavcodec and libavformat?</a></h2>
<p>Yes. Read the Developers Guide of the Libav documentation. Alternatively,
examine the source code for one of the many open source projects that
already incorporate Libav at (<a href="projects.html">projects.html</a>).
</p>
<a name="Can-you-support-my-C-compiler-XXX_003f"></a>
<h2 class="section"><a href="faq.html#toc-Can-you-support-my-C-compiler-XXX_003f">4.2 Can you support my C compiler XXX?</a></h2>
<p>It depends. If your compiler is C99-compliant, then patches to support
it are likely to be welcome if they do not pollute the source code
with <code>#ifdef</code>s related to the compiler.
</p>
<a name="Is-Microsoft-Visual-C_002b_002b-supported_003f"></a>
<h2 class="section"><a href="faq.html#toc-Is-Microsoft-Visual-C_002b_002b-supported_003f">4.3 Is Microsoft Visual C++ supported?</a></h2>
<p>Yes. Please see the <a href="platform.html">Microsoft Visual C++</a>
section in the Libav documentation.
</p>
<a name="Can-you-add-automake_002c-libtool-or-autoconf-support_003f"></a>
<h2 class="section"><a href="faq.html#toc-Can-you-add-automake_002c-libtool-or-autoconf-support_003f">4.4 Can you add automake, libtool or autoconf support?</a></h2>
<p>No. These tools are too bloated and they complicate the build.
</p>
<a name="Why-not-rewrite-Libav-in-object_002doriented-C_002b_002b_003f"></a>
<h2 class="section"><a href="faq.html#toc-Why-not-rewrite-Libav-in-object_002doriented-C_002b_002b_003f">4.5 Why not rewrite Libav in object-oriented C++?</a></h2>
<p>Libav is already organized in a highly modular manner and does not need to
be rewritten in a formal object language. Further, many of the developers
favor straight C; it works for them. For more arguments on this matter,
read <a href="http://www.tux.org/lkml/#s15">"Programming Religion"</a>.
</p>
<a name="I-do-not-like-the-LGPL_002c-can-I-contribute-code-under-the-GPL-instead_003f"></a>
<h2 class="section"><a href="faq.html#toc-I-do-not-like-the-LGPL_002c-can-I-contribute-code-under-the-GPL-instead_003f">4.6 I do not like the LGPL, can I contribute code under the GPL instead?</a></h2>
<p>Yes, as long as the code is optional and can easily and cleanly be placed
under #if CONFIG_GPL without breaking anything. So for example a new codec
or filter would be OK under GPL while a bug fix to LGPL code would not.
</p>
<a name="I_0027m-using-Libav-from-within-my-C_002b_002b-application-but-the-linker-complains-about-missing-symbols-which-seem-to-be-available_002e"></a>
<h2 class="section"><a href="faq.html#toc-I_0027m-using-Libav-from-within-my-C_002b_002b-application-but-the-linker-complains-about-missing-symbols-which-seem-to-be-available_002e">4.7 I’m using Libav from within my C++ application but the linker complains about missing symbols which seem to be available.</a></h2>
<p>Libav is a pure C project, so to use the libraries within your C++ application
you need to explicitly state that you are using a C library. You can do this by
encompassing your Libav includes using <code>extern "C"</code>.
</p>
<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>
</p>
<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>
<h2 class="section"><a href="faq.html#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">4.8 I’m using libavutil from within my C++ application but the compiler complains about ’UINT64_C’ was not declared in this scope</a></h2>
<p>Libav is a pure C project using C99 math features, in order to enable C++
to use them you have to append -D__STDC_CONSTANT_MACROS to your CXXFLAGS
</p>
<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>
<h2 class="section"><a href="faq.html#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">4.9 I have a file in memory / a API different from *open/*read/ libc how do I use it with libavformat?</a></h2>
<p>You have to create a custom AVIOContext using <code>avio_alloc_context</code>,
see ‘<tt>libavformat/aviobuf.c</tt>’ in Libav and ‘<tt>libmpdemux/demux_lavf.c</tt>’ in MPlayer2 sources.
</p>
<a name="Why-is-make-fate-not-running-all-tests_003f"></a>
<h2 class="section"><a href="faq.html#toc-Why-is-make-fate-not-running-all-tests_003f">4.10 Why is <code>make fate</code> not running all tests?</a></h2>
<p>Make sure you have the fate-suite samples and the <code>SAMPLES</code> Make variable
or <code>FATE_SAMPLES</code> environment variable or the <code>--samples</code>
<code>configure</code> option is set to the right path.
</p>
<a name="Why-is-make-fate-not-finding-the-samples_003f"></a>
<h2 class="section"><a href="faq.html#toc-Why-is-make-fate-not-finding-the-samples_003f">4.11 Why is <code>make fate</code> not finding the samples?</a></h2>
<p>Do you happen to have a <code>~</code> character in the samples path to indicate a
home directory? The value is used in ways where the shell cannot expand it,
causing FATE to not find files. Just replace <code>~</code> by the full path.
</p>
<footer class="footer pagination-right">
<span class="label label-info">This document was generated by <em>Sebastian Ramacher</em> on <em>February 18, 2018</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.82</em></a>.</span></footer></div>
|