From: ronag Date: Wed, 18 May 2011 14:04:42 +0000 (+0000) Subject: Added ffmpeg 0.7 RC X-Git-Tag: dependencies_subtree~23 X-Git-Url: https://git.sesse.net/?p=casparcg;a=commitdiff_plain;h=4f7058172b7b297e10aad63001a9f4521846b06e Added ffmpeg 0.7 RC --- diff --git a/ffmpeg 0.7/README.txt b/ffmpeg 0.7/README.txt new file mode 100644 index 000000000..552a134ff --- /dev/null +++ b/ffmpeg 0.7/README.txt @@ -0,0 +1,75 @@ +This is a FFmpeg Win32 shared build by Kyle Schwarz. + +Zeranoe's FFmpeg Builds Home Page: http://ffmpeg.zeranoe.com/builds/ + +Built on May 18 2011 04:43:18 + +FFmpeg version git-b4bcd1e + libavutil 51. 2. 1 / 51. 2. 1 + libavcodec 53. 6. 0 / 53. 6. 0 + libavformat 53. 1. 0 / 53. 1. 0 + libavdevice 53. 0. 0 / 53. 0. 0 + libavfilter 2. 5. 0 / 2. 5. 0 + libswscale 0. 14. 0 / 0. 14. 0 + libpostproc 51. 2. 0 / 51. 2. 0 + +FFmpeg configured with: + --disable-static + --enable-shared + --enable-gpl + --enable-version3 + --enable-memalign-hack + --enable-runtime-cpudetect + --enable-avisynth + --enable-bzlib + --enable-frei0r + --enable-libopencore-amrnb + --enable-libopencore-amrwb + --enable-libfreetype + --enable-libgsm + --enable-libmp3lame + --enable-libopenjpeg + --enable-librtmp + --enable-libschroedinger + --enable-libspeex + --enable-libtheora + --enable-libvorbis + --enable-libvpx + --enable-libx264 + --enable-libxavs + --enable-libxvid + --enable-zlib + --pkg-config=pkg-config + +The source code for this FFmpeg build can be found at: + http://hawkeye.arrozcru.org/source/ + +This version of FFmpeg was built on: + Ubuntu Desktop 11.04: http://www.ubuntu.com/desktop + +The cross-compile toolchain used to compile this FFmpeg was: + MinGW-w64 r4161: http://mingw-w64.sourceforge.net/ + +The GCC version used to compile this FFmpeg was: + GCC 4.5.3: http://gcc.gnu.org/ + +The external libaries compiled into this FFmpeg are: + bzip2 1.0.6 http://www.bzip.org + Frei0r 1.3 http://frei0r.dyne.org/ + opencore-amr 0.1.2 http://sourceforge.net/projects/opencore-amr/ + FreeType 2.4.4 http://www.freetype.org/ + gsm 1.0.13-3 http://libgsm.sourcearchive.com/ + LAME 3.98.4 http://lame.sourceforge.net/ + OpenJPEG 1.4 http://www.openjpeg.org/ + RTMP git-6155179b http://rtmpdump.mplayerhq.hu/ + Schroedinger 1.0.10 http://diracvideo.org/ + Speex 1.2rc1 http://www.speex.org/ + Theora 1.1.1 http://www.theora.org/ + Vorbis 1.3.2 http://www.vorbis.com/ + libvpx 0.9.6 http://www.webmproject.org/code/ + x264 git-b5a8ad7e http://www.videolan.org/developers/x264.html + XAVS r51 http://xavs.sourceforge.net/ + Xvid 1.3.1 http://www.xvid.org/ + zlib 1.2.5 http://zlib.net/ + +License for each library can be found in the licenses folder. diff --git a/ffmpeg 0.7/doc/developer.html b/ffmpeg 0.7/doc/developer.html new file mode 100644 index 000000000..373499994 --- /dev/null +++ b/ffmpeg 0.7/doc/developer.html @@ -0,0 +1,521 @@ + + + + +Developer Documentation + + + + + + + + + + + + + + + +

Developer Documentation

+ + +

Table of Contents

+
+ + +
+ +
+ +

1. Developers Guide

+ + +

1.1 API

+ + + +

1.2 Integrating libavcodec or libavformat in your program

+ +

You can integrate all the source code of the libraries to link them +statically to avoid any version problem. All you need is to provide a +’config.mak’ and a ’config.h’ in the parent directory. See the defines +generated by ./configure to understand what is needed. +

+

You can use libavcodec or libavformat in your commercial program, but +any patch you make must be published. The best way to proceed is +to send your patches to the FFmpeg mailing list. +

+

+

+

1.3 Coding Rules

+ +

FFmpeg is programmed in the ISO C90 language with a few additional +features from ISO C99, namely: +

+ +

These features are supported by all compilers we care about, so we will not +accept patches to remove their use unless they absolutely do not impair +clarity and performance. +

+

All code must compile with GCC 2.95 and GCC 3.3. Currently, FFmpeg also +compiles with several other compilers, such as the Compaq ccc compiler +or Sun Studio 9, and we would like to keep it that way unless it would +be exceedingly involved. To ensure compatibility, please do not use any +additional C99 features or GCC extensions. Especially watch out for: +

+ +

Indent size is 4. +The presentation is one inspired by ’indent -i4 -kr -nut’. +The TAB character is forbidden outside of Makefiles as is any +form of trailing whitespace. Commits containing either will be +rejected by the git repository. +

+

The main priority in FFmpeg is simplicity and small code size in order to +minimize the bug count. +

+

Comments: Use the JavaDoc/Doxygen +format (see examples below) so that code documentation +can be generated automatically. All nontrivial functions should have a comment +above them explaining what the function does, even if it is just one sentence. +All structures and their member variables should be documented, too. +

 
/**
+ * @file mpeg.c
+ * MPEG codec.
+ * @author ...
+ */
+
+/**
+ * Summary sentence.
+ * more text ...
+ * ...
+ */
+typedef struct Foobar{
+    int var1; /**< var1 description */
+    int var2; ///< var2 description
+    /** var3 description */
+    int var3;
+} Foobar;
+
+/**
+ * Summary sentence.
+ * more text ...
+ * ...
+ * @param my_parameter description of my_parameter
+ * @return return value description
+ */
+int myfunc(int my_parameter)
+...
+
+ +

fprintf and printf are forbidden in libavformat and libavcodec, +please use av_log() instead. +

+

Casts should be used only when necessary. Unneeded parentheses +should also be avoided if they don’t make the code easier to understand. +

+ +

1.4 Development Policy

+ +
    +
  1. + Contributions should be licensed under the LGPL 2.1, including an + "or any later version" clause, or the MIT license. GPL 2 including + an "or any later version" clause is also acceptable, but LGPL is + preferred. +
  2. + You must not commit code which breaks FFmpeg! (Meaning unfinished but + enabled code which breaks compilation or compiles but does not work or + breaks the regression tests) + You can commit unfinished stuff (for testing etc), but it must be disabled + (#ifdef etc) by default so it does not interfere with other developers’ + work. +
  3. + You do not have to over-test things. If it works for you, and you think it + should work for others, then commit. If your code has problems + (portability, triggers compiler bugs, unusual environment etc) they will be + reported and eventually fixed. +
  4. + Do not commit unrelated changes together, split them into self-contained + pieces. Also do not forget that if part B depends on part A, but A does not + depend on B, then A can and should be committed first and separate from B. + Keeping changes well split into self-contained parts makes reviewing and + understanding them on the commit log mailing list easier. This also helps + in case of debugging later on. + Also if you have doubts about splitting or not splitting, do not hesitate to + ask/discuss it on the developer mailing list. +
  5. + Do not change behavior of the programs (renaming options etc) or public + API or ABI without first discussing it on the ffmpeg-devel mailing list. + Do not remove functionality from the code. Just improve! + +

    Note: Redundant code can be removed. +

  6. + Do not commit changes to the build system (Makefiles, configure script) + which change behavior, defaults etc, without asking first. The same + applies to compiler warning fixes, trivial looking fixes and to code + maintained by other developers. We usually have a reason for doing things + the way we do. Send your changes as patches to the ffmpeg-devel mailing + list, and if the code maintainers say OK, you may commit. This does not + apply to files you wrote and/or maintain. +
  7. + We refuse source indentation and other cosmetic changes if they are mixed + with functional changes, such commits will be rejected and removed. Every + developer has his own indentation style, you should not change it. Of course + if you (re)write something, you can use your own style, even though we would + prefer if the indentation throughout FFmpeg was consistent (Many projects + force a given indentation style - we do not.). If you really need to make + indentation changes (try to avoid this), separate them strictly from real + changes. + +

    NOTE: If you had to put if(){ .. } over a large (> 5 lines) chunk of code, + then either do NOT change the indentation of the inner part within (do not + move it to the right)! or do so in a separate commit +

  8. + Always fill out the commit log message. Describe in a few lines what you + changed and why. You can refer to mailing list postings if you fix a + particular bug. Comments such as "fixed!" or "Changed it." are unacceptable. + Recommanded format: + area changed: Short 1 line description + +

    details describing what and why and giving references. +

  9. + Make sure the author of the commit is set correctly. (see git commit –author) + If you apply a patch, send an + answer to ffmpeg-devel (or wherever you got the patch from) saying that + you applied the patch. +
  10. + When applying patches that have been discussed (at length) on the mailing + list, reference the thread in the log message. +
  11. + Do NOT commit to code actively maintained by others without permission. + Send a patch to ffmpeg-devel instead. If no one answers within a reasonable + timeframe (12h for build failures and security fixes, 3 days small changes, + 1 week for big patches) then commit your patch if you think it is OK. + Also note, the maintainer can simply ask for more time to review! +
  12. + Subscribe to the ffmpeg-cvslog mailing list. The diffs of all commits + are sent there and reviewed by all the other developers. Bugs and possible + improvements or general questions regarding commits are discussed there. We + expect you to react if problems with your code are uncovered. +
  13. + Update the documentation if you change behavior or add features. If you are + unsure how best to do this, send a patch to ffmpeg-devel, the documentation + maintainer(s) will review and commit your stuff. +
  14. + Try to keep important discussions and requests (also) on the public + developer mailing list, so that all developers can benefit from them. +
  15. + Never write to unallocated memory, never write over the end of arrays, + always check values read from some untrusted source before using them + as array index or other risky things. +
  16. + Remember to check if you need to bump versions for the specific libav + parts (libavutil, libavcodec, libavformat) you are changing. You need + to change the version integer. + Incrementing the first component means no backward compatibility to + previous versions (e.g. removal of a function from the public API). + Incrementing the second component means backward compatible change + (e.g. addition of a function to the public API or extension of an + existing data structure). + Incrementing the third component means a noteworthy binary compatible + change (e.g. encoder bug fix that matters for the decoder). +
  17. + Compiler warnings indicate potential bugs or code with bad style. If a type of + warning always points to correct and clean code, that warning should + be disabled, not the code changed. + Thus the remaining warnings can either be bugs or correct code. + If it is a bug, the bug has to be fixed. If it is not, the code should + be changed to not generate a warning unless that causes a slowdown + or obfuscates the code. +
  18. + If you add a new file, give it a proper license header. Do not copy and + paste it from a random place, use an existing file as template. +
+ +

We think our rules are not too hard. If you have comments, contact us. +

+

Note, these rules are mostly borrowed from the MPlayer project. +

+ +

1.5 Submitting patches

+ +

First, read the (see Coding Rules) above if you did not yet. +

+

When you submit your patch, please use git format-patch or +git send-email. We cannot read other diffs :-) +

+

Also please do not submit a patch which contains several unrelated changes. +Split it into separate, self-contained pieces. This does not mean splitting +file by file. Instead, make the patch as small as possible while still +keeping it as a logical unit that contains an individual change, even +if it spans multiple files. This makes reviewing your patches much easier +for us and greatly increases your chances of getting your patch applied. +

+

Use the patcheck tool of FFmpeg to check your patch. +The tool is located in the tools directory. +

+

Run the regression tests before submitting a patch so that you can +verify that there are no big problems. +

+

Patches should be posted as base64 encoded attachments (or any other +encoding which ensures that the patch will not be trashed during +transmission) to the ffmpeg-devel mailing list, see +http://lists.ffmpeg.org/mailman/listinfo/ffmpeg-devel +

+

It also helps quite a bit if you tell us what the patch does (for example +’replaces lrint by lrintf’), and why (for example ’*BSD isn’t C99 compliant +and has no lrint()’) +

+

Also please if you send several patches, send each patch as a separate mail, +do not attach several unrelated patches to the same mail. +

+

Your patch will be reviewed on the mailing list. You will likely be asked +to make some changes and are expected to send in an improved version that +incorporates the requests from the review. This process may go through +several iterations. Once your patch is deemed good enough, some developer +will pick it up and commit it to the official FFmpeg tree. +

+

Give us a few days to react. But if some time passes without reaction, +send a reminder by email. Your patch should eventually be dealt with. +

+ + +

1.6 New codecs or formats checklist

+ +
    +
  1. + Did you use av_cold for codec initialization and close functions? +
  2. + Did you add a long_name under NULL_IF_CONFIG_SMALL to the AVCodec or + AVInputFormat/AVOutputFormat struct? +
  3. + Did you bump the minor version number (and reset the micro version + number) in ‘avcodec.h’ or ‘avformat.h’? +
  4. + Did you register it in ‘allcodecs.c’ or ‘allformats.c’? +
  5. + Did you add the CodecID to ‘avcodec.h’? +
  6. + If it has a fourcc, did you add it to ‘libavformat/riff.c’, + even if it is only a decoder? +
  7. + Did you add a rule to compile the appropriate files in the Makefile? + Remember to do this even if you’re just adding a format to a file that is + already being compiled by some other rule, like a raw demuxer. +
  8. + Did you add an entry to the table of supported formats or codecs in + ‘doc/general.texi’? +
  9. + Did you add an entry in the Changelog? +
  10. + If it depends on a parser or a library, did you add that dependency in + configure? +
  11. + Did you git add the appropriate files before committing? +
  12. + Did you make sure it compiles standalone, i.e. with + configure --disable-everything --enable-decoder=foo + (or --enable-demuxer or whatever your component is)? +
+ + + +

1.7 patch submission checklist

+ +
    +
  1. + Does ’make fate’ pass with the patch applied? +
  2. + Was the patch generated with git format-patch or send-email? +
  3. + Did you sign off your patch? (git commit -s) + See http://kerneltrap.org/files/Jeremy/DCO.txt for the meaning + of sign off. +
  4. + Did you provide a clear git commit log message? +
  5. + Is the patch against latest FFmpeg git master branch? +
  6. + Are you subscribed to ffmpeg-dev? + (the list is subscribers only due to spam) +
  7. + Have you checked that the changes are minimal, so that the same cannot be + achieved with a smaller patch and/or simpler final code? +
  8. + If the change is to speed critical code, did you benchmark it? +
  9. + If you did any benchmarks, did you provide them in the mail? +
  10. + Have you checked that the patch does not introduce buffer overflows or + other security issues? +
  11. + Did you test your decoder or demuxer against damaged data? If no, see + tools/trasher and the noise bitstream filter. Your decoder or demuxer + should not crash or end in a (near) infinite loop when fed damaged data. +
  12. + Does the patch not mix functional and cosmetic changes? +
  13. + Did you add tabs or trailing whitespace to the code? Both are forbidden. +
  14. + Is the patch attached to the email you send? +
  15. + Is the mime type of the patch correct? It should be text/x-diff or + text/x-patch or at least text/plain and not application/octet-stream. +
  16. + If the patch fixes a bug, did you provide a verbose analysis of the bug? +
  17. + If the patch fixes a bug, did you provide enough information, including + a sample, so the bug can be reproduced and the fix can be verified? + Note please do not attach samples >100k to mails but rather provide a + URL, you can upload to ftp://upload.ffmpeg.org +
  18. + Did you provide a verbose summary about what the patch does change? +
  19. + Did you provide a verbose explanation why it changes things like it does? +
  20. + Did you provide a verbose summary of the user visible advantages and + disadvantages if the patch is applied? +
  21. + Did you provide an example so we can verify the new feature added by the + patch easily? +
  22. + If you added a new file, did you insert a license header? It should be + taken from FFmpeg, not randomly copied and pasted from somewhere else. +
  23. + You should maintain alphabetical order in alphabetically ordered lists as + long as doing so does not break API/ABI compatibility. +
  24. + Lines with similar content should be aligned vertically when doing so + improves readability. +
  25. + Consider to add a regression test for your code. +
+ + +

1.8 Patch review process

+ +

All patches posted to ffmpeg-devel will be reviewed, unless they contain a +clear note that the patch is not for the git master branch. +Reviews and comments will be posted as replies to the patch on the +mailing list. The patch submitter then has to take care of every comment, +that can be by resubmitting a changed patch or by discussion. Resubmitted +patches will themselves be reviewed like any other patch. If at some point +a patch passes review with no comments then it is approved, that can for +simple and small patches happen immediately while large patches will generally +have to be changed and reviewed many times before they are approved. +After a patch is approved it will be committed to the repository. +

+

We will review all submitted patches, but sometimes we are quite busy so +especially for large patches this can take several weeks. +

+

When resubmitting patches, please do not make any significant changes +not related to the comments received during review. Such patches will +be rejected. Instead, submit significant changes or new features as +separate patches. +

+ +

1.9 Regression tests

+ +

Before submitting a patch (or committing to the repository), you should at least +test that you did not break anything. +

+

The regression tests build a synthetic video stream and a synthetic +audio stream. These are then encoded and decoded with all codecs or +formats. The CRC (or MD5) of each generated file is recorded in a +result file. A ’diff’ is launched to compare the reference results and +the result file. The output is checked immediately after each test +has run. +

+

The regression tests then go on to test the FFserver code with a +limited set of streams. It is important that this step runs correctly +as well. +

+

Run ’make test’ to test all the codecs and formats. Commands like +’make regtest-mpeg2’ can be used to run a single test. By default, +make will abort if any test fails. To run all tests regardless, +use make -k. To get a more verbose output, use ’make V=1 test’ or +’make V=2 test’. +

+

Run ’make fulltest’ to test all the codecs, formats and FFserver. +

+

[Of course, some patches may change the results of the regression tests. In +this case, the reference results of the regression tests shall be modified +accordingly]. +

+
+

+ + This document was generated by Kyle Schwarz on May 18, 2011 using texi2html 1.82. + +
+ +

+ + diff --git a/ffmpeg 0.7/doc/faq.html b/ffmpeg 0.7/doc/faq.html new file mode 100644 index 000000000..047690ff7 --- /dev/null +++ b/ffmpeg 0.7/doc/faq.html @@ -0,0 +1,655 @@ + + + + +FFmpeg FAQ + + + + + + + + + + + + + + + +

FFmpeg FAQ

+ + +

Table of Contents

+
+ + +
+ +
+ +

1. General Questions

+ + +

1.1 When will the next FFmpeg version be released? / Why are FFmpeg releases so few and far between?

+ +

Like most open source projects FFmpeg suffers from a certain lack of +manpower. For this reason the developers have to prioritize the work +they do and putting out releases is not at the top of the list, fixing +bugs and reviewing patches takes precedence. Please don’t complain or +request more timely and/or frequent releases unless you are willing to +help out creating them. +

+ +

1.2 I have a problem with an old version of FFmpeg; where should I report it?

+

Nowhere. We do not support old FFmpeg versions in any way, we simply lack +the time, motivation and manpower to do so. If you have a problem with an +old version of FFmpeg, upgrade to the latest git snapshot. If you +still experience the problem, then you can report it according to the +guidelines in http://ffmpeg.org/bugreports.html. +

+ +

1.3 Why doesn’t FFmpeg support feature [xyz]?

+ +

Because no one has taken on that task yet. FFmpeg 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. +

+ +

1.4 FFmpeg does not support codec XXX. Can you include a Windows DLL loader to support it?

+ +

No. Windows DLLs are not portable, bloated and often slow. +Moreover FFmpeg strives to support all codecs natively. +A DLL loader is not conducive to that goal. +

+ +

1.5 My bug report/mail to ffmpeg-devel/user has not received any replies.

+ +

Likely reasons +

+ + +

1.6 Is there a forum for FFmpeg? I do not like mailing lists.

+ +

You may view our mailing lists with a more forum-alike look here: +http://dir.gmane.org/gmane.comp.video.ffmpeg.user, +but, if you post, please remember that our mailing list rules still apply there. +

+ +

1.7 I cannot read this file although this format seems to be supported by ffmpeg.

+ +

Even if ffmpeg can read the container format, it may not support all its +codecs. Please consult the supported codec list in the ffmpeg +documentation. +

+ +

1.8 Which codecs are supported by Windows?

+ +

Windows does not support standard formats like MPEG very well, unless you +install some additional codecs. +

+

The following list of video codecs should work on most Windows systems: +

+
msmpeg4v2
+

.avi/.asf +

+
msmpeg4
+

.asf only +

+
wmv1
+

.asf only +

+
wmv2
+

.asf only +

+
mpeg4
+

Only if you have some MPEG-4 codec like ffdshow or Xvid installed. +

+
mpeg1video
+

.mpg only +

+
+

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. +

+

The following list of audio codecs should work on most Windows systems: +

+
adpcm_ima_wav
+
adpcm_ms
+
pcm_s16le
+

always +

+
libmp3lame
+

If some MP3 codec like LAME is installed. +

+
+ + + +

2. Compilation

+ + +

2.1 error: can't find a register in class 'GENERAL_REGS' while reloading 'asm'

+ +

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. +

+

Also note that (some of) the gcc developers believe this is not a bug or +not a bug they should fix: +http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11203. +Then again, some of them do not know the difference between an undecidable +problem and an NP-hard problem... +

+ +

3. Usage

+ + +

3.1 ffmpeg does not work; what is wrong?

+ +

Try a make distclean in the ffmpeg source directory before the build. If this does not help see +(http://ffmpeg.org/bugreports.html). +

+ +

3.2 How do I encode single pictures into movies?

+ +

First, rename your pictures to follow a numerical sequence. +For example, img1.jpg, img2.jpg, img3.jpg,... +Then you may run: +

+
 
  ffmpeg -f image2 -i img%d.jpg /tmp/a.mpg
+
+ +

Notice that ‘%d’ is replaced by the image number. +

+

img%03d.jpg’ means the sequence ‘img001.jpg’, ‘img002.jpg’, etc... +

+

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 *jpg to the ‘/tmp’ directory in the sequence of +‘img001.jpg’, ‘img002.jpg’ and so on. +

+
 
  x=1; for i in *jpg; do counter=$(printf %03d $x); ln -s "$i" /tmp/img"$counter".jpg; x=$(($x+1)); done
+
+ +

If you want to sequence them by oldest modified first, substitute +$(ls -r -t *jpg) in place of *jpg. +

+

Then run: +

+
 
  ffmpeg -f image2 -i /tmp/img%03d.jpg /tmp/a.mpg
+
+ +

The same logic is used for any image format that ffmpeg reads. +

+ +

3.3 How do I encode movie to single pictures?

+ +

Use: +

+
 
  ffmpeg -i movie.mpg movie%d.jpg
+
+ +

The ‘movie.mpg’ used as input will be converted to +‘movie1.jpg’, ‘movie2.jpg’, etc... +

+

Instead of relying on file format self-recognition, you may also use +

+
-vcodec ppm
+
-vcodec png
+
-vcodec mjpeg
+
+

to force the encoding. +

+

Applying that to the previous example: +

 
  ffmpeg -i movie.mpg -f image2 -vcodec mjpeg menu%d.jpg
+
+ +

Beware that there is no "jpeg" codec. Use "mjpeg" instead. +

+ +

3.4 Why do I see a slight quality degradation with multithreaded MPEG* encoding?

+ +

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. +

+ +

3.5 How can I read from the standard input or write to the standard output?

+ +

Use ‘-’ as file name. +

+ +

3.6 -f jpeg doesn’t work.

+ +

Try ’-f image2 test%d.jpg’. +

+ +

3.7 Why can I not change the framerate?

+ +

Some codecs, like MPEG-1/2, only allow a small number of fixed framerates. +Choose a different codec with the -vcodec command line option. +

+ +

3.8 How do I encode Xvid or DivX video with ffmpeg?

+ +

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 ’-vcodec 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. +

+ +

3.9 How do I encode videos which play on the iPod?

+ +
+
needed stuff
+

-acodec libfaac -vcodec mpeg4 width<=320 height<=240 +

+
working stuff
+

mv4, title +

+
non-working stuff
+

B-frames +

+
example command line
+

ffmpeg -i input -acodec libfaac -ab 128k -vcodec mpeg4 -b 1200k -mbd 2 -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2 -s 320x180 -metadata title=X output.mp4 +

+
+ + +

3.10 How do I encode videos which play on the PSP?

+ +
+
needed stuff
+

-acodec libfaac -vcodec mpeg4 width*height<=76800 width%16=0 height%16=0 -ar 24000 -r 30000/1001 or 15000/1001 -f psp +

+
working stuff
+

mv4, title +

+
non-working stuff
+

B-frames +

+
example command line
+

ffmpeg -i input -acodec libfaac -ab 128k -vcodec mpeg4 -b 1200k -ar 24000 -mbd 2 -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2 -s 368x192 -r 30000/1001 -metadata title=X -f psp output.mp4 +

+
needed stuff for H.264
+

-acodec libfaac -vcodec libx264 width*height<=76800 width%16=0? height%16=0? -ar 48000 -coder 1 -r 30000/1001 or 15000/1001 -f psp +

+
working stuff for H.264
+

title, loop filter +

+
non-working stuff for H.264
+

CAVLC +

+
example command line
+

ffmpeg -i input -acodec libfaac -ab 128k -vcodec libx264 -b 1200k -ar 48000 -mbd 2 -coder 1 -cmp 2 -subcmp 2 -s 368x192 -r 30000/1001 -metadata title=X -f psp -flags loop -trellis 2 -partitions parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 output.mp4 +

+
higher resolution for newer PSP firmwares, width<=480, height<=272
+

-vcodec libx264 -level 21 -coder 1 -f psp +

+
example command line
+

ffmpeg -i input -acodec libfaac -ab 128k -ac 2 -ar 48000 -vcodec libx264 -level 21 -b 640k -coder 1 -f psp -flags +loop -trellis 2 -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -g 250 -s 480x272 output.mp4 +

+
+ + +

3.11 Which are good parameters for encoding high quality MPEG-4?

+ +

’-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’. +

+ +

3.12 Which are good parameters for encoding high quality MPEG-1/MPEG-2?

+ +

’-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. +

+ +

3.13 Interlaced video looks very bad when encoded with ffmpeg, what is wrong?

+ +

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. +

+ +

3.14 How can I read DirectShow files?

+ +

If you have built FFmpeg with ./configure --enable-avisynth +(only possible on MinGW/Cygwin platforms), +then you may use any file that DirectShow can read as input. +

+

Just create an "input.avs" text file with this single line ... +

 
  DirectShowSource("C:\path to your file\yourfile.asf")
+
+

... and then feed that text file to ffmpeg: +

 
  ffmpeg -i input.avs
+
+ +

For ANY other help on Avisynth, please visit http://www.avisynth.org/. +

+ +

3.15 How can I join video files?

+ +

A few multimedia containers (MPEG-1, MPEG-2 PS, DV) allow to join video files by +merely concatenating them. +

+

Hence you may concatenate your multimedia files by first transcoding them to +these privileged formats, then using the humble cat command (or the +equally humble copy under Windows), and finally transcoding back to your +format of choice. +

+
 
ffmpeg -i input1.avi -sameq intermediate1.mpg
+ffmpeg -i input2.avi -sameq intermediate2.mpg
+cat intermediate1.mpg intermediate2.mpg > intermediate_all.mpg
+ffmpeg -i intermediate_all.mpg -sameq output.avi
+
+ +

Notice that you should either use -sameq or set a reasonably high +bitrate for your intermediate and output files, if you want to preserve +video quality. +

+

Also notice that you may avoid the huge intermediate files by taking advantage +of named pipes, should your platform support it: +

+
 
mkfifo intermediate1.mpg
+mkfifo intermediate2.mpg
+ffmpeg -i input1.avi -sameq -y intermediate1.mpg < /dev/null &
+ffmpeg -i input2.avi -sameq -y intermediate2.mpg < /dev/null &
+cat intermediate1.mpg intermediate2.mpg |\
+ffmpeg -f mpeg -i - -sameq -vcodec mpeg4 -acodec libmp3lame output.avi
+
+ +

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 +tail as seen below. Note that when piping through tail you +must use command grouping, { ;}, to background properly. +

+

For example, let’s say we want to join two FLV files into an output.flv file: +

+
 
mkfifo temp1.a
+mkfifo temp1.v
+mkfifo temp2.a
+mkfifo temp2.v
+mkfifo all.a
+mkfifo all.v
+ffmpeg -i input1.flv -vn -f u16le -acodec pcm_s16le -ac 2 -ar 44100 - > temp1.a < /dev/null &
+ffmpeg -i input2.flv -vn -f u16le -acodec pcm_s16le -ac 2 -ar 44100 - > temp2.a < /dev/null &
+ffmpeg -i input1.flv -an -f yuv4mpegpipe - > temp1.v < /dev/null &
+{ ffmpeg -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 &
+ffmpeg -f u16le -acodec pcm_s16le -ac 2 -ar 44100 -i all.a \
+       -f yuv4mpegpipe -i all.v \
+       -sameq -y output.flv
+rm temp[12].[av] all.[av]
+
+ + +

3.16 The ffmpeg program does not respect the -maxrate setting, some frames are bigger than maxrate/fps.

+ +

Read the MPEG spec about video buffer verifier. +

+ +

3.17 I want CBR, but no matter what I do frame sizes differ.

+ +

You do not understand what CBR is, please read the MPEG spec. +Read about video buffer verifier and constant bitrate. +The one sentence summary is that there is a buffer and the input rate is +constant, the output can vary as needed. +

+ +

3.18 How do I check if a stream is CBR?

+ +

To quote the MPEG-2 spec: +"There is no way to tell that a bitstream is constant bitrate without +examining all of the vbv_delay values and making complicated computations." +

+ + +

4. Development

+ + +

4.1 Are there examples illustrating how to use the FFmpeg libraries, particularly libavcodec and libavformat?

+ +

Yes. Read the Developers Guide of the FFmpeg documentation. Alternatively, +examine the source code for one of the many open source projects that +already incorporate FFmpeg at (projects.html). +

+ +

4.2 Can you support my C compiler XXX?

+ +

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 #ifdefs related to the compiler. +

+ +

4.3 Is Microsoft Visual C++ supported?

+ +

No. Microsoft Visual C++ is not compliant to the C99 standard and does +not - among other things - support the inline assembly used in FFmpeg. +If you wish to use MSVC++ for your +project then you can link the MSVC++ code with libav* as long as +you compile the latter with a working C compiler. For more information, see +the Microsoft Visual C++ compatibility section in the FFmpeg +documentation. +

+

There have been efforts to make FFmpeg compatible with MSVC++ in the +past. However, they have all been rejected as too intrusive, especially +since MinGW does the job adequately. None of the core developers +work with MSVC++ and thus this item is low priority. Should you find +the silver bullet that solves this problem, feel free to shoot it at us. +

+

We strongly recommend you to move over from MSVC++ to MinGW tools. +

+ +

4.4 Can I use FFmpeg or libavcodec under Windows?

+ +

Yes, but the Cygwin or MinGW tools must be used to compile FFmpeg. +Read the Windows section in the FFmpeg documentation to find more +information. +

+

To get help and instructions for building FFmpeg under Windows, check out +the FFmpeg Windows Help Forum at +http://ffmpeg.arrozcru.org/. +

+ +

4.5 Can you add automake, libtool or autoconf support?

+ +

No. These tools are too bloated and they complicate the build. +

+ +

4.6 Why not rewrite ffmpeg in object-oriented C++?

+ +

FFmpeg 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 "Programming Religion" at (http://www.tux.org/lkml/#s15). +

+ +

4.7 Why are the ffmpeg programs devoid of debugging symbols?

+ +

The build process creates ffmpeg_g, ffplay_g, etc. which contain full debug +information. Those binaries are stripped to create ffmpeg, ffplay, etc. If +you need the debug information, use the *_g versions. +

+ +

4.8 I do not like the LGPL, can I contribute code under the GPL instead?

+ +

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. +

+ +

4.9 I want to compile xyz.c alone but my compiler produced many errors.

+ +

Common code is in its own files in libav* and is used by the individual +codecs. They will not work without the common parts, you have to compile +the whole libav*. If you wish, disable some parts with configure switches. +You can also try to hack it and remove more, but if you had problems fixing +the compilation failure then you are probably not qualified for this. +

+ +

4.10 I’m using libavcodec from within my C++ application but the linker complains about missing symbols which seem to be available.

+ +

FFmpeg 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 FFmpeg includes using extern "C". +

+

See http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html#faq-32.3 +

+ +

4.11 I have a file in memory / a API different from *open/*read/ libc how do I use it with libavformat?

+ +

You have to implement a URLProtocol, see ‘libavformat/file.c’ in +FFmpeg and ‘libmpdemux/demux_lavf.c’ in MPlayer sources. +

+ +

4.12 I get "No compatible shell script interpreter found." in MSys.

+ +

The standard MSys bash (2.04) is broken. You need to install 2.05 or later. +

+ +

4.13 I get "./configure: line <xxx>: pr: command not found" in MSys.

+ +

The standard MSys install doesn’t come with pr. You need to get it from the coreutils package. +

+ +

4.14 Where can I find libav* headers for Pascal/Delphi?

+ +

see http://www.iversenit.dk/dev/ffmpeg-headers/ +

+ +

4.15 Where is the documentation about ffv1, msmpeg4, asv1, 4xm?

+ +

see http://www.ffmpeg.org/~michael/ +

+ +

4.16 How do I feed H.263-RTP (and other codecs in RTP) to libavcodec?

+ +

Even if peculiar since it is network oriented, RTP is a container like any +other. You have to demux RTP before feeding the payload to libavcodec. +In this specific case please look at RFC 4629 to see how it should be done. +

+ +

4.17 AVStream.r_frame_rate is wrong, it is much larger than the framerate.

+ +

r_frame_rate is NOT the average framerate, it is the smallest framerate +that can accurately represent all timestamps. So no, it is not +wrong if it is larger than the average! +For example, if you have mixed 25 and 30 fps content, then r_frame_rate +will be 150. +

+
+

+ + This document was generated by Kyle Schwarz on May 18, 2011 using texi2html 1.82. + +
+ +

+ + diff --git a/ffmpeg 0.7/doc/ffmpeg.html b/ffmpeg 0.7/doc/ffmpeg.html new file mode 100644 index 000000000..7622e3d1f --- /dev/null +++ b/ffmpeg 0.7/doc/ffmpeg.html @@ -0,0 +1,5203 @@ + + + + +ffmpeg Documentation + + + + + + + + + + + + + + + +

ffmpeg Documentation

+ + +

Table of Contents

+
+ + +
+ +
+ +

1. Synopsis

+ +

The generic syntax is: +

+
 
ffmpeg [[infile options][‘-iinfile]]... {[outfile options] outfile}...
+
+ + +

2. Description

+ +

ffmpeg is a very fast video and audio converter that can also grab from +a live audio/video source. It can also convert between arbitrary sample +rates and resize video on the fly with a high quality polyphase filter. +

+

The command line interface is designed to be intuitive, in the sense +that ffmpeg tries to figure out all parameters that can possibly be +derived automatically. You usually only have to specify the target +bitrate you want. +

+

As a general rule, options are applied to the next specified +file. Therefore, order is important, and you can have the same +option on the command line multiple times. Each occurrence is +then applied to the next input or output file. +

+ + +

The format option may be needed for raw input files. +

+

By default ffmpeg tries to convert as losslessly as possible: It +uses the same audio and video parameters for the outputs as the one +specified for the inputs. +

+ + +

3. Options

+ +

All the numerical options, if not specified otherwise, accept in input +a string representing a number, which may contain one of the +International System number postfixes, for example ’K’, ’M’, ’G’. +If ’i’ is appended after the postfix, powers of 2 are used instead of +powers of 10. The ’B’ postfix multiplies the value for 8, and can be +appended after another postfix or used alone. This allows using for +example ’KB’, ’MiB’, ’G’ and ’B’ as postfix. +

+

Options which do not take arguments are boolean options, and set the +corresponding value to true. They can be set to false by prefixing +with "no" the option name, for example using "-nofoo" in the +commandline will set to false the boolean option with name "foo". +

+ +

3.1 Generic options

+ +

These options are shared amongst the ff* tools. +

+
+
-L
+

Show license. +

+
+
-h, -?, -help, --help
+

Show help. +

+
+
-version
+

Show version. +

+
+
-formats
+

Show available formats. +

+

The fields preceding the format names have the following meanings: +

+
D
+

Decoding available +

+
E
+

Encoding available +

+
+ +
+
-codecs
+

Show available codecs. +

+

The fields preceding the codec names have the following meanings: +

+
D
+

Decoding available +

+
E
+

Encoding available +

+
V/A/S
+

Video/audio/subtitle codec +

+
S
+

Codec supports slices +

+
D
+

Codec supports direct rendering +

+
T
+

Codec can handle input truncated at random locations instead of only at frame boundaries +

+
+ +
+
-bsfs
+

Show available bitstream filters. +

+
+
-protocols
+

Show available protocols. +

+
+
-filters
+

Show available libavfilter filters. +

+
+
-pix_fmts
+

Show available pixel formats. +

+
+
-loglevel loglevel
+

Set the logging level used by the library. +loglevel is a number or a string containing one of the following values: +

+
quiet
+
panic
+
fatal
+
error
+
warning
+
info
+
verbose
+
debug
+
+ +

By default the program logs to stderr, if coloring is supported by the +terminal, colors are used to mark errors and warnings. Log coloring +can be disabled setting the environment variable +FFMPEG_FORCE_NOCOLOR or NO_COLOR, or can be forced setting +the environment variable FFMPEG_FORCE_COLOR. +The use of the environment variable NO_COLOR is deprecated and +will be dropped in a following FFmpeg version. +

+
+
+ + +

3.2 Main options

+ +
+
-f fmt
+

Force format. +

+
+
-i filename
+

input file name +

+
+
-y
+

Overwrite output files. +

+
+
-t duration
+

Restrict the transcoded/captured video sequence +to the duration specified in seconds. +hh:mm:ss[.xxx] syntax is also supported. +

+
+
-fs limit_size
+

Set the file size limit. +

+
+
-ss position
+

Seek to given time position in seconds. +hh:mm:ss[.xxx] syntax is also supported. +

+
+
-itsoffset offset
+

Set the input time offset in seconds. +[-]hh:mm:ss[.xxx] syntax is also supported. +This option affects all the input files that follow it. +The offset is added to the timestamps of the input files. +Specifying a positive offset means that the corresponding +streams are delayed by ’offset’ seconds. +

+
+
-timestamp time
+

Set the recording timestamp in the container. +The syntax for time is: +

 
now|([(YYYY-MM-DD|YYYYMMDD)[T|t| ]]((HH[:MM[:SS[.m...]]])|(HH[MM[SS[.m...]]]))[Z|z])
+
+

If the value is "now" it takes the current time. +Time is local time unless ’Z’ or ’z’ is appended, in which case it is +interpreted as UTC. +If the year-month-day part is not specified it takes the current +year-month-day. +

+
+
-metadata key=value
+

Set a metadata key/value pair. +

+

For example, for setting the title in the output file: +

 
ffmpeg -i in.avi -metadata title="my title" out.flv
+
+ +
+
-v number
+

Set the logging verbosity level. +

+
+
-target type
+

Specify target file type ("vcd", "svcd", "dvd", "dv", "dv50", "pal-vcd", +"ntsc-svcd", ... ). All the format options (bitrate, codecs, +buffer sizes) are then set automatically. You can just type: +

+
 
ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
+
+ +

Nevertheless you can specify additional options as long as you know +they do not conflict with the standard, as in: +

+
 
ffmpeg -i myfile.avi -target vcd -bf 2 /tmp/vcd.mpg
+
+ +
+
-dframes number
+

Set the number of data frames to record. +

+
+
-scodec codec
+

Force subtitle codec (’copy’ to copy stream). +

+
+
-newsubtitle
+

Add a new subtitle stream to the current output stream. +

+
+
-slang code
+

Set the ISO 639 language code (3 letters) of the current subtitle stream. +

+
+
+ + +

3.3 Video Options

+ +
+
-b bitrate
+

Set the video bitrate in bit/s (default = 200 kb/s). +

+
-vframes number
+

Set the number of video frames to record. +

+
-r fps
+

Set frame rate (Hz value, fraction or abbreviation), (default = 25). +

+
-s size
+

Set frame size. The format is ‘wxh’ (ffserver default = 160x128). +There is no default for input streams, +for output streams it is set by default to the size of the source stream. +If the input file has video streams with different resolutions, the behaviour is undefined. +The following abbreviations are recognized: +

+
sqcif
+

128x96 +

+
qcif
+

176x144 +

+
cif
+

352x288 +

+
4cif
+

704x576 +

+
16cif
+

1408x1152 +

+
qqvga
+

160x120 +

+
qvga
+

320x240 +

+
vga
+

640x480 +

+
svga
+

800x600 +

+
xga
+

1024x768 +

+
uxga
+

1600x1200 +

+
qxga
+

2048x1536 +

+
sxga
+

1280x1024 +

+
qsxga
+

2560x2048 +

+
hsxga
+

5120x4096 +

+
wvga
+

852x480 +

+
wxga
+

1366x768 +

+
wsxga
+

1600x1024 +

+
wuxga
+

1920x1200 +

+
woxga
+

2560x1600 +

+
wqsxga
+

3200x2048 +

+
wquxga
+

3840x2400 +

+
whsxga
+

6400x4096 +

+
whuxga
+

7680x4800 +

+
cga
+

320x200 +

+
ega
+

640x350 +

+
hd480
+

852x480 +

+
hd720
+

1280x720 +

+
hd1080
+

1920x1080 +

+
+ +
+
-aspect aspect
+

Set the video display aspect ratio specified by aspect. +

+

aspect can be a floating point number string, or a string of the +form num:den, where num and den are the +numerator and denominator of the aspect ratio. For example "4:3", +"16:9", "1.3333", and "1.7777" are valid argument values. +

+
+
-croptop size
+
-cropbottom size
+
-cropleft size
+
-cropright size
+

All the crop options have been removed. Use -vf +crop=width:height:x:y instead. +

+
+
-padtop size
+
-padbottom size
+
-padleft size
+
-padright size
+
-padcolor hex_color
+

All the pad options have been removed. Use -vf +pad=width:height:x:y:color instead. +

+
-vn
+

Disable video recording. +

+
-bt tolerance
+

Set video bitrate tolerance (in bits, default 4000k). +Has a minimum value of: (target_bitrate/target_framerate). +In 1-pass mode, bitrate tolerance specifies how far ratecontrol is +willing to deviate from the target average bitrate value. This is +not related to min/max bitrate. Lowering tolerance too much has +an adverse effect on quality. +

+
-maxrate bitrate
+

Set max video bitrate (in bit/s). +Requires -bufsize to be set. +

+
-minrate bitrate
+

Set min video bitrate (in bit/s). +Most useful in setting up a CBR encode: +

 
ffmpeg -i myfile.avi -b 4000k -minrate 4000k -maxrate 4000k -bufsize 1835k out.m2v
+
+

It is of little use elsewise. +

+
-bufsize size
+

Set video buffer verifier buffer size (in bits). +

+
-vcodec codec
+

Force video codec to codec. Use the copy special value to +tell that the raw codec data must be copied as is. +

+
-sameq
+

Use same quantizer as source (implies VBR). +

+
+
-pass n
+

Select the pass number (1 or 2). It is used to do two-pass +video encoding. The statistics of the video are recorded in the first +pass into a log file (see also the option -passlogfile), +and in the second pass that log file is used to generate the video +at the exact requested bitrate. +On pass 1, you may just deactivate audio and set output to null, +examples for Windows and Unix: +

 
ffmpeg -i foo.mov -vcodec libxvid -pass 1 -an -f rawvideo -y NUL
+ffmpeg -i foo.mov -vcodec libxvid -pass 1 -an -f rawvideo -y /dev/null
+
+ +
+
-passlogfile prefix
+

Set two-pass log file name prefix to prefix, the default file name +prefix is “ffmpeg2pass”. The complete file name will be +‘PREFIX-N.log’, where N is a number specific to the output +stream. +

+
+
-newvideo
+

Add a new video stream to the current output stream. +

+
+
-vlang code
+

Set the ISO 639 language code (3 letters) of the current video stream. +

+
+
-vf filter_graph
+

filter_graph is a description of the filter graph to apply to +the input video. +Use the option "-filters" to show all the available filters (including +also sources and sinks). +

+
+
+ + +

3.4 Advanced Video Options

+ +
+
-pix_fmt format
+

Set pixel format. Use ’list’ as parameter to show all the supported +pixel formats. +

+
-sws_flags flags
+

Set SwScaler flags. +

+
-g gop_size
+

Set the group of pictures size. +

+
-intra
+

Use only intra frames. +

+
-vdt n
+

Discard threshold. +

+
-qscale q
+

Use fixed video quantizer scale (VBR). +

+
-qmin q
+

minimum video quantizer scale (VBR) +

+
-qmax q
+

maximum video quantizer scale (VBR) +

+
-qdiff q
+

maximum difference between the quantizer scales (VBR) +

+
-qblur blur
+

video quantizer scale blur (VBR) (range 0.0 - 1.0) +

+
-qcomp compression
+

video quantizer scale compression (VBR) (default 0.5). +Constant of ratecontrol equation. Recommended range for default rc_eq: 0.0-1.0 +

+
+
-lmin lambda
+

minimum video lagrange factor (VBR) +

+
-lmax lambda
+

max video lagrange factor (VBR) +

+
-mblmin lambda
+

minimum macroblock quantizer scale (VBR) +

+
-mblmax lambda
+

maximum macroblock quantizer scale (VBR) +

+

These four options (lmin, lmax, mblmin, mblmax) use ’lambda’ units, +but you may use the QP2LAMBDA constant to easily convert from ’q’ units: +

 
ffmpeg -i src.ext -lmax 21*QP2LAMBDA dst.ext
+
+ +
+
-rc_init_cplx complexity
+

initial complexity for single pass encoding +

+
-b_qfactor factor
+

qp factor between P- and B-frames +

+
-i_qfactor factor
+

qp factor between P- and I-frames +

+
-b_qoffset offset
+

qp offset between P- and B-frames +

+
-i_qoffset offset
+

qp offset between P- and I-frames +

+
-rc_eq equation
+

Set rate control equation (see section "Expression Evaluation") +(default = tex^qComp). +

+

When computing the rate control equation expression, besides the +standard functions defined in the section "Expression Evaluation", the +following functions are available: +

+
bits2qp(bits)
+
qp2bits(qp)
+
+ +

and the following constants are available: +

+
iTex
+
pTex
+
tex
+
mv
+
fCode
+
iCount
+
mcVar
+
var
+
isI
+
isP
+
isB
+
avgQP
+
qComp
+
avgIITex
+
avgPITex
+
avgPPTex
+
avgBPTex
+
avgTex
+
+ +
+
-rc_override override
+

rate control override for specific intervals +

+
-me_method method
+

Set motion estimation method to method. +Available methods are (from lowest to best quality): +

+
zero
+

Try just the (0, 0) vector. +

+
phods
+
log
+
x1
+
hex
+
umh
+
epzs
+

(default method) +

+
full
+

exhaustive search (slow and marginally better than epzs) +

+
+ +
+
-dct_algo algo
+

Set DCT algorithm to algo. Available values are: +

+
0
+

FF_DCT_AUTO (default) +

+
1
+

FF_DCT_FASTINT +

+
2
+

FF_DCT_INT +

+
3
+

FF_DCT_MMX +

+
4
+

FF_DCT_MLIB +

+
5
+

FF_DCT_ALTIVEC +

+
+ +
+
-idct_algo algo
+

Set IDCT algorithm to algo. Available values are: +

+
0
+

FF_IDCT_AUTO (default) +

+
1
+

FF_IDCT_INT +

+
2
+

FF_IDCT_SIMPLE +

+
3
+

FF_IDCT_SIMPLEMMX +

+
4
+

FF_IDCT_LIBMPEG2MMX +

+
5
+

FF_IDCT_PS2 +

+
6
+

FF_IDCT_MLIB +

+
7
+

FF_IDCT_ARM +

+
8
+

FF_IDCT_ALTIVEC +

+
9
+

FF_IDCT_SH4 +

+
10
+

FF_IDCT_SIMPLEARM +

+
+ +
+
-er n
+

Set error resilience to n. +

+
1
+

FF_ER_CAREFUL (default) +

+
2
+

FF_ER_COMPLIANT +

+
3
+

FF_ER_AGGRESSIVE +

+
4
+

FF_ER_VERY_AGGRESSIVE +

+
+ +
+
-ec bit_mask
+

Set error concealment to bit_mask. bit_mask is a bit mask of +the following values: +

+
1
+

FF_EC_GUESS_MVS (default = enabled) +

+
2
+

FF_EC_DEBLOCK (default = enabled) +

+
+ +
+
-bf frames
+

Use ’frames’ B-frames (supported for MPEG-1, MPEG-2 and MPEG-4). +

+
-mbd mode
+

macroblock decision +

+
0
+

FF_MB_DECISION_SIMPLE: Use mb_cmp (cannot change it yet in ffmpeg). +

+
1
+

FF_MB_DECISION_BITS: Choose the one which needs the fewest bits. +

+
2
+

FF_MB_DECISION_RD: rate distortion +

+
+ +
+
-4mv
+

Use four motion vector by macroblock (MPEG-4 only). +

+
-part
+

Use data partitioning (MPEG-4 only). +

+
-bug param
+

Work around encoder bugs that are not auto-detected. +

+
-strict strictness
+

How strictly to follow the standards. +

+
-aic
+

Enable Advanced intra coding (h263+). +

+
-umv
+

Enable Unlimited Motion Vector (h263+) +

+
+
-deinterlace
+

Deinterlace pictures. +

+
-ilme
+

Force interlacing support in encoder (MPEG-2 and MPEG-4 only). +Use this option if your input file is interlaced and you want +to keep the interlaced format for minimum losses. +The alternative is to deinterlace the input stream with +‘-deinterlace’, but deinterlacing introduces losses. +

+
-psnr
+

Calculate PSNR of compressed frames. +

+
-vstats
+

Dump video coding statistics to ‘vstats_HHMMSS.log’. +

+
-vstats_file file
+

Dump video coding statistics to file. +

+
-top n
+

top=1/bottom=0/auto=-1 field first +

+
-dc precision
+

Intra_dc_precision. +

+
-vtag fourcc/tag
+

Force video tag/fourcc. +

+
-qphist
+

Show QP histogram. +

+
-vbsf bitstream_filter
+

Bitstream filters available are "dump_extra", "remove_extra", "noise", "h264_mp4toannexb", "imxdump", "mjpegadump", "mjpeg2jpeg". +

 
ffmpeg -i h264.mp4 -vcodec copy -vbsf h264_mp4toannexb -an out.h264
+
+
+
-force_key_frames time[,time...]
+

Force key frames at the specified timestamps, more precisely at the first +frames after each specified time. +This option can be useful to ensure that a seek point is present at a +chapter mark or any other designated place in the output file. +The timestamps must be specified in ascending order. +

+
+ + +

3.5 Audio Options

+ +
+
-aframes number
+

Set the number of audio frames to record. +

+
-ar freq
+

Set the audio sampling frequency. For input streams it is set by +default to 44100 Hz, for output streams it is set by default to the +frequency of the input stream. If the input file has audio streams +with different frequencies, the behaviour is undefined. +

+
-ab bitrate
+

Set the audio bitrate in bit/s (default = 64k). +

+
-aq q
+

Set the audio quality (codec-specific, VBR). +

+
-ac channels
+

Set the number of audio channels. For input streams it is set by +default to 1, for output streams it is set by default to the same +number of audio channels in input. If the input file has audio streams +with different channel count, the behaviour is undefined. +

+
-an
+

Disable audio recording. +

+
-acodec codec
+

Force audio codec to codec. Use the copy special value to +specify that the raw codec data must be copied as is. +

+
-newaudio
+

Add a new audio track to the output file. If you want to specify parameters, +do so before -newaudio (-acodec, -ab, etc..). +

+

Mapping will be done automatically, if the number of output streams is equal to +the number of input streams, else it will pick the first one that matches. You +can override the mapping using -map as usual. +

+

Example: +

 
ffmpeg -i file.mpg -vcodec copy -acodec ac3 -ab 384k test.mpg -acodec mp2 -ab 192k -newaudio
+
+
+
-alang code
+

Set the ISO 639 language code (3 letters) of the current audio stream. +

+
+ + +

3.6 Advanced Audio options:

+ +
+
-atag fourcc/tag
+

Force audio tag/fourcc. +

+
-audio_service_type type
+

Set the type of service that the audio stream contains. +

+
ma
+

Main Audio Service (default) +

+
ef
+

Effects +

+
vi
+

Visually Impaired +

+
hi
+

Hearing Impaired +

+
di
+

Dialogue +

+
co
+

Commentary +

+
em
+

Emergency +

+
vo
+

Voice Over +

+
ka
+

Karaoke +

+
+
+
-absf bitstream_filter
+

Bitstream filters available are "dump_extra", "remove_extra", "noise", "mp3comp", "mp3decomp". +

+
+ + +

3.7 Subtitle options:

+ +
+
-scodec codec
+

Force subtitle codec (’copy’ to copy stream). +

+
-newsubtitle
+

Add a new subtitle stream to the current output stream. +

+
-slang code
+

Set the ISO 639 language code (3 letters) of the current subtitle stream. +

+
-sn
+

Disable subtitle recording. +

+
-sbsf bitstream_filter
+

Bitstream filters available are "mov2textsub", "text2movsub". +

 
ffmpeg -i file.mov -an -vn -sbsf mov2textsub -scodec copy -f rawvideo sub.txt
+
+
+
+ + +

3.8 Audio/Video grab options

+ +
+
-vc channel
+

Set video grab channel (DV1394 only). +

+
-tvstd standard
+

Set television standard (NTSC, PAL (SECAM)). +

+
-isync
+

Synchronize read on input. +

+
+ + +

3.9 Advanced options

+ +
+
-map input_file_id.input_stream_id[:sync_file_id.sync_stream_id]
+
+

Designate an input stream as a source for the output file. Each input +stream is identified by the input file index input_file_id and +the input stream index input_stream_id within the input +file. Both indexes start at 0. If specified, +sync_file_id.sync_stream_id sets which input stream +is used as a presentation sync reference. +

+

The -map options must be specified just after the output file. +If any -map options are used, the number of -map options +on the command line must match the number of streams in the output +file. The first -map option on the command line specifies the +source for output stream 0, the second -map option specifies +the source for output stream 1, etc. +

+

For example, if you have two audio streams in the first input file, +these streams are identified by "0.0" and "0.1". You can use +-map to select which stream to place in an output file. For +example: +

 
ffmpeg -i INPUT out.wav -map 0.1
+
+

will map the input stream in ‘INPUT’ identified by "0.1" to +the (single) output stream in ‘out.wav’. +

+

For example, to select the stream with index 2 from input file +‘a.mov’ (specified by the identifier "0.2"), and stream with +index 6 from input ‘b.mov’ (specified by the identifier "1.6"), +and copy them to the output file ‘out.mov’: +

 
ffmpeg -i a.mov -i b.mov -vcodec copy -acodec copy out.mov -map 0.2 -map 1.6
+
+ +

To add more streams to the output file, you can use the +-newaudio, -newvideo, -newsubtitle options. +

+
+
-map_meta_data outfile[,metadata]:infile[,metadata]
+

Deprecated, use -map_metadata instead. +

+
+
-map_metadata outfile[,metadata]:infile[,metadata]
+

Set metadata information of outfile from infile. Note that those +are file indices (zero-based), not filenames. +Optional metadata parameters specify, which metadata to copy - (g)lobal +(i.e. metadata that applies to the whole file), per-(s)tream, per-(c)hapter or +per-(p)rogram. All metadata specifiers other than global must be followed by the +stream/chapter/program number. If metadata specifier is omitted, it defaults to +global. +

+

By default, global metadata is copied from the first input file to all output files, +per-stream and per-chapter metadata is copied along with streams/chapters. These +default mappings are disabled by creating any mapping of the relevant type. A negative +file index can be used to create a dummy mapping that just disables automatic copying. +

+

For example to copy metadata from the first stream of the input file to global metadata +of the output file: +

 
ffmpeg -i in.ogg -map_metadata 0:0,s0 out.mp3
+
+
+
-map_chapters outfile:infile
+

Copy chapters from infile to outfile. If no chapter mapping is specified, +then chapters are copied from the first input file with at least one chapter to all +output files. Use a negative file index to disable any chapter copying. +

+
-debug
+

Print specific debug info. +

+
-benchmark
+

Show benchmarking information at the end of an encode. +Shows CPU time used and maximum memory consumption. +Maximum memory consumption is not supported on all systems, +it will usually display as 0 if not supported. +

+
-dump
+

Dump each input packet. +

+
-hex
+

When dumping packets, also dump the payload. +

+
-bitexact
+

Only use bit exact algorithms (for codec testing). +

+
-ps size
+

Set RTP payload size in bytes. +

+
-re
+

Read input at native frame rate. Mainly used to simulate a grab device. +

+
-loop_input
+

Loop over the input stream. Currently it works only for image +streams. This option is used for automatic FFserver testing. +

+
-loop_output number_of_times
+

Repeatedly loop output for formats that support looping such as animated GIF +(0 will loop the output infinitely). +

+
-threads count
+

Thread count. +

+
-vsync parameter
+

Video sync method. +

+
+
0
+

Each frame is passed with its timestamp from the demuxer to the muxer. +

+
1
+

Frames will be duplicated and dropped to achieve exactly the requested +constant framerate. +

+
2
+

Frames are passed through with their timestamp or dropped so as to +prevent 2 frames from having the same timestamp. +

+
-1
+

Chooses between 1 and 2 depending on muxer capabilities. This is the +default method. +

+
+ +

With -map you can select from which stream the timestamps should be +taken. You can leave either video or audio unchanged and sync the +remaining stream(s) to the unchanged one. +

+
+
-async samples_per_second
+

Audio sync method. "Stretches/squeezes" the audio stream to match the timestamps, +the parameter is the maximum samples per second by which the audio is changed. +-async 1 is a special case where only the start of the audio stream is corrected +without any later correction. +

+
-copyts
+

Copy timestamps from input to output. +

+
-copytb
+

Copy input stream time base from input to output when stream copying. +

+
-shortest
+

Finish encoding when the shortest input stream ends. +

+
-dts_delta_threshold
+

Timestamp discontinuity delta threshold. +

+
-muxdelay seconds
+

Set the maximum demux-decode delay. +

+
-muxpreload seconds
+

Set the initial demux-decode delay. +

+
-streamid output-stream-index:new-value
+

Assign a new stream-id value to an output stream. This option should be +specified prior to the output filename to which it applies. +For the situation where multiple output files exist, a streamid +may be reassigned to a different value. +

+

For example, to set the stream 0 PID to 33 and the stream 1 PID to 36 for +an output mpegts file: +

 
ffmpeg -i infile -streamid 0:33 -streamid 1:36 out.ts
+
+
+
+ + +

3.10 Preset files

+ +

A preset file contains a sequence of option=value pairs, +one for each line, specifying a sequence of options which would be +awkward to specify on the command line. Lines starting with the hash +(’#’) character are ignored and are used to provide comments. Check +the ‘ffpresets’ directory in the FFmpeg source tree for examples. +

+

Preset files are specified with the vpre, apre, +spre, and fpre options. The fpre option takes the +filename of the preset instead of a preset name as input and can be +used for any kind of codec. For the vpre, apre, and +spre options, the options specified in a preset file are +applied to the currently selected codec of the same type as the preset +option. +

+

The argument passed to the vpre, apre, and spre +preset options identifies the preset file to use according to the +following rules: +

+

First ffmpeg searches for a file named arg.ffpreset in the +directories ‘$FFMPEG_DATADIR’ (if set), and ‘$HOME/.ffmpeg’, and in +the datadir defined at configuration time (usually ‘PREFIX/share/ffmpeg’) +in that order. For example, if the argument is libx264-max, it will +search for the file ‘libx264-max.ffpreset’. +

+

If no such file is found, then ffmpeg will search for a file named +codec_name-arg.ffpreset in the above-mentioned +directories, where codec_name is the name of the codec to which +the preset file options will be applied. For example, if you select +the video codec with -vcodec libx264 and use -vpre max, +then it will search for the file ‘libx264-max.ffpreset’. +

+ +

4. Tips

+ + + + +

5. Examples

+ + +

5.1 Video and Audio grabbing

+ +

If you specify the input format and device then ffmpeg can grab video +and audio directly. +

+
 
ffmpeg -f oss -i /dev/dsp -f video4linux2 -i /dev/video0 /tmp/out.mpg
+
+ +

Note that you must activate the right video source and channel before +launching ffmpeg with any TV viewer such as xawtv +(http://linux.bytesex.org/xawtv/) by Gerd Knorr. You also +have to set the audio recording levels correctly with a +standard mixer. +

+ +

5.2 X11 grabbing

+ +

Grab the X11 display with ffmpeg via +

+
 
ffmpeg -f x11grab -s cif -r 25 -i :0.0 /tmp/out.mpg
+
+ +

0.0 is display.screen number of your X11 server, same as +the DISPLAY environment variable. +

+
 
ffmpeg -f x11grab -s cif -r 25 -i :0.0+10,20 /tmp/out.mpg
+
+ +

0.0 is display.screen number of your X11 server, same as the DISPLAY environment +variable. 10 is the x-offset and 20 the y-offset for the grabbing. +

+ +

5.3 Video and Audio file format conversion

+ +

Any supported file format and protocol can serve as input to ffmpeg: +

+

Examples: +

+ + +

6. Expression Evaluation

+ +

When evaluating an arithemetic expression, FFmpeg uses an internal +formula evaluator, implemented through the ‘libavutil/eval.h’ +interface. +

+

An expression may contain unary, binary operators, constants, and +functions. +

+

Two expressions expr1 and expr2 can be combined to form +another expression "expr1;expr2". +expr1 and expr2 are evaluated in turn, and the new +expression evaluates to the value of expr2. +

+

The following binary operators are available: +, -, +*, /, ^. +

+

The following unary operators are available: +, -. +

+

The following functions are available: +

+
sinh(x)
+
cosh(x)
+
tanh(x)
+
sin(x)
+
cos(x)
+
tan(x)
+
atan(x)
+
asin(x)
+
acos(x)
+
exp(x)
+
log(x)
+
abs(x)
+
squish(x)
+
gauss(x)
+
isnan(x)
+

Return 1.0 if x is NAN, 0.0 otherwise. +

+
+
mod(x, y)
+
max(x, y)
+
min(x, y)
+
eq(x, y)
+
gte(x, y)
+
gt(x, y)
+
lte(x, y)
+
lt(x, y)
+
st(var, expr)
+

Allow to store the value of the expression expr in an internal +variable. var specifies the number of the variable where to +store the value, and it is a value ranging from 0 to 9. The function +returns the value stored in the internal variable. +

+
+
ld(var)
+

Allow to load the value of the internal variable with number +var, which was previosly stored with st(var, expr). +The function returns the loaded value. +

+
+
while(cond, expr)
+

Evaluate expression expr while the expression cond is +non-zero, and returns the value of the last expr evaluation, or +NAN if cond was always false. +

+
+
ceil(expr)
+

Round the value of expression expr upwards to the nearest +integer. For example, "ceil(1.5)" is "2.0". +

+
+
floor(expr)
+

Round the value of expression expr downwards to the nearest +integer. For example, "floor(-1.5)" is "-2.0". +

+
+
trunc(expr)
+

Round the value of expression expr towards zero to the nearest +integer. For example, "trunc(-1.5)" is "-1.0". +

+
+
sqrt(expr)
+

Compute the square root of expr. This is equivalent to +"(expr)^.5". +

+
+ +

Note that: +

+

* works like AND +

+

+ works like OR +

+

thus +

 
if A then B else C
+
+

is equivalent to +

 
A*B + not(A)*C
+
+ +

When A evaluates to either 1 or 0, that is the same as +

 
A*B + eq(A,0)*C
+
+ +

In your C code, you can extend the list of unary and binary functions, +and define recognized constants, so that they are available for your +expressions. +

+

The evaluator also recognizes the International System number +postfixes. If ’i’ is appended after the postfix, powers of 2 are used +instead of powers of 10. The ’B’ postfix multiplies the value for 8, +and can be appended after another postfix or used alone. This allows +using for example ’KB’, ’MiB’, ’G’ and ’B’ as postfix. +

+

Follows the list of available International System postfixes, with +indication of the corresponding powers of 10 and of 2. +

+
y
+

-24 / -80 +

+
z
+

-21 / -70 +

+
a
+

-18 / -60 +

+
f
+

-15 / -50 +

+
p
+

-12 / -40 +

+
n
+

-9 / -30 +

+
u
+

-6 / -20 +

+
m
+

-3 / -10 +

+
c
+

-2 +

+
d
+

-1 +

+
h
+

2 +

+
k
+

3 / 10 +

+
K
+

3 / 10 +

+
M
+

6 / 20 +

+
G
+

9 / 30 +

+
T
+

12 / 40 +

+
P
+

15 / 40 +

+
E
+

18 / 50 +

+
Z
+

21 / 60 +

+
Y
+

24 / 70 +

+
+ + +

7. Encoders

+ +

Encoders are configured elements in FFmpeg which allow the encoding of +multimedia streams. +

+

When you configure your FFmpeg build, all the supported native encoders +are enabled by default. Encoders requiring an external library must be enabled +manually via the corresponding --enable-lib option. You can list all +available encoders using the configure option --list-encoders. +

+

You can disable all the encoders with the configure option +--disable-encoders and selectively enable / disable single encoders +with the options --enable-encoder=ENCODER / +--disable-encoder=ENCODER. +

+

The option -codecs of the ff* tools will display the list of +enabled encoders. +

+

A description of some of the currently available encoders follows. +

+ +

7.1 Audio Encoders

+ + +

7.1.1 ac3 and ac3_fixed

+ +

AC-3 audio encoders. +

+

These encoders implement part of ATSC A/52:2010 and ETSI TS 102 366, as well as +the undocumented RealAudio 3 (a.k.a. dnet). +

+

The ac3 encoder uses floating-point math, while the ac3_fixed +encoder only uses fixed-point integer math. This does not mean that one is +always faster, just that one or the other may be better suited to a +particular system. The floating-point encoder will generally produce better +quality audio for a given bitrate. The ac3_fixed encoder is not the +default codec for any of the output formats, so it must be specified explicitly +using the option -acodec ac3_fixed in order to use it. +

+ +

AC-3 Metadata

+ +

The AC-3 metadata options are used to set parameters that describe the audio, +but in most cases do not affect the audio encoding itself. Some of the options +do directly affect or influence the decoding and playback of the resulting +bitstream, while others are just for informational purposes. A few of the +options will add bits to the output stream that could otherwise be used for +audio data, and will thus affect the quality of the output. Those will be +indicated accordingly with a note in the option list below. +

+

These parameters are described in detail in several publicly-available +documents. +

+ + +

Metadata Control Options

+ +
+
-per_frame_metadata boolean
+

Allow Per-Frame Metadata. Specifies if the encoder should check for changing +metadata for each frame. +

+
0
+

The metadata values set at initialization will be used for every frame in the +stream. (default) +

+
1
+

Metadata values can be changed before encoding each frame. +

+
+ +
+
+ + +

Downmix Levels

+ +
+
-center_mixlev level
+

Center Mix Level. The amount of gain the decoder should apply to the center +channel when downmixing to stereo. This field will only be written to the +bitstream if a center channel is present. The value is specified as a scale +factor. There are 3 valid values: +

+
0.707
+

Apply -3dB gain +

+
0.595
+

Apply -4.5dB gain (default) +

+
0.500
+

Apply -6dB gain +

+
+ +
+
-surround_mixlev level
+

Surround Mix Level. The amount of gain the decoder should apply to the surround +channel(s) when downmixing to stereo. This field will only be written to the +bitstream if one or more surround channels are present. The value is specified +as a scale factor. There are 3 valid values: +

+
0.707
+

Apply -3dB gain +

+
0.500
+

Apply -6dB gain (default) +

+
0.000
+

Silence Surround Channel(s) +

+
+ +
+
+ + +

Audio Production Information

+

Audio Production Information is optional information describing the mixing +environment. Either none or both of the fields are written to the bitstream. +

+
+
-mixing_level number
+

Mixing Level. Specifies peak sound pressure level (SPL) in the production +environment when the mix was mastered. Valid values are 80 to 111, or -1 for +unknown or not indicated. The default value is -1, but that value cannot be +used if the Audio Production Information is written to the bitstream. Therefore, +if the room_type option is not the default value, the mixing_level +option must not be -1. +

+
+
-room_type type
+

Room Type. Describes the equalization used during the final mixing session at +the studio or on the dubbing stage. A large room is a dubbing stage with the +industry standard X-curve equalization; a small room has flat equalization. +This field will not be written to the bitstream if both the mixing_level +option and the room_type option have the default values. +

+
0
+
notindicated
+

Not Indicated (default) +

+
1
+
large
+

Large Room +

+
2
+
small
+

Small Room +

+
+ +
+
+ + +

Other Metadata Options

+ +
+
-copyright boolean
+

Copyright Indicator. Specifies whether a copyright exists for this audio. +

+
0
+
off
+

No Copyright Exists (default) +

+
1
+
on
+

Copyright Exists +

+
+ +
+
-dialnorm value
+

Dialogue Normalization. Indicates how far the average dialogue level of the +program is below digital 100% full scale (0 dBFS). This parameter determines a +level shift during audio reproduction that sets the average volume of the +dialogue to a preset level. The goal is to match volume level between program +sources. A value of -31dB will result in no volume level change, relative to +the source volume, during audio reproduction. Valid values are whole numbers in +the range -31 to -1, with -31 being the default. +

+
+
-dsur_mode mode
+

Dolby Surround Mode. Specifies whether the stereo signal uses Dolby Surround +(Pro Logic). This field will only be written to the bitstream if the audio +stream is stereo. Using this option does NOT mean the encoder will actually +apply Dolby Surround processing. +

+
0
+
notindicated
+

Not Indicated (default) +

+
1
+
off
+

Not Dolby Surround Encoded +

+
2
+
on
+

Dolby Surround Encoded +

+
+ +
+
-original boolean
+

Original Bit Stream Indicator. Specifies whether this audio is from the +original source and not a copy. +

+
0
+
off
+

Not Original Source +

+
1
+
on
+

Original Source (default) +

+
+ +
+
+ + +

Extended Bitstream Information

+

The extended bitstream options are part of the Alternate Bit Stream Syntax as +specified in Annex D of the A/52:2010 standard. It is grouped into 2 parts. +If any one parameter in a group is specified, all values in that group will be +written to the bitstream. Default values are used for those that are written +but have not been specified. If the mixing levels are written, the decoder +will use these values instead of the ones specified in the center_mixlev +and surround_mixlev options if it supports the Alternate Bit Stream +Syntax. +

+ +

Extended Bitstream Information - Part 1

+ +
+
-dmix_mode mode
+

Preferred Stereo Downmix Mode. Allows the user to select either Lt/Rt +(Dolby Surround) or Lo/Ro (normal stereo) as the preferred stereo downmix mode. +

+
0
+
notindicated
+

Not Indicated (default) +

+
1
+
ltrt
+

Lt/Rt Downmix Preferred +

+
2
+
loro
+

Lo/Ro Downmix Preferred +

+
+ +
+
-ltrt_cmixlev level
+

Lt/Rt Center Mix Level. The amount of gain the decoder should apply to the +center channel when downmixing to stereo in Lt/Rt mode. +

+
1.414
+

Apply +3dB gain +

+
1.189
+

Apply +1.5dB gain +

+
1.000
+

Apply 0dB gain +

+
0.841
+

Apply -1.5dB gain +

+
0.707
+

Apply -3.0dB gain +

+
0.595
+

Apply -4.5dB gain (default) +

+
0.500
+

Apply -6.0dB gain +

+
0.000
+

Silence Center Channel +

+
+ +
+
-ltrt_surmixlev level
+

Lt/Rt Surround Mix Level. The amount of gain the decoder should apply to the +surround channel(s) when downmixing to stereo in Lt/Rt mode. +

+
0.841
+

Apply -1.5dB gain +

+
0.707
+

Apply -3.0dB gain +

+
0.595
+

Apply -4.5dB gain +

+
0.500
+

Apply -6.0dB gain (default) +

+
0.000
+

Silence Surround Channel(s) +

+
+ +
+
-loro_cmixlev level
+

Lo/Ro Center Mix Level. The amount of gain the decoder should apply to the +center channel when downmixing to stereo in Lo/Ro mode. +

+
1.414
+

Apply +3dB gain +

+
1.189
+

Apply +1.5dB gain +

+
1.000
+

Apply 0dB gain +

+
0.841
+

Apply -1.5dB gain +

+
0.707
+

Apply -3.0dB gain +

+
0.595
+

Apply -4.5dB gain (default) +

+
0.500
+

Apply -6.0dB gain +

+
0.000
+

Silence Center Channel +

+
+ +
+
-loro_surmixlev level
+

Lo/Ro Surround Mix Level. The amount of gain the decoder should apply to the +surround channel(s) when downmixing to stereo in Lo/Ro mode. +

+
0.841
+

Apply -1.5dB gain +

+
0.707
+

Apply -3.0dB gain +

+
0.595
+

Apply -4.5dB gain +

+
0.500
+

Apply -6.0dB gain (default) +

+
0.000
+

Silence Surround Channel(s) +

+
+ +
+
+ + +

Extended Bitstream Information - Part 2

+ +
+
-dsurex_mode mode
+

Dolby Surround EX Mode. Indicates whether the stream uses Dolby Surround EX +(7.1 matrixed to 5.1). Using this option does NOT mean the encoder will actually +apply Dolby Surround EX processing. +

+
0
+
notindicated
+

Not Indicated (default) +

+
1
+
on
+

Dolby Surround EX On +

+
2
+
off
+

Dolby Surround EX Off +

+
+ +
+
-dheadphone_mode mode
+

Dolby Headphone Mode. Indicates whether the stream uses Dolby Headphone +encoding (multi-channel matrixed to 2.0 for use with headphones). Using this +option does NOT mean the encoder will actually apply Dolby Headphone +processing. +

+
0
+
notindicated
+

Not Indicated (default) +

+
1
+
on
+

Dolby Headphone On +

+
2
+
off
+

Dolby Headphone Off +

+
+ +
+
-ad_conv_type type
+

A/D Converter Type. Indicates whether the audio has passed through HDCD A/D +conversion. +

+
0
+
standard
+

Standard A/D Converter (default) +

+
1
+
hdcd
+

HDCD A/D Converter +

+
+ +
+
+ + +

Other AC-3 Encoding Options

+ +
+
-stereo_rematrixing boolean
+

Stereo Rematrixing. Enables/Disables use of rematrixing for stereo input. This +is an optional AC-3 feature that increases quality by selectively encoding +the left/right channels as mid/side. This option is enabled by default, and it +is highly recommended that it be left as enabled except for testing purposes. +

+
+
+ + +

8. Demuxers

+ +

Demuxers are configured elements in FFmpeg which allow to read the +multimedia streams from a particular type of file. +

+

When you configure your FFmpeg build, all the supported demuxers +are enabled by default. You can list all available ones using the +configure option "–list-demuxers". +

+

You can disable all the demuxers using the configure option +"–disable-demuxers", and selectively enable a single demuxer with +the option "–enable-demuxer=DEMUXER", or disable it +with the option "–disable-demuxer=DEMUXER". +

+

The option "-formats" of the ff* tools will display the list of +enabled demuxers. +

+

The description of some of the currently available demuxers follows. +

+ +

8.1 image2

+ +

Image file demuxer. +

+

This demuxer reads from a list of image files specified by a pattern. +

+

The pattern may contain the string "%d" or "%0Nd", which +specifies the position of the characters representing a sequential +number in each filename matched by the pattern. If the form +"%d0Nd" is used, the string representing the number in each +filename is 0-padded and N is the total number of 0-padded +digits representing the number. The literal character ’%’ can be +specified in the pattern with the string "%%". +

+

If the pattern contains "%d" or "%0Nd", the first filename of +the file list specified by the pattern must contain a number +inclusively contained between 0 and 4, all the following numbers must +be sequential. This limitation may be hopefully fixed. +

+

The pattern may contain a suffix which is used to automatically +determine the format of the images contained in the files. +

+

For example the pattern "img-%03d.bmp" will match a sequence of +filenames of the form ‘img-001.bmp’, ‘img-002.bmp’, ..., +‘img-010.bmp’, etc.; the pattern "i%%m%%g-%d.jpg" will match a +sequence of filenames of the form ‘i%m%g-1.jpg’, +‘i%m%g-2.jpg’, ..., ‘i%m%g-10.jpg’, etc. +

+

The size, the pixel format, and the format of each image must be the +same for all the files in the sequence. +

+

The following example shows how to use ‘ffmpeg’ for creating a +video from the images in the file sequence ‘img-001.jpeg’, +‘img-002.jpeg’, ..., assuming an input framerate of 10 frames per +second: +

 
ffmpeg -r 10 -f image2 -i 'img-%03d.jpeg' out.avi
+
+ +

Note that the pattern must not necessarily contain "%d" or +"%0Nd", for example to convert a single image file +‘img.jpeg’ you can employ the command: +

 
ffmpeg -f image2 -i img.jpeg img.png
+
+ + +

8.2 applehttp

+ +

Apple HTTP Live Streaming demuxer. +

+

This demuxer presents all AVStreams from all variant streams. +The id field is set to the bitrate variant index number. By setting +the discard flags on AVStreams (by pressing ’a’ or ’v’ in ffplay), +the caller can decide which variant streams to actually receive. +The total bitrate of the variant that the stream belongs to is +available in a metadata key named "variant_bitrate". +

+ +

9. Muxers

+ +

Muxers are configured elements in FFmpeg which allow writing +multimedia streams to a particular type of file. +

+

When you configure your FFmpeg build, all the supported muxers +are enabled by default. You can list all available muxers using the +configure option --list-muxers. +

+

You can disable all the muxers with the configure option +--disable-muxers and selectively enable / disable single muxers +with the options --enable-muxer=MUXER / +--disable-muxer=MUXER. +

+

The option -formats of the ff* tools will display the list of +enabled muxers. +

+

A description of some of the currently available muxers follows. +

+

+

+

9.1 crc

+ +

CRC (Cyclic Redundancy Check) testing format. +

+

This muxer computes and prints the Adler-32 CRC of all the input audio +and video frames. By default audio frames are converted to signed +16-bit raw audio and video frames to raw video before computing the +CRC. +

+

The output of the muxer consists of a single line of the form: +CRC=0xCRC, where CRC is a hexadecimal number 0-padded to +8 digits containing the CRC for all the decoded input frames. +

+

For example to compute the CRC of the input, and store it in the file +‘out.crc’: +

 
ffmpeg -i INPUT -f crc out.crc
+
+ +

You can print the CRC to stdout with the command: +

 
ffmpeg -i INPUT -f crc -
+
+ +

You can select the output format of each frame with ‘ffmpeg’ by +specifying the audio and video codec and format. For example to +compute the CRC of the input audio converted to PCM unsigned 8-bit +and the input video converted to MPEG-2 video, use the command: +

 
ffmpeg -i INPUT -acodec pcm_u8 -vcodec mpeg2video -f crc -
+
+ +

See also the framecrc muxer (see framecrc). +

+

+

+

9.2 framecrc

+ +

Per-frame CRC (Cyclic Redundancy Check) testing format. +

+

This muxer computes and prints the Adler-32 CRC for each decoded audio +and video frame. By default audio frames are converted to signed +16-bit raw audio and video frames to raw video before computing the +CRC. +

+

The output of the muxer consists of a line for each audio and video +frame of the form: stream_index, frame_dts, +frame_size, 0xCRC, where CRC is a hexadecimal +number 0-padded to 8 digits containing the CRC of the decoded frame. +

+

For example to compute the CRC of each decoded frame in the input, and +store it in the file ‘out.crc’: +

 
ffmpeg -i INPUT -f framecrc out.crc
+
+ +

You can print the CRC of each decoded frame to stdout with the command: +

 
ffmpeg -i INPUT -f framecrc -
+
+ +

You can select the output format of each frame with ‘ffmpeg’ by +specifying the audio and video codec and format. For example, to +compute the CRC of each decoded input audio frame converted to PCM +unsigned 8-bit and of each decoded input video frame converted to +MPEG-2 video, use the command: +

 
ffmpeg -i INPUT -acodec pcm_u8 -vcodec mpeg2video -f framecrc -
+
+ +

See also the crc muxer (see crc). +

+ +

9.3 image2

+ +

Image file muxer. +

+

The image file muxer writes video frames to image files. +

+

The output filenames are specified by a pattern, which can be used to +produce sequentially numbered series of files. +The pattern may contain the string "%d" or "%0Nd", this string +specifies the position of the characters representing a numbering in +the filenames. If the form "%0Nd" is used, the string +representing the number in each filename is 0-padded to N +digits. The literal character ’%’ can be specified in the pattern with +the string "%%". +

+

If the pattern contains "%d" or "%0Nd", the first filename of +the file list specified will contain the number 1, all the following +numbers will be sequential. +

+

The pattern may contain a suffix which is used to automatically +determine the format of the image files to write. +

+

For example the pattern "img-%03d.bmp" will specify a sequence of +filenames of the form ‘img-001.bmp’, ‘img-002.bmp’, ..., +‘img-010.bmp’, etc. +The pattern "img%%-%d.jpg" will specify a sequence of filenames of the +form ‘img%-1.jpg’, ‘img%-2.jpg’, ..., ‘img%-10.jpg’, +etc. +

+

The following example shows how to use ‘ffmpeg’ for creating a +sequence of files ‘img-001.jpeg’, ‘img-002.jpeg’, ..., +taking one image every second from the input video: +

 
ffmpeg -i in.avi -r 1 -f image2 'img-%03d.jpeg'
+
+ +

Note that with ‘ffmpeg’, if the format is not specified with the +-f option and the output filename specifies an image file +format, the image2 muxer is automatically selected, so the previous +command can be written as: +

 
ffmpeg -i in.avi -r 1 'img-%03d.jpeg'
+
+ +

Note also that the pattern must not necessarily contain "%d" or +"%0Nd", for example to create a single image file +‘img.jpeg’ from the input video you can employ the command: +

 
ffmpeg -i in.avi -f image2 -vframes 1 img.jpeg
+
+ +

The image muxer supports the .Y.U.V image file format. This format is +special in that that each image frame consists of three files, for +each of the YUV420P components. To read or write this image file format, +specify the name of the ’.Y’ file. The muxer will automatically open the +’.U’ and ’.V’ files as required. +

+ +

9.4 mpegts

+ +

MPEG transport stream muxer. +

+

This muxer implements ISO 13818-1 and part of ETSI EN 300 468. +

+

The muxer options are: +

+
+
-mpegts_original_network_id number
+

Set the original_network_id (default 0x0001). This is unique identifier +of a network in DVB. Its main use is in the unique identification of a +service through the path Original_Network_ID, Transport_Stream_ID. +

+
-mpegts_transport_stream_id number
+

Set the transport_stream_id (default 0x0001). This identifies a +transponder in DVB. +

+
-mpegts_service_id number
+

Set the service_id (default 0x0001) also known as program in DVB. +

+
-mpegts_pmt_start_pid number
+

Set the first PID for PMT (default 0x1000, max 0x1f00). +

+
-mpegts_start_pid number
+

Set the first PID for data packets (default 0x0100, max 0x0f00). +

+
+ +

The recognized metadata settings in mpegts muxer are service_provider +and service_name. If they are not set the default for +service_provider is "FFmpeg" and the default for +service_name is "Service01". +

+
 
ffmpeg -i file.mpg -acodec copy -vcodec copy \
+     -mpegts_original_network_id 0x1122 \
+     -mpegts_transport_stream_id 0x3344 \
+     -mpegts_service_id 0x5566 \
+     -mpegts_pmt_start_pid 0x1500 \
+     -mpegts_start_pid 0x150 \
+     -metadata service_provider="Some provider" \
+     -metadata service_name="Some Channel" \
+     -y out.ts
+
+ + +

9.5 null

+ +

Null muxer. +

+

This muxer does not generate any output file, it is mainly useful for +testing or benchmarking purposes. +

+

For example to benchmark decoding with ‘ffmpeg’ you can use the +command: +

 
ffmpeg -benchmark -i INPUT -f null out.null
+
+ +

Note that the above command does not read or write the ‘out.null’ +file, but specifying the output file is required by the ‘ffmpeg’ +syntax. +

+

Alternatively you can write the command as: +

 
ffmpeg -benchmark -i INPUT -f null -
+
+ + +

10. Input Devices

+ +

Input devices are configured elements in FFmpeg which allow to access +the data coming from a multimedia device attached to your system. +

+

When you configure your FFmpeg build, all the supported input devices +are enabled by default. You can list all available ones using the +configure option "–list-indevs". +

+

You can disable all the input devices using the configure option +"–disable-indevs", and selectively enable an input device using the +option "–enable-indev=INDEV", or you can disable a particular +input device using the option "–disable-indev=INDEV". +

+

The option "-formats" of the ff* tools will display the list of +supported input devices (amongst the demuxers). +

+

A description of the currently available input devices follows. +

+ +

10.1 alsa

+ +

ALSA (Advanced Linux Sound Architecture) input device. +

+

To enable this input device during configuration you need libasound +installed on your system. +

+

This device allows capturing from an ALSA device. The name of the +device to capture has to be an ALSA card identifier. +

+

An ALSA identifier has the syntax: +

 
hw:CARD[,DEV[,SUBDEV]]
+
+ +

where the DEV and SUBDEV components are optional. +

+

The three arguments (in order: CARD,DEV,SUBDEV) +specify card number or identifier, device number and subdevice number +(-1 means any). +

+

To see the list of cards currently recognized by your system check the +files ‘/proc/asound/cards’ and ‘/proc/asound/devices’. +

+

For example to capture with ‘ffmpeg’ from an ALSA device with +card id 0, you may run the command: +

 
ffmpeg -f alsa -i hw:0 alsaout.wav
+
+ +

For more information see: +http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html +

+ +

10.2 bktr

+ +

BSD video input device. +

+ +

10.3 dv1394

+ +

Linux DV 1394 input device. +

+ +

10.4 fbdev

+ +

Linux framebuffer input device. +

+

The Linux framebuffer is a graphic hardware-independent abstraction +layer to show graphics on a computer monitor, typically on the +console. It is accessed through a file device node, usually +‘/dev/fb0’. +

+

For more detailed information read the file +Documentation/fb/framebuffer.txt included in the Linux source tree. +

+

To record from the framebuffer device ‘/dev/fb0’ with +‘ffmpeg’: +

 
ffmpeg -f fbdev -r 10 -i /dev/fb0 out.avi
+
+ +

You can take a single screenshot image with the command: +

 
ffmpeg -f fbdev -vframes 1 -r 1 -i /dev/fb0 screenshot.jpeg
+
+ +

See also http://linux-fbdev.sourceforge.net/, and fbset(1). +

+ +

10.5 jack

+ +

JACK input device. +

+

To enable this input device during configuration you need libjack +installed on your system. +

+

A JACK input device creates one or more JACK writable clients, one for +each audio channel, with name client_name:input_N, where +client_name is the name provided by the application, and N +is a number which identifies the channel. +Each writable client will send the acquired data to the FFmpeg input +device. +

+

Once you have created one or more JACK readable clients, you need to +connect them to one or more JACK writable clients. +

+

To connect or disconnect JACK clients you can use the +‘jack_connect’ and ‘jack_disconnect’ programs, or do it +through a graphical interface, for example with ‘qjackctl’. +

+

To list the JACK clients and their properties you can invoke the command +‘jack_lsp’. +

+

Follows an example which shows how to capture a JACK readable client +with ‘ffmpeg’. +

 
# Create a JACK writable client with name "ffmpeg".
+$ ffmpeg -f jack -i ffmpeg -y out.wav
+
+# Start the sample jack_metro readable client.
+$ jack_metro -b 120 -d 0.2 -f 4000
+
+# List the current JACK clients.
+$ jack_lsp -c
+system:capture_1
+system:capture_2
+system:playback_1
+system:playback_2
+ffmpeg:input_1
+metro:120_bpm
+
+# Connect metro to the ffmpeg writable client.
+$ jack_connect metro:120_bpm ffmpeg:input_1
+
+ +

For more information read: +http://jackaudio.org/ +

+ +

10.6 libdc1394

+ +

IIDC1394 input device, based on libdc1394 and libraw1394. +

+ +

10.7 oss

+ +

Open Sound System input device. +

+

The filename to provide to the input device is the device node +representing the OSS input device, and is usually set to +‘/dev/dsp’. +

+

For example to grab from ‘/dev/dsp’ using ‘ffmpeg’ use the +command: +

 
ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
+
+ +

For more information about OSS see: +http://manuals.opensound.com/usersguide/dsp.html +

+ +

10.8 sndio

+ +

sndio input device. +

+

To enable this input device during configuration you need libsndio +installed on your system. +

+

The filename to provide to the input device is the device node +representing the sndio input device, and is usually set to +‘/dev/audio0’. +

+

For example to grab from ‘/dev/audio0’ using ‘ffmpeg’ use the +command: +

 
ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
+
+ + +

10.9 video4linux and video4linux2

+ +

Video4Linux and Video4Linux2 input video devices. +

+

The name of the device to grab is a file device node, usually Linux +systems tend to automatically create such nodes when the device +(e.g. an USB webcam) is plugged into the system, and has a name of the +kind ‘/dev/videoN’, where N is a number associated to +the device. +

+

Video4Linux and Video4Linux2 devices only support a limited set of +widthxheight sizes and framerates. You can check which are +supported for example with the command ‘dov4l’ for Video4Linux +devices and the command ‘v4l-info’ for Video4Linux2 devices. +

+

If the size for the device is set to 0x0, the input device will +try to autodetect the size to use. +Only for the video4linux2 device, if the frame rate is set to 0/0 the +input device will use the frame rate value already set in the driver. +

+

Video4Linux support is deprecated since Linux 2.6.30, and will be +dropped in later versions. +

+

Follow some usage examples of the video4linux devices with the ff* +tools. +

 
# Grab and show the input of a video4linux device, frame rate is set
+# to the default of 25/1.
+ffplay -s 320x240 -f video4linux /dev/video0
+
+# Grab and show the input of a video4linux2 device, autoadjust size.
+ffplay -f video4linux2 /dev/video0
+
+# Grab and record the input of a video4linux2 device, autoadjust size,
+# frame rate value defaults to 0/0 so it is read from the video4linux2
+# driver.
+ffmpeg -f video4linux2 -i /dev/video0 out.mpeg
+
+ + +

10.10 vfwcap

+ +

VfW (Video for Windows) capture input device. +

+

The filename passed as input is the capture driver number, ranging from +0 to 9. You may use "list" as filename to print a list of drivers. Any +other filename will be interpreted as device number 0. +

+ +

10.11 x11grab

+ +

X11 video input device. +

+

This device allows to capture a region of an X11 display. +

+

The filename passed as input has the syntax: +

 
[hostname]:display_number.screen_number[+x_offset,y_offset]
+
+ +

hostname:display_number.screen_number specifies the +X11 display name of the screen to grab from. hostname can be +ommitted, and defaults to "localhost". The environment variable +DISPLAY contains the default display name. +

+

x_offset and y_offset specify the offsets of the grabbed +area with respect to the top-left border of the X11 screen. They +default to 0. +

+

Check the X11 documentation (e.g. man X) for more detailed information. +

+

Use the ‘dpyinfo’ program for getting basic information about the +properties of your X11 display (e.g. grep for "name" or "dimensions"). +

+

For example to grab from ‘:0.0’ using ‘ffmpeg’: +

 
ffmpeg -f x11grab -r 25 -s cif -i :0.0 out.mpg
+
+# Grab at position 10,20.
+ffmpeg -f x11grab -25 -s cif -i :0.0+10,20 out.mpg
+
+ + +

11. Output Devices

+ +

Output devices are configured elements in FFmpeg which allow to write +multimedia data to an output device attached to your system. +

+

When you configure your FFmpeg build, all the supported output devices +are enabled by default. You can list all available ones using the +configure option "–list-outdevs". +

+

You can disable all the output devices using the configure option +"–disable-outdevs", and selectively enable an output device using the +option "–enable-outdev=OUTDEV", or you can disable a particular +input device using the option "–disable-outdev=OUTDEV". +

+

The option "-formats" of the ff* tools will display the list of +enabled output devices (amongst the muxers). +

+

A description of the currently available output devices follows. +

+ +

11.1 alsa

+ +

ALSA (Advanced Linux Sound Architecture) output device. +

+ +

11.2 oss

+ +

OSS (Open Sound System) output device. +

+ +

11.3 sndio

+ +

sndio audio output device. +

+ +

12. Protocols

+ +

Protocols are configured elements in FFmpeg which allow to access +resources which require the use of a particular protocol. +

+

When you configure your FFmpeg build, all the supported protocols are +enabled by default. You can list all available ones using the +configure option "–list-protocols". +

+

You can disable all the protocols using the configure option +"–disable-protocols", and selectively enable a protocol using the +option "–enable-protocol=PROTOCOL", or you can disable a +particular protocol using the option +"–disable-protocol=PROTOCOL". +

+

The option "-protocols" of the ff* tools will display the list of +supported protocols. +

+

A description of the currently available protocols follows. +

+ +

12.1 applehttp

+ +

Read Apple HTTP Live Streaming compliant segmented stream as +a uniform one. The M3U8 playlists describing the segments can be +remote HTTP resources or local files, accessed using the standard +file protocol. +HTTP is default, specific protocol can be declared by specifying +"+proto" after the applehttp URI scheme name, where proto +is either "file" or "http". +

+
 
applehttp://host/path/to/remote/resource.m3u8
+applehttp+http://host/path/to/remote/resource.m3u8
+applehttp+file://path/to/local/resource.m3u8
+
+ + +

12.2 concat

+ +

Physical concatenation protocol. +

+

Allow to read and seek from many resource in sequence as if they were +a unique resource. +

+

A URL accepted by this protocol has the syntax: +

 
concat:URL1|URL2|...|URLN
+
+ +

where URL1, URL2, ..., URLN are the urls of the +resource to be concatenated, each one possibly specifying a distinct +protocol. +

+

For example to read a sequence of files ‘split1.mpeg’, +‘split2.mpeg’, ‘split3.mpeg’ with ‘ffplay’ use the +command: +

 
ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
+
+ +

Note that you may need to escape the character "|" which is special for +many shells. +

+ +

12.3 file

+ +

File access protocol. +

+

Allow to read from or read to a file. +

+

For example to read from a file ‘input.mpeg’ with ‘ffmpeg’ +use the command: +

 
ffmpeg -i file:input.mpeg output.mpeg
+
+ +

The ff* tools default to the file protocol, that is a resource +specified with the name "FILE.mpeg" is interpreted as the URL +"file:FILE.mpeg". +

+ +

12.4 gopher

+ +

Gopher protocol. +

+ +

12.5 http

+ +

HTTP (Hyper Text Transfer Protocol). +

+ +

12.6 mmst

+ +

MMS (Microsoft Media Server) protocol over TCP. +

+ +

12.7 mmsh

+ +

MMS (Microsoft Media Server) protocol over HTTP. +

+

The required syntax is: +

 
mmsh://server[:port][/app][/playpath]
+
+ + +

12.8 md5

+ +

MD5 output protocol. +

+

Computes the MD5 hash of the data to be written, and on close writes +this to the designated output or stdout if none is specified. It can +be used to test muxers without writing an actual file. +

+

Some examples follow. +

 
# Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
+ffmpeg -i input.flv -f avi -y md5:output.avi.md5
+
+# Write the MD5 hash of the encoded AVI file to stdout.
+ffmpeg -i input.flv -f avi -y md5:
+
+ +

Note that some formats (typically MOV) require the output protocol to +be seekable, so they will fail with the MD5 output protocol. +

+ +

12.9 pipe

+ +

UNIX pipe access protocol. +

+

Allow to read and write from UNIX pipes. +

+

The accepted syntax is: +

 
pipe:[number]
+
+ +

number is the number corresponding to the file descriptor of the +pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If number +is not specified, by default the stdout file descriptor will be used +for writing, stdin for reading. +

+

For example to read from stdin with ‘ffmpeg’: +

 
cat test.wav | ffmpeg -i pipe:0
+# ...this is the same as...
+cat test.wav | ffmpeg -i pipe:
+
+ +

For writing to stdout with ‘ffmpeg’: +

 
ffmpeg -i test.wav -f avi pipe:1 | cat > test.avi
+# ...this is the same as...
+ffmpeg -i test.wav -f avi pipe: | cat > test.avi
+
+ +

Note that some formats (typically MOV), require the output protocol to +be seekable, so they will fail with the pipe output protocol. +

+ +

12.10 rtmp

+ +

Real-Time Messaging Protocol. +

+

The Real-Time Messaging Protocol (RTMP) is used for streaming multime‐ +dia content across a TCP/IP network. +

+

The required syntax is: +

 
rtmp://server[:port][/app][/playpath]
+
+ +

The accepted parameters are: +

+
server
+

The address of the RTMP server. +

+
+
port
+

The number of the TCP port to use (by default is 1935). +

+
+
app
+

It is the name of the application to access. It usually corresponds to +the path where the application is installed on the RTMP server +(e.g. ‘/ondemand/’, ‘/flash/live/’, etc.). +

+
+
playpath
+

It is the path or name of the resource to play with reference to the +application specified in app, may be prefixed by "mp4:". +

+
+
+ +

For example to read with ‘ffplay’ a multimedia resource named +"sample" from the application "vod" from an RTMP server "myserver": +

 
ffplay rtmp://myserver/vod/sample
+
+ + +

12.11 rtmp, rtmpe, rtmps, rtmpt, rtmpte

+ +

Real-Time Messaging Protocol and its variants supported through +librtmp. +

+

Requires the presence of the librtmp headers and library during +configuration. You need to explicitely configure the build with +"–enable-librtmp". If enabled this will replace the native RTMP +protocol. +

+

This protocol provides most client functions and a few server +functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT), +encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled +variants of these encrypted types (RTMPTE, RTMPTS). +

+

The required syntax is: +

 
rtmp_proto://server[:port][/app][/playpath] options
+
+ +

where rtmp_proto is one of the strings "rtmp", "rtmpt", "rtmpe", +"rtmps", "rtmpte", "rtmpts" corresponding to each RTMP variant, and +server, port, app and playpath have the same +meaning as specified for the RTMP native protocol. +options contains a list of space-separated options of the form +key=val. +

+

See the librtmp manual page (man 3 librtmp) for more information. +

+

For example, to stream a file in real-time to an RTMP server using +‘ffmpeg’: +

 
ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
+
+ +

To play the same stream using ‘ffplay’: +

 
ffplay "rtmp://myserver/live/mystream live=1"
+
+ + +

12.12 rtp

+ +

Real-Time Protocol. +

+ +

12.13 rtsp

+ +

RTSP is not technically a protocol handler in libavformat, it is a demuxer +and muxer. The demuxer supports both normal RTSP (with data transferred +over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with +data transferred over RDT). +

+

The muxer can be used to send a stream using RTSP ANNOUNCE to a server +supporting it (currently Darwin Streaming Server and Mischa Spiegelmock’s +RTSP server, http://github.com/revmischa/rtsp-server). +

+

The required syntax for a RTSP url is: +

 
rtsp://hostname[:port]/path[?options]
+
+ +

options is a &-separated list. The following options +are supported: +

+
+
udp
+

Use UDP as lower transport protocol. +

+
+
tcp
+

Use TCP (interleaving within the RTSP control channel) as lower +transport protocol. +

+
+
multicast
+

Use UDP multicast as lower transport protocol. +

+
+
http
+

Use HTTP tunneling as lower transport protocol, which is useful for +passing proxies. +

+
+
filter_src
+

Accept packets only from negotiated peer address and port. +

+
+ +

Multiple lower transport protocols may be specified, in that case they are +tried one at a time (if the setup of one fails, the next one is tried). +For the muxer, only the tcp and udp options are supported. +

+

When receiving data over UDP, the demuxer tries to reorder received packets +(since they may arrive out of order, or packets may get lost totally). In +order for this to be enabled, a maximum delay must be specified in the +max_delay field of AVFormatContext. +

+

When watching multi-bitrate Real-RTSP streams with ‘ffplay’, the +streams to display can be chosen with -vst n and +-ast n for video and audio respectively, and can be switched +on the fly by pressing v and a. +

+

Example command lines: +

+

To watch a stream over UDP, with a max reordering delay of 0.5 seconds: +

+
 
ffplay -max_delay 500000 rtsp://server/video.mp4?udp
+
+ +

To watch a stream tunneled over HTTP: +

+
 
ffplay rtsp://server/video.mp4?http
+
+ +

To send a stream in realtime to a RTSP server, for others to watch: +

+
 
ffmpeg -re -i input -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
+
+ + +

12.14 sap

+ +

Session Announcement Protocol (RFC 2974). This is not technically a +protocol handler in libavformat, it is a muxer and demuxer. +It is used for signalling of RTP streams, by announcing the SDP for the +streams regularly on a separate port. +

+ +

12.14.1 Muxer

+ +

The syntax for a SAP url given to the muxer is: +

 
sap://destination[:port][?options]
+
+ +

The RTP packets are sent to destination on port port, +or to port 5004 if no port is specified. +options is a &-separated list. The following options +are supported: +

+
+
announce_addr=address
+

Specify the destination IP address for sending the announcements to. +If omitted, the announcements are sent to the commonly used SAP +announcement multicast address 224.2.127.254 (sap.mcast.net), or +ff0e::2:7ffe if destination is an IPv6 address. +

+
+
announce_port=port
+

Specify the port to send the announcements on, defaults to +9875 if not specified. +

+
+
ttl=ttl
+

Specify the time to live value for the announcements and RTP packets, +defaults to 255. +

+
+
same_port=0|1
+

If set to 1, send all RTP streams on the same port pair. If zero (the +default), all streams are sent on unique ports, with each stream on a +port 2 numbers higher than the previous. +VLC/Live555 requires this to be set to 1, to be able to receive the stream. +The RTP stack in libavformat for receiving requires all streams to be sent +on unique ports. +

+
+ +

Example command lines follow. +

+

To broadcast a stream on the local subnet, for watching in VLC: +

+
 
ffmpeg -re -i input -f sap sap://224.0.0.255?same_port=1
+
+ +

Similarly, for watching in ffplay: +

+
 
ffmpeg -re -i input -f sap sap://224.0.0.255
+
+ +

And for watching in ffplay, over IPv6: +

+
 
ffmpeg -re -i input -f sap sap://[ff0e::1:2:3:4]
+
+ + +

12.14.2 Demuxer

+ +

The syntax for a SAP url given to the demuxer is: +

 
sap://[address][:port]
+
+ +

address is the multicast address to listen for announcements on, +if omitted, the default 224.2.127.254 (sap.mcast.net) is used. port +is the port that is listened on, 9875 if omitted. +

+

The demuxers listens for announcements on the given address and port. +Once an announcement is received, it tries to receive that particular stream. +

+

Example command lines follow. +

+

To play back the first stream announced on the normal SAP multicast address: +

+
 
ffplay sap://
+
+ +

To play back the first stream announced on one the default IPv6 SAP multicast address: +

+
 
ffplay sap://[ff0e::2:7ffe]
+
+ + +

12.15 tcp

+ +

Trasmission Control Protocol. +

+

The required syntax for a TCP url is: +

 
tcp://hostname:port[?options]
+
+ +
+
listen
+

Listen for an incoming connection +

+
 
ffmpeg -i input -f format tcp://hostname:port?listen
+ffplay tcp://hostname:port
+
+ +
+
+ + +

12.16 udp

+ +

User Datagram Protocol. +

+

The required syntax for a UDP url is: +

 
udp://hostname:port[?options]
+
+ +

options contains a list of &-seperated options of the form key=val. +Follow the list of supported options. +

+
+
buffer_size=size
+

set the UDP buffer size in bytes +

+
+
localport=port
+

override the local UDP port to bind with +

+
+
pkt_size=size
+

set the size in bytes of UDP packets +

+
+
reuse=1|0
+

explicitly allow or disallow reusing UDP sockets +

+
+
ttl=ttl
+

set the time to live value (for multicast only) +

+
+
connect=1|0
+

Initialize the UDP socket with connect(). In this case, the +destination address can’t be changed with ff_udp_set_remote_url later. +If the destination address isn’t known at the start, this option can +be specified in ff_udp_set_remote_url, too. +This allows finding out the source address for the packets with getsockname, +and makes writes return with AVERROR(ECONNREFUSED) if "destination +unreachable" is received. +For receiving, this gives the benefit of only receiving packets from +the specified peer address/port. +

+
+ +

Some usage examples of the udp protocol with ‘ffmpeg’ follow. +

+

To stream over UDP to a remote endpoint: +

 
ffmpeg -i input -f format udp://hostname:port
+
+ +

To stream in mpegts format over UDP using 188 sized UDP packets, using a large input buffer: +

 
ffmpeg -i input -f mpegts udp://hostname:port?pkt_size=188&buffer_size=65535
+
+ +

To receive over UDP from a remote endpoint: +

 
ffmpeg -i udp://[multicast-address]:port
+
+ + +

13. Bitstream Filters

+ +

When you configure your FFmpeg build, all the supported bitstream +filters are enabled by default. You can list all available ones using +the configure option --list-bsfs. +

+

You can disable all the bitstream filters using the configure option +--disable-bsfs, and selectively enable any bitstream filter using +the option --enable-bsf=BSF, or you can disable a particular +bitstream filter using the option --disable-bsf=BSF. +

+

The option -bsfs of the ff* tools will display the list of +all the supported bitstream filters included in your build. +

+

Below is a description of the currently available bitstream filters. +

+ +

13.1 aac_adtstoasc

+ + +

13.2 chomp

+ + +

13.3 dump_extradata

+ + +

13.4 h264_mp4toannexb

+ + +

13.5 imx_dump_header

+ + +

13.6 mjpeg2jpeg

+ +

Convert MJPEG/AVI1 packets to full JPEG/JFIF packets. +

+

MJPEG is a video codec wherein each video frame is essentially a +JPEG image. The individual frames can be extracted without loss, +e.g. by +

+
 
ffmpeg -i ../some_mjpeg.avi -vcodec copy frames_%d.jpg
+
+ +

Unfortunately, these chunks are incomplete JPEG images, because +they lack the DHT segment required for decoding. Quoting from +http://www.digitalpreservation.gov/formats/fdd/fdd000063.shtml: +

+

Avery Lee, writing in the rec.video.desktop newsgroup in 2001, +commented that "MJPEG, or at least the MJPEG in AVIs having the +MJPG fourcc, is restricted JPEG with a fixed – and *omitted* – +Huffman table. The JPEG must be YCbCr colorspace, it must be 4:2:2, +and it must use basic Huffman encoding, not arithmetic or +progressive. . . . You can indeed extract the MJPEG frames and +decode them with a regular JPEG decoder, but you have to prepend +the DHT segment to them, or else the decoder won’t have any idea +how to decompress the data. The exact table necessary is given in +the OpenDML spec." +

+

This bitstream filter patches the header of frames extracted from an MJPEG +stream (carrying the AVI1 header ID and lacking a DHT segment) to +produce fully qualified JPEG images. +

+
 
ffmpeg -i mjpeg-movie.avi -vcodec copy -vbsf mjpeg2jpeg frame_%d.jpg
+exiftran -i -9 frame*.jpg
+ffmpeg -i frame_%d.jpg -vcodec copy rotated.avi
+
+ + +

13.7 mjpega_dump_header

+ + +

13.8 movsub

+ + +

13.9 mp3_header_compress

+ + +

13.10 mp3_header_decompress

+ + +

13.11 noise

+ + +

13.12 remove_extradata

+ + +

14. Filtergraph description

+ +

A filtergraph is a directed graph of connected filters. It can contain +cycles, and there can be multiple links between a pair of +filters. Each link has one input pad on one side connecting it to one +filter from which it takes its input, and one output pad on the other +side connecting it to the one filter accepting its output. +

+

Each filter in a filtergraph is an instance of a filter class +registered in the application, which defines the features and the +number of input and output pads of the filter. +

+

A filter with no input pads is called a "source", a filter with no +output pads is called a "sink". +

+ +

14.1 Filtergraph syntax

+ +

A filtergraph can be represented using a textual representation, which +is recognized by the -vf and -af options of the ff* +tools, and by the av_parse_graph() function defined in +‘libavfilter/avfiltergraph’. +

+

A filterchain consists of a sequence of connected filters, each one +connected to the previous one in the sequence. A filterchain is +represented by a list of ","-separated filter descriptions. +

+

A filtergraph consists of a sequence of filterchains. A sequence of +filterchains is represented by a list of ";"-separated filterchain +descriptions. +

+

A filter is represented by a string of the form: +[in_link_1]...[in_link_N]filter_name=arguments[out_link_1]...[out_link_M] +

+

filter_name is the name of the filter class of which the +described filter is an instance of, and has to be the name of one of +the filter classes registered in the program. +The name of the filter class is optionally followed by a string +"=arguments". +

+

arguments is a string which contains the parameters used to +initialize the filter instance, and are described in the filter +descriptions below. +

+

The list of arguments can be quoted using the character "’" as initial +and ending mark, and the character ’\’ for escaping the characters +within the quoted text; otherwise the argument string is considered +terminated when the next special character (belonging to the set +"[]=;,") is encountered. +

+

The name and arguments of the filter are optionally preceded and +followed by a list of link labels. +A link label allows to name a link and associate it to a filter output +or input pad. The preceding labels in_link_1 +... in_link_N, are associated to the filter input pads, +the following labels out_link_1 ... out_link_M, are +associated to the output pads. +

+

When two link labels with the same name are found in the +filtergraph, a link between the corresponding input and output pad is +created. +

+

If an output pad is not labelled, it is linked by default to the first +unlabelled input pad of the next filter in the filterchain. +For example in the filterchain: +

 
nullsrc, split[L1], [L2]overlay, nullsink
+
+

the split filter instance has two output pads, and the overlay filter +instance two input pads. The first output pad of split is labelled +"L1", the first input pad of overlay is labelled "L2", and the second +output pad of split is linked to the second input pad of overlay, +which are both unlabelled. +

+

In a complete filterchain all the unlabelled filter input and output +pads must be connected. A filtergraph is considered valid if all the +filter input and output pads of all the filterchains are connected. +

+

Follows a BNF description for the filtergraph syntax: +

 
NAME             ::= sequence of alphanumeric characters and '_'
+LINKLABEL        ::= "[" NAME "]"
+LINKLABELS       ::= LINKLABEL [LINKLABELS]
+FILTER_ARGUMENTS ::= sequence of chars (eventually quoted)
+FILTER           ::= [LINKNAMES] NAME ["=" ARGUMENTS] [LINKNAMES]
+FILTERCHAIN      ::= FILTER [,FILTERCHAIN]
+FILTERGRAPH      ::= FILTERCHAIN [;FILTERGRAPH]
+
+ + + +

15. Audio Filters

+ +

When you configure your FFmpeg build, you can disable any of the +existing filters using –disable-filters. +The configure output will show the audio filters included in your +build. +

+

Below is a description of the currently available audio filters. +

+ +

15.1 anull

+ +

Pass the audio source unchanged to the output. +

+ + +

16. Audio Sources

+ +

Below is a description of the currently available audio sources. +

+ +

16.1 anullsrc

+ +

Null audio source, never return audio frames. It is mainly useful as a +template and to be employed in analysis / debugging tools. +

+

It accepts as optional parameter a string of the form +sample_rate:channel_layout. +

+

sample_rate specify the sample rate, and defaults to 44100. +

+

channel_layout specify the channel layout, and can be either an +integer or a string representing a channel layout. The default value +of channel_layout is 3, which corresponds to CH_LAYOUT_STEREO. +

+

Check the channel_layout_map definition in +‘libavcodec/audioconvert.c’ for the mapping between strings and +channel layout values. +

+

Follow some examples: +

 
#  set the sample rate to 48000 Hz and the channel layout to CH_LAYOUT_MONO.
+anullsrc=48000:4
+
+# same as
+anullsrc=48000:mono
+
+ + + +

17. Audio Sinks

+ +

Below is a description of the currently available audio sinks. +

+ +

17.1 anullsink

+ +

Null audio sink, do absolutely nothing with the input audio. It is +mainly useful as a template and to be employed in analysis / debugging +tools. +

+ + +

18. Video Filters

+ +

When you configure your FFmpeg build, you can disable any of the +existing filters using –disable-filters. +The configure output will show the video filters included in your +build. +

+

Below is a description of the currently available video filters. +

+ +

18.1 blackframe

+ +

Detect frames that are (almost) completely black. Can be useful to +detect chapter transitions or commercials. Output lines consist of +the frame number of the detected frame, the percentage of blackness, +the position in the file if known or -1 and the timestamp in seconds. +

+

In order to display the output lines, you need to set the loglevel at +least to the AV_LOG_INFO value. +

+

The filter accepts the syntax: +

 
blackframe[=amount:[threshold]]
+
+ +

amount is the percentage of the pixels that have to be below the +threshold, and defaults to 98. +

+

threshold is the threshold below which a pixel value is +considered black, and defaults to 32. +

+ +

18.2 copy

+ +

Copy the input source unchanged to the output. Mainly useful for +testing purposes. +

+ +

18.3 crop

+ +

Crop the input video to out_w:out_h:x:y. +

+

The parameters are expressions containing the following constants: +

+
+
E, PI, PHI
+

the corresponding mathematical approximated values for e +(euler number), pi (greek PI), PHI (golden ratio) +

+
+
x, y
+

the computed values for x and y. They are evaluated for +each new frame. +

+
+
in_w, in_h
+

the input width and heigth +

+
+
iw, ih
+

same as in_w and in_h +

+
+
out_w, out_h
+

the output (cropped) width and heigth +

+
+
ow, oh
+

same as out_w and out_h +

+
+
n
+

the number of input frame, starting from 0 +

+
+
pos
+

the position in the file of the input frame, NAN if unknown +

+
+
t
+

timestamp expressed in seconds, NAN if the input timestamp is unknown +

+
+
+ +

The out_w and out_h parameters specify the expressions for +the width and height of the output (cropped) video. They are +evaluated just at the configuration of the filter. +

+

The default value of out_w is "in_w", and the default value of +out_h is "in_h". +

+

The expression for out_w may depend on the value of out_h, +and the expression for out_h may depend on out_w, but they +cannot depend on x and y, as x and y are +evaluated after out_w and out_h. +

+

The x and y parameters specify the expressions for the +position of the top-left corner of the output (non-cropped) area. They +are evaluated for each frame. If the evaluated value is not valid, it +is approximated to the nearest valid value. +

+

The default value of x is "(in_w-out_w)/2", and the default +value for y is "(in_h-out_h)/2", which set the cropped area at +the center of the input image. +

+

The expression for x may depend on y, and the expression +for y may depend on x. +

+

Follow some examples: +

 
# crop the central input area with size 100x100
+crop=100:100
+
+# crop the central input area with size 2/3 of the input video
+"crop=2/3*in_w:2/3*in_h"
+
+# crop the input video central square
+crop=in_h
+
+# delimit the rectangle with the top-left corner placed at position
+# 100:100 and the right-bottom corner corresponding to the right-bottom
+# corner of the input image.
+crop=in_w-100:in_h-100:100:100
+
+# crop 10 pixels from the left and right borders, and 20 pixels from
+# the top and bottom borders
+"crop=in_w-2*10:in_h-2*20"
+
+# keep only the bottom right quarter of the input image
+"crop=in_w/2:in_h/2:in_w/2:in_h/2"
+
+# crop height for getting Greek harmony
+"crop=in_w:1/PHI*in_w"
+
+# trembling effect
+"crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(n/10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(n/7)"
+
+# erratic camera effect depending on timestamp
+"crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(t*10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(t*13)"
+
+# set x depending on the value of y
+"crop=in_w/2:in_h/2:y:10+10*sin(n/10)"
+
+ + +

18.4 cropdetect

+ +

Auto-detect crop size. +

+

Calculate necessary cropping parameters and prints the recommended +parameters through the logging system. The detected dimensions +correspond to the non-black area of the input video. +

+

It accepts the syntax: +

 
cropdetect[=limit[:round[:reset]]]
+
+ +
+
limit
+

Threshold, which can be optionally specified from nothing (0) to +everything (255), defaults to 24. +

+
+
round
+

Value which the width/height should be divisible by, defaults to +16. The offset is automatically adjusted to center the video. Use 2 to +get only even dimensions (needed for 4:2:2 video). 16 is best when +encoding to most video codecs. +

+
+
reset
+

Counter that determines after how many frames cropdetect will reset +the previously detected largest video area and start over to detect +the current optimal crop area. Defaults to 0. +

+

This can be useful when channel logos distort the video area. 0 +indicates never reset and return the largest area encountered during +playback. +

+
+ + +

18.5 drawbox

+ +

Draw a colored box on the input image. +

+

It accepts the syntax: +

 
drawbox=x:y:width:height:color
+
+ +
+
x, y
+

Specify the top left corner coordinates of the box. Default to 0. +

+
+
width, height
+

Specify the width and height of the box, if 0 they are interpreted as +the input width and height. Default to 0. +

+
+
color
+

Specify the color of the box to write, it can be the name of a color +(case insensitive match) or a 0xRRGGBB[AA] sequence. +

+
+ +

Follow some examples: +

 
# draw a black box around the edge of the input image
+drawbox
+
+# draw a box with color red and an opacity of 50%
+drawbox=10:20:200:60:red@0.5"
+
+ + +

18.6 drawtext

+ +

Draw text string or text from specified file on top of video using the +libfreetype library. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-libfreetype. +

+

The filter also recognizes strftime() sequences in the provided text +and expands them accordingly. Check the documentation of strftime(). +

+

The filter accepts parameters as a list of key=value pairs, +separated by ":". +

+

The description of the accepted parameters follows. +

+
+
fontfile
+

The font file to be used for drawing text. Path must be included. +This parameter is mandatory. +

+
+
text
+

The text string to be drawn. The text must be a sequence of UTF-8 +encoded characters. +This parameter is mandatory if no file is specified with the parameter +textfile. +

+
+
textfile
+

A text file containing text to be drawn. The text must be a sequence +of UTF-8 encoded characters. +

+

This parameter is mandatory if no text string is specified with the +parameter text. +

+

If both text and textfile are specified, an error is thrown. +

+
+
x, y
+

The offsets where text will be drawn within the video frame. +Relative to the top/left border of the output image. +

+

The default value of x and y is 0. +

+
+
fontsize
+

The font size to be used for drawing text. +The default value of fontsize is 16. +

+
+
fontcolor
+

The color to be used for drawing fonts. +Either a string (e.g. "red") or in 0xRRGGBB[AA] format +(e.g. "0xff000033"), possibly followed by an alpha specifier. +The default value of fontcolor is "black". +

+
+
boxcolor
+

The color to be used for drawing box around text. +Either a string (e.g. "yellow") or in 0xRRGGBB[AA] format +(e.g. "0xff00ff"), possibly followed by an alpha specifier. +The default value of boxcolor is "white". +

+
+
box
+

Used to draw a box around text using background color. +Value should be either 1 (enable) or 0 (disable). +The default value of box is 0. +

+
+
shadowx, shadowy
+

The x and y offsets for the text shadow position with respect to the +position of the text. They can be either positive or negative +values. Default value for both is "0". +

+
+
shadowcolor
+

The color to be used for drawing a shadow behind the drawn text. It +can be a color name (e.g. "yellow") or a string in the 0xRRGGBB[AA] +form (e.g. "0xff00ff"), possibly followed by an alpha specifier. +The default value of shadowcolor is "black". +

+
+
ft_load_flags
+

Flags to be used for loading the fonts. +

+

The flags map the corresponding flags supported by libfreetype, and are +a combination of the following values: +

+
default
+
no_scale
+
no_hinting
+
render
+
no_bitmap
+
vertical_layout
+
force_autohint
+
crop_bitmap
+
pedantic
+
ignore_global_advance_width
+
no_recurse
+
ignore_transform
+
monochrome
+
linear_design
+
no_autohint
+
end table
+
+ +

Default value is "render". +

+

For more information consult the documentation for the FT_LOAD_* +libfreetype flags. +

+
+
tabsize
+

The size in number of spaces to use for rendering the tab. +Default value is 4. +

+
+ +

For example the command: +

 
drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'"
+
+ +

will draw "Test Text" with font FreeSerif, using the default values +for the optional parameters. +

+

The command: +

 
drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
+          x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2"
+
+ +

will draw ’Test Text’ with font FreeSerif of size 24 at position x=100 +and y=50 (counting from the top-left corner of the screen), text is +yellow with a red box around it. Both the text and the box have an +opacity of 20%. +

+

Note that the double quotes are not necessary if spaces are not used +within the parameter list. +

+

For more information about libfreetype, check: +http://www.freetype.org/. +

+ +

18.7 fade

+ +

Apply fade-in/out effect to input video. +

+

It accepts the parameters: +type:start_frame:nb_frames +

+

type specifies if the effect type, can be either "in" for +fade-in, or "out" for a fade-out effect. +

+

start_frame specifies the number of the start frame for starting +to apply the fade effect. +

+

nb_frames specifies the number of frames for which the fade +effect has to last. At the end of the fade-in effect the output video +will have the same intensity as the input video, at the end of the +fade-out transition the output video will be completely black. +

+

A few usage examples follow, usable too as test scenarios. +

 
# fade in first 30 frames of video
+fade=in:0:30
+
+# fade out last 45 frames of a 200-frame video
+fade=out:155:45
+
+# fade in first 25 frames and fade out last 25 frames of a 1000-frame video
+fade=in:0:25, fade=out:975:25
+
+# make first 5 frames black, then fade in from frame 5-24
+fade=in:5:20
+
+ + +

18.8 fieldorder

+ +

Transform the field order of the input video. +

+

It accepts one parameter which specifies the required field order that +the input interlaced video will be transformed to. The parameter can +assume one of the following values: +

+
+
0 or bff
+

output bottom field first +

+
1 or tff
+

output top field first +

+
+ +

Default value is "tff". +

+

Transformation is achieved by shifting the picture content up or down +by one line, and filling the remaining line with appropriate picture content. +This method is consistent with most broadcast field order converters. +

+

If the input video is not flagged as being interlaced, or it is already +flagged as being of the required output field order then this filter does +not alter the incoming video. +

+

This filter is very useful when converting to or from PAL DV material, +which is bottom field first. +

+

For example: +

 
./ffmpeg -i in.vob -vf "fieldorder=bff" out.dv
+
+ + +

18.9 fifo

+ +

Buffer input images and send them when they are requested. +

+

This filter is mainly useful when auto-inserted by the libavfilter +framework. +

+

The filter does not take parameters. +

+ +

18.10 format

+ +

Convert the input video to one of the specified pixel formats. +Libavfilter will try to pick one that is supported for the input to +the next filter. +

+

The filter accepts a list of pixel format names, separated by ":", +for example "yuv420p:monow:rgb24". +

+

Some examples follow: +

 
# convert the input video to the format "yuv420p"
+format=yuv420p
+
+# convert the input video to any of the formats in the list
+format=yuv420p:yuv444p:yuv410p
+
+ +

+

+

18.11 frei0r

+ +

Apply a frei0r effect to the input video. +

+

To enable compilation of this filter you need to install the frei0r +header and configure FFmpeg with –enable-frei0r. +

+

The filter supports the syntax: +

 
filter_name[{:|=}param1:param2:...:paramN]
+
+ +

filter_name is the name to the frei0r effect to load. If the +environment variable FREI0R_PATH is defined, the frei0r effect +is searched in each one of the directories specified by the colon +separated list in FREIOR_PATH, otherwise in the standard frei0r +paths, which are in this order: ‘HOME/.frei0r-1/lib/’, +‘/usr/local/lib/frei0r-1/’, ‘/usr/lib/frei0r-1/’. +

+

param1, param2, ... , paramN specify the parameters +for the frei0r effect. +

+

A frei0r effect parameter can be a boolean (whose values are specified +with "y" and "n"), a double, a color (specified by the syntax +R/G/B, R, G, and B being float +numbers from 0.0 to 1.0) or by an av_parse_color() color +description), a position (specified by the syntax X/Y, +X and Y being float numbers) and a string. +

+

The number and kind of parameters depend on the loaded effect. If an +effect parameter is not specified the default value is set. +

+

Some examples follow: +

 
# apply the distort0r effect, set the first two double parameters
+frei0r=distort0r:0.5:0.01
+
+# apply the colordistance effect, takes a color as first parameter
+frei0r=colordistance:0.2/0.3/0.4
+frei0r=colordistance:violet
+frei0r=colordistance:0x112233
+
+# apply the perspective effect, specify the top left and top right
+# image positions
+frei0r=perspective:0.2/0.2:0.8/0.2
+
+ +

For more information see: +http://piksel.org/frei0r +

+ +

18.12 gradfun

+ +

Fix the banding artifacts that are sometimes introduced into nearly flat +regions by truncation to 8bit colordepth. +Interpolate the gradients that should go where the bands are, and +dither them. +

+

This filter is designed for playback only. Do not use it prior to +lossy compression, because compression tends to lose the dither and +bring back the bands. +

+

The filter takes two optional parameters, separated by ’:’: +strength:radius +

+

strength is the maximum amount by which the filter will change +any one pixel. Also the threshold for detecting nearly flat +regions. Acceptable values range from .51 to 255, default value is +1.2, out-of-range values will be clipped to the valid range. +

+

radius is the neighborhood to fit the gradient to. A larger +radius makes for smoother gradients, but also prevents the filter from +modifying the pixels near detailed regions. Acceptable values are +8-32, default value is 16, out-of-range values will be clipped to the +valid range. +

+
 
# default parameters
+gradfun=1.2:16
+
+# omitting radius
+gradfun=1.2
+
+ + +

18.13 hflip

+ +

Flip the input video horizontally. +

+

For example to horizontally flip the video in input with +‘ffmpeg’: +

 
ffmpeg -i in.avi -vf "hflip" out.avi
+
+ + +

18.14 hqdn3d

+ +

High precision/quality 3d denoise filter. This filter aims to reduce +image noise producing smooth images and making still images really +still. It should enhance compressibility. +

+

It accepts the following optional parameters: +luma_spatial:chroma_spatial:luma_tmp:chroma_tmp +

+
+
luma_spatial
+

a non-negative float number which specifies spatial luma strength, +defaults to 4.0 +

+
+
chroma_spatial
+

a non-negative float number which specifies spatial chroma strength, +defaults to 3.0*luma_spatial/4.0 +

+
+
luma_tmp
+

a float number which specifies luma temporal strength, defaults to +6.0*luma_spatial/4.0 +

+
+
chroma_tmp
+

a float number which specifies chroma temporal strength, defaults to +luma_tmp*chroma_spatial/luma_spatial +

+
+ + +

18.15 mp

+ +

Apply an MPlayer filter to the input video. +

+

This filter provides a wrapper around most of the filters of +MPlayer/MEncoder. +

+

This wrapper is considered experimental. Some of the wrapped filters +may not work properly and we may drop support for them, as they will +be implemented natively into FFmpeg. Thus you should avoid +depending on them when writing portable scripts. +

+

The filters accepts the parameters: +filter_name[:=]filter_params +

+

filter_name is the name of a supported MPlayer filter, +filter_params is a string containing the parameters accepted by +the named filter. +

+

The list of the currently supported filters follows: +

+
2xsai
+
blackframe
+
boxblur
+
cropdetect
+
decimate
+
delogo
+
denoise3d
+
detc
+
dint
+
divtc
+
down3dright
+
dsize
+
eq2
+
eq
+
field
+
fil
+
fixpts
+
framestep
+
fspp
+
geq
+
gradfun
+
harddup
+
hqdn3d
+
hue
+
il
+
ilpack
+
ivtc
+
kerndeint
+
mcdeint
+
mirror
+
noise
+
ow
+
palette
+
perspective
+
phase
+
pp7
+
pullup
+
qp
+
rectangle
+
remove_logo
+
rgbtest
+
rotate
+
sab
+
screenshot
+
smartblur
+
softpulldown
+
softskip
+
spp
+
swapuv
+
telecine
+
test
+
tile
+
tinterlace
+
unsharp
+
uspp
+
yuvcsp
+
yvu9
+
+ +

The parameter syntax and behavior for the listed filters are the same +of the corresponding MPlayer filters. For detailed instructions check +the "VIDEO FILTERS" section in the MPlayer manual. +

+

Some examples follow: +

 
# remove a logo by interpolating the surrounding pixels
+mp=delogo=200:200:80:20:1
+
+# adjust gamma, brightness, contrast
+mp=eq2=1.0:2:0.5
+
+# tweak hue and saturation
+mp=hue=100:-10
+
+ +

See also mplayer(1), http://www.mplayerhq.hu/. +

+ +

18.16 noformat

+ +

Force libavfilter not to use any of the specified pixel formats for the +input to the next filter. +

+

The filter accepts a list of pixel format names, separated by ":", +for example "yuv420p:monow:rgb24". +

+

Some examples follow: +

 
# force libavfilter to use a format different from "yuv420p" for the
+# input to the vflip filter
+noformat=yuv420p,vflip
+
+# convert the input video to any of the formats not contained in the list
+noformat=yuv420p:yuv444p:yuv410p
+
+ + +

18.17 null

+ +

Pass the video source unchanged to the output. +

+ +

18.18 ocv

+ +

Apply video transform using libopencv. +

+

To enable this filter install libopencv library and headers and +configure FFmpeg with –enable-libopencv. +

+

The filter takes the parameters: filter_name{:=}filter_params. +

+

filter_name is the name of the libopencv filter to apply. +

+

filter_params specifies the parameters to pass to the libopencv +filter. If not specified the default values are assumed. +

+

Refer to the official libopencv documentation for more precise +informations: +http://opencv.willowgarage.com/documentation/c/image_filtering.html +

+

Follows the list of supported libopencv filters. +

+

+

+

18.18.1 dilate

+ +

Dilate an image by using a specific structuring element. +This filter corresponds to the libopencv function cvDilate. +

+

It accepts the parameters: struct_el:nb_iterations. +

+

struct_el represents a structuring element, and has the syntax: +colsxrows+anchor_xxanchor_y/shape +

+

cols and rows represent the number of colums and rows of +the structuring element, anchor_x and anchor_y the anchor +point, and shape the shape for the structuring element, and +can be one of the values "rect", "cross", "ellipse", "custom". +

+

If the value for shape is "custom", it must be followed by a +string of the form "=filename". The file with name +filename is assumed to represent a binary image, with each +printable character corresponding to a bright pixel. When a custom +shape is used, cols and rows are ignored, the number +or columns and rows of the read file are assumed instead. +

+

The default value for struct_el is "3x3+0x0/rect". +

+

nb_iterations specifies the number of times the transform is +applied to the image, and defaults to 1. +

+

Follow some example: +

 
# use the default values
+ocv=dilate
+
+# dilate using a structuring element with a 5x5 cross, iterate two times
+ocv=dilate=5x5+2x2/cross:2
+
+# read the shape from the file diamond.shape, iterate two times
+# the file diamond.shape may contain a pattern of characters like this:
+#   *
+#  ***
+# *****
+#  ***
+#   *
+# the specified cols and rows are ignored (but not the anchor point coordinates)
+ocv=0x0+2x2/custom=diamond.shape:2
+
+ + +

18.18.2 erode

+ +

Erode an image by using a specific structuring element. +This filter corresponds to the libopencv function cvErode. +

+

The filter accepts the parameters: struct_el:nb_iterations, +with the same meaning and use of those of the dilate filter +(see dilate). +

+ +

18.18.3 smooth

+ +

Smooth the input video. +

+

The filter takes the following parameters: +type:param1:param2:param3:param4. +

+

type is the type of smooth filter to apply, and can be one of +the following values: "blur", "blur_no_scale", "median", "gaussian", +"bilateral". The default value is "gaussian". +

+

param1, param2, param3, and param4 are +parameters whose meanings depend on smooth type. param1 and +param2 accept integer positive values or 0, param3 and +param4 accept float values. +

+

The default value for param1 is 3, the default value for the +other parameters is 0. +

+

These parameters correspond to the parameters assigned to the +libopencv function cvSmooth. +

+ +

18.19 overlay

+ +

Overlay one video on top of another. +

+

It takes two inputs and one output, the first input is the "main" +video on which the second input is overlayed. +

+

It accepts the parameters: x:y. +

+

x is the x coordinate of the overlayed video on the main video, +y is the y coordinate. The parameters are expressions containing +the following parameters: +

+
+
main_w, main_h
+

main input width and height +

+
+
W, H
+

same as main_w and main_h +

+
+
overlay_w, overlay_h
+

overlay input width and height +

+
+
w, h
+

same as overlay_w and overlay_h +

+
+ +

Be aware that frames are taken from each input video in timestamp +order, hence, if their initial timestamps differ, it is a a good idea +to pass the two inputs through a setpts=PTS-STARTPTS filter to +have them begin in the same zero timestamp, as it does the example for +the movie filter. +

+

Follow some examples: +

 
# draw the overlay at 10 pixels from the bottom right
+# corner of the main video.
+overlay=main_w-overlay_w-10:main_h-overlay_h-10
+
+# insert a transparent PNG logo in the bottom left corner of the input
+movie=logo.png [logo];
+[in][logo] overlay=10:main_h-overlay_h-10 [out]
+
+# insert 2 different transparent PNG logos (second logo on bottom
+# right corner):
+movie=logo1.png [logo1];
+movie=logo2.png [logo2];
+[in][logo1]       overlay=10:H-h-10 [in+logo1];
+[in+logo1][logo2] overlay=W-w-10:H-h-10 [out]
+
+# add a transparent color layer on top of the main video,
+# WxH specifies the size of the main input to the overlay filter
+color=red.3:WxH [over]; [in][over] overlay [out]
+
+ +

You can chain togheter more overlays but the efficiency of such +approach is yet to be tested. +

+ +

18.20 pad

+ +

Add paddings to the input image, and places the original input at the +given coordinates x, y. +

+

It accepts the following parameters: +width:height:x:y:color. +

+

The parameters width, height, x, and y are +expressions containing the following constants: +

+
+
E, PI, PHI
+

the corresponding mathematical approximated values for e +(euler number), pi (greek PI), phi (golden ratio) +

+
+
in_w, in_h
+

the input video width and heigth +

+
+
iw, ih
+

same as in_w and in_h +

+
+
out_w, out_h
+

the output width and heigth, that is the size of the padded area as +specified by the width and height expressions +

+
+
ow, oh
+

same as out_w and out_h +

+
+
x, y
+

x and y offsets as specified by the x and y +expressions, or NAN if not yet specified +

+
+
a
+

input display aspect ratio, same as iw / ih +

+
+
hsub, vsub
+

horizontal and vertical chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+ +

Follows the description of the accepted parameters. +

+
+
width, height
+
+

Specify the size of the output image with the paddings added. If the +value for width or height is 0, the corresponding input size +is used for the output. +

+

The width expression can reference the value set by the +height expression, and viceversa. +

+

The default value of width and height is 0. +

+
+
x, y
+
+

Specify the offsets where to place the input image in the padded area +with respect to the top/left border of the output image. +

+

The x expression can reference the value set by the y +expression, and viceversa. +

+

The default value of x and y is 0. +

+
+
color
+
+

Specify the color of the padded area, it can be the name of a color +(case insensitive match) or a 0xRRGGBB[AA] sequence. +

+

The default value of color is "black". +

+
+
+ +

Some examples follow: +

+
 
# Add paddings with color "violet" to the input video. Output video
+# size is 640x480, the top-left corner of the input video is placed at
+# column 0, row 40.
+pad=640:480:0:40:violet
+
+# pad the input to get an output with dimensions increased bt 3/2,
+# and put the input video at the center of the padded area
+pad="3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2"
+
+# pad the input to get a squared output with size equal to the maximum
+# value between the input width and height, and put the input video at
+# the center of the padded area
+pad="max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2"
+
+# pad the input to get a final w/h ratio of 16:9
+pad="ih*16/9:ih:(ow-iw)/2:(oh-ih)/2"
+
+# double output size and put the input video in the bottom-right
+# corner of the output padded area
+pad="2*iw:2*ih:ow-iw:oh-ih"
+
+ + +

18.21 pixdesctest

+ +

Pixel format descriptor test filter, mainly useful for internal +testing. The output video should be equal to the input video. +

+

For example: +

 
format=monow, pixdesctest
+
+ +

can be used to test the monowhite pixel format descriptor definition. +

+ +

18.22 scale

+ +

Scale the input video to width:height and/or convert the image format. +

+

The parameters width and height are expressions containing +the following constants: +

+
+
E, PI, PHI
+

the corresponding mathematical approximated values for e +(euler number), pi (greek PI), phi (golden ratio) +

+
+
in_w, in_h
+

the input width and heigth +

+
+
iw, ih
+

same as in_w and in_h +

+
+
out_w, out_h
+

the output (cropped) width and heigth +

+
+
ow, oh
+

same as out_w and out_h +

+
+
a
+

input display aspect ratio, same as iw / ih +

+
+
hsub, vsub
+

horizontal and vertical chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+ +

If the input image format is different from the format requested by +the next filter, the scale filter will convert the input to the +requested format. +

+

If the value for width or height is 0, the respective input +size is used for the output. +

+

If the value for width or height is -1, the scale filter will +use, for the respective output size, a value that maintains the aspect +ratio of the input image. +

+

The default value of width and height is 0. +

+

Some examples follow: +

 
# scale the input video to a size of 200x100.
+scale=200:100
+
+# scale the input to 2x
+scale=2*iw:2*ih
+# the above is the same as
+scale=2*in_w:2*in_h
+
+# scale the input to half size
+scale=iw/2:ih/2
+
+# increase the width, and set the height to the same size
+scale=3/2*iw:ow
+
+# seek for Greek harmony
+scale=iw:1/PHI*iw
+scale=ih*PHI:ih
+
+# increase the height, and set the width to 3/2 of the height
+scale=3/2*oh:3/5*ih
+
+# increase the size, but make the size a multiple of the chroma
+scale="trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub"
+
+# increase the width to a maximum of 500 pixels, keep the same input aspect ratio
+scale='min(500\, iw*3/2):-1'
+
+ +

+

+

18.23 setdar

+ +

Set the Display Aspect Ratio for the filter output video. +

+

This is done by changing the specified Sample (aka Pixel) Aspect +Ratio, according to the following equation: +DAR = HORIZONTAL_RESOLUTION / VERTICAL_RESOLUTION * SAR +

+

Keep in mind that this filter does not modify the pixel dimensions of +the video frame. Also the display aspect ratio set by this filter may +be changed by later filters in the filterchain, e.g. in case of +scaling or if another "setdar" or a "setsar" filter is applied. +

+

The filter accepts a parameter string which represents the wanted +display aspect ratio. +The parameter can be a floating point number string, or an expression +of the form num:den, where num and den are the +numerator and denominator of the aspect ratio. +If the parameter is not specified, it is assumed the value "0:1". +

+

For example to change the display aspect ratio to 16:9, specify: +

 
setdar=16:9
+# the above is equivalent to
+setdar=1.77777
+
+ +

See also the "setsar" filter documentation (see setsar). +

+ +

18.24 setpts

+ +

Change the PTS (presentation timestamp) of the input video frames. +

+

Accept in input an expression evaluated through the eval API, which +can contain the following constants: +

+
+
PTS
+

the presentation timestamp in input +

+
+
PI
+

Greek PI +

+
+
PHI
+

golden ratio +

+
+
E
+

Euler number +

+
+
N
+

the count of the input frame, starting from 0. +

+
+
STARTPTS
+

the PTS of the first video frame +

+
+
INTERLACED
+

tell if the current frame is interlaced +

+
+
POS
+

original position in the file of the frame, or undefined if undefined +for the current frame +

+
+
PREV_INPTS
+

previous input PTS +

+
+
PREV_OUTPTS
+

previous output PTS +

+
+
+ +

Some examples follow: +

+
 
# start counting PTS from zero
+setpts=PTS-STARTPTS
+
+# fast motion
+setpts=0.5*PTS
+
+# slow motion
+setpts=2.0*PTS
+
+# fixed rate 25 fps
+setpts=N/(25*TB)
+
+# fixed rate 25 fps with some jitter
+setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
+
+ +

+

+

18.25 setsar

+ +

Set the Sample (aka Pixel) Aspect Ratio for the filter output video. +

+

Note that as a consequence of the application of this filter, the +output display aspect ratio will change according to the following +equation: +DAR = HORIZONTAL_RESOLUTION / VERTICAL_RESOLUTION * SAR +

+

Keep in mind that the sample aspect ratio set by this filter may be +changed by later filters in the filterchain, e.g. if another "setsar" +or a "setdar" filter is applied. +

+

The filter accepts a parameter string which represents the wanted +sample aspect ratio. +The parameter can be a floating point number string, or an expression +of the form num:den, where num and den are the +numerator and denominator of the aspect ratio. +If the parameter is not specified, it is assumed the value "0:1". +

+

For example to change the sample aspect ratio to 10:11, specify: +

 
setsar=10:11
+
+ + +

18.26 settb

+ +

Set the timebase to use for the output frames timestamps. +It is mainly useful for testing timebase configuration. +

+

It accepts in input an arithmetic expression representing a rational. +The expression can contain the constants "PI", "E", "PHI", "AVTB" (the +default timebase), and "intb" (the input timebase). +

+

The default value for the input is "intb". +

+

Follow some examples. +

+
 
# set the timebase to 1/25
+settb=1/25
+
+# set the timebase to 1/10
+settb=0.1
+
+#set the timebase to 1001/1000
+settb=1+0.001
+
+#set the timebase to 2*intb
+settb=2*intb
+
+#set the default timebase value
+settb=AVTB
+
+ + +

18.27 showinfo

+ +

Show a line containing various information for each input video frame. +The input video is not modified. +

+

The shown line contains a sequence of key/value pairs of the form +key:value. +

+

A description of each shown parameter follows: +

+
+
n
+

sequential number of the input frame, starting from 0 +

+
+
pts
+

Presentation TimeStamp of the input frame, expressed as a number of +time base units. The time base unit depends on the filter input pad. +

+
+
pts_time
+

Presentation TimeStamp of the input frame, expressed as a number of +seconds +

+
+
pos
+

position of the frame in the input stream, -1 if this information in +unavailable and/or meanigless (for example in case of synthetic video) +

+
+
fmt
+

pixel format name +

+
+
sar
+

sample aspect ratio of the input frame, expressed in the form +num/den +

+
+
s
+

size of the input frame, expressed in the form +widthxheight +

+
+
i
+

interlaced mode ("P" for "progressive", "T" for top field first, "B" +for bottom field first) +

+
+
iskey
+

1 if the frame is a key frame, 0 otherwise +

+
+
type
+

picture type of the input frame ("I" for an I-frame, "P" for a +P-frame, "B" for a B-frame, "?" for unknown type). +Check also the documentation of the AVPictureType enum and of +the av_get_picture_type_char function defined in +‘libavutil/avutil.h’. +

+
+
checksum
+

Adler-32 checksum of all the planes of the input frame +

+
+
plane_checksum
+

Adler-32 checksum of each plane of the input frame, expressed in the form +"[c0 c1 c2 c3]" +

+
+ + +

18.28 slicify

+ +

Pass the images of input video on to next video filter as multiple +slices. +

+
 
./ffmpeg -i in.avi -vf "slicify=32" out.avi
+
+ +

The filter accepts the slice height as parameter. If the parameter is +not specified it will use the default value of 16. +

+

Adding this in the beginning of filter chains should make filtering +faster due to better use of the memory cache. +

+ +

18.29 transpose

+ +

Transpose rows with columns in the input video and optionally flip it. +

+

It accepts a parameter representing an integer, which can assume the +values: +

+
+
0
+

Rotate by 90 degrees counterclockwise and vertically flip (default), that is: +

 
L.R     L.l
+. . ->  . .
+l.r     R.r
+
+ +
+
1
+

Rotate by 90 degrees clockwise, that is: +

 
L.R     l.L
+. . ->  . .
+l.r     r.R
+
+ +
+
2
+

Rotate by 90 degrees counterclockwise, that is: +

 
L.R     R.r
+. . ->  . .
+l.r     L.l
+
+ +
+
3
+

Rotate by 90 degrees clockwise and vertically flip, that is: +

 
L.R     r.R
+. . ->  . .
+l.r     l.L
+
+
+
+ + +

18.30 unsharp

+ +

Sharpen or blur the input video. +

+

It accepts the following parameters: +luma_msize_x:luma_msize_y:luma_amount:chroma_msize_x:chroma_msize_y:chroma_amount +

+

Negative values for the amount will blur the input video, while positive +values will sharpen. All parameters are optional and default to the +equivalent of the string ’5:5:1.0:0:0:0.0’. +

+
+
luma_msize_x
+

Set the luma matrix horizontal size. It can be an integer between 3 +and 13, default value is 5. +

+
+
luma_msize_y
+

Set the luma matrix vertical size. It can be an integer between 3 +and 13, default value is 5. +

+
+
luma_amount
+

Set the luma effect strength. It can be a float number between -2.0 +and 5.0, default value is 1.0. +

+
+
chroma_msize_x
+

Set the chroma matrix horizontal size. It can be an integer between 3 +and 13, default value is 0. +

+
+
chroma_msize_y
+

Set the chroma matrix vertical size. It can be an integer between 3 +and 13, default value is 0. +

+
+
luma_amount
+

Set the chroma effect strength. It can be a float number between -2.0 +and 5.0, default value is 0.0. +

+
+
+ +
 
# Strong luma sharpen effect parameters
+unsharp=7:7:2.5
+
+# Strong blur of both luma and chroma parameters
+unsharp=7:7:-2:7:7:-2
+
+# Use the default values with ffmpeg
+./ffmpeg -i in.avi -vf "unsharp" out.mp4
+
+ + +

18.31 vflip

+ +

Flip the input video vertically. +

+
 
./ffmpeg -i in.avi -vf "vflip" out.avi
+
+ + +

18.32 yadif

+ +

Deinterlace the input video ("yadif" means "yet another deinterlacing +filter"). +

+

It accepts the optional parameters: mode:parity. +

+

mode specifies the interlacing mode to adopt, accepts one of the +following values: +

+
+
0
+

output 1 frame for each frame +

+
1
+

output 1 frame for each field +

+
2
+

like 0 but skips spatial interlacing check +

+
3
+

like 1 but skips spatial interlacing check +

+
+ +

Default value is 0. +

+

parity specifies the picture field parity assumed for the input +interlaced video, accepts one of the following values: +

+
+
0
+

assume bottom field first +

+
1
+

assume top field first +

+
-1
+

enable automatic detection +

+
+ +

Default value is -1. +If interlacing is unknown or decoder does not export this information, +top field first will be assumed. +

+ + +

19. Video Sources

+ +

Below is a description of the currently available video sources. +

+ +

19.1 buffer

+ +

Buffer video frames, and make them available to the filter chain. +

+

This source is mainly intended for a programmatic use, in particular +through the interface defined in ‘libavfilter/vsrc_buffer.h’. +

+

It accepts the following parameters: +width:height:pix_fmt_string:timebase_num:timebase_den:sample_aspect_ratio_num:sample_aspect_ratio.den +

+

All the parameters need to be explicitely defined. +

+

Follows the list of the accepted parameters. +

+
+
width, height
+

Specify the width and height of the buffered video frames. +

+
+
pix_fmt_string
+

A string representing the pixel format of the buffered video frames. +It may be a number corresponding to a pixel format, or a pixel format +name. +

+
+
timebase_num, timebase_den
+

Specify numerator and denomitor of the timebase assumed by the +timestamps of the buffered frames. +

+
+
sample_aspect_ratio.num, sample_aspect_ratio.den
+

Specify numerator and denominator of the sample aspect ratio assumed +by the video frames. +

+
+ +

For example: +

 
buffer=320:240:yuv410p:1:24:1:1
+
+ +

will instruct the source to accept video frames with size 320x240 and +with format "yuv410p", assuming 1/24 as the timestamps timebase and +square pixels (1:1 sample aspect ratio). +Since the pixel format with name "yuv410p" corresponds to the number 6 +(check the enum PixelFormat definition in ‘libavutil/pixfmt.h’), +this example corresponds to: +

 
buffer=320:240:6:1:24
+
+ + +

19.2 color

+ +

Provide an uniformly colored input. +

+

It accepts the following parameters: +color:frame_size:frame_rate +

+

Follows the description of the accepted parameters. +

+
+
color
+

Specify the color of the source. It can be the name of a color (case +insensitive match) or a 0xRRGGBB[AA] sequence, possibly followed by an +alpha specifier. The default value is "black". +

+
+
frame_size
+

Specify the size of the sourced video, it may be a string of the form +widthxheigth, or the name of a size abbreviation. The +default value is "320x240". +

+
+
frame_rate
+

Specify the frame rate of the sourced video, as the number of frames +generated per second. It has to be a string in the format +frame_rate_num/frame_rate_den, an integer number, a float +number or a valid video frame rate abbreviation. The default value is +"25". +

+
+
+ +

For example the following graph description will generate a red source +with an opacity of 0.2, with size "qcif" and a frame rate of 10 +frames per second, which will be overlayed over the source connected +to the pad with identifier "in". +

+
 
"color=red@0.2:qcif:10 [color]; [in][color] overlay [out]"
+
+ + +

19.3 movie

+ +

Read a video stream from a movie container. +

+

It accepts the syntax: movie_name[:options] where +movie_name is the name of the resource to read (not necessarily +a file but also a device or a stream accessed through some protocol), +and options is an optional sequence of key=value +pairs, separated by ":". +

+

The description of the accepted options follows. +

+
+
format_name, f
+

Specifies the format assumed for the movie to read, and can be either +the name of a container or an input device. If not specified the +format is guessed from movie_name or by probing. +

+
+
seek_point, sp
+

Specifies the seek point in seconds, the frames will be output +starting from this seek point, the parameter is evaluated with +av_strtod so the numerical value may be suffixed by an IS +postfix. Default value is "0". +

+
+
stream_index, si
+

Specifies the index of the video stream to read. If the value is -1, +the best suited video stream will be automatically selected. Default +value is "-1". +

+
+
+ +

This filter allows to overlay a second video on top of main input of +a filtergraph as shown in this graph: +

 
input -----------> deltapts0 --> overlay --> output
+                                    ^
+                                    |
+movie --> scale--> deltapts1 -------+
+
+ +

Some examples follow: +

 
# skip 3.2 seconds from the start of the avi file in.avi, and overlay it
+# on top of the input labelled as "in".
+movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [movie];
+[in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
+
+# read from a video4linux2 device, and overlay it on top of the input
+# labelled as "in"
+movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [movie];
+[in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
+
+
+ + +

19.4 nullsrc

+ +

Null video source, never return images. It is mainly useful as a +template and to be employed in analysis / debugging tools. +

+

It accepts as optional parameter a string of the form +width:height:timebase. +

+

width and height specify the size of the configured +source. The default values of width and height are +respectively 352 and 288 (corresponding to the CIF size format). +

+

timebase specifies an arithmetic expression representing a +timebase. The expression can contain the constants "PI", "E", "PHI", +"AVTB" (the default timebase), and defaults to the value "AVTB". +

+ +

19.5 frei0r_src

+ +

Provide a frei0r source. +

+

To enable compilation of this filter you need to install the frei0r +header and configure FFmpeg with –enable-frei0r. +

+

The source supports the syntax: +

 
size:rate:src_name[{=|:}param1:param2:...:paramN]
+
+ +

size is the size of the video to generate, may be a string of the +form widthxheight or a frame size abbreviation. +rate is the rate of the video to generate, may be a string of +the form num/den or a frame rate abbreviation. +src_name is the name to the frei0r source to load. For more +information regarding frei0r and how to set the parameters read the +section "frei0r" (see frei0r) in the description of the video +filters. +

+

Some examples follow: +

 
# generate a frei0r partik0l source with size 200x200 and framerate 10
+# which is overlayed on the overlay filter main input
+frei0r_src=200x200:10:partik0l=1234 [overlay]; [in][overlay] overlay
+
+ + + +

20. Video Sinks

+ +

Below is a description of the currently available video sinks. +

+ +

20.1 nullsink

+ +

Null video sink, do absolutely nothing with the input video. It is +mainly useful as a template and to be employed in analysis / debugging +tools. +

+ + +

21. Metadata

+ +

FFmpeg is able to dump metadata from media files into a simple UTF-8-encoded +INI-like text file and then load it back using the metadata muxer/demuxer. +

+

The file format is as follows: +

    +
  1. +A file consists of a header and a number of metadata tags divided into sections, +each on its own line. + +
  2. +The header is a ’;FFMETADATA’ string, followed by a version number (now 1). + +
  3. +Metadata tags are of the form ’key=value’ + +
  4. +Immediately after header follows global metadata + +
  5. +After global metadata there may be sections with per-stream/per-chapter +metadata. + +
  6. +A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in +brackets (’[’, ’]’) and ends with next section or end of file. + +
  7. +At the beginning of a chapter section there may be an optional timebase to be +used for start/end values. It must be in form ’TIMEBASE=num/den’, where num and +den are integers. If the timebase is missing then start/end times are assumed to +be in milliseconds. +Next a chapter section must contain chapter start and end times in form +’START=num’, ’END=num’, where num is a positive integer. + +
  8. +Empty lines and lines starting with ’;’ or ’#’ are ignored. + +
  9. +Metadata keys or values containing special characters (’=’, ’;’, ’#’, ’\’ and a +newline) must be escaped with a backslash ’\’. + +
  10. +Note that whitespace in metadata (e.g. foo = bar) is considered to be a part of +the tag (in the example above key is ’foo ’, value is ’ bar’). +
+ +

A ffmetadata file might look like this: +

 
;FFMETADATA1
+title=bike\\shed
+;this is a comment
+artist=FFmpeg troll team
+
+[CHAPTER]
+TIMEBASE=1/1000
+START=0
+#chapter ends at 0:01:00
+END=60000
+title=chapter \#1
+[STREAM]
+title=multi\
+line
+
+ + +
+

+ + This document was generated by Kyle Schwarz on May 18, 2011 using texi2html 1.82. + +
+ +

+ + diff --git a/ffmpeg 0.7/doc/ffplay.html b/ffmpeg 0.7/doc/ffplay.html new file mode 100644 index 000000000..717b4cead --- /dev/null +++ b/ffmpeg 0.7/doc/ffplay.html @@ -0,0 +1,3579 @@ + + + + +ffplay Documentation + + + + + + + + + + + + + + + +

ffplay Documentation

+ + +

Table of Contents

+
+ + +
+ +
+ +

1. Synopsis

+ +
 
ffplay [options] ‘input_file’
+
+ + +

2. Description

+ +

FFplay is a very simple and portable media player using the FFmpeg +libraries and the SDL library. It is mostly used as a testbed for the +various FFmpeg APIs. +

+ +

3. Options

+ +

All the numerical options, if not specified otherwise, accept in input +a string representing a number, which may contain one of the +International System number postfixes, for example ’K’, ’M’, ’G’. +If ’i’ is appended after the postfix, powers of 2 are used instead of +powers of 10. The ’B’ postfix multiplies the value for 8, and can be +appended after another postfix or used alone. This allows using for +example ’KB’, ’MiB’, ’G’ and ’B’ as postfix. +

+

Options which do not take arguments are boolean options, and set the +corresponding value to true. They can be set to false by prefixing +with "no" the option name, for example using "-nofoo" in the +commandline will set to false the boolean option with name "foo". +

+ +

3.1 Generic options

+ +

These options are shared amongst the ff* tools. +

+
+
-L
+

Show license. +

+
+
-h, -?, -help, --help
+

Show help. +

+
+
-version
+

Show version. +

+
+
-formats
+

Show available formats. +

+

The fields preceding the format names have the following meanings: +

+
D
+

Decoding available +

+
E
+

Encoding available +

+
+ +
+
-codecs
+

Show available codecs. +

+

The fields preceding the codec names have the following meanings: +

+
D
+

Decoding available +

+
E
+

Encoding available +

+
V/A/S
+

Video/audio/subtitle codec +

+
S
+

Codec supports slices +

+
D
+

Codec supports direct rendering +

+
T
+

Codec can handle input truncated at random locations instead of only at frame boundaries +

+
+ +
+
-bsfs
+

Show available bitstream filters. +

+
+
-protocols
+

Show available protocols. +

+
+
-filters
+

Show available libavfilter filters. +

+
+
-pix_fmts
+

Show available pixel formats. +

+
+
-loglevel loglevel
+

Set the logging level used by the library. +loglevel is a number or a string containing one of the following values: +

+
quiet
+
panic
+
fatal
+
error
+
warning
+
info
+
verbose
+
debug
+
+ +

By default the program logs to stderr, if coloring is supported by the +terminal, colors are used to mark errors and warnings. Log coloring +can be disabled setting the environment variable +FFMPEG_FORCE_NOCOLOR or NO_COLOR, or can be forced setting +the environment variable FFMPEG_FORCE_COLOR. +The use of the environment variable NO_COLOR is deprecated and +will be dropped in a following FFmpeg version. +

+
+
+ + +

3.2 Main options

+ +
+
-x width
+

Force displayed width. +

+
-y height
+

Force displayed height. +

+
-s size
+

Set frame size (WxH or abbreviation), needed for videos which don’t +contain a header with the frame size like raw YUV. +

+
-an
+

Disable audio. +

+
-vn
+

Disable video. +

+
-ss pos
+

Seek to a given position in seconds. +

+
-t duration
+

play <duration> seconds of audio/video +

+
-bytes
+

Seek by bytes. +

+
-nodisp
+

Disable graphical display. +

+
-f fmt
+

Force format. +

+
-window_title title
+

Set window title (default is the input filename). +

+
-loop number
+

Loops movie playback <number> times. 0 means forever. +

+
-showmode mode
+

Set the show mode to use. +Available values for mode are: +

+
0, video
+

show video +

+
1, waves
+

show audio waves +

+
2, rdft
+

show audio frequency band using RDFT ((Inverse) Real Discrete Fourier Transform) +

+
+ +

Default value is "video", if video is not present or cannot be played +"rdft" is automatically selected. +

+

You can interactively cycle through the available show modes by +pressing the key <w>. +

+
+
-vf filter_graph
+

filter_graph is a description of the filter graph to apply to +the input video. +Use the option "-filters" to show all the available filters (including +also sources and sinks). +

+
+
+ + +

3.3 Advanced options

+
+
-pix_fmt format
+

Set pixel format. +

+
-stats
+

Show the stream duration, the codec parameters, the current position in +the stream and the audio/video synchronisation drift. +

+
-debug
+

Print specific debug info. +

+
-bug
+

Work around bugs. +

+
-vismv
+

Visualize motion vectors. +

+
-fast
+

Non-spec-compliant optimizations. +

+
-genpts
+

Generate pts. +

+
-rtp_tcp
+

Force RTP/TCP protocol usage instead of RTP/UDP. It is only meaningful +if you are streaming with the RTSP protocol. +

+
-sync type
+

Set the master clock to audio (type=audio), video +(type=video) or external (type=ext). Default is audio. The +master clock is used to control audio-video synchronization. Most media +players use audio as master clock, but in some cases (streaming or high +quality broadcast) it is necessary to change that. This option is mainly +used for debugging purposes. +

+
-threads count
+

Set the thread count. +

+
-ast audio_stream_number
+

Select the desired audio stream number, counting from 0. The number +refers to the list of all the input audio streams. If it is greater +than the number of audio streams minus one, then the last one is +selected, if it is negative the audio playback is disabled. +

+
-vst video_stream_number
+

Select the desired video stream number, counting from 0. The number +refers to the list of all the input video streams. If it is greater +than the number of video streams minus one, then the last one is +selected, if it is negative the video playback is disabled. +

+
-sst subtitle_stream_number
+

Select the desired subtitle stream number, counting from 0. The number +refers to the list of all the input subtitle streams. If it is greater +than the number of subtitle streams minus one, then the last one is +selected, if it is negative the subtitle rendering is disabled. +

+
-autoexit
+

Exit when video is done playing. +

+
-exitonkeydown
+

Exit if any key is pressed. +

+
-exitonmousedown
+

Exit if any mouse button is pressed. +

+
+ + +

3.4 While playing

+ +
+
<q, ESC>
+

Quit. +

+
+
<f>
+

Toggle full screen. +

+
+
<p, SPC>
+

Pause. +

+
+
<a>
+

Cycle audio channel. +

+
+
<v>
+

Cycle video channel. +

+
+
<t>
+

Cycle subtitle channel. +

+
+
<w>
+

Show audio waves. +

+
+
<left/right>
+

Seek backward/forward 10 seconds. +

+
+
<down/up>
+

Seek backward/forward 1 minute. +

+
+
<mouse click>
+

Seek to percentage in file corresponding to fraction of width. +

+
+
+ + + +

4. Expression Evaluation

+ +

When evaluating an arithemetic expression, FFmpeg uses an internal +formula evaluator, implemented through the ‘libavutil/eval.h’ +interface. +

+

An expression may contain unary, binary operators, constants, and +functions. +

+

Two expressions expr1 and expr2 can be combined to form +another expression "expr1;expr2". +expr1 and expr2 are evaluated in turn, and the new +expression evaluates to the value of expr2. +

+

The following binary operators are available: +, -, +*, /, ^. +

+

The following unary operators are available: +, -. +

+

The following functions are available: +

+
sinh(x)
+
cosh(x)
+
tanh(x)
+
sin(x)
+
cos(x)
+
tan(x)
+
atan(x)
+
asin(x)
+
acos(x)
+
exp(x)
+
log(x)
+
abs(x)
+
squish(x)
+
gauss(x)
+
isnan(x)
+

Return 1.0 if x is NAN, 0.0 otherwise. +

+
+
mod(x, y)
+
max(x, y)
+
min(x, y)
+
eq(x, y)
+
gte(x, y)
+
gt(x, y)
+
lte(x, y)
+
lt(x, y)
+
st(var, expr)
+

Allow to store the value of the expression expr in an internal +variable. var specifies the number of the variable where to +store the value, and it is a value ranging from 0 to 9. The function +returns the value stored in the internal variable. +

+
+
ld(var)
+

Allow to load the value of the internal variable with number +var, which was previosly stored with st(var, expr). +The function returns the loaded value. +

+
+
while(cond, expr)
+

Evaluate expression expr while the expression cond is +non-zero, and returns the value of the last expr evaluation, or +NAN if cond was always false. +

+
+
ceil(expr)
+

Round the value of expression expr upwards to the nearest +integer. For example, "ceil(1.5)" is "2.0". +

+
+
floor(expr)
+

Round the value of expression expr downwards to the nearest +integer. For example, "floor(-1.5)" is "-2.0". +

+
+
trunc(expr)
+

Round the value of expression expr towards zero to the nearest +integer. For example, "trunc(-1.5)" is "-1.0". +

+
+
sqrt(expr)
+

Compute the square root of expr. This is equivalent to +"(expr)^.5". +

+
+ +

Note that: +

+

* works like AND +

+

+ works like OR +

+

thus +

 
if A then B else C
+
+

is equivalent to +

 
A*B + not(A)*C
+
+ +

When A evaluates to either 1 or 0, that is the same as +

 
A*B + eq(A,0)*C
+
+ +

In your C code, you can extend the list of unary and binary functions, +and define recognized constants, so that they are available for your +expressions. +

+

The evaluator also recognizes the International System number +postfixes. If ’i’ is appended after the postfix, powers of 2 are used +instead of powers of 10. The ’B’ postfix multiplies the value for 8, +and can be appended after another postfix or used alone. This allows +using for example ’KB’, ’MiB’, ’G’ and ’B’ as postfix. +

+

Follows the list of available International System postfixes, with +indication of the corresponding powers of 10 and of 2. +

+
y
+

-24 / -80 +

+
z
+

-21 / -70 +

+
a
+

-18 / -60 +

+
f
+

-15 / -50 +

+
p
+

-12 / -40 +

+
n
+

-9 / -30 +

+
u
+

-6 / -20 +

+
m
+

-3 / -10 +

+
c
+

-2 +

+
d
+

-1 +

+
h
+

2 +

+
k
+

3 / 10 +

+
K
+

3 / 10 +

+
M
+

6 / 20 +

+
G
+

9 / 30 +

+
T
+

12 / 40 +

+
P
+

15 / 40 +

+
E
+

18 / 50 +

+
Z
+

21 / 60 +

+
Y
+

24 / 70 +

+
+ + +

5. Demuxers

+ +

Demuxers are configured elements in FFmpeg which allow to read the +multimedia streams from a particular type of file. +

+

When you configure your FFmpeg build, all the supported demuxers +are enabled by default. You can list all available ones using the +configure option "–list-demuxers". +

+

You can disable all the demuxers using the configure option +"–disable-demuxers", and selectively enable a single demuxer with +the option "–enable-demuxer=DEMUXER", or disable it +with the option "–disable-demuxer=DEMUXER". +

+

The option "-formats" of the ff* tools will display the list of +enabled demuxers. +

+

The description of some of the currently available demuxers follows. +

+ +

5.1 image2

+ +

Image file demuxer. +

+

This demuxer reads from a list of image files specified by a pattern. +

+

The pattern may contain the string "%d" or "%0Nd", which +specifies the position of the characters representing a sequential +number in each filename matched by the pattern. If the form +"%d0Nd" is used, the string representing the number in each +filename is 0-padded and N is the total number of 0-padded +digits representing the number. The literal character ’%’ can be +specified in the pattern with the string "%%". +

+

If the pattern contains "%d" or "%0Nd", the first filename of +the file list specified by the pattern must contain a number +inclusively contained between 0 and 4, all the following numbers must +be sequential. This limitation may be hopefully fixed. +

+

The pattern may contain a suffix which is used to automatically +determine the format of the images contained in the files. +

+

For example the pattern "img-%03d.bmp" will match a sequence of +filenames of the form ‘img-001.bmp’, ‘img-002.bmp’, ..., +‘img-010.bmp’, etc.; the pattern "i%%m%%g-%d.jpg" will match a +sequence of filenames of the form ‘i%m%g-1.jpg’, +‘i%m%g-2.jpg’, ..., ‘i%m%g-10.jpg’, etc. +

+

The size, the pixel format, and the format of each image must be the +same for all the files in the sequence. +

+

The following example shows how to use ‘ffmpeg’ for creating a +video from the images in the file sequence ‘img-001.jpeg’, +‘img-002.jpeg’, ..., assuming an input framerate of 10 frames per +second: +

 
ffmpeg -r 10 -f image2 -i 'img-%03d.jpeg' out.avi
+
+ +

Note that the pattern must not necessarily contain "%d" or +"%0Nd", for example to convert a single image file +‘img.jpeg’ you can employ the command: +

 
ffmpeg -f image2 -i img.jpeg img.png
+
+ + +

5.2 applehttp

+ +

Apple HTTP Live Streaming demuxer. +

+

This demuxer presents all AVStreams from all variant streams. +The id field is set to the bitrate variant index number. By setting +the discard flags on AVStreams (by pressing ’a’ or ’v’ in ffplay), +the caller can decide which variant streams to actually receive. +The total bitrate of the variant that the stream belongs to is +available in a metadata key named "variant_bitrate". +

+ +

6. Muxers

+ +

Muxers are configured elements in FFmpeg which allow writing +multimedia streams to a particular type of file. +

+

When you configure your FFmpeg build, all the supported muxers +are enabled by default. You can list all available muxers using the +configure option --list-muxers. +

+

You can disable all the muxers with the configure option +--disable-muxers and selectively enable / disable single muxers +with the options --enable-muxer=MUXER / +--disable-muxer=MUXER. +

+

The option -formats of the ff* tools will display the list of +enabled muxers. +

+

A description of some of the currently available muxers follows. +

+

+

+

6.1 crc

+ +

CRC (Cyclic Redundancy Check) testing format. +

+

This muxer computes and prints the Adler-32 CRC of all the input audio +and video frames. By default audio frames are converted to signed +16-bit raw audio and video frames to raw video before computing the +CRC. +

+

The output of the muxer consists of a single line of the form: +CRC=0xCRC, where CRC is a hexadecimal number 0-padded to +8 digits containing the CRC for all the decoded input frames. +

+

For example to compute the CRC of the input, and store it in the file +‘out.crc’: +

 
ffmpeg -i INPUT -f crc out.crc
+
+ +

You can print the CRC to stdout with the command: +

 
ffmpeg -i INPUT -f crc -
+
+ +

You can select the output format of each frame with ‘ffmpeg’ by +specifying the audio and video codec and format. For example to +compute the CRC of the input audio converted to PCM unsigned 8-bit +and the input video converted to MPEG-2 video, use the command: +

 
ffmpeg -i INPUT -acodec pcm_u8 -vcodec mpeg2video -f crc -
+
+ +

See also the framecrc muxer (see framecrc). +

+

+

+

6.2 framecrc

+ +

Per-frame CRC (Cyclic Redundancy Check) testing format. +

+

This muxer computes and prints the Adler-32 CRC for each decoded audio +and video frame. By default audio frames are converted to signed +16-bit raw audio and video frames to raw video before computing the +CRC. +

+

The output of the muxer consists of a line for each audio and video +frame of the form: stream_index, frame_dts, +frame_size, 0xCRC, where CRC is a hexadecimal +number 0-padded to 8 digits containing the CRC of the decoded frame. +

+

For example to compute the CRC of each decoded frame in the input, and +store it in the file ‘out.crc’: +

 
ffmpeg -i INPUT -f framecrc out.crc
+
+ +

You can print the CRC of each decoded frame to stdout with the command: +

 
ffmpeg -i INPUT -f framecrc -
+
+ +

You can select the output format of each frame with ‘ffmpeg’ by +specifying the audio and video codec and format. For example, to +compute the CRC of each decoded input audio frame converted to PCM +unsigned 8-bit and of each decoded input video frame converted to +MPEG-2 video, use the command: +

 
ffmpeg -i INPUT -acodec pcm_u8 -vcodec mpeg2video -f framecrc -
+
+ +

See also the crc muxer (see crc). +

+ +

6.3 image2

+ +

Image file muxer. +

+

The image file muxer writes video frames to image files. +

+

The output filenames are specified by a pattern, which can be used to +produce sequentially numbered series of files. +The pattern may contain the string "%d" or "%0Nd", this string +specifies the position of the characters representing a numbering in +the filenames. If the form "%0Nd" is used, the string +representing the number in each filename is 0-padded to N +digits. The literal character ’%’ can be specified in the pattern with +the string "%%". +

+

If the pattern contains "%d" or "%0Nd", the first filename of +the file list specified will contain the number 1, all the following +numbers will be sequential. +

+

The pattern may contain a suffix which is used to automatically +determine the format of the image files to write. +

+

For example the pattern "img-%03d.bmp" will specify a sequence of +filenames of the form ‘img-001.bmp’, ‘img-002.bmp’, ..., +‘img-010.bmp’, etc. +The pattern "img%%-%d.jpg" will specify a sequence of filenames of the +form ‘img%-1.jpg’, ‘img%-2.jpg’, ..., ‘img%-10.jpg’, +etc. +

+

The following example shows how to use ‘ffmpeg’ for creating a +sequence of files ‘img-001.jpeg’, ‘img-002.jpeg’, ..., +taking one image every second from the input video: +

 
ffmpeg -i in.avi -r 1 -f image2 'img-%03d.jpeg'
+
+ +

Note that with ‘ffmpeg’, if the format is not specified with the +-f option and the output filename specifies an image file +format, the image2 muxer is automatically selected, so the previous +command can be written as: +

 
ffmpeg -i in.avi -r 1 'img-%03d.jpeg'
+
+ +

Note also that the pattern must not necessarily contain "%d" or +"%0Nd", for example to create a single image file +‘img.jpeg’ from the input video you can employ the command: +

 
ffmpeg -i in.avi -f image2 -vframes 1 img.jpeg
+
+ +

The image muxer supports the .Y.U.V image file format. This format is +special in that that each image frame consists of three files, for +each of the YUV420P components. To read or write this image file format, +specify the name of the ’.Y’ file. The muxer will automatically open the +’.U’ and ’.V’ files as required. +

+ +

6.4 mpegts

+ +

MPEG transport stream muxer. +

+

This muxer implements ISO 13818-1 and part of ETSI EN 300 468. +

+

The muxer options are: +

+
+
-mpegts_original_network_id number
+

Set the original_network_id (default 0x0001). This is unique identifier +of a network in DVB. Its main use is in the unique identification of a +service through the path Original_Network_ID, Transport_Stream_ID. +

+
-mpegts_transport_stream_id number
+

Set the transport_stream_id (default 0x0001). This identifies a +transponder in DVB. +

+
-mpegts_service_id number
+

Set the service_id (default 0x0001) also known as program in DVB. +

+
-mpegts_pmt_start_pid number
+

Set the first PID for PMT (default 0x1000, max 0x1f00). +

+
-mpegts_start_pid number
+

Set the first PID for data packets (default 0x0100, max 0x0f00). +

+
+ +

The recognized metadata settings in mpegts muxer are service_provider +and service_name. If they are not set the default for +service_provider is "FFmpeg" and the default for +service_name is "Service01". +

+
 
ffmpeg -i file.mpg -acodec copy -vcodec copy \
+     -mpegts_original_network_id 0x1122 \
+     -mpegts_transport_stream_id 0x3344 \
+     -mpegts_service_id 0x5566 \
+     -mpegts_pmt_start_pid 0x1500 \
+     -mpegts_start_pid 0x150 \
+     -metadata service_provider="Some provider" \
+     -metadata service_name="Some Channel" \
+     -y out.ts
+
+ + +

6.5 null

+ +

Null muxer. +

+

This muxer does not generate any output file, it is mainly useful for +testing or benchmarking purposes. +

+

For example to benchmark decoding with ‘ffmpeg’ you can use the +command: +

 
ffmpeg -benchmark -i INPUT -f null out.null
+
+ +

Note that the above command does not read or write the ‘out.null’ +file, but specifying the output file is required by the ‘ffmpeg’ +syntax. +

+

Alternatively you can write the command as: +

 
ffmpeg -benchmark -i INPUT -f null -
+
+ + +

7. Input Devices

+ +

Input devices are configured elements in FFmpeg which allow to access +the data coming from a multimedia device attached to your system. +

+

When you configure your FFmpeg build, all the supported input devices +are enabled by default. You can list all available ones using the +configure option "–list-indevs". +

+

You can disable all the input devices using the configure option +"–disable-indevs", and selectively enable an input device using the +option "–enable-indev=INDEV", or you can disable a particular +input device using the option "–disable-indev=INDEV". +

+

The option "-formats" of the ff* tools will display the list of +supported input devices (amongst the demuxers). +

+

A description of the currently available input devices follows. +

+ +

7.1 alsa

+ +

ALSA (Advanced Linux Sound Architecture) input device. +

+

To enable this input device during configuration you need libasound +installed on your system. +

+

This device allows capturing from an ALSA device. The name of the +device to capture has to be an ALSA card identifier. +

+

An ALSA identifier has the syntax: +

 
hw:CARD[,DEV[,SUBDEV]]
+
+ +

where the DEV and SUBDEV components are optional. +

+

The three arguments (in order: CARD,DEV,SUBDEV) +specify card number or identifier, device number and subdevice number +(-1 means any). +

+

To see the list of cards currently recognized by your system check the +files ‘/proc/asound/cards’ and ‘/proc/asound/devices’. +

+

For example to capture with ‘ffmpeg’ from an ALSA device with +card id 0, you may run the command: +

 
ffmpeg -f alsa -i hw:0 alsaout.wav
+
+ +

For more information see: +http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html +

+ +

7.2 bktr

+ +

BSD video input device. +

+ +

7.3 dv1394

+ +

Linux DV 1394 input device. +

+ +

7.4 fbdev

+ +

Linux framebuffer input device. +

+

The Linux framebuffer is a graphic hardware-independent abstraction +layer to show graphics on a computer monitor, typically on the +console. It is accessed through a file device node, usually +‘/dev/fb0’. +

+

For more detailed information read the file +Documentation/fb/framebuffer.txt included in the Linux source tree. +

+

To record from the framebuffer device ‘/dev/fb0’ with +‘ffmpeg’: +

 
ffmpeg -f fbdev -r 10 -i /dev/fb0 out.avi
+
+ +

You can take a single screenshot image with the command: +

 
ffmpeg -f fbdev -vframes 1 -r 1 -i /dev/fb0 screenshot.jpeg
+
+ +

See also http://linux-fbdev.sourceforge.net/, and fbset(1). +

+ +

7.5 jack

+ +

JACK input device. +

+

To enable this input device during configuration you need libjack +installed on your system. +

+

A JACK input device creates one or more JACK writable clients, one for +each audio channel, with name client_name:input_N, where +client_name is the name provided by the application, and N +is a number which identifies the channel. +Each writable client will send the acquired data to the FFmpeg input +device. +

+

Once you have created one or more JACK readable clients, you need to +connect them to one or more JACK writable clients. +

+

To connect or disconnect JACK clients you can use the +‘jack_connect’ and ‘jack_disconnect’ programs, or do it +through a graphical interface, for example with ‘qjackctl’. +

+

To list the JACK clients and their properties you can invoke the command +‘jack_lsp’. +

+

Follows an example which shows how to capture a JACK readable client +with ‘ffmpeg’. +

 
# Create a JACK writable client with name "ffmpeg".
+$ ffmpeg -f jack -i ffmpeg -y out.wav
+
+# Start the sample jack_metro readable client.
+$ jack_metro -b 120 -d 0.2 -f 4000
+
+# List the current JACK clients.
+$ jack_lsp -c
+system:capture_1
+system:capture_2
+system:playback_1
+system:playback_2
+ffmpeg:input_1
+metro:120_bpm
+
+# Connect metro to the ffmpeg writable client.
+$ jack_connect metro:120_bpm ffmpeg:input_1
+
+ +

For more information read: +http://jackaudio.org/ +

+ +

7.6 libdc1394

+ +

IIDC1394 input device, based on libdc1394 and libraw1394. +

+ +

7.7 oss

+ +

Open Sound System input device. +

+

The filename to provide to the input device is the device node +representing the OSS input device, and is usually set to +‘/dev/dsp’. +

+

For example to grab from ‘/dev/dsp’ using ‘ffmpeg’ use the +command: +

 
ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
+
+ +

For more information about OSS see: +http://manuals.opensound.com/usersguide/dsp.html +

+ +

7.8 sndio

+ +

sndio input device. +

+

To enable this input device during configuration you need libsndio +installed on your system. +

+

The filename to provide to the input device is the device node +representing the sndio input device, and is usually set to +‘/dev/audio0’. +

+

For example to grab from ‘/dev/audio0’ using ‘ffmpeg’ use the +command: +

 
ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
+
+ + +

7.9 video4linux and video4linux2

+ +

Video4Linux and Video4Linux2 input video devices. +

+

The name of the device to grab is a file device node, usually Linux +systems tend to automatically create such nodes when the device +(e.g. an USB webcam) is plugged into the system, and has a name of the +kind ‘/dev/videoN’, where N is a number associated to +the device. +

+

Video4Linux and Video4Linux2 devices only support a limited set of +widthxheight sizes and framerates. You can check which are +supported for example with the command ‘dov4l’ for Video4Linux +devices and the command ‘v4l-info’ for Video4Linux2 devices. +

+

If the size for the device is set to 0x0, the input device will +try to autodetect the size to use. +Only for the video4linux2 device, if the frame rate is set to 0/0 the +input device will use the frame rate value already set in the driver. +

+

Video4Linux support is deprecated since Linux 2.6.30, and will be +dropped in later versions. +

+

Follow some usage examples of the video4linux devices with the ff* +tools. +

 
# Grab and show the input of a video4linux device, frame rate is set
+# to the default of 25/1.
+ffplay -s 320x240 -f video4linux /dev/video0
+
+# Grab and show the input of a video4linux2 device, autoadjust size.
+ffplay -f video4linux2 /dev/video0
+
+# Grab and record the input of a video4linux2 device, autoadjust size,
+# frame rate value defaults to 0/0 so it is read from the video4linux2
+# driver.
+ffmpeg -f video4linux2 -i /dev/video0 out.mpeg
+
+ + +

7.10 vfwcap

+ +

VfW (Video for Windows) capture input device. +

+

The filename passed as input is the capture driver number, ranging from +0 to 9. You may use "list" as filename to print a list of drivers. Any +other filename will be interpreted as device number 0. +

+ +

7.11 x11grab

+ +

X11 video input device. +

+

This device allows to capture a region of an X11 display. +

+

The filename passed as input has the syntax: +

 
[hostname]:display_number.screen_number[+x_offset,y_offset]
+
+ +

hostname:display_number.screen_number specifies the +X11 display name of the screen to grab from. hostname can be +ommitted, and defaults to "localhost". The environment variable +DISPLAY contains the default display name. +

+

x_offset and y_offset specify the offsets of the grabbed +area with respect to the top-left border of the X11 screen. They +default to 0. +

+

Check the X11 documentation (e.g. man X) for more detailed information. +

+

Use the ‘dpyinfo’ program for getting basic information about the +properties of your X11 display (e.g. grep for "name" or "dimensions"). +

+

For example to grab from ‘:0.0’ using ‘ffmpeg’: +

 
ffmpeg -f x11grab -r 25 -s cif -i :0.0 out.mpg
+
+# Grab at position 10,20.
+ffmpeg -f x11grab -25 -s cif -i :0.0+10,20 out.mpg
+
+ + +

8. Output Devices

+ +

Output devices are configured elements in FFmpeg which allow to write +multimedia data to an output device attached to your system. +

+

When you configure your FFmpeg build, all the supported output devices +are enabled by default. You can list all available ones using the +configure option "–list-outdevs". +

+

You can disable all the output devices using the configure option +"–disable-outdevs", and selectively enable an output device using the +option "–enable-outdev=OUTDEV", or you can disable a particular +input device using the option "–disable-outdev=OUTDEV". +

+

The option "-formats" of the ff* tools will display the list of +enabled output devices (amongst the muxers). +

+

A description of the currently available output devices follows. +

+ +

8.1 alsa

+ +

ALSA (Advanced Linux Sound Architecture) output device. +

+ +

8.2 oss

+ +

OSS (Open Sound System) output device. +

+ +

8.3 sndio

+ +

sndio audio output device. +

+ +

9. Protocols

+ +

Protocols are configured elements in FFmpeg which allow to access +resources which require the use of a particular protocol. +

+

When you configure your FFmpeg build, all the supported protocols are +enabled by default. You can list all available ones using the +configure option "–list-protocols". +

+

You can disable all the protocols using the configure option +"–disable-protocols", and selectively enable a protocol using the +option "–enable-protocol=PROTOCOL", or you can disable a +particular protocol using the option +"–disable-protocol=PROTOCOL". +

+

The option "-protocols" of the ff* tools will display the list of +supported protocols. +

+

A description of the currently available protocols follows. +

+ +

9.1 applehttp

+ +

Read Apple HTTP Live Streaming compliant segmented stream as +a uniform one. The M3U8 playlists describing the segments can be +remote HTTP resources or local files, accessed using the standard +file protocol. +HTTP is default, specific protocol can be declared by specifying +"+proto" after the applehttp URI scheme name, where proto +is either "file" or "http". +

+
 
applehttp://host/path/to/remote/resource.m3u8
+applehttp+http://host/path/to/remote/resource.m3u8
+applehttp+file://path/to/local/resource.m3u8
+
+ + +

9.2 concat

+ +

Physical concatenation protocol. +

+

Allow to read and seek from many resource in sequence as if they were +a unique resource. +

+

A URL accepted by this protocol has the syntax: +

 
concat:URL1|URL2|...|URLN
+
+ +

where URL1, URL2, ..., URLN are the urls of the +resource to be concatenated, each one possibly specifying a distinct +protocol. +

+

For example to read a sequence of files ‘split1.mpeg’, +‘split2.mpeg’, ‘split3.mpeg’ with ‘ffplay’ use the +command: +

 
ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
+
+ +

Note that you may need to escape the character "|" which is special for +many shells. +

+ +

9.3 file

+ +

File access protocol. +

+

Allow to read from or read to a file. +

+

For example to read from a file ‘input.mpeg’ with ‘ffmpeg’ +use the command: +

 
ffmpeg -i file:input.mpeg output.mpeg
+
+ +

The ff* tools default to the file protocol, that is a resource +specified with the name "FILE.mpeg" is interpreted as the URL +"file:FILE.mpeg". +

+ +

9.4 gopher

+ +

Gopher protocol. +

+ +

9.5 http

+ +

HTTP (Hyper Text Transfer Protocol). +

+ +

9.6 mmst

+ +

MMS (Microsoft Media Server) protocol over TCP. +

+ +

9.7 mmsh

+ +

MMS (Microsoft Media Server) protocol over HTTP. +

+

The required syntax is: +

 
mmsh://server[:port][/app][/playpath]
+
+ + +

9.8 md5

+ +

MD5 output protocol. +

+

Computes the MD5 hash of the data to be written, and on close writes +this to the designated output or stdout if none is specified. It can +be used to test muxers without writing an actual file. +

+

Some examples follow. +

 
# Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
+ffmpeg -i input.flv -f avi -y md5:output.avi.md5
+
+# Write the MD5 hash of the encoded AVI file to stdout.
+ffmpeg -i input.flv -f avi -y md5:
+
+ +

Note that some formats (typically MOV) require the output protocol to +be seekable, so they will fail with the MD5 output protocol. +

+ +

9.9 pipe

+ +

UNIX pipe access protocol. +

+

Allow to read and write from UNIX pipes. +

+

The accepted syntax is: +

 
pipe:[number]
+
+ +

number is the number corresponding to the file descriptor of the +pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If number +is not specified, by default the stdout file descriptor will be used +for writing, stdin for reading. +

+

For example to read from stdin with ‘ffmpeg’: +

 
cat test.wav | ffmpeg -i pipe:0
+# ...this is the same as...
+cat test.wav | ffmpeg -i pipe:
+
+ +

For writing to stdout with ‘ffmpeg’: +

 
ffmpeg -i test.wav -f avi pipe:1 | cat > test.avi
+# ...this is the same as...
+ffmpeg -i test.wav -f avi pipe: | cat > test.avi
+
+ +

Note that some formats (typically MOV), require the output protocol to +be seekable, so they will fail with the pipe output protocol. +

+ +

9.10 rtmp

+ +

Real-Time Messaging Protocol. +

+

The Real-Time Messaging Protocol (RTMP) is used for streaming multime‐ +dia content across a TCP/IP network. +

+

The required syntax is: +

 
rtmp://server[:port][/app][/playpath]
+
+ +

The accepted parameters are: +

+
server
+

The address of the RTMP server. +

+
+
port
+

The number of the TCP port to use (by default is 1935). +

+
+
app
+

It is the name of the application to access. It usually corresponds to +the path where the application is installed on the RTMP server +(e.g. ‘/ondemand/’, ‘/flash/live/’, etc.). +

+
+
playpath
+

It is the path or name of the resource to play with reference to the +application specified in app, may be prefixed by "mp4:". +

+
+
+ +

For example to read with ‘ffplay’ a multimedia resource named +"sample" from the application "vod" from an RTMP server "myserver": +

 
ffplay rtmp://myserver/vod/sample
+
+ + +

9.11 rtmp, rtmpe, rtmps, rtmpt, rtmpte

+ +

Real-Time Messaging Protocol and its variants supported through +librtmp. +

+

Requires the presence of the librtmp headers and library during +configuration. You need to explicitely configure the build with +"–enable-librtmp". If enabled this will replace the native RTMP +protocol. +

+

This protocol provides most client functions and a few server +functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT), +encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled +variants of these encrypted types (RTMPTE, RTMPTS). +

+

The required syntax is: +

 
rtmp_proto://server[:port][/app][/playpath] options
+
+ +

where rtmp_proto is one of the strings "rtmp", "rtmpt", "rtmpe", +"rtmps", "rtmpte", "rtmpts" corresponding to each RTMP variant, and +server, port, app and playpath have the same +meaning as specified for the RTMP native protocol. +options contains a list of space-separated options of the form +key=val. +

+

See the librtmp manual page (man 3 librtmp) for more information. +

+

For example, to stream a file in real-time to an RTMP server using +‘ffmpeg’: +

 
ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
+
+ +

To play the same stream using ‘ffplay’: +

 
ffplay "rtmp://myserver/live/mystream live=1"
+
+ + +

9.12 rtp

+ +

Real-Time Protocol. +

+ +

9.13 rtsp

+ +

RTSP is not technically a protocol handler in libavformat, it is a demuxer +and muxer. The demuxer supports both normal RTSP (with data transferred +over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with +data transferred over RDT). +

+

The muxer can be used to send a stream using RTSP ANNOUNCE to a server +supporting it (currently Darwin Streaming Server and Mischa Spiegelmock’s +RTSP server, http://github.com/revmischa/rtsp-server). +

+

The required syntax for a RTSP url is: +

 
rtsp://hostname[:port]/path[?options]
+
+ +

options is a &-separated list. The following options +are supported: +

+
+
udp
+

Use UDP as lower transport protocol. +

+
+
tcp
+

Use TCP (interleaving within the RTSP control channel) as lower +transport protocol. +

+
+
multicast
+

Use UDP multicast as lower transport protocol. +

+
+
http
+

Use HTTP tunneling as lower transport protocol, which is useful for +passing proxies. +

+
+
filter_src
+

Accept packets only from negotiated peer address and port. +

+
+ +

Multiple lower transport protocols may be specified, in that case they are +tried one at a time (if the setup of one fails, the next one is tried). +For the muxer, only the tcp and udp options are supported. +

+

When receiving data over UDP, the demuxer tries to reorder received packets +(since they may arrive out of order, or packets may get lost totally). In +order for this to be enabled, a maximum delay must be specified in the +max_delay field of AVFormatContext. +

+

When watching multi-bitrate Real-RTSP streams with ‘ffplay’, the +streams to display can be chosen with -vst n and +-ast n for video and audio respectively, and can be switched +on the fly by pressing v and a. +

+

Example command lines: +

+

To watch a stream over UDP, with a max reordering delay of 0.5 seconds: +

+
 
ffplay -max_delay 500000 rtsp://server/video.mp4?udp
+
+ +

To watch a stream tunneled over HTTP: +

+
 
ffplay rtsp://server/video.mp4?http
+
+ +

To send a stream in realtime to a RTSP server, for others to watch: +

+
 
ffmpeg -re -i input -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
+
+ + +

9.14 sap

+ +

Session Announcement Protocol (RFC 2974). This is not technically a +protocol handler in libavformat, it is a muxer and demuxer. +It is used for signalling of RTP streams, by announcing the SDP for the +streams regularly on a separate port. +

+ +

9.14.1 Muxer

+ +

The syntax for a SAP url given to the muxer is: +

 
sap://destination[:port][?options]
+
+ +

The RTP packets are sent to destination on port port, +or to port 5004 if no port is specified. +options is a &-separated list. The following options +are supported: +

+
+
announce_addr=address
+

Specify the destination IP address for sending the announcements to. +If omitted, the announcements are sent to the commonly used SAP +announcement multicast address 224.2.127.254 (sap.mcast.net), or +ff0e::2:7ffe if destination is an IPv6 address. +

+
+
announce_port=port
+

Specify the port to send the announcements on, defaults to +9875 if not specified. +

+
+
ttl=ttl
+

Specify the time to live value for the announcements and RTP packets, +defaults to 255. +

+
+
same_port=0|1
+

If set to 1, send all RTP streams on the same port pair. If zero (the +default), all streams are sent on unique ports, with each stream on a +port 2 numbers higher than the previous. +VLC/Live555 requires this to be set to 1, to be able to receive the stream. +The RTP stack in libavformat for receiving requires all streams to be sent +on unique ports. +

+
+ +

Example command lines follow. +

+

To broadcast a stream on the local subnet, for watching in VLC: +

+
 
ffmpeg -re -i input -f sap sap://224.0.0.255?same_port=1
+
+ +

Similarly, for watching in ffplay: +

+
 
ffmpeg -re -i input -f sap sap://224.0.0.255
+
+ +

And for watching in ffplay, over IPv6: +

+
 
ffmpeg -re -i input -f sap sap://[ff0e::1:2:3:4]
+
+ + +

9.14.2 Demuxer

+ +

The syntax for a SAP url given to the demuxer is: +

 
sap://[address][:port]
+
+ +

address is the multicast address to listen for announcements on, +if omitted, the default 224.2.127.254 (sap.mcast.net) is used. port +is the port that is listened on, 9875 if omitted. +

+

The demuxers listens for announcements on the given address and port. +Once an announcement is received, it tries to receive that particular stream. +

+

Example command lines follow. +

+

To play back the first stream announced on the normal SAP multicast address: +

+
 
ffplay sap://
+
+ +

To play back the first stream announced on one the default IPv6 SAP multicast address: +

+
 
ffplay sap://[ff0e::2:7ffe]
+
+ + +

9.15 tcp

+ +

Trasmission Control Protocol. +

+

The required syntax for a TCP url is: +

 
tcp://hostname:port[?options]
+
+ +
+
listen
+

Listen for an incoming connection +

+
 
ffmpeg -i input -f format tcp://hostname:port?listen
+ffplay tcp://hostname:port
+
+ +
+
+ + +

9.16 udp

+ +

User Datagram Protocol. +

+

The required syntax for a UDP url is: +

 
udp://hostname:port[?options]
+
+ +

options contains a list of &-seperated options of the form key=val. +Follow the list of supported options. +

+
+
buffer_size=size
+

set the UDP buffer size in bytes +

+
+
localport=port
+

override the local UDP port to bind with +

+
+
pkt_size=size
+

set the size in bytes of UDP packets +

+
+
reuse=1|0
+

explicitly allow or disallow reusing UDP sockets +

+
+
ttl=ttl
+

set the time to live value (for multicast only) +

+
+
connect=1|0
+

Initialize the UDP socket with connect(). In this case, the +destination address can’t be changed with ff_udp_set_remote_url later. +If the destination address isn’t known at the start, this option can +be specified in ff_udp_set_remote_url, too. +This allows finding out the source address for the packets with getsockname, +and makes writes return with AVERROR(ECONNREFUSED) if "destination +unreachable" is received. +For receiving, this gives the benefit of only receiving packets from +the specified peer address/port. +

+
+ +

Some usage examples of the udp protocol with ‘ffmpeg’ follow. +

+

To stream over UDP to a remote endpoint: +

 
ffmpeg -i input -f format udp://hostname:port
+
+ +

To stream in mpegts format over UDP using 188 sized UDP packets, using a large input buffer: +

 
ffmpeg -i input -f mpegts udp://hostname:port?pkt_size=188&buffer_size=65535
+
+ +

To receive over UDP from a remote endpoint: +

 
ffmpeg -i udp://[multicast-address]:port
+
+ + +

10. Filtergraph description

+ +

A filtergraph is a directed graph of connected filters. It can contain +cycles, and there can be multiple links between a pair of +filters. Each link has one input pad on one side connecting it to one +filter from which it takes its input, and one output pad on the other +side connecting it to the one filter accepting its output. +

+

Each filter in a filtergraph is an instance of a filter class +registered in the application, which defines the features and the +number of input and output pads of the filter. +

+

A filter with no input pads is called a "source", a filter with no +output pads is called a "sink". +

+ +

10.1 Filtergraph syntax

+ +

A filtergraph can be represented using a textual representation, which +is recognized by the -vf and -af options of the ff* +tools, and by the av_parse_graph() function defined in +‘libavfilter/avfiltergraph’. +

+

A filterchain consists of a sequence of connected filters, each one +connected to the previous one in the sequence. A filterchain is +represented by a list of ","-separated filter descriptions. +

+

A filtergraph consists of a sequence of filterchains. A sequence of +filterchains is represented by a list of ";"-separated filterchain +descriptions. +

+

A filter is represented by a string of the form: +[in_link_1]...[in_link_N]filter_name=arguments[out_link_1]...[out_link_M] +

+

filter_name is the name of the filter class of which the +described filter is an instance of, and has to be the name of one of +the filter classes registered in the program. +The name of the filter class is optionally followed by a string +"=arguments". +

+

arguments is a string which contains the parameters used to +initialize the filter instance, and are described in the filter +descriptions below. +

+

The list of arguments can be quoted using the character "’" as initial +and ending mark, and the character ’\’ for escaping the characters +within the quoted text; otherwise the argument string is considered +terminated when the next special character (belonging to the set +"[]=;,") is encountered. +

+

The name and arguments of the filter are optionally preceded and +followed by a list of link labels. +A link label allows to name a link and associate it to a filter output +or input pad. The preceding labels in_link_1 +... in_link_N, are associated to the filter input pads, +the following labels out_link_1 ... out_link_M, are +associated to the output pads. +

+

When two link labels with the same name are found in the +filtergraph, a link between the corresponding input and output pad is +created. +

+

If an output pad is not labelled, it is linked by default to the first +unlabelled input pad of the next filter in the filterchain. +For example in the filterchain: +

 
nullsrc, split[L1], [L2]overlay, nullsink
+
+

the split filter instance has two output pads, and the overlay filter +instance two input pads. The first output pad of split is labelled +"L1", the first input pad of overlay is labelled "L2", and the second +output pad of split is linked to the second input pad of overlay, +which are both unlabelled. +

+

In a complete filterchain all the unlabelled filter input and output +pads must be connected. A filtergraph is considered valid if all the +filter input and output pads of all the filterchains are connected. +

+

Follows a BNF description for the filtergraph syntax: +

 
NAME             ::= sequence of alphanumeric characters and '_'
+LINKLABEL        ::= "[" NAME "]"
+LINKLABELS       ::= LINKLABEL [LINKLABELS]
+FILTER_ARGUMENTS ::= sequence of chars (eventually quoted)
+FILTER           ::= [LINKNAMES] NAME ["=" ARGUMENTS] [LINKNAMES]
+FILTERCHAIN      ::= FILTER [,FILTERCHAIN]
+FILTERGRAPH      ::= FILTERCHAIN [;FILTERGRAPH]
+
+ + + +

11. Audio Filters

+ +

When you configure your FFmpeg build, you can disable any of the +existing filters using –disable-filters. +The configure output will show the audio filters included in your +build. +

+

Below is a description of the currently available audio filters. +

+ +

11.1 anull

+ +

Pass the audio source unchanged to the output. +

+ + +

12. Audio Sources

+ +

Below is a description of the currently available audio sources. +

+ +

12.1 anullsrc

+ +

Null audio source, never return audio frames. It is mainly useful as a +template and to be employed in analysis / debugging tools. +

+

It accepts as optional parameter a string of the form +sample_rate:channel_layout. +

+

sample_rate specify the sample rate, and defaults to 44100. +

+

channel_layout specify the channel layout, and can be either an +integer or a string representing a channel layout. The default value +of channel_layout is 3, which corresponds to CH_LAYOUT_STEREO. +

+

Check the channel_layout_map definition in +‘libavcodec/audioconvert.c’ for the mapping between strings and +channel layout values. +

+

Follow some examples: +

 
#  set the sample rate to 48000 Hz and the channel layout to CH_LAYOUT_MONO.
+anullsrc=48000:4
+
+# same as
+anullsrc=48000:mono
+
+ + + +

13. Audio Sinks

+ +

Below is a description of the currently available audio sinks. +

+ +

13.1 anullsink

+ +

Null audio sink, do absolutely nothing with the input audio. It is +mainly useful as a template and to be employed in analysis / debugging +tools. +

+ + +

14. Video Filters

+ +

When you configure your FFmpeg build, you can disable any of the +existing filters using –disable-filters. +The configure output will show the video filters included in your +build. +

+

Below is a description of the currently available video filters. +

+ +

14.1 blackframe

+ +

Detect frames that are (almost) completely black. Can be useful to +detect chapter transitions or commercials. Output lines consist of +the frame number of the detected frame, the percentage of blackness, +the position in the file if known or -1 and the timestamp in seconds. +

+

In order to display the output lines, you need to set the loglevel at +least to the AV_LOG_INFO value. +

+

The filter accepts the syntax: +

 
blackframe[=amount:[threshold]]
+
+ +

amount is the percentage of the pixels that have to be below the +threshold, and defaults to 98. +

+

threshold is the threshold below which a pixel value is +considered black, and defaults to 32. +

+ +

14.2 copy

+ +

Copy the input source unchanged to the output. Mainly useful for +testing purposes. +

+ +

14.3 crop

+ +

Crop the input video to out_w:out_h:x:y. +

+

The parameters are expressions containing the following constants: +

+
+
E, PI, PHI
+

the corresponding mathematical approximated values for e +(euler number), pi (greek PI), PHI (golden ratio) +

+
+
x, y
+

the computed values for x and y. They are evaluated for +each new frame. +

+
+
in_w, in_h
+

the input width and heigth +

+
+
iw, ih
+

same as in_w and in_h +

+
+
out_w, out_h
+

the output (cropped) width and heigth +

+
+
ow, oh
+

same as out_w and out_h +

+
+
n
+

the number of input frame, starting from 0 +

+
+
pos
+

the position in the file of the input frame, NAN if unknown +

+
+
t
+

timestamp expressed in seconds, NAN if the input timestamp is unknown +

+
+
+ +

The out_w and out_h parameters specify the expressions for +the width and height of the output (cropped) video. They are +evaluated just at the configuration of the filter. +

+

The default value of out_w is "in_w", and the default value of +out_h is "in_h". +

+

The expression for out_w may depend on the value of out_h, +and the expression for out_h may depend on out_w, but they +cannot depend on x and y, as x and y are +evaluated after out_w and out_h. +

+

The x and y parameters specify the expressions for the +position of the top-left corner of the output (non-cropped) area. They +are evaluated for each frame. If the evaluated value is not valid, it +is approximated to the nearest valid value. +

+

The default value of x is "(in_w-out_w)/2", and the default +value for y is "(in_h-out_h)/2", which set the cropped area at +the center of the input image. +

+

The expression for x may depend on y, and the expression +for y may depend on x. +

+

Follow some examples: +

 
# crop the central input area with size 100x100
+crop=100:100
+
+# crop the central input area with size 2/3 of the input video
+"crop=2/3*in_w:2/3*in_h"
+
+# crop the input video central square
+crop=in_h
+
+# delimit the rectangle with the top-left corner placed at position
+# 100:100 and the right-bottom corner corresponding to the right-bottom
+# corner of the input image.
+crop=in_w-100:in_h-100:100:100
+
+# crop 10 pixels from the left and right borders, and 20 pixels from
+# the top and bottom borders
+"crop=in_w-2*10:in_h-2*20"
+
+# keep only the bottom right quarter of the input image
+"crop=in_w/2:in_h/2:in_w/2:in_h/2"
+
+# crop height for getting Greek harmony
+"crop=in_w:1/PHI*in_w"
+
+# trembling effect
+"crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(n/10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(n/7)"
+
+# erratic camera effect depending on timestamp
+"crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(t*10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(t*13)"
+
+# set x depending on the value of y
+"crop=in_w/2:in_h/2:y:10+10*sin(n/10)"
+
+ + +

14.4 cropdetect

+ +

Auto-detect crop size. +

+

Calculate necessary cropping parameters and prints the recommended +parameters through the logging system. The detected dimensions +correspond to the non-black area of the input video. +

+

It accepts the syntax: +

 
cropdetect[=limit[:round[:reset]]]
+
+ +
+
limit
+

Threshold, which can be optionally specified from nothing (0) to +everything (255), defaults to 24. +

+
+
round
+

Value which the width/height should be divisible by, defaults to +16. The offset is automatically adjusted to center the video. Use 2 to +get only even dimensions (needed for 4:2:2 video). 16 is best when +encoding to most video codecs. +

+
+
reset
+

Counter that determines after how many frames cropdetect will reset +the previously detected largest video area and start over to detect +the current optimal crop area. Defaults to 0. +

+

This can be useful when channel logos distort the video area. 0 +indicates never reset and return the largest area encountered during +playback. +

+
+ + +

14.5 drawbox

+ +

Draw a colored box on the input image. +

+

It accepts the syntax: +

 
drawbox=x:y:width:height:color
+
+ +
+
x, y
+

Specify the top left corner coordinates of the box. Default to 0. +

+
+
width, height
+

Specify the width and height of the box, if 0 they are interpreted as +the input width and height. Default to 0. +

+
+
color
+

Specify the color of the box to write, it can be the name of a color +(case insensitive match) or a 0xRRGGBB[AA] sequence. +

+
+ +

Follow some examples: +

 
# draw a black box around the edge of the input image
+drawbox
+
+# draw a box with color red and an opacity of 50%
+drawbox=10:20:200:60:red@0.5"
+
+ + +

14.6 drawtext

+ +

Draw text string or text from specified file on top of video using the +libfreetype library. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-libfreetype. +

+

The filter also recognizes strftime() sequences in the provided text +and expands them accordingly. Check the documentation of strftime(). +

+

The filter accepts parameters as a list of key=value pairs, +separated by ":". +

+

The description of the accepted parameters follows. +

+
+
fontfile
+

The font file to be used for drawing text. Path must be included. +This parameter is mandatory. +

+
+
text
+

The text string to be drawn. The text must be a sequence of UTF-8 +encoded characters. +This parameter is mandatory if no file is specified with the parameter +textfile. +

+
+
textfile
+

A text file containing text to be drawn. The text must be a sequence +of UTF-8 encoded characters. +

+

This parameter is mandatory if no text string is specified with the +parameter text. +

+

If both text and textfile are specified, an error is thrown. +

+
+
x, y
+

The offsets where text will be drawn within the video frame. +Relative to the top/left border of the output image. +

+

The default value of x and y is 0. +

+
+
fontsize
+

The font size to be used for drawing text. +The default value of fontsize is 16. +

+
+
fontcolor
+

The color to be used for drawing fonts. +Either a string (e.g. "red") or in 0xRRGGBB[AA] format +(e.g. "0xff000033"), possibly followed by an alpha specifier. +The default value of fontcolor is "black". +

+
+
boxcolor
+

The color to be used for drawing box around text. +Either a string (e.g. "yellow") or in 0xRRGGBB[AA] format +(e.g. "0xff00ff"), possibly followed by an alpha specifier. +The default value of boxcolor is "white". +

+
+
box
+

Used to draw a box around text using background color. +Value should be either 1 (enable) or 0 (disable). +The default value of box is 0. +

+
+
shadowx, shadowy
+

The x and y offsets for the text shadow position with respect to the +position of the text. They can be either positive or negative +values. Default value for both is "0". +

+
+
shadowcolor
+

The color to be used for drawing a shadow behind the drawn text. It +can be a color name (e.g. "yellow") or a string in the 0xRRGGBB[AA] +form (e.g. "0xff00ff"), possibly followed by an alpha specifier. +The default value of shadowcolor is "black". +

+
+
ft_load_flags
+

Flags to be used for loading the fonts. +

+

The flags map the corresponding flags supported by libfreetype, and are +a combination of the following values: +

+
default
+
no_scale
+
no_hinting
+
render
+
no_bitmap
+
vertical_layout
+
force_autohint
+
crop_bitmap
+
pedantic
+
ignore_global_advance_width
+
no_recurse
+
ignore_transform
+
monochrome
+
linear_design
+
no_autohint
+
end table
+
+ +

Default value is "render". +

+

For more information consult the documentation for the FT_LOAD_* +libfreetype flags. +

+
+
tabsize
+

The size in number of spaces to use for rendering the tab. +Default value is 4. +

+
+ +

For example the command: +

 
drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'"
+
+ +

will draw "Test Text" with font FreeSerif, using the default values +for the optional parameters. +

+

The command: +

 
drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
+          x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2"
+
+ +

will draw ’Test Text’ with font FreeSerif of size 24 at position x=100 +and y=50 (counting from the top-left corner of the screen), text is +yellow with a red box around it. Both the text and the box have an +opacity of 20%. +

+

Note that the double quotes are not necessary if spaces are not used +within the parameter list. +

+

For more information about libfreetype, check: +http://www.freetype.org/. +

+ +

14.7 fade

+ +

Apply fade-in/out effect to input video. +

+

It accepts the parameters: +type:start_frame:nb_frames +

+

type specifies if the effect type, can be either "in" for +fade-in, or "out" for a fade-out effect. +

+

start_frame specifies the number of the start frame for starting +to apply the fade effect. +

+

nb_frames specifies the number of frames for which the fade +effect has to last. At the end of the fade-in effect the output video +will have the same intensity as the input video, at the end of the +fade-out transition the output video will be completely black. +

+

A few usage examples follow, usable too as test scenarios. +

 
# fade in first 30 frames of video
+fade=in:0:30
+
+# fade out last 45 frames of a 200-frame video
+fade=out:155:45
+
+# fade in first 25 frames and fade out last 25 frames of a 1000-frame video
+fade=in:0:25, fade=out:975:25
+
+# make first 5 frames black, then fade in from frame 5-24
+fade=in:5:20
+
+ + +

14.8 fieldorder

+ +

Transform the field order of the input video. +

+

It accepts one parameter which specifies the required field order that +the input interlaced video will be transformed to. The parameter can +assume one of the following values: +

+
+
0 or bff
+

output bottom field first +

+
1 or tff
+

output top field first +

+
+ +

Default value is "tff". +

+

Transformation is achieved by shifting the picture content up or down +by one line, and filling the remaining line with appropriate picture content. +This method is consistent with most broadcast field order converters. +

+

If the input video is not flagged as being interlaced, or it is already +flagged as being of the required output field order then this filter does +not alter the incoming video. +

+

This filter is very useful when converting to or from PAL DV material, +which is bottom field first. +

+

For example: +

 
./ffmpeg -i in.vob -vf "fieldorder=bff" out.dv
+
+ + +

14.9 fifo

+ +

Buffer input images and send them when they are requested. +

+

This filter is mainly useful when auto-inserted by the libavfilter +framework. +

+

The filter does not take parameters. +

+ +

14.10 format

+ +

Convert the input video to one of the specified pixel formats. +Libavfilter will try to pick one that is supported for the input to +the next filter. +

+

The filter accepts a list of pixel format names, separated by ":", +for example "yuv420p:monow:rgb24". +

+

Some examples follow: +

 
# convert the input video to the format "yuv420p"
+format=yuv420p
+
+# convert the input video to any of the formats in the list
+format=yuv420p:yuv444p:yuv410p
+
+ +

+

+

14.11 frei0r

+ +

Apply a frei0r effect to the input video. +

+

To enable compilation of this filter you need to install the frei0r +header and configure FFmpeg with –enable-frei0r. +

+

The filter supports the syntax: +

 
filter_name[{:|=}param1:param2:...:paramN]
+
+ +

filter_name is the name to the frei0r effect to load. If the +environment variable FREI0R_PATH is defined, the frei0r effect +is searched in each one of the directories specified by the colon +separated list in FREIOR_PATH, otherwise in the standard frei0r +paths, which are in this order: ‘HOME/.frei0r-1/lib/’, +‘/usr/local/lib/frei0r-1/’, ‘/usr/lib/frei0r-1/’. +

+

param1, param2, ... , paramN specify the parameters +for the frei0r effect. +

+

A frei0r effect parameter can be a boolean (whose values are specified +with "y" and "n"), a double, a color (specified by the syntax +R/G/B, R, G, and B being float +numbers from 0.0 to 1.0) or by an av_parse_color() color +description), a position (specified by the syntax X/Y, +X and Y being float numbers) and a string. +

+

The number and kind of parameters depend on the loaded effect. If an +effect parameter is not specified the default value is set. +

+

Some examples follow: +

 
# apply the distort0r effect, set the first two double parameters
+frei0r=distort0r:0.5:0.01
+
+# apply the colordistance effect, takes a color as first parameter
+frei0r=colordistance:0.2/0.3/0.4
+frei0r=colordistance:violet
+frei0r=colordistance:0x112233
+
+# apply the perspective effect, specify the top left and top right
+# image positions
+frei0r=perspective:0.2/0.2:0.8/0.2
+
+ +

For more information see: +http://piksel.org/frei0r +

+ +

14.12 gradfun

+ +

Fix the banding artifacts that are sometimes introduced into nearly flat +regions by truncation to 8bit colordepth. +Interpolate the gradients that should go where the bands are, and +dither them. +

+

This filter is designed for playback only. Do not use it prior to +lossy compression, because compression tends to lose the dither and +bring back the bands. +

+

The filter takes two optional parameters, separated by ’:’: +strength:radius +

+

strength is the maximum amount by which the filter will change +any one pixel. Also the threshold for detecting nearly flat +regions. Acceptable values range from .51 to 255, default value is +1.2, out-of-range values will be clipped to the valid range. +

+

radius is the neighborhood to fit the gradient to. A larger +radius makes for smoother gradients, but also prevents the filter from +modifying the pixels near detailed regions. Acceptable values are +8-32, default value is 16, out-of-range values will be clipped to the +valid range. +

+
 
# default parameters
+gradfun=1.2:16
+
+# omitting radius
+gradfun=1.2
+
+ + +

14.13 hflip

+ +

Flip the input video horizontally. +

+

For example to horizontally flip the video in input with +‘ffmpeg’: +

 
ffmpeg -i in.avi -vf "hflip" out.avi
+
+ + +

14.14 hqdn3d

+ +

High precision/quality 3d denoise filter. This filter aims to reduce +image noise producing smooth images and making still images really +still. It should enhance compressibility. +

+

It accepts the following optional parameters: +luma_spatial:chroma_spatial:luma_tmp:chroma_tmp +

+
+
luma_spatial
+

a non-negative float number which specifies spatial luma strength, +defaults to 4.0 +

+
+
chroma_spatial
+

a non-negative float number which specifies spatial chroma strength, +defaults to 3.0*luma_spatial/4.0 +

+
+
luma_tmp
+

a float number which specifies luma temporal strength, defaults to +6.0*luma_spatial/4.0 +

+
+
chroma_tmp
+

a float number which specifies chroma temporal strength, defaults to +luma_tmp*chroma_spatial/luma_spatial +

+
+ + +

14.15 mp

+ +

Apply an MPlayer filter to the input video. +

+

This filter provides a wrapper around most of the filters of +MPlayer/MEncoder. +

+

This wrapper is considered experimental. Some of the wrapped filters +may not work properly and we may drop support for them, as they will +be implemented natively into FFmpeg. Thus you should avoid +depending on them when writing portable scripts. +

+

The filters accepts the parameters: +filter_name[:=]filter_params +

+

filter_name is the name of a supported MPlayer filter, +filter_params is a string containing the parameters accepted by +the named filter. +

+

The list of the currently supported filters follows: +

+
2xsai
+
blackframe
+
boxblur
+
cropdetect
+
decimate
+
delogo
+
denoise3d
+
detc
+
dint
+
divtc
+
down3dright
+
dsize
+
eq2
+
eq
+
field
+
fil
+
fixpts
+
framestep
+
fspp
+
geq
+
gradfun
+
harddup
+
hqdn3d
+
hue
+
il
+
ilpack
+
ivtc
+
kerndeint
+
mcdeint
+
mirror
+
noise
+
ow
+
palette
+
perspective
+
phase
+
pp7
+
pullup
+
qp
+
rectangle
+
remove_logo
+
rgbtest
+
rotate
+
sab
+
screenshot
+
smartblur
+
softpulldown
+
softskip
+
spp
+
swapuv
+
telecine
+
test
+
tile
+
tinterlace
+
unsharp
+
uspp
+
yuvcsp
+
yvu9
+
+ +

The parameter syntax and behavior for the listed filters are the same +of the corresponding MPlayer filters. For detailed instructions check +the "VIDEO FILTERS" section in the MPlayer manual. +

+

Some examples follow: +

 
# remove a logo by interpolating the surrounding pixels
+mp=delogo=200:200:80:20:1
+
+# adjust gamma, brightness, contrast
+mp=eq2=1.0:2:0.5
+
+# tweak hue and saturation
+mp=hue=100:-10
+
+ +

See also mplayer(1), http://www.mplayerhq.hu/. +

+ +

14.16 noformat

+ +

Force libavfilter not to use any of the specified pixel formats for the +input to the next filter. +

+

The filter accepts a list of pixel format names, separated by ":", +for example "yuv420p:monow:rgb24". +

+

Some examples follow: +

 
# force libavfilter to use a format different from "yuv420p" for the
+# input to the vflip filter
+noformat=yuv420p,vflip
+
+# convert the input video to any of the formats not contained in the list
+noformat=yuv420p:yuv444p:yuv410p
+
+ + +

14.17 null

+ +

Pass the video source unchanged to the output. +

+ +

14.18 ocv

+ +

Apply video transform using libopencv. +

+

To enable this filter install libopencv library and headers and +configure FFmpeg with –enable-libopencv. +

+

The filter takes the parameters: filter_name{:=}filter_params. +

+

filter_name is the name of the libopencv filter to apply. +

+

filter_params specifies the parameters to pass to the libopencv +filter. If not specified the default values are assumed. +

+

Refer to the official libopencv documentation for more precise +informations: +http://opencv.willowgarage.com/documentation/c/image_filtering.html +

+

Follows the list of supported libopencv filters. +

+

+

+

14.18.1 dilate

+ +

Dilate an image by using a specific structuring element. +This filter corresponds to the libopencv function cvDilate. +

+

It accepts the parameters: struct_el:nb_iterations. +

+

struct_el represents a structuring element, and has the syntax: +colsxrows+anchor_xxanchor_y/shape +

+

cols and rows represent the number of colums and rows of +the structuring element, anchor_x and anchor_y the anchor +point, and shape the shape for the structuring element, and +can be one of the values "rect", "cross", "ellipse", "custom". +

+

If the value for shape is "custom", it must be followed by a +string of the form "=filename". The file with name +filename is assumed to represent a binary image, with each +printable character corresponding to a bright pixel. When a custom +shape is used, cols and rows are ignored, the number +or columns and rows of the read file are assumed instead. +

+

The default value for struct_el is "3x3+0x0/rect". +

+

nb_iterations specifies the number of times the transform is +applied to the image, and defaults to 1. +

+

Follow some example: +

 
# use the default values
+ocv=dilate
+
+# dilate using a structuring element with a 5x5 cross, iterate two times
+ocv=dilate=5x5+2x2/cross:2
+
+# read the shape from the file diamond.shape, iterate two times
+# the file diamond.shape may contain a pattern of characters like this:
+#   *
+#  ***
+# *****
+#  ***
+#   *
+# the specified cols and rows are ignored (but not the anchor point coordinates)
+ocv=0x0+2x2/custom=diamond.shape:2
+
+ + +

14.18.2 erode

+ +

Erode an image by using a specific structuring element. +This filter corresponds to the libopencv function cvErode. +

+

The filter accepts the parameters: struct_el:nb_iterations, +with the same meaning and use of those of the dilate filter +(see dilate). +

+ +

14.18.3 smooth

+ +

Smooth the input video. +

+

The filter takes the following parameters: +type:param1:param2:param3:param4. +

+

type is the type of smooth filter to apply, and can be one of +the following values: "blur", "blur_no_scale", "median", "gaussian", +"bilateral". The default value is "gaussian". +

+

param1, param2, param3, and param4 are +parameters whose meanings depend on smooth type. param1 and +param2 accept integer positive values or 0, param3 and +param4 accept float values. +

+

The default value for param1 is 3, the default value for the +other parameters is 0. +

+

These parameters correspond to the parameters assigned to the +libopencv function cvSmooth. +

+ +

14.19 overlay

+ +

Overlay one video on top of another. +

+

It takes two inputs and one output, the first input is the "main" +video on which the second input is overlayed. +

+

It accepts the parameters: x:y. +

+

x is the x coordinate of the overlayed video on the main video, +y is the y coordinate. The parameters are expressions containing +the following parameters: +

+
+
main_w, main_h
+

main input width and height +

+
+
W, H
+

same as main_w and main_h +

+
+
overlay_w, overlay_h
+

overlay input width and height +

+
+
w, h
+

same as overlay_w and overlay_h +

+
+ +

Be aware that frames are taken from each input video in timestamp +order, hence, if their initial timestamps differ, it is a a good idea +to pass the two inputs through a setpts=PTS-STARTPTS filter to +have them begin in the same zero timestamp, as it does the example for +the movie filter. +

+

Follow some examples: +

 
# draw the overlay at 10 pixels from the bottom right
+# corner of the main video.
+overlay=main_w-overlay_w-10:main_h-overlay_h-10
+
+# insert a transparent PNG logo in the bottom left corner of the input
+movie=logo.png [logo];
+[in][logo] overlay=10:main_h-overlay_h-10 [out]
+
+# insert 2 different transparent PNG logos (second logo on bottom
+# right corner):
+movie=logo1.png [logo1];
+movie=logo2.png [logo2];
+[in][logo1]       overlay=10:H-h-10 [in+logo1];
+[in+logo1][logo2] overlay=W-w-10:H-h-10 [out]
+
+# add a transparent color layer on top of the main video,
+# WxH specifies the size of the main input to the overlay filter
+color=red.3:WxH [over]; [in][over] overlay [out]
+
+ +

You can chain togheter more overlays but the efficiency of such +approach is yet to be tested. +

+ +

14.20 pad

+ +

Add paddings to the input image, and places the original input at the +given coordinates x, y. +

+

It accepts the following parameters: +width:height:x:y:color. +

+

The parameters width, height, x, and y are +expressions containing the following constants: +

+
+
E, PI, PHI
+

the corresponding mathematical approximated values for e +(euler number), pi (greek PI), phi (golden ratio) +

+
+
in_w, in_h
+

the input video width and heigth +

+
+
iw, ih
+

same as in_w and in_h +

+
+
out_w, out_h
+

the output width and heigth, that is the size of the padded area as +specified by the width and height expressions +

+
+
ow, oh
+

same as out_w and out_h +

+
+
x, y
+

x and y offsets as specified by the x and y +expressions, or NAN if not yet specified +

+
+
a
+

input display aspect ratio, same as iw / ih +

+
+
hsub, vsub
+

horizontal and vertical chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+ +

Follows the description of the accepted parameters. +

+
+
width, height
+
+

Specify the size of the output image with the paddings added. If the +value for width or height is 0, the corresponding input size +is used for the output. +

+

The width expression can reference the value set by the +height expression, and viceversa. +

+

The default value of width and height is 0. +

+
+
x, y
+
+

Specify the offsets where to place the input image in the padded area +with respect to the top/left border of the output image. +

+

The x expression can reference the value set by the y +expression, and viceversa. +

+

The default value of x and y is 0. +

+
+
color
+
+

Specify the color of the padded area, it can be the name of a color +(case insensitive match) or a 0xRRGGBB[AA] sequence. +

+

The default value of color is "black". +

+
+
+ +

Some examples follow: +

+
 
# Add paddings with color "violet" to the input video. Output video
+# size is 640x480, the top-left corner of the input video is placed at
+# column 0, row 40.
+pad=640:480:0:40:violet
+
+# pad the input to get an output with dimensions increased bt 3/2,
+# and put the input video at the center of the padded area
+pad="3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2"
+
+# pad the input to get a squared output with size equal to the maximum
+# value between the input width and height, and put the input video at
+# the center of the padded area
+pad="max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2"
+
+# pad the input to get a final w/h ratio of 16:9
+pad="ih*16/9:ih:(ow-iw)/2:(oh-ih)/2"
+
+# double output size and put the input video in the bottom-right
+# corner of the output padded area
+pad="2*iw:2*ih:ow-iw:oh-ih"
+
+ + +

14.21 pixdesctest

+ +

Pixel format descriptor test filter, mainly useful for internal +testing. The output video should be equal to the input video. +

+

For example: +

 
format=monow, pixdesctest
+
+ +

can be used to test the monowhite pixel format descriptor definition. +

+ +

14.22 scale

+ +

Scale the input video to width:height and/or convert the image format. +

+

The parameters width and height are expressions containing +the following constants: +

+
+
E, PI, PHI
+

the corresponding mathematical approximated values for e +(euler number), pi (greek PI), phi (golden ratio) +

+
+
in_w, in_h
+

the input width and heigth +

+
+
iw, ih
+

same as in_w and in_h +

+
+
out_w, out_h
+

the output (cropped) width and heigth +

+
+
ow, oh
+

same as out_w and out_h +

+
+
a
+

input display aspect ratio, same as iw / ih +

+
+
hsub, vsub
+

horizontal and vertical chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+ +

If the input image format is different from the format requested by +the next filter, the scale filter will convert the input to the +requested format. +

+

If the value for width or height is 0, the respective input +size is used for the output. +

+

If the value for width or height is -1, the scale filter will +use, for the respective output size, a value that maintains the aspect +ratio of the input image. +

+

The default value of width and height is 0. +

+

Some examples follow: +

 
# scale the input video to a size of 200x100.
+scale=200:100
+
+# scale the input to 2x
+scale=2*iw:2*ih
+# the above is the same as
+scale=2*in_w:2*in_h
+
+# scale the input to half size
+scale=iw/2:ih/2
+
+# increase the width, and set the height to the same size
+scale=3/2*iw:ow
+
+# seek for Greek harmony
+scale=iw:1/PHI*iw
+scale=ih*PHI:ih
+
+# increase the height, and set the width to 3/2 of the height
+scale=3/2*oh:3/5*ih
+
+# increase the size, but make the size a multiple of the chroma
+scale="trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub"
+
+# increase the width to a maximum of 500 pixels, keep the same input aspect ratio
+scale='min(500\, iw*3/2):-1'
+
+ +

+

+

14.23 setdar

+ +

Set the Display Aspect Ratio for the filter output video. +

+

This is done by changing the specified Sample (aka Pixel) Aspect +Ratio, according to the following equation: +DAR = HORIZONTAL_RESOLUTION / VERTICAL_RESOLUTION * SAR +

+

Keep in mind that this filter does not modify the pixel dimensions of +the video frame. Also the display aspect ratio set by this filter may +be changed by later filters in the filterchain, e.g. in case of +scaling or if another "setdar" or a "setsar" filter is applied. +

+

The filter accepts a parameter string which represents the wanted +display aspect ratio. +The parameter can be a floating point number string, or an expression +of the form num:den, where num and den are the +numerator and denominator of the aspect ratio. +If the parameter is not specified, it is assumed the value "0:1". +

+

For example to change the display aspect ratio to 16:9, specify: +

 
setdar=16:9
+# the above is equivalent to
+setdar=1.77777
+
+ +

See also the "setsar" filter documentation (see setsar). +

+ +

14.24 setpts

+ +

Change the PTS (presentation timestamp) of the input video frames. +

+

Accept in input an expression evaluated through the eval API, which +can contain the following constants: +

+
+
PTS
+

the presentation timestamp in input +

+
+
PI
+

Greek PI +

+
+
PHI
+

golden ratio +

+
+
E
+

Euler number +

+
+
N
+

the count of the input frame, starting from 0. +

+
+
STARTPTS
+

the PTS of the first video frame +

+
+
INTERLACED
+

tell if the current frame is interlaced +

+
+
POS
+

original position in the file of the frame, or undefined if undefined +for the current frame +

+
+
PREV_INPTS
+

previous input PTS +

+
+
PREV_OUTPTS
+

previous output PTS +

+
+
+ +

Some examples follow: +

+
 
# start counting PTS from zero
+setpts=PTS-STARTPTS
+
+# fast motion
+setpts=0.5*PTS
+
+# slow motion
+setpts=2.0*PTS
+
+# fixed rate 25 fps
+setpts=N/(25*TB)
+
+# fixed rate 25 fps with some jitter
+setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
+
+ +

+

+

14.25 setsar

+ +

Set the Sample (aka Pixel) Aspect Ratio for the filter output video. +

+

Note that as a consequence of the application of this filter, the +output display aspect ratio will change according to the following +equation: +DAR = HORIZONTAL_RESOLUTION / VERTICAL_RESOLUTION * SAR +

+

Keep in mind that the sample aspect ratio set by this filter may be +changed by later filters in the filterchain, e.g. if another "setsar" +or a "setdar" filter is applied. +

+

The filter accepts a parameter string which represents the wanted +sample aspect ratio. +The parameter can be a floating point number string, or an expression +of the form num:den, where num and den are the +numerator and denominator of the aspect ratio. +If the parameter is not specified, it is assumed the value "0:1". +

+

For example to change the sample aspect ratio to 10:11, specify: +

 
setsar=10:11
+
+ + +

14.26 settb

+ +

Set the timebase to use for the output frames timestamps. +It is mainly useful for testing timebase configuration. +

+

It accepts in input an arithmetic expression representing a rational. +The expression can contain the constants "PI", "E", "PHI", "AVTB" (the +default timebase), and "intb" (the input timebase). +

+

The default value for the input is "intb". +

+

Follow some examples. +

+
 
# set the timebase to 1/25
+settb=1/25
+
+# set the timebase to 1/10
+settb=0.1
+
+#set the timebase to 1001/1000
+settb=1+0.001
+
+#set the timebase to 2*intb
+settb=2*intb
+
+#set the default timebase value
+settb=AVTB
+
+ + +

14.27 showinfo

+ +

Show a line containing various information for each input video frame. +The input video is not modified. +

+

The shown line contains a sequence of key/value pairs of the form +key:value. +

+

A description of each shown parameter follows: +

+
+
n
+

sequential number of the input frame, starting from 0 +

+
+
pts
+

Presentation TimeStamp of the input frame, expressed as a number of +time base units. The time base unit depends on the filter input pad. +

+
+
pts_time
+

Presentation TimeStamp of the input frame, expressed as a number of +seconds +

+
+
pos
+

position of the frame in the input stream, -1 if this information in +unavailable and/or meanigless (for example in case of synthetic video) +

+
+
fmt
+

pixel format name +

+
+
sar
+

sample aspect ratio of the input frame, expressed in the form +num/den +

+
+
s
+

size of the input frame, expressed in the form +widthxheight +

+
+
i
+

interlaced mode ("P" for "progressive", "T" for top field first, "B" +for bottom field first) +

+
+
iskey
+

1 if the frame is a key frame, 0 otherwise +

+
+
type
+

picture type of the input frame ("I" for an I-frame, "P" for a +P-frame, "B" for a B-frame, "?" for unknown type). +Check also the documentation of the AVPictureType enum and of +the av_get_picture_type_char function defined in +‘libavutil/avutil.h’. +

+
+
checksum
+

Adler-32 checksum of all the planes of the input frame +

+
+
plane_checksum
+

Adler-32 checksum of each plane of the input frame, expressed in the form +"[c0 c1 c2 c3]" +

+
+ + +

14.28 slicify

+ +

Pass the images of input video on to next video filter as multiple +slices. +

+
 
./ffmpeg -i in.avi -vf "slicify=32" out.avi
+
+ +

The filter accepts the slice height as parameter. If the parameter is +not specified it will use the default value of 16. +

+

Adding this in the beginning of filter chains should make filtering +faster due to better use of the memory cache. +

+ +

14.29 transpose

+ +

Transpose rows with columns in the input video and optionally flip it. +

+

It accepts a parameter representing an integer, which can assume the +values: +

+
+
0
+

Rotate by 90 degrees counterclockwise and vertically flip (default), that is: +

 
L.R     L.l
+. . ->  . .
+l.r     R.r
+
+ +
+
1
+

Rotate by 90 degrees clockwise, that is: +

 
L.R     l.L
+. . ->  . .
+l.r     r.R
+
+ +
+
2
+

Rotate by 90 degrees counterclockwise, that is: +

 
L.R     R.r
+. . ->  . .
+l.r     L.l
+
+ +
+
3
+

Rotate by 90 degrees clockwise and vertically flip, that is: +

 
L.R     r.R
+. . ->  . .
+l.r     l.L
+
+
+
+ + +

14.30 unsharp

+ +

Sharpen or blur the input video. +

+

It accepts the following parameters: +luma_msize_x:luma_msize_y:luma_amount:chroma_msize_x:chroma_msize_y:chroma_amount +

+

Negative values for the amount will blur the input video, while positive +values will sharpen. All parameters are optional and default to the +equivalent of the string ’5:5:1.0:0:0:0.0’. +

+
+
luma_msize_x
+

Set the luma matrix horizontal size. It can be an integer between 3 +and 13, default value is 5. +

+
+
luma_msize_y
+

Set the luma matrix vertical size. It can be an integer between 3 +and 13, default value is 5. +

+
+
luma_amount
+

Set the luma effect strength. It can be a float number between -2.0 +and 5.0, default value is 1.0. +

+
+
chroma_msize_x
+

Set the chroma matrix horizontal size. It can be an integer between 3 +and 13, default value is 0. +

+
+
chroma_msize_y
+

Set the chroma matrix vertical size. It can be an integer between 3 +and 13, default value is 0. +

+
+
luma_amount
+

Set the chroma effect strength. It can be a float number between -2.0 +and 5.0, default value is 0.0. +

+
+
+ +
 
# Strong luma sharpen effect parameters
+unsharp=7:7:2.5
+
+# Strong blur of both luma and chroma parameters
+unsharp=7:7:-2:7:7:-2
+
+# Use the default values with ffmpeg
+./ffmpeg -i in.avi -vf "unsharp" out.mp4
+
+ + +

14.31 vflip

+ +

Flip the input video vertically. +

+
 
./ffmpeg -i in.avi -vf "vflip" out.avi
+
+ + +

14.32 yadif

+ +

Deinterlace the input video ("yadif" means "yet another deinterlacing +filter"). +

+

It accepts the optional parameters: mode:parity. +

+

mode specifies the interlacing mode to adopt, accepts one of the +following values: +

+
+
0
+

output 1 frame for each frame +

+
1
+

output 1 frame for each field +

+
2
+

like 0 but skips spatial interlacing check +

+
3
+

like 1 but skips spatial interlacing check +

+
+ +

Default value is 0. +

+

parity specifies the picture field parity assumed for the input +interlaced video, accepts one of the following values: +

+
+
0
+

assume bottom field first +

+
1
+

assume top field first +

+
-1
+

enable automatic detection +

+
+ +

Default value is -1. +If interlacing is unknown or decoder does not export this information, +top field first will be assumed. +

+ + +

15. Video Sources

+ +

Below is a description of the currently available video sources. +

+ +

15.1 buffer

+ +

Buffer video frames, and make them available to the filter chain. +

+

This source is mainly intended for a programmatic use, in particular +through the interface defined in ‘libavfilter/vsrc_buffer.h’. +

+

It accepts the following parameters: +width:height:pix_fmt_string:timebase_num:timebase_den:sample_aspect_ratio_num:sample_aspect_ratio.den +

+

All the parameters need to be explicitely defined. +

+

Follows the list of the accepted parameters. +

+
+
width, height
+

Specify the width and height of the buffered video frames. +

+
+
pix_fmt_string
+

A string representing the pixel format of the buffered video frames. +It may be a number corresponding to a pixel format, or a pixel format +name. +

+
+
timebase_num, timebase_den
+

Specify numerator and denomitor of the timebase assumed by the +timestamps of the buffered frames. +

+
+
sample_aspect_ratio.num, sample_aspect_ratio.den
+

Specify numerator and denominator of the sample aspect ratio assumed +by the video frames. +

+
+ +

For example: +

 
buffer=320:240:yuv410p:1:24:1:1
+
+ +

will instruct the source to accept video frames with size 320x240 and +with format "yuv410p", assuming 1/24 as the timestamps timebase and +square pixels (1:1 sample aspect ratio). +Since the pixel format with name "yuv410p" corresponds to the number 6 +(check the enum PixelFormat definition in ‘libavutil/pixfmt.h’), +this example corresponds to: +

 
buffer=320:240:6:1:24
+
+ + +

15.2 color

+ +

Provide an uniformly colored input. +

+

It accepts the following parameters: +color:frame_size:frame_rate +

+

Follows the description of the accepted parameters. +

+
+
color
+

Specify the color of the source. It can be the name of a color (case +insensitive match) or a 0xRRGGBB[AA] sequence, possibly followed by an +alpha specifier. The default value is "black". +

+
+
frame_size
+

Specify the size of the sourced video, it may be a string of the form +widthxheigth, or the name of a size abbreviation. The +default value is "320x240". +

+
+
frame_rate
+

Specify the frame rate of the sourced video, as the number of frames +generated per second. It has to be a string in the format +frame_rate_num/frame_rate_den, an integer number, a float +number or a valid video frame rate abbreviation. The default value is +"25". +

+
+
+ +

For example the following graph description will generate a red source +with an opacity of 0.2, with size "qcif" and a frame rate of 10 +frames per second, which will be overlayed over the source connected +to the pad with identifier "in". +

+
 
"color=red@0.2:qcif:10 [color]; [in][color] overlay [out]"
+
+ + +

15.3 movie

+ +

Read a video stream from a movie container. +

+

It accepts the syntax: movie_name[:options] where +movie_name is the name of the resource to read (not necessarily +a file but also a device or a stream accessed through some protocol), +and options is an optional sequence of key=value +pairs, separated by ":". +

+

The description of the accepted options follows. +

+
+
format_name, f
+

Specifies the format assumed for the movie to read, and can be either +the name of a container or an input device. If not specified the +format is guessed from movie_name or by probing. +

+
+
seek_point, sp
+

Specifies the seek point in seconds, the frames will be output +starting from this seek point, the parameter is evaluated with +av_strtod so the numerical value may be suffixed by an IS +postfix. Default value is "0". +

+
+
stream_index, si
+

Specifies the index of the video stream to read. If the value is -1, +the best suited video stream will be automatically selected. Default +value is "-1". +

+
+
+ +

This filter allows to overlay a second video on top of main input of +a filtergraph as shown in this graph: +

 
input -----------> deltapts0 --> overlay --> output
+                                    ^
+                                    |
+movie --> scale--> deltapts1 -------+
+
+ +

Some examples follow: +

 
# skip 3.2 seconds from the start of the avi file in.avi, and overlay it
+# on top of the input labelled as "in".
+movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [movie];
+[in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
+
+# read from a video4linux2 device, and overlay it on top of the input
+# labelled as "in"
+movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [movie];
+[in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
+
+
+ + +

15.4 nullsrc

+ +

Null video source, never return images. It is mainly useful as a +template and to be employed in analysis / debugging tools. +

+

It accepts as optional parameter a string of the form +width:height:timebase. +

+

width and height specify the size of the configured +source. The default values of width and height are +respectively 352 and 288 (corresponding to the CIF size format). +

+

timebase specifies an arithmetic expression representing a +timebase. The expression can contain the constants "PI", "E", "PHI", +"AVTB" (the default timebase), and defaults to the value "AVTB". +

+ +

15.5 frei0r_src

+ +

Provide a frei0r source. +

+

To enable compilation of this filter you need to install the frei0r +header and configure FFmpeg with –enable-frei0r. +

+

The source supports the syntax: +

 
size:rate:src_name[{=|:}param1:param2:...:paramN]
+
+ +

size is the size of the video to generate, may be a string of the +form widthxheight or a frame size abbreviation. +rate is the rate of the video to generate, may be a string of +the form num/den or a frame rate abbreviation. +src_name is the name to the frei0r source to load. For more +information regarding frei0r and how to set the parameters read the +section "frei0r" (see frei0r) in the description of the video +filters. +

+

Some examples follow: +

 
# generate a frei0r partik0l source with size 200x200 and framerate 10
+# which is overlayed on the overlay filter main input
+frei0r_src=200x200:10:partik0l=1234 [overlay]; [in][overlay] overlay
+
+ + + +

16. Video Sinks

+ +

Below is a description of the currently available video sinks. +

+ +

16.1 nullsink

+ +

Null video sink, do absolutely nothing with the input video. It is +mainly useful as a template and to be employed in analysis / debugging +tools. +

+ + + +
+

+ + This document was generated by Kyle Schwarz on May 18, 2011 using texi2html 1.82. + +
+ +

+ + diff --git a/ffmpeg 0.7/doc/ffprobe.html b/ffmpeg 0.7/doc/ffprobe.html new file mode 100644 index 000000000..c23ed2831 --- /dev/null +++ b/ffmpeg 0.7/doc/ffprobe.html @@ -0,0 +1,1363 @@ + + + + +ffprobe Documentation + + + + + + + + + + + + + + + +

ffprobe Documentation

+ + +

Table of Contents

+
+ + +
+ +
+ +

1. Synopsis

+ +

The generic syntax is: +

+
 
ffprobe [options] [‘input_file’]
+
+ + +

2. Description

+ +

ffprobe gathers information from multimedia streams and prints it in +human- and machine-readable fashion. +

+

For example it can be used to check the format of the container used +by a multimedia stream and the format and type of each media stream +contained in it. +

+

If a filename is specified in input, ffprobe will try to open and +probe the file content. If the file cannot be opened or recognized as +a multimedia file, a positive exit code is returned. +

+

ffprobe may be employed both as a standalone application or in +combination with a textual filter, which may perform more +sophisticated processing, e.g. statistical processing or plotting. +

+

Options are used to list some of the formats supported by ffprobe or +for specifying which information to display, and for setting how +ffprobe will show it. +

+

ffprobe output is designed to be easily parsable by a textual filter, +and consists of one or more sections of the form: +

 
[SECTION]
+key1=val1
+...
+keyN=valN
+[/SECTION]
+
+ +

Metadata tags stored in the container or in the streams are recognized +and printed in the corresponding "FORMAT" or "STREAM" section, and +are prefixed by the string "TAG:". +

+ + +

3. Options

+ +

All the numerical options, if not specified otherwise, accept in input +a string representing a number, which may contain one of the +International System number postfixes, for example ’K’, ’M’, ’G’. +If ’i’ is appended after the postfix, powers of 2 are used instead of +powers of 10. The ’B’ postfix multiplies the value for 8, and can be +appended after another postfix or used alone. This allows using for +example ’KB’, ’MiB’, ’G’ and ’B’ as postfix. +

+

Options which do not take arguments are boolean options, and set the +corresponding value to true. They can be set to false by prefixing +with "no" the option name, for example using "-nofoo" in the +commandline will set to false the boolean option with name "foo". +

+ +

3.1 Generic options

+ +

These options are shared amongst the ff* tools. +

+
+
-L
+

Show license. +

+
+
-h, -?, -help, --help
+

Show help. +

+
+
-version
+

Show version. +

+
+
-formats
+

Show available formats. +

+

The fields preceding the format names have the following meanings: +

+
D
+

Decoding available +

+
E
+

Encoding available +

+
+ +
+
-codecs
+

Show available codecs. +

+

The fields preceding the codec names have the following meanings: +

+
D
+

Decoding available +

+
E
+

Encoding available +

+
V/A/S
+

Video/audio/subtitle codec +

+
S
+

Codec supports slices +

+
D
+

Codec supports direct rendering +

+
T
+

Codec can handle input truncated at random locations instead of only at frame boundaries +

+
+ +
+
-bsfs
+

Show available bitstream filters. +

+
+
-protocols
+

Show available protocols. +

+
+
-filters
+

Show available libavfilter filters. +

+
+
-pix_fmts
+

Show available pixel formats. +

+
+
-loglevel loglevel
+

Set the logging level used by the library. +loglevel is a number or a string containing one of the following values: +

+
quiet
+
panic
+
fatal
+
error
+
warning
+
info
+
verbose
+
debug
+
+ +

By default the program logs to stderr, if coloring is supported by the +terminal, colors are used to mark errors and warnings. Log coloring +can be disabled setting the environment variable +FFMPEG_FORCE_NOCOLOR or NO_COLOR, or can be forced setting +the environment variable FFMPEG_FORCE_COLOR. +The use of the environment variable NO_COLOR is deprecated and +will be dropped in a following FFmpeg version. +

+
+
+ + +

3.2 Main options

+ +
+
-f format
+

Force format to use. +

+
+
-unit
+

Show the unit of the displayed values. +

+
+
-prefix
+

Use SI prefixes for the displayed values. +Unless the "-byte_binary_prefix" option is used all the prefixes +are decimal. +

+
+
-byte_binary_prefix
+

Force the use of binary prefixes for byte values. +

+
+
-sexagesimal
+

Use sexagesimal format HH:MM:SS.MICROSECONDS for time values. +

+
+
-pretty
+

Prettify the format of the displayed values, it corresponds to the +options "-unit -prefix -byte_binary_prefix -sexagesimal". +

+
+
-show_format
+

Show information about the container format of the input multimedia +stream. +

+

All the container format information is printed within a section with +name "FORMAT". +

+
+
-show_packets
+

Show information about each packet contained in the input multimedia +stream. +

+

The information for each single packet is printed within a dedicated +section with name "PACKET". +

+
+
-show_streams
+

Show information about each media stream contained in the input +multimedia stream. +

+

Each media stream information is printed within a dedicated section +with name "STREAM". +

+
+
+ + +

4. Demuxers

+ +

Demuxers are configured elements in FFmpeg which allow to read the +multimedia streams from a particular type of file. +

+

When you configure your FFmpeg build, all the supported demuxers +are enabled by default. You can list all available ones using the +configure option "–list-demuxers". +

+

You can disable all the demuxers using the configure option +"–disable-demuxers", and selectively enable a single demuxer with +the option "–enable-demuxer=DEMUXER", or disable it +with the option "–disable-demuxer=DEMUXER". +

+

The option "-formats" of the ff* tools will display the list of +enabled demuxers. +

+

The description of some of the currently available demuxers follows. +

+ +

4.1 image2

+ +

Image file demuxer. +

+

This demuxer reads from a list of image files specified by a pattern. +

+

The pattern may contain the string "%d" or "%0Nd", which +specifies the position of the characters representing a sequential +number in each filename matched by the pattern. If the form +"%d0Nd" is used, the string representing the number in each +filename is 0-padded and N is the total number of 0-padded +digits representing the number. The literal character ’%’ can be +specified in the pattern with the string "%%". +

+

If the pattern contains "%d" or "%0Nd", the first filename of +the file list specified by the pattern must contain a number +inclusively contained between 0 and 4, all the following numbers must +be sequential. This limitation may be hopefully fixed. +

+

The pattern may contain a suffix which is used to automatically +determine the format of the images contained in the files. +

+

For example the pattern "img-%03d.bmp" will match a sequence of +filenames of the form ‘img-001.bmp’, ‘img-002.bmp’, ..., +‘img-010.bmp’, etc.; the pattern "i%%m%%g-%d.jpg" will match a +sequence of filenames of the form ‘i%m%g-1.jpg’, +‘i%m%g-2.jpg’, ..., ‘i%m%g-10.jpg’, etc. +

+

The size, the pixel format, and the format of each image must be the +same for all the files in the sequence. +

+

The following example shows how to use ‘ffmpeg’ for creating a +video from the images in the file sequence ‘img-001.jpeg’, +‘img-002.jpeg’, ..., assuming an input framerate of 10 frames per +second: +

 
ffmpeg -r 10 -f image2 -i 'img-%03d.jpeg' out.avi
+
+ +

Note that the pattern must not necessarily contain "%d" or +"%0Nd", for example to convert a single image file +‘img.jpeg’ you can employ the command: +

 
ffmpeg -f image2 -i img.jpeg img.png
+
+ + +

4.2 applehttp

+ +

Apple HTTP Live Streaming demuxer. +

+

This demuxer presents all AVStreams from all variant streams. +The id field is set to the bitrate variant index number. By setting +the discard flags on AVStreams (by pressing ’a’ or ’v’ in ffplay), +the caller can decide which variant streams to actually receive. +The total bitrate of the variant that the stream belongs to is +available in a metadata key named "variant_bitrate". +

+ +

5. Muxers

+ +

Muxers are configured elements in FFmpeg which allow writing +multimedia streams to a particular type of file. +

+

When you configure your FFmpeg build, all the supported muxers +are enabled by default. You can list all available muxers using the +configure option --list-muxers. +

+

You can disable all the muxers with the configure option +--disable-muxers and selectively enable / disable single muxers +with the options --enable-muxer=MUXER / +--disable-muxer=MUXER. +

+

The option -formats of the ff* tools will display the list of +enabled muxers. +

+

A description of some of the currently available muxers follows. +

+

+

+

5.1 crc

+ +

CRC (Cyclic Redundancy Check) testing format. +

+

This muxer computes and prints the Adler-32 CRC of all the input audio +and video frames. By default audio frames are converted to signed +16-bit raw audio and video frames to raw video before computing the +CRC. +

+

The output of the muxer consists of a single line of the form: +CRC=0xCRC, where CRC is a hexadecimal number 0-padded to +8 digits containing the CRC for all the decoded input frames. +

+

For example to compute the CRC of the input, and store it in the file +‘out.crc’: +

 
ffmpeg -i INPUT -f crc out.crc
+
+ +

You can print the CRC to stdout with the command: +

 
ffmpeg -i INPUT -f crc -
+
+ +

You can select the output format of each frame with ‘ffmpeg’ by +specifying the audio and video codec and format. For example to +compute the CRC of the input audio converted to PCM unsigned 8-bit +and the input video converted to MPEG-2 video, use the command: +

 
ffmpeg -i INPUT -acodec pcm_u8 -vcodec mpeg2video -f crc -
+
+ +

See also the framecrc muxer (see framecrc). +

+

+

+

5.2 framecrc

+ +

Per-frame CRC (Cyclic Redundancy Check) testing format. +

+

This muxer computes and prints the Adler-32 CRC for each decoded audio +and video frame. By default audio frames are converted to signed +16-bit raw audio and video frames to raw video before computing the +CRC. +

+

The output of the muxer consists of a line for each audio and video +frame of the form: stream_index, frame_dts, +frame_size, 0xCRC, where CRC is a hexadecimal +number 0-padded to 8 digits containing the CRC of the decoded frame. +

+

For example to compute the CRC of each decoded frame in the input, and +store it in the file ‘out.crc’: +

 
ffmpeg -i INPUT -f framecrc out.crc
+
+ +

You can print the CRC of each decoded frame to stdout with the command: +

 
ffmpeg -i INPUT -f framecrc -
+
+ +

You can select the output format of each frame with ‘ffmpeg’ by +specifying the audio and video codec and format. For example, to +compute the CRC of each decoded input audio frame converted to PCM +unsigned 8-bit and of each decoded input video frame converted to +MPEG-2 video, use the command: +

 
ffmpeg -i INPUT -acodec pcm_u8 -vcodec mpeg2video -f framecrc -
+
+ +

See also the crc muxer (see crc). +

+ +

5.3 image2

+ +

Image file muxer. +

+

The image file muxer writes video frames to image files. +

+

The output filenames are specified by a pattern, which can be used to +produce sequentially numbered series of files. +The pattern may contain the string "%d" or "%0Nd", this string +specifies the position of the characters representing a numbering in +the filenames. If the form "%0Nd" is used, the string +representing the number in each filename is 0-padded to N +digits. The literal character ’%’ can be specified in the pattern with +the string "%%". +

+

If the pattern contains "%d" or "%0Nd", the first filename of +the file list specified will contain the number 1, all the following +numbers will be sequential. +

+

The pattern may contain a suffix which is used to automatically +determine the format of the image files to write. +

+

For example the pattern "img-%03d.bmp" will specify a sequence of +filenames of the form ‘img-001.bmp’, ‘img-002.bmp’, ..., +‘img-010.bmp’, etc. +The pattern "img%%-%d.jpg" will specify a sequence of filenames of the +form ‘img%-1.jpg’, ‘img%-2.jpg’, ..., ‘img%-10.jpg’, +etc. +

+

The following example shows how to use ‘ffmpeg’ for creating a +sequence of files ‘img-001.jpeg’, ‘img-002.jpeg’, ..., +taking one image every second from the input video: +

 
ffmpeg -i in.avi -r 1 -f image2 'img-%03d.jpeg'
+
+ +

Note that with ‘ffmpeg’, if the format is not specified with the +-f option and the output filename specifies an image file +format, the image2 muxer is automatically selected, so the previous +command can be written as: +

 
ffmpeg -i in.avi -r 1 'img-%03d.jpeg'
+
+ +

Note also that the pattern must not necessarily contain "%d" or +"%0Nd", for example to create a single image file +‘img.jpeg’ from the input video you can employ the command: +

 
ffmpeg -i in.avi -f image2 -vframes 1 img.jpeg
+
+ +

The image muxer supports the .Y.U.V image file format. This format is +special in that that each image frame consists of three files, for +each of the YUV420P components. To read or write this image file format, +specify the name of the ’.Y’ file. The muxer will automatically open the +’.U’ and ’.V’ files as required. +

+ +

5.4 mpegts

+ +

MPEG transport stream muxer. +

+

This muxer implements ISO 13818-1 and part of ETSI EN 300 468. +

+

The muxer options are: +

+
+
-mpegts_original_network_id number
+

Set the original_network_id (default 0x0001). This is unique identifier +of a network in DVB. Its main use is in the unique identification of a +service through the path Original_Network_ID, Transport_Stream_ID. +

+
-mpegts_transport_stream_id number
+

Set the transport_stream_id (default 0x0001). This identifies a +transponder in DVB. +

+
-mpegts_service_id number
+

Set the service_id (default 0x0001) also known as program in DVB. +

+
-mpegts_pmt_start_pid number
+

Set the first PID for PMT (default 0x1000, max 0x1f00). +

+
-mpegts_start_pid number
+

Set the first PID for data packets (default 0x0100, max 0x0f00). +

+
+ +

The recognized metadata settings in mpegts muxer are service_provider +and service_name. If they are not set the default for +service_provider is "FFmpeg" and the default for +service_name is "Service01". +

+
 
ffmpeg -i file.mpg -acodec copy -vcodec copy \
+     -mpegts_original_network_id 0x1122 \
+     -mpegts_transport_stream_id 0x3344 \
+     -mpegts_service_id 0x5566 \
+     -mpegts_pmt_start_pid 0x1500 \
+     -mpegts_start_pid 0x150 \
+     -metadata service_provider="Some provider" \
+     -metadata service_name="Some Channel" \
+     -y out.ts
+
+ + +

5.5 null

+ +

Null muxer. +

+

This muxer does not generate any output file, it is mainly useful for +testing or benchmarking purposes. +

+

For example to benchmark decoding with ‘ffmpeg’ you can use the +command: +

 
ffmpeg -benchmark -i INPUT -f null out.null
+
+ +

Note that the above command does not read or write the ‘out.null’ +file, but specifying the output file is required by the ‘ffmpeg’ +syntax. +

+

Alternatively you can write the command as: +

 
ffmpeg -benchmark -i INPUT -f null -
+
+ + +

6. Protocols

+ +

Protocols are configured elements in FFmpeg which allow to access +resources which require the use of a particular protocol. +

+

When you configure your FFmpeg build, all the supported protocols are +enabled by default. You can list all available ones using the +configure option "–list-protocols". +

+

You can disable all the protocols using the configure option +"–disable-protocols", and selectively enable a protocol using the +option "–enable-protocol=PROTOCOL", or you can disable a +particular protocol using the option +"–disable-protocol=PROTOCOL". +

+

The option "-protocols" of the ff* tools will display the list of +supported protocols. +

+

A description of the currently available protocols follows. +

+ +

6.1 applehttp

+ +

Read Apple HTTP Live Streaming compliant segmented stream as +a uniform one. The M3U8 playlists describing the segments can be +remote HTTP resources or local files, accessed using the standard +file protocol. +HTTP is default, specific protocol can be declared by specifying +"+proto" after the applehttp URI scheme name, where proto +is either "file" or "http". +

+
 
applehttp://host/path/to/remote/resource.m3u8
+applehttp+http://host/path/to/remote/resource.m3u8
+applehttp+file://path/to/local/resource.m3u8
+
+ + +

6.2 concat

+ +

Physical concatenation protocol. +

+

Allow to read and seek from many resource in sequence as if they were +a unique resource. +

+

A URL accepted by this protocol has the syntax: +

 
concat:URL1|URL2|...|URLN
+
+ +

where URL1, URL2, ..., URLN are the urls of the +resource to be concatenated, each one possibly specifying a distinct +protocol. +

+

For example to read a sequence of files ‘split1.mpeg’, +‘split2.mpeg’, ‘split3.mpeg’ with ‘ffplay’ use the +command: +

 
ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg
+
+ +

Note that you may need to escape the character "|" which is special for +many shells. +

+ +

6.3 file

+ +

File access protocol. +

+

Allow to read from or read to a file. +

+

For example to read from a file ‘input.mpeg’ with ‘ffmpeg’ +use the command: +

 
ffmpeg -i file:input.mpeg output.mpeg
+
+ +

The ff* tools default to the file protocol, that is a resource +specified with the name "FILE.mpeg" is interpreted as the URL +"file:FILE.mpeg". +

+ +

6.4 gopher

+ +

Gopher protocol. +

+ +

6.5 http

+ +

HTTP (Hyper Text Transfer Protocol). +

+ +

6.6 mmst

+ +

MMS (Microsoft Media Server) protocol over TCP. +

+ +

6.7 mmsh

+ +

MMS (Microsoft Media Server) protocol over HTTP. +

+

The required syntax is: +

 
mmsh://server[:port][/app][/playpath]
+
+ + +

6.8 md5

+ +

MD5 output protocol. +

+

Computes the MD5 hash of the data to be written, and on close writes +this to the designated output or stdout if none is specified. It can +be used to test muxers without writing an actual file. +

+

Some examples follow. +

 
# Write the MD5 hash of the encoded AVI file to the file output.avi.md5.
+ffmpeg -i input.flv -f avi -y md5:output.avi.md5
+
+# Write the MD5 hash of the encoded AVI file to stdout.
+ffmpeg -i input.flv -f avi -y md5:
+
+ +

Note that some formats (typically MOV) require the output protocol to +be seekable, so they will fail with the MD5 output protocol. +

+ +

6.9 pipe

+ +

UNIX pipe access protocol. +

+

Allow to read and write from UNIX pipes. +

+

The accepted syntax is: +

 
pipe:[number]
+
+ +

number is the number corresponding to the file descriptor of the +pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If number +is not specified, by default the stdout file descriptor will be used +for writing, stdin for reading. +

+

For example to read from stdin with ‘ffmpeg’: +

 
cat test.wav | ffmpeg -i pipe:0
+# ...this is the same as...
+cat test.wav | ffmpeg -i pipe:
+
+ +

For writing to stdout with ‘ffmpeg’: +

 
ffmpeg -i test.wav -f avi pipe:1 | cat > test.avi
+# ...this is the same as...
+ffmpeg -i test.wav -f avi pipe: | cat > test.avi
+
+ +

Note that some formats (typically MOV), require the output protocol to +be seekable, so they will fail with the pipe output protocol. +

+ +

6.10 rtmp

+ +

Real-Time Messaging Protocol. +

+

The Real-Time Messaging Protocol (RTMP) is used for streaming multime‐ +dia content across a TCP/IP network. +

+

The required syntax is: +

 
rtmp://server[:port][/app][/playpath]
+
+ +

The accepted parameters are: +

+
server
+

The address of the RTMP server. +

+
+
port
+

The number of the TCP port to use (by default is 1935). +

+
+
app
+

It is the name of the application to access. It usually corresponds to +the path where the application is installed on the RTMP server +(e.g. ‘/ondemand/’, ‘/flash/live/’, etc.). +

+
+
playpath
+

It is the path or name of the resource to play with reference to the +application specified in app, may be prefixed by "mp4:". +

+
+
+ +

For example to read with ‘ffplay’ a multimedia resource named +"sample" from the application "vod" from an RTMP server "myserver": +

 
ffplay rtmp://myserver/vod/sample
+
+ + +

6.11 rtmp, rtmpe, rtmps, rtmpt, rtmpte

+ +

Real-Time Messaging Protocol and its variants supported through +librtmp. +

+

Requires the presence of the librtmp headers and library during +configuration. You need to explicitely configure the build with +"–enable-librtmp". If enabled this will replace the native RTMP +protocol. +

+

This protocol provides most client functions and a few server +functions needed to support RTMP, RTMP tunneled in HTTP (RTMPT), +encrypted RTMP (RTMPE), RTMP over SSL/TLS (RTMPS) and tunneled +variants of these encrypted types (RTMPTE, RTMPTS). +

+

The required syntax is: +

 
rtmp_proto://server[:port][/app][/playpath] options
+
+ +

where rtmp_proto is one of the strings "rtmp", "rtmpt", "rtmpe", +"rtmps", "rtmpte", "rtmpts" corresponding to each RTMP variant, and +server, port, app and playpath have the same +meaning as specified for the RTMP native protocol. +options contains a list of space-separated options of the form +key=val. +

+

See the librtmp manual page (man 3 librtmp) for more information. +

+

For example, to stream a file in real-time to an RTMP server using +‘ffmpeg’: +

 
ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream
+
+ +

To play the same stream using ‘ffplay’: +

 
ffplay "rtmp://myserver/live/mystream live=1"
+
+ + +

6.12 rtp

+ +

Real-Time Protocol. +

+ +

6.13 rtsp

+ +

RTSP is not technically a protocol handler in libavformat, it is a demuxer +and muxer. The demuxer supports both normal RTSP (with data transferred +over RTP; this is used by e.g. Apple and Microsoft) and Real-RTSP (with +data transferred over RDT). +

+

The muxer can be used to send a stream using RTSP ANNOUNCE to a server +supporting it (currently Darwin Streaming Server and Mischa Spiegelmock’s +RTSP server, http://github.com/revmischa/rtsp-server). +

+

The required syntax for a RTSP url is: +

 
rtsp://hostname[:port]/path[?options]
+
+ +

options is a &-separated list. The following options +are supported: +

+
+
udp
+

Use UDP as lower transport protocol. +

+
+
tcp
+

Use TCP (interleaving within the RTSP control channel) as lower +transport protocol. +

+
+
multicast
+

Use UDP multicast as lower transport protocol. +

+
+
http
+

Use HTTP tunneling as lower transport protocol, which is useful for +passing proxies. +

+
+
filter_src
+

Accept packets only from negotiated peer address and port. +

+
+ +

Multiple lower transport protocols may be specified, in that case they are +tried one at a time (if the setup of one fails, the next one is tried). +For the muxer, only the tcp and udp options are supported. +

+

When receiving data over UDP, the demuxer tries to reorder received packets +(since they may arrive out of order, or packets may get lost totally). In +order for this to be enabled, a maximum delay must be specified in the +max_delay field of AVFormatContext. +

+

When watching multi-bitrate Real-RTSP streams with ‘ffplay’, the +streams to display can be chosen with -vst n and +-ast n for video and audio respectively, and can be switched +on the fly by pressing v and a. +

+

Example command lines: +

+

To watch a stream over UDP, with a max reordering delay of 0.5 seconds: +

+
 
ffplay -max_delay 500000 rtsp://server/video.mp4?udp
+
+ +

To watch a stream tunneled over HTTP: +

+
 
ffplay rtsp://server/video.mp4?http
+
+ +

To send a stream in realtime to a RTSP server, for others to watch: +

+
 
ffmpeg -re -i input -f rtsp -muxdelay 0.1 rtsp://server/live.sdp
+
+ + +

6.14 sap

+ +

Session Announcement Protocol (RFC 2974). This is not technically a +protocol handler in libavformat, it is a muxer and demuxer. +It is used for signalling of RTP streams, by announcing the SDP for the +streams regularly on a separate port. +

+ +

6.14.1 Muxer

+ +

The syntax for a SAP url given to the muxer is: +

 
sap://destination[:port][?options]
+
+ +

The RTP packets are sent to destination on port port, +or to port 5004 if no port is specified. +options is a &-separated list. The following options +are supported: +

+
+
announce_addr=address
+

Specify the destination IP address for sending the announcements to. +If omitted, the announcements are sent to the commonly used SAP +announcement multicast address 224.2.127.254 (sap.mcast.net), or +ff0e::2:7ffe if destination is an IPv6 address. +

+
+
announce_port=port
+

Specify the port to send the announcements on, defaults to +9875 if not specified. +

+
+
ttl=ttl
+

Specify the time to live value for the announcements and RTP packets, +defaults to 255. +

+
+
same_port=0|1
+

If set to 1, send all RTP streams on the same port pair. If zero (the +default), all streams are sent on unique ports, with each stream on a +port 2 numbers higher than the previous. +VLC/Live555 requires this to be set to 1, to be able to receive the stream. +The RTP stack in libavformat for receiving requires all streams to be sent +on unique ports. +

+
+ +

Example command lines follow. +

+

To broadcast a stream on the local subnet, for watching in VLC: +

+
 
ffmpeg -re -i input -f sap sap://224.0.0.255?same_port=1
+
+ +

Similarly, for watching in ffplay: +

+
 
ffmpeg -re -i input -f sap sap://224.0.0.255
+
+ +

And for watching in ffplay, over IPv6: +

+
 
ffmpeg -re -i input -f sap sap://[ff0e::1:2:3:4]
+
+ + +

6.14.2 Demuxer

+ +

The syntax for a SAP url given to the demuxer is: +

 
sap://[address][:port]
+
+ +

address is the multicast address to listen for announcements on, +if omitted, the default 224.2.127.254 (sap.mcast.net) is used. port +is the port that is listened on, 9875 if omitted. +

+

The demuxers listens for announcements on the given address and port. +Once an announcement is received, it tries to receive that particular stream. +

+

Example command lines follow. +

+

To play back the first stream announced on the normal SAP multicast address: +

+
 
ffplay sap://
+
+ +

To play back the first stream announced on one the default IPv6 SAP multicast address: +

+
 
ffplay sap://[ff0e::2:7ffe]
+
+ + +

6.15 tcp

+ +

Trasmission Control Protocol. +

+

The required syntax for a TCP url is: +

 
tcp://hostname:port[?options]
+
+ +
+
listen
+

Listen for an incoming connection +

+
 
ffmpeg -i input -f format tcp://hostname:port?listen
+ffplay tcp://hostname:port
+
+ +
+
+ + +

6.16 udp

+ +

User Datagram Protocol. +

+

The required syntax for a UDP url is: +

 
udp://hostname:port[?options]
+
+ +

options contains a list of &-seperated options of the form key=val. +Follow the list of supported options. +

+
+
buffer_size=size
+

set the UDP buffer size in bytes +

+
+
localport=port
+

override the local UDP port to bind with +

+
+
pkt_size=size
+

set the size in bytes of UDP packets +

+
+
reuse=1|0
+

explicitly allow or disallow reusing UDP sockets +

+
+
ttl=ttl
+

set the time to live value (for multicast only) +

+
+
connect=1|0
+

Initialize the UDP socket with connect(). In this case, the +destination address can’t be changed with ff_udp_set_remote_url later. +If the destination address isn’t known at the start, this option can +be specified in ff_udp_set_remote_url, too. +This allows finding out the source address for the packets with getsockname, +and makes writes return with AVERROR(ECONNREFUSED) if "destination +unreachable" is received. +For receiving, this gives the benefit of only receiving packets from +the specified peer address/port. +

+
+ +

Some usage examples of the udp protocol with ‘ffmpeg’ follow. +

+

To stream over UDP to a remote endpoint: +

 
ffmpeg -i input -f format udp://hostname:port
+
+ +

To stream in mpegts format over UDP using 188 sized UDP packets, using a large input buffer: +

 
ffmpeg -i input -f mpegts udp://hostname:port?pkt_size=188&buffer_size=65535
+
+ +

To receive over UDP from a remote endpoint: +

 
ffmpeg -i udp://[multicast-address]:port
+
+ + +

7. Input Devices

+ +

Input devices are configured elements in FFmpeg which allow to access +the data coming from a multimedia device attached to your system. +

+

When you configure your FFmpeg build, all the supported input devices +are enabled by default. You can list all available ones using the +configure option "–list-indevs". +

+

You can disable all the input devices using the configure option +"–disable-indevs", and selectively enable an input device using the +option "–enable-indev=INDEV", or you can disable a particular +input device using the option "–disable-indev=INDEV". +

+

The option "-formats" of the ff* tools will display the list of +supported input devices (amongst the demuxers). +

+

A description of the currently available input devices follows. +

+ +

7.1 alsa

+ +

ALSA (Advanced Linux Sound Architecture) input device. +

+

To enable this input device during configuration you need libasound +installed on your system. +

+

This device allows capturing from an ALSA device. The name of the +device to capture has to be an ALSA card identifier. +

+

An ALSA identifier has the syntax: +

 
hw:CARD[,DEV[,SUBDEV]]
+
+ +

where the DEV and SUBDEV components are optional. +

+

The three arguments (in order: CARD,DEV,SUBDEV) +specify card number or identifier, device number and subdevice number +(-1 means any). +

+

To see the list of cards currently recognized by your system check the +files ‘/proc/asound/cards’ and ‘/proc/asound/devices’. +

+

For example to capture with ‘ffmpeg’ from an ALSA device with +card id 0, you may run the command: +

 
ffmpeg -f alsa -i hw:0 alsaout.wav
+
+ +

For more information see: +http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html +

+ +

7.2 bktr

+ +

BSD video input device. +

+ +

7.3 dv1394

+ +

Linux DV 1394 input device. +

+ +

7.4 fbdev

+ +

Linux framebuffer input device. +

+

The Linux framebuffer is a graphic hardware-independent abstraction +layer to show graphics on a computer monitor, typically on the +console. It is accessed through a file device node, usually +‘/dev/fb0’. +

+

For more detailed information read the file +Documentation/fb/framebuffer.txt included in the Linux source tree. +

+

To record from the framebuffer device ‘/dev/fb0’ with +‘ffmpeg’: +

 
ffmpeg -f fbdev -r 10 -i /dev/fb0 out.avi
+
+ +

You can take a single screenshot image with the command: +

 
ffmpeg -f fbdev -vframes 1 -r 1 -i /dev/fb0 screenshot.jpeg
+
+ +

See also http://linux-fbdev.sourceforge.net/, and fbset(1). +

+ +

7.5 jack

+ +

JACK input device. +

+

To enable this input device during configuration you need libjack +installed on your system. +

+

A JACK input device creates one or more JACK writable clients, one for +each audio channel, with name client_name:input_N, where +client_name is the name provided by the application, and N +is a number which identifies the channel. +Each writable client will send the acquired data to the FFmpeg input +device. +

+

Once you have created one or more JACK readable clients, you need to +connect them to one or more JACK writable clients. +

+

To connect or disconnect JACK clients you can use the +‘jack_connect’ and ‘jack_disconnect’ programs, or do it +through a graphical interface, for example with ‘qjackctl’. +

+

To list the JACK clients and their properties you can invoke the command +‘jack_lsp’. +

+

Follows an example which shows how to capture a JACK readable client +with ‘ffmpeg’. +

 
# Create a JACK writable client with name "ffmpeg".
+$ ffmpeg -f jack -i ffmpeg -y out.wav
+
+# Start the sample jack_metro readable client.
+$ jack_metro -b 120 -d 0.2 -f 4000
+
+# List the current JACK clients.
+$ jack_lsp -c
+system:capture_1
+system:capture_2
+system:playback_1
+system:playback_2
+ffmpeg:input_1
+metro:120_bpm
+
+# Connect metro to the ffmpeg writable client.
+$ jack_connect metro:120_bpm ffmpeg:input_1
+
+ +

For more information read: +http://jackaudio.org/ +

+ +

7.6 libdc1394

+ +

IIDC1394 input device, based on libdc1394 and libraw1394. +

+ +

7.7 oss

+ +

Open Sound System input device. +

+

The filename to provide to the input device is the device node +representing the OSS input device, and is usually set to +‘/dev/dsp’. +

+

For example to grab from ‘/dev/dsp’ using ‘ffmpeg’ use the +command: +

 
ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
+
+ +

For more information about OSS see: +http://manuals.opensound.com/usersguide/dsp.html +

+ +

7.8 sndio

+ +

sndio input device. +

+

To enable this input device during configuration you need libsndio +installed on your system. +

+

The filename to provide to the input device is the device node +representing the sndio input device, and is usually set to +‘/dev/audio0’. +

+

For example to grab from ‘/dev/audio0’ using ‘ffmpeg’ use the +command: +

 
ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
+
+ + +

7.9 video4linux and video4linux2

+ +

Video4Linux and Video4Linux2 input video devices. +

+

The name of the device to grab is a file device node, usually Linux +systems tend to automatically create such nodes when the device +(e.g. an USB webcam) is plugged into the system, and has a name of the +kind ‘/dev/videoN’, where N is a number associated to +the device. +

+

Video4Linux and Video4Linux2 devices only support a limited set of +widthxheight sizes and framerates. You can check which are +supported for example with the command ‘dov4l’ for Video4Linux +devices and the command ‘v4l-info’ for Video4Linux2 devices. +

+

If the size for the device is set to 0x0, the input device will +try to autodetect the size to use. +Only for the video4linux2 device, if the frame rate is set to 0/0 the +input device will use the frame rate value already set in the driver. +

+

Video4Linux support is deprecated since Linux 2.6.30, and will be +dropped in later versions. +

+

Follow some usage examples of the video4linux devices with the ff* +tools. +

 
# Grab and show the input of a video4linux device, frame rate is set
+# to the default of 25/1.
+ffplay -s 320x240 -f video4linux /dev/video0
+
+# Grab and show the input of a video4linux2 device, autoadjust size.
+ffplay -f video4linux2 /dev/video0
+
+# Grab and record the input of a video4linux2 device, autoadjust size,
+# frame rate value defaults to 0/0 so it is read from the video4linux2
+# driver.
+ffmpeg -f video4linux2 -i /dev/video0 out.mpeg
+
+ + +

7.10 vfwcap

+ +

VfW (Video for Windows) capture input device. +

+

The filename passed as input is the capture driver number, ranging from +0 to 9. You may use "list" as filename to print a list of drivers. Any +other filename will be interpreted as device number 0. +

+ +

7.11 x11grab

+ +

X11 video input device. +

+

This device allows to capture a region of an X11 display. +

+

The filename passed as input has the syntax: +

 
[hostname]:display_number.screen_number[+x_offset,y_offset]
+
+ +

hostname:display_number.screen_number specifies the +X11 display name of the screen to grab from. hostname can be +ommitted, and defaults to "localhost". The environment variable +DISPLAY contains the default display name. +

+

x_offset and y_offset specify the offsets of the grabbed +area with respect to the top-left border of the X11 screen. They +default to 0. +

+

Check the X11 documentation (e.g. man X) for more detailed information. +

+

Use the ‘dpyinfo’ program for getting basic information about the +properties of your X11 display (e.g. grep for "name" or "dimensions"). +

+

For example to grab from ‘:0.0’ using ‘ffmpeg’: +

 
ffmpeg -f x11grab -r 25 -s cif -i :0.0 out.mpg
+
+# Grab at position 10,20.
+ffmpeg -f x11grab -25 -s cif -i :0.0+10,20 out.mpg
+
+ + + +
+

+ + This document was generated by Kyle Schwarz on May 18, 2011 using texi2html 1.82. + +
+ +

+ + diff --git a/ffmpeg 0.7/doc/general.html b/ffmpeg 0.7/doc/general.html new file mode 100644 index 000000000..013d9e2d7 --- /dev/null +++ b/ffmpeg 0.7/doc/general.html @@ -0,0 +1,1031 @@ + + + + +General Documentation + + + + + + + + + + + + + + + +

General Documentation

+ + +

Table of Contents

+
+ + +
+ +
+ +

1. external libraries

+ +

FFmpeg can be hooked up with a number of external libraries to add support +for more formats. None of them are used by default, their use has to be +explicitly requested by passing the appropriate flags to ‘./configure’. +

+ +

1.1 OpenCORE AMR

+ +

FFmpeg can make use of the OpenCORE libraries for AMR-NB +decoding/encoding and AMR-WB decoding. +

+

Go to http://sourceforge.net/projects/opencore-amr/ and follow the instructions for +installing the libraries. Then pass --enable-libopencore-amrnb and/or +--enable-libopencore-amrwb to configure to enable the libraries. +

+

Note that OpenCORE is under the Apache License 2.0 (see +http://www.apache.org/licenses/LICENSE-2.0 for details), which is +incompatible with the LGPL version 2.1 and GPL version 2. You have to +upgrade FFmpeg’s license to LGPL version 3 (or if you have enabled +GPL components, GPL version 3) to use it. +

+ + +

2. Supported File Formats and Codecs

+ +

You can use the -formats and -codecs options to have an exhaustive list. +

+ +

2.1 File Formats

+ +

FFmpeg supports the following file formats through the libavformat +library: +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameEncodingDecodingComments
4xmX4X Technologies format, used in some games.
8088flex TMVX
Adobe FilmstripXX
Audio IFF (AIFF)XX
American Laser Games MMXMultimedia format used in games like Mad Dog McCree.
3GPP AMRXX
Apple HTTP Live StreamingX
ASFXX
AVIXX
AVISynthX
AVSXMultimedia format used by the Creature Shock game.
Beam Software SIFFXAudio and video format used in some games by Beam Software.
Bethesda Softworks VIDXUsed in some games from Bethesda Softworks.
BinkXMultimedia format used by many games.
Bitmap Brothers JVXUsed in Z and Z95 games.
Brute Force & IgnoranceXUsed in the game Flash Traffic: City of Angels.
Interplay C93XUsed in the game Cyberia from Interplay.
Delphine Software International CINXMultimedia format used by Delphine Software games.
CD+GXVideo format used by CD+G karaoke disks
Core Audio FormatXXApple Core Audio Format
CRC testing formatX
Creative VoiceXXCreated for the Sound Blaster Pro.
CRYO APCXAudio format used in some games by CRYO Interactive Entertainment.
D-Cinema audioXX
Deluxe Paint AnimationX
DFAXThis format is used in Chronomaster game
DV videoXX
DXAXThis format is used in the non-Windows version of the Feeble Files + game and different game cutscenes repacked for use with ScummVM.
Electronic Arts cdataX
Electronic Arts MultimediaXUsed in various EA games; files have extensions like WVE and UV2.
FFM (FFserver live feed)XX
Flash (SWF)XX
Flash 9 (AVM2)XXOnly embedded audio is decoded.
FLI/FLC/FLX animationX.fli/.flc files
Flash Video (FLV)XXMacromedia Flash video files
framecrc testing formatX
FunCom ISSXAudio format used in various games from FunCom like The Longest Journey.
GIF AnimationX
GXFXXGeneral eXchange Format SMPTE 360M, used by Thomson Grass Valley + playout servers.
id Quake II CIN videoX
id RoQXXUsed in Quake III, Jedi Knight 2, other computer games.
IEC61937 encapsulationXX
IFFXInterchange File Format
Interplay MVEXFormat used in various Interplay computer games.
IV8XA format generated by IndigoVision 8000 video server.
IVF (On2)XXA format used by libvpx
LMLM4XUsed by Linux Media Labs MPEG-4 PCI boards
LXFXVR native stream format, used by Leitch/Harris’ video servers.
MatroskaXX
Matroska audioX
FFmpeg metadataXXMetadata in text format.
MAXIS XAXUsed in Sim City 3000; file extension .xa.
MD StudioX
Mobotix .mxgX
Monkey’s AudioX
Motion Pixels MVIX
MOV/QuickTime/MP4XX3GP, 3GP2, PSP, iPod variants supported
MP2XX
MP3XX
MPEG-1 SystemXXmuxed audio and video, VCD format supported
MPEG-PS (program stream)XXalso known as VOB file, SVCD and DVD format supported
MPEG-TS (transport stream)XXalso known as DVB Transport Stream
MPEG-4XXMPEG-4 is a variant of QuickTime.
MIME multipart JPEGX
MSN TCP webcamXUsed by MSN Messenger webcam streams.
MTVX
MusepackX
Musepack SV8X
Material eXchange Format (MXF)XXSMPTE 377M, used by D-Cinema, broadcast industry.
Material eXchange Format (MXF), D-10 MappingXXSMPTE 386M, D-10/IMX Mapping.
NC camera feedXNC (AVIP NC4600) camera streams
NTT TwinVQ (VQF)XNippon Telegraph and Telephone Corporation TwinVQ.
Nullsoft Streaming VideoX
NuppelVideoX
NUTXXNUT Open Container Format
OggXX
Playstation Portable PMPX
TechnoTrend PVAXUsed by TechnoTrend DVB PCI boards.
QCPX
raw ADTS (AAC)XX
raw AC-3XX
raw Chinese AVS videoXX
raw CRI ADXXX
raw DiracXX
raw DNxHDXX
raw DTSXX
raw E-AC-3XX
raw FLACXX
raw GSMX
raw H.261XX
raw H.263XX
raw H.264XX
raw Ingenient MJPEGX
raw MJPEGXX
raw MLPX
raw MPEGX
raw MPEG-1X
raw MPEG-2X
raw MPEG-4XX
raw NULLX
raw videoXX
raw id RoQX
raw ShortenX
raw TrueHDXX
raw VC-1X
raw PCM A-lawXX
raw PCM mu-lawXX
raw PCM signed 8 bitXX
raw PCM signed 16 bit big-endianXX
raw PCM signed 16 bit little-endianXX
raw PCM signed 24 bit big-endianXX
raw PCM signed 24 bit little-endianXX
raw PCM signed 32 bit big-endianXX
raw PCM signed 32 bit little-endianXX
raw PCM unsigned 8 bitXX
raw PCM unsigned 16 bit big-endianXX
raw PCM unsigned 16 bit little-endianXX
raw PCM unsigned 24 bit big-endianXX
raw PCM unsigned 24 bit little-endianXX
raw PCM unsigned 32 bit big-endianXX
raw PCM unsigned 32 bit little-endianXX
raw PCM floating-point 32 bit big-endianXX
raw PCM floating-point 32 bit little-endianXX
raw PCM floating-point 64 bit big-endianXX
raw PCM floating-point 64 bit little-endianXX
RDTX
REDCODE R3DXFile format used by RED Digital cameras, contains JPEG 2000 frames and PCM audio.
RealMediaXX
RedirectorX
Renderware TeXture DictionaryX
RL2XAudio and video format used in some games by Entertainment Software Partners.
RPL/ARMovieX
Lego Mindstorms RSOXX
RTMPXXOutput is performed by publishing stream to RTMP server
RTPXX
RTSPXX
SAPXX
SDPX
Sega FILM/CPKXUsed in many Sega Saturn console games.
Sierra SOLX.sol files used in Sierra Online games.
Sierra VMDXUsed in Sierra CD-ROM games.
SmackerXMultimedia format used by many games.
Sony OpenMG (OMA)XAudio format used in Sony Sonic Stage and Sony Vegas.
Sony PlayStation STRX
Sony Wave64 (W64)X
SoX native formatXX
SUN AU formatXX
Text filesX
THPXUsed on the Nintendo GameCube.
Tiertex Limited SEQXTiertex .seq files used in the DOS CD-ROM version of the game Flashback.
True AudioX
VC-1 test bitstreamXX
WAVXX
WavPackX
WebMXX
Windows Televison (WTV)X
Wing Commander III movieXMultimedia format used in Origin’s Wing Commander III computer game.
Westwood Studios audioXMultimedia format used in Westwood Studios games.
Westwood Studios VQAXMultimedia format used in Westwood Studios games.
xWMAXMicrosoft audio container used by XAudio 2.
YUV4MPEG pipeXX
Psygnosis YOPX
+ +

X means that encoding (resp. decoding) is supported. +

+ +

2.2 Image Formats

+ +

FFmpeg can read and write images for each frame of a video sequence. The +following image formats are supported: +

+ + + + + + + + + + + + + + + + + + + + + + + +
NameEncodingDecodingComments
.Y.U.VXXone raw file per component
animated GIFXXOnly uncompressed GIFs are generated.
BMPXXMicrosoft BMP image
DPXXXDigital Picture Exchange
JPEGXXProgressive JPEG is not supported.
JPEG 2000Edecoding supported through external library libopenjpeg
JPEG-LSXX
LJPEGXLossless JPEG
PAMXXPAM is a PNM extension with alpha support.
PBMXXPortable BitMap image
PCXXXPC Paintbrush
PGMXXPortable GrayMap image
PGMYUVXXPGM with U and V components in YUV 4:2:0
PICXPictor/PC Paint
PNGXX2/4 bpp not supported yet
PPMXXPortable PixelMap image
PTXXV.Flash PTX format
SGIXXSGI RGB image format
Sun RasterfileXSun RAS image format
TIFFXXYUV, JPEG and some extension is not supported yet.
Truevision TargaXXTarga (.TGA) image format
+ +

X means that encoding (resp. decoding) is supported. +

+

E means that support is provided through an external library. +

+ +

2.3 Video Codecs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameEncodingDecodingComments
4X MovieXUsed in certain computer games.
8088flex TMVX
8SVX exponentialX
8SVX fibonacciX
A64 multicolorXCreates video suitable to be played on a commodore 64 (multicolor mode).
American Laser Games MMXUsed in games like Mad Dog McCree.
AMV VideoXUsed in Chinese MP3 players.
ANSI/ASCII artX
Apple MJPEG-BX
Apple QuickDrawXfourcc: qdrw
Asus v1XXfourcc: ASV1
Asus v2XXfourcc: ASV2
ATI VCR1Xfourcc: VCR1
ATI VCR2Xfourcc: VCR2
Auravision AuraX
Auravision Aura 2X
Autodesk Animator Flic videoX
Autodesk RLEXfourcc: AASC
AVS (Audio Video Standard) videoXVideo encoding used by the Creature Shock game.
Beam Software VBX
Bethesda VID videoXUsed in some games from Bethesda Softworks.
Bink VideoX
Bitmap Brothers JV videoX
Brute Force & IgnoranceXUsed in the game Flash Traffic: City of Angels.
C93 videoXCodec used in Cyberia game.
CamStudioXfourcc: CSCD
CD+GXVideo codec for CD+G karaoke disks
Chinese AVS videoEXAVS1-P2, JiZhun profile, encoding through external library libxavs
Delphine Software International CIN videoXCodec used in Delphine Software International games.
CinepakX
Cirrus Logic AccuPakXfourcc: CLJR
Creative YUV (CYUV)X
DFAXCodec used in Chronomaster game.
DiracEEsupported through external libdirac/libschroedinger libraries
Deluxe Paint AnimationX
DNxHDXXaka SMPTE VC3
Duck TrueMotion 1.0Xfourcc: DUCK
Duck TrueMotion 2.0Xfourcc: TM20
DV (Digital Video)XX
Feeble Files/ScummVM DXAXCodec originally used in Feeble Files game.
Electronic Arts CMV videoXUsed in NHL 95 game.
Electronic Arts Madcow videoX
Electronic Arts TGV videoX
Electronic Arts TGQ videoX
Electronic Arts TQI videoX
Escape 124X
FFmpeg video codec #1XXexperimental lossless codec (fourcc: FFV1)
Flash Screen Video v1XXfourcc: FSV1
Flash Screen Video v2X
Flash Video (FLV)XXSorenson H.263 used in Flash
FrapsX
H.261XX
H.263 / H.263-1996XX
H.263+ / H.263-1998 / H.263 version 2XX
H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10EXencoding supported through external library libx264
H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (VDPAU acceleration)EX
HuffYUVXX
HuffYUV FFmpeg variantXX
IBM UltimotionXfourcc: ULTI
id Cinematic videoXUsed in Quake II.
id RoQ videoXXUsed in Quake III, Jedi Knight 2, other computer games.
IFF ILBMXIFF interlaved bitmap
IFF ByteRun1XIFF run length encoded bitmap
Intel H.263X
Intel Indeo 2X
Intel Indeo 3X
Intel Indeo 5X
Interplay C93XUsed in the game Cyberia from Interplay.
Interplay MVE videoXUsed in Interplay .MVE files.
Karl Morton’s video codecXCodec used in Worms games.
Kega Game Video (KGV1)XKega emulator screen capture codec.
LagarithX
LCL (LossLess Codec Library) MSZHX
LCL (LossLess Codec Library) ZLIBEE
LOCOX
lossless MJPEGXX
Microsoft RLEX
Microsoft Video 1X
MimicXUsed in MSN Messenger Webcam streams.
Miro VideoXLXfourcc: VIXL
MJPEG (Motion JPEG)XX
Mobotix MxPEG videoX
Motion Pixels videoX
MPEG-1 videoXX
MPEG-1/2 video XvMC (X-Video Motion Compensation)X
MPEG-1/2 video (VDPAU acceleration)X
MPEG-2 videoXX
MPEG-4 part 2XX +  libxvidcore can be used alternatively for encoding.
MPEG-4 part 2 Microsoft variant version 1X
MPEG-4 part 2 Microsoft variant version 2XX
MPEG-4 part 2 Microsoft variant version 3XX
Nintendo Gamecube THP videoX
NuppelVideo/RTjpegXVideo encoding used in NuppelVideo files.
On2 VP3Xstill experimental
On2 VP5Xfourcc: VP50
On2 VP6Xfourcc: VP60,VP61,VP62
VP8EXfourcc: VP80, encoding supported through external library libvpx
planar RGBXfourcc: 8BPS
Q-team QPEGXfourccs: QPEG, Q1.0, Q1.1
QuickTime 8BPS videoX
QuickTime Animation (RLE) videoXXfourcc: ’rle ’
QuickTime Graphics (SMC)Xfourcc: ’smc ’
QuickTime video (RPZA)Xfourcc: rpza
R10K AJA Kona 10-bit RGB CodecX
R210 Quicktime Uncompressed RGB 10-bitX
Raw VideoXX
RealVideo 1.0XX
RealVideo 2.0XX
RealVideo 3.0Xstill far from ideal
RealVideo 4.0X
Renderware TXD (TeXture Dictionary)XTexture dictionaries used by the Renderware Engine.
RL2 videoXused in some games by Entertainment Software Partners
Sierra VMD videoXUsed in Sierra VMD files.
Smacker videoXVideo encoding used in Smacker.
SMPTE VC-1X
SnowXXexperimental wavelet codec (fourcc: SNOW)
Sony PlayStation MDEC (Motion DECoder)X
Sorenson Vector Quantizer 1XXfourcc: SVQ1
Sorenson Vector Quantizer 3Xfourcc: SVQ3
Sunplus JPEG (SP5X)Xfourcc: SP5X
TechSmith Screen Capture CodecXfourcc: TSCC
TheoraEXencoding supported through external library libtheora
Tiertex Limited SEQ videoXCodec used in DOS CD-ROM FlashBack game.
V210 Quicktime Uncompressed 4:2:2 10-bitXX
VMware Screen Codec / VMware VideoXCodec used in videos captured by VMware.
Westwood Studios VQA (Vector Quantized Animation) videoX
Windows Media Video 7XX
Windows Media Video 8XX
Windows Media Video 9Xnot completely working
Wing Commander III / XanXUsed in Wing Commander III .MVE files.
Wing Commander IV / XanXUsed in Wing Commander IV.
Winnov WNV1X
WMV7XX
YAMAHA SMAFXX
Psygnosis YOP VideoX
ZLIBXXpart of LCL, encoder experimental
Zip Motion Blocks VideoXXEncoder works only in PAL8.
+ +

X means that encoding (resp. decoding) is supported. +

+

E means that support is provided through an external library. +

+ +

2.4 Audio Codecs

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameEncodingDecodingComments
8SVX audioX
AACEXencoding supported through external library libfaac and libvo-aacenc
AC-3IXX
ADPCM 4X MovieX
ADPCM CDROM XAX
ADPCM Creative TechnologyX16 -> 4, 8 -> 4, 8 -> 3, 8 -> 2
ADPCM Electronic ArtsXUsed in various EA titles.
ADPCM Electronic Arts Maxis CDROM XSXUsed in Sim City 3000.
ADPCM Electronic Arts R1X
ADPCM Electronic Arts R2X
ADPCM Electronic Arts R3X
ADPCM Electronic Arts XASX
ADPCM G.722XX
ADPCM G.726XX
ADPCM IMA AMVXUsed in AMV files
ADPCM IMA Electronic Arts EACSX
ADPCM IMA Electronic Arts SEADX
ADPCM IMA FuncomX
ADPCM IMA QuickTimeXX
ADPCM IMA Loki SDL MJPEGX
ADPCM IMA WAVXX
ADPCM IMA WestwoodX
ADPCM ISS IMAXUsed in FunCom games.
ADPCM IMA Duck DK3XUsed in some Sega Saturn console games.
ADPCM IMA Duck DK4XUsed in some Sega Saturn console games.
ADPCM MicrosoftXX
ADPCM MS IMAXX
ADPCM Nintendo Gamecube THPX
ADPCM QT IMAXX
ADPCM SEGA CRI ADXXXUsed in Sega Dreamcast games.
ADPCM Shockwave FlashXX
ADPCM SMJPEG IMAXUsed in certain Loki game ports.
ADPCM Sound Blaster Pro 2-bitX
ADPCM Sound Blaster Pro 2.6-bitX
ADPCM Sound Blaster Pro 4-bitX
ADPCM Westwood Studios IMAXUsed in Westwood Studios games like Command and Conquer.
ADPCM YamahaXX
AMR-NBEXencoding supported through external library libopencore-amrnb
AMR-WBEXencoding supported through external library libvo-amrwbenc
Apple lossless audioXXQuickTime fourcc ’alac’
Atrac 1X
Atrac 3X
Bink AudioXUsed in Bink and Smacker files in many games.
CELT (Opus)Edecoding supported through external library libcelt
Delphine Software International CIN audioXCodec used in Delphine Software International games.
COOKXAll versions except 5.1 are supported.
DCA (DTS Coherent Acoustics)XX
DPCM id RoQXXUsed in Quake III, Jedi Knight 2, other computer games.
DPCM InterplayXUsed in various Interplay computer games.
DPCM Sierra OnlineXUsed in Sierra Online game audio files.
DPCM SolX
DPCM XanXUsed in Origin’s Wing Commander IV AVI files.
DSP Group TrueSpeechX
DV audioX
Enhanced AC-3X
FLAC (Free Lossless Audio Codec)XIX
GSMEXencoding supported through external library libgsm
GSM Microsoft variantEXencoding supported through external library libgsm
IMC (Intel Music Coder)X
MACE (Macintosh Audio Compression/Expansion) 3:1X
MACE (Macintosh Audio Compression/Expansion) 6:1X
MLP (Meridian Lossless Packing)XUsed in DVD-Audio discs.
Monkey’s AudioXOnly versions 3.97-3.99 are supported.
MP1 (MPEG audio layer 1)IX
MP2 (MPEG audio layer 2)IXIX
MP3 (MPEG audio layer 3)EIXencoding supported through external library LAME, ADU MP3 and MP3onMP4 also supported
MPEG-4 Audio Lossless Coding (ALS)X
Musepack SV7X
Musepack SV8X
Nellymoser AsaoXX
PCM A-lawXX
PCM mu-lawXX
PCM 16-bit little-endian planarX
PCM 32-bit floating point big-endianXX
PCM 32-bit floating point little-endianXX
PCM 64-bit floating point big-endianXX
PCM 64-bit floating point little-endianXX
PCM D-Cinema audio signed 24-bitXX
PCM signed 8-bitXX
PCM signed 16-bit big-endianXX
PCM signed 16-bit little-endianXX
PCM signed 24-bit big-endianXX
PCM signed 24-bit little-endianXX
PCM signed 32-bit big-endianXX
PCM signed 32-bit little-endianXX
PCM signed 16/20/24-bit big-endian in MPEG-TSX
PCM unsigned 8-bitXX
PCM unsigned 16-bit big-endianXX
PCM unsigned 16-bit little-endianXX
PCM unsigned 24-bit big-endianXX
PCM unsigned 24-bit little-endianXX
PCM unsigned 32-bit big-endianXX
PCM unsigned 32-bit little-endianXX
PCM ZorkXX
QCELP / PureVoiceX
QDesign Music Codec 2XThere are still some distortions.
RealAudio 1.0 (14.4K)XXReal 14400 bit/s codec
RealAudio 2.0 (28.8K)XReal 28800 bit/s codec
RealAudio 3.0 (dnet)IXXReal low bitrate AC-3 codec
RealAudio SIPR / ACELP.NETX
ShortenX
Sierra VMD audioXUsed in Sierra VMD files.
Smacker audioX
SMPTE 302M AES3 audioX
SonicXXexperimental codec
Sonic losslessXXexperimental codec
SpeexEsupported through external library libspeex
True Audio (TTA)X
TrueHDXUsed in HD-DVD and Blu-Ray discs.
TwinVQ (VQF flavor)X
VorbisEXA native but very primitive encoder exists.
WavPackX
Westwood Audio (SND1)X
Windows Media Audio 1XX
Windows Media Audio 2XX
Windows Media Audio ProX
Windows Media Audio VoiceX
+ +

X means that encoding (resp. decoding) is supported. +

+

E means that support is provided through an external library. +

+

I means that an integer-only version is available, too (ensures high +performance on systems without hardware floating point support). +

+ +

2.5 Subtitle Formats

+ + + + + + + + + + +
NameMuxingDemuxingEncodingDecoding
SSA/ASSXXXX
DVBXXXX
DVDXXXX
MicroDVDXX
PGSX
SubRip (SRT)XXXX
XSUBXX
+ +

X means that the feature is supported. +

+ +

2.6 Network Protocols

+ + + + + + + + + + + + +
NameSupport
Apple HTTP Live StreamingX
fileX
GopherX
HTTPX
MMSX
pipeX
RTPX
TCPX
UDPX
+ +

X means that the protocol is supported. +

+ + +

2.7 Input/Output Devices

+ + + + + + + + + + + + + +
NameInputOutput
ALSAXX
BKTRX
DV1394X
JACKX
LIBDC1394X
OSSXX
Video4LinuxX
Video4Linux2X
VfW captureX
X11 grabbingX
+ +

X means that input/output is supported. +

+ + +

3. Platform Specific information

+ + +

3.1 DOS

+ +

Using a cross-compiler is preferred for various reasons. +

+ +

3.1.1 DJGPP

+ +

FFmpeg cannot be compiled because of broken system headers, add +--extra-cflags=-U__STRICT_ANSI__ to the configure options as a +workaround. +

+ +

3.2 OS/2

+ +

For information about compiling FFmpeg on OS/2 see +http://www.edm2.com/index.php/FFmpeg. +

+ +

3.3 Unix-like

+ +

Some parts of FFmpeg cannot be built with version 2.15 of the GNU +assembler which is still provided by a few AMD64 distributions. To +make sure your compiler really uses the required version of gas +after a binutils upgrade, run: +

+
 
$(gcc -print-prog-name=as) --version
+
+ +

If not, then you should install a different compiler that has no +hard-coded path to gas. In the worst case pass --disable-asm +to configure. +

+ +

3.3.1 BSD

+ +

BSD make will not build FFmpeg, you need to install and use GNU Make +(‘gmake’). +

+ +

3.3.2 (Open)Solaris

+ +

GNU Make is required to build FFmpeg, so you have to invoke (‘gmake’), +standard Solaris Make will not work. When building with a non-c99 front-end +(gcc, generic suncc) add either --extra-libs=/usr/lib/values-xpg6.o +or --extra-libs=/usr/lib/64/values-xpg6.o to the configure options +since the libc is not c99-compliant by default. The probes performed by +configure may raise an exception leading to the death of configure itself +due to a bug in the system shell. Simply invoke a different shell such as +bash directly to work around this: +

+
 
bash ./configure
+
+ + +

3.3.3 Darwin (MacOS X, iPhone)

+ +

MacOS X on PowerPC or ARM (iPhone) requires a preprocessor from +http://github.com/yuvi/gas-preprocessor to build the optimized +assembler functions. Just download the Perl script and put it somewhere +in your PATH, FFmpeg’s configure will pick it up automatically. +

+ +

3.4 Windows

+ +

To get help and instructions for building FFmpeg under Windows, check out +the FFmpeg Windows Help Forum at +http://ffmpeg.arrozcru.org/. +

+ +

3.4.1 Native Windows compilation

+ +

FFmpeg can be built to run natively on Windows using the MinGW tools. Install +the latest versions of MSYS and MinGW from http://www.mingw.org/. +You can find detailed installation +instructions in the download section and the FAQ. +

+

FFmpeg does not build out-of-the-box with the packages the automated MinGW +installer provides. It also requires coreutils to be installed and many other +packages updated to the latest version. The minimum version for some packages +are listed below: +

+ + +

FFmpeg automatically passes -fno-common to the compiler to work around +a GCC bug (see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37216). +

+

Within the MSYS shell, configure and make with: +

+
 
./configure --enable-memalign-hack
+make
+make install
+
+ +

This will install ‘ffmpeg.exe’ along with many other development files +to ‘/usr/local’. You may specify another install path using the +--prefix option in ‘configure’. +

+

Notes: +

+ + + +

3.4.2 Microsoft Visual C++ compatibility

+ +

As stated in the FAQ, FFmpeg will not compile under MSVC++. However, if you +want to use the libav* libraries in your own applications, you can still +compile those applications using MSVC++. But the libav* libraries you link +to must be built with MinGW. However, you will not be able to debug +inside the libav* libraries, since MSVC++ does not recognize the debug +symbols generated by GCC. +We strongly recommend you to move over from MSVC++ to MinGW tools. +

+

This description of how to use the FFmpeg libraries with MSVC++ is based on +Microsoft Visual C++ 2005 Express Edition. If you have a different version, +you might have to modify the procedures slightly. +

+ +

3.4.2.1 Using static libraries

+ +

Assuming you have just built and installed FFmpeg in ‘/usr/local’. +

+
    +
  1. Create a new console application ("File / New / Project") and then +select "Win32 Console Application". On the appropriate page of the +Application Wizard, uncheck the "Precompiled headers" option. + +
  2. Write the source code for your application, or, for testing, just +copy the code from an existing sample application into the source file +that MSVC++ has already created for you. For example, you can copy +‘libavformat/output-example.c’ from the FFmpeg distribution. + +
  3. Open the "Project / Properties" dialog box. In the "Configuration" +combo box, select "All Configurations" so that the changes you make will +affect both debug and release builds. In the tree view on the left hand +side, select "C/C++ / General", then edit the "Additional Include +Directories" setting to contain the path where the FFmpeg includes were +installed (i.e. ‘c:\msys\1.0\local\include’). +Do not add MinGW’s include directory here, or the include files will +conflict with MSVC’s. + +
  4. Still in the "Project / Properties" dialog box, select +"Linker / General" from the tree view and edit the +"Additional Library Directories" setting to contain the ‘lib’ +directory where FFmpeg was installed (i.e. ‘c:\msys\1.0\local\lib’), +the directory where MinGW libs are installed (i.e. ‘c:\mingw\lib’), +and the directory where MinGW’s GCC libs are installed +(i.e. ‘C:\mingw\lib\gcc\mingw32\4.2.1-sjlj’). Then select +"Linker / Input" from the tree view, and add the files ‘libavformat.a’, +‘libavcodec.a’, ‘libavutil.a’, ‘libmingwex.a’, +‘libgcc.a’, and any other libraries you used (i.e. ‘libz.a’) +to the end of "Additional Dependencies". + +
  5. Now, select "C/C++ / Code Generation" from the tree view. Select +"Debug" in the "Configuration" combo box. Make sure that "Runtime +Library" is set to "Multi-threaded Debug DLL". Then, select "Release" in +the "Configuration" combo box and make sure that "Runtime Library" is +set to "Multi-threaded DLL". + +
  6. Click "OK" to close the "Project / Properties" dialog box. + +
  7. MSVC++ lacks some C99 header files that are fundamental for FFmpeg. +Get msinttypes from http://code.google.com/p/msinttypes/downloads/list +and install it in MSVC++’s include directory +(i.e. ‘C:\Program Files\Microsoft Visual Studio 8\VC\include’). + +
  8. MSVC++ also does not understand the inline keyword used by +FFmpeg, so you must add this line before #includeing libav*: +
     
    #define inline _inline
    +
    + +
  9. Build your application, everything should work. + +
+ + +

3.4.2.2 Using shared libraries

+ +

This is how to create DLL and LIB files that are compatible with MSVC++: +

+
    +
  1. Add a call to ‘vcvars32.bat’ (which sets up the environment +variables for the Visual C++ tools) as the first line of ‘msys.bat’. +The standard location for ‘vcvars32.bat’ is +‘C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat’, +and the standard location for ‘msys.bat’ is ‘C:\msys\1.0\msys.bat’. +If this corresponds to your setup, add the following line as the first line +of ‘msys.bat’: + +
     
    call "C:\Program Files\Microsoft Visual Studio 8\VC\bin\vcvars32.bat"
    +
    + +

    Alternatively, you may start the ‘Visual Studio 2005 Command Prompt’, +and run ‘c:\msys\1.0\msys.bat’ from there. +

    +
  2. Within the MSYS shell, run lib.exe. If you get a help message +from ‘Microsoft (R) Library Manager’, this means your environment +variables are set up correctly, the ‘Microsoft (R) Library Manager’ +is on the path and will be used by FFmpeg to create +MSVC++-compatible import libraries. + +
  3. Build FFmpeg with + +
     
    ./configure --enable-shared --enable-memalign-hack
    +make
    +make install
    +
    + +

    Your install path (‘/usr/local/’ by default) should now have the +necessary DLL and LIB files under the ‘bin’ directory. +

    +
+ +

To use those files with MSVC++, do the same as you would do with +the static libraries, as described above. But in Step 4, +you should only need to add the directory where the LIB files are installed +(i.e. ‘c:\msys\usr\local\bin’). This is not a typo, the LIB files are +installed in the ‘bin’ directory. And instead of adding the static +libraries (‘libxxx.a’ files) you should add the MSVC import libraries +(‘avcodec.lib’, ‘avformat.lib’, and +‘avutil.lib’). Note that you should not use the GCC import +libraries (‘libxxx.dll.a’ files), as these will give you undefined +reference errors. There should be no need for ‘libmingwex.a’, +‘libgcc.a’, and ‘wsock32.lib’, nor any other external library +statically linked into the DLLs. The ‘bin’ directory contains a bunch +of DLL files, but the ones that are actually used to run your application +are the ones with a major version number in their filenames +(i.e. ‘avcodec-51.dll’). +

+

FFmpeg headers do not declare global data for Windows DLLs through the usual +dllexport/dllimport interface. Such data will be exported properly while +building, but to use them in your MSVC++ code you will have to edit the +appropriate headers and mark the data as dllimport. For example, in +libavutil/pixdesc.h you should have: +

 
extern __declspec(dllimport) const AVPixFmtDescriptor av_pix_fmt_descriptors[];
+
+ +

Note that using import libraries created by dlltool requires +the linker optimization option to be set to +"References: Keep Unreferenced Data (/OPT:NOREF)", otherwise +the resulting binaries will fail during runtime. This isn’t +required when using import libraries generated by lib.exe. +

+ +

3.4.3 Cross compilation for Windows with Linux

+ +

You must use the MinGW cross compilation tools available at +http://www.mingw.org/. +

+

Then configure FFmpeg with the following options: +

 
./configure --target-os=mingw32 --cross-prefix=i386-mingw32msvc-
+
+

(you can change the cross-prefix according to the prefix chosen for the +MinGW tools). +

+

Then you can easily test FFmpeg with Wine +(http://www.winehq.com/). +

+ +

3.4.4 Compilation under Cygwin

+ +

Please use Cygwin 1.7.x as the obsolete 1.5.x Cygwin versions lack +llrint() in its C library. +

+

Install your Cygwin with all the "Base" packages, plus the +following "Devel" ones: +

 
binutils, gcc4-core, make, git, mingw-runtime, texi2html
+
+ +

And the following "Utils" one: +

 
diffutils
+
+ +

Then run +

+
 
./configure --enable-static --disable-shared
+
+ +

to make a static build. +

+

The current gcc4-core package is buggy and needs this flag to build +shared libraries: +

+
 
./configure --enable-shared --disable-static --extra-cflags=-fno-reorder-functions
+
+ +

If you want to build FFmpeg with additional libraries, download Cygwin +"Devel" packages for Ogg and Vorbis from any Cygwin packages repository: +

 
libogg-devel, libvorbis-devel
+
+ +

These library packages are only available from Cygwin Ports +(http://sourceware.org/cygwinports/) : +

+
 
yasm, libSDL-devel, libdirac-devel, libfaac-devel, libgsm-devel,
+libmp3lame-devel, libschroedinger1.0-devel, speex-devel, libtheora-devel,
+libxvidcore-devel
+
+ +

The recommendation for libnut and x264 is to build them from source by +yourself, as they evolve too quickly for Cygwin Ports to be up to date. +

+

Cygwin 1.7.x has IPv6 support. You can add IPv6 to Cygwin 1.5.x by means +of the libgetaddrinfo-devel package, available at Cygwin Ports. +

+ +

3.4.5 Crosscompilation for Windows under Cygwin

+ +

With Cygwin you can create Windows binaries that do not need the cygwin1.dll. +

+

Just install your Cygwin as explained before, plus these additional +"Devel" packages: +

 
gcc-mingw-core, mingw-runtime, mingw-zlib
+
+ +

and add some special flags to your configure invocation. +

+

For a static build run +

 
./configure --target-os=mingw32 --enable-memalign-hack --enable-static --disable-shared --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
+
+ +

and for a build with shared libraries +

 
./configure --target-os=mingw32 --enable-memalign-hack --enable-shared --disable-static --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin
+
+ +
+

+ + This document was generated by Kyle Schwarz on May 18, 2011 using texi2html 1.82. + +
+ +

+ + diff --git a/ffmpeg 0.7/doc/libavfilter.html b/ffmpeg 0.7/doc/libavfilter.html new file mode 100644 index 000000000..f443bd1bc --- /dev/null +++ b/ffmpeg 0.7/doc/libavfilter.html @@ -0,0 +1,2051 @@ + + + + +Libavfilter Documentation + + + + + + + + + + + + + + + +

Libavfilter Documentation

+ + +

Table of Contents

+
+ + +
+ +
+ +

1. Introduction

+ +

Libavfilter is the filtering API of FFmpeg. It is the substitute of the +now deprecated ’vhooks’ and started as a Google Summer of Code project. +

+

Integrating libavfilter into the main FFmpeg repository is a work in +progress. If you wish to try the unfinished development code of +libavfilter then check it out from the libavfilter repository into +some directory of your choice by: +

+
 
   svn checkout svn://svn.ffmpeg.org/soc/libavfilter
+
+ +

And then read the README file in the top directory to learn how to +integrate it into ffmpeg and ffplay. +

+

But note that there may still be serious bugs in the code and its API +and ABI should not be considered stable yet! +

+ +

2. Tutorial

+ +

In libavfilter, it is possible for filters to have multiple inputs and +multiple outputs. +To illustrate the sorts of things that are possible, we can +use a complex filter graph. For example, the following one: +

+
 
input --> split --> fifo -----------------------> overlay --> output
+            |                                        ^
+            |                                        |
+            +------> fifo --> crop --> vflip --------+
+
+ +

splits the stream in two streams, sends one stream through the crop filter +and the vflip filter before merging it back with the other stream by +overlaying it on top. You can use the following command to achieve this: +

+
 
./ffmpeg -i in.avi -s 240x320 -vf "[in] split [T1], fifo, [T2] overlay= 0:240 [out]; [T1] fifo, crop=0:0:-1:240, vflip [T2]
+
+ +

where input_video.avi has a vertical resolution of 480 pixels. The +result will be that in output the top half of the video is mirrored +onto the bottom half. +

+

Video filters are loaded using the -vf option passed to +ffmpeg or to ffplay. Filters in the same linear chain are separated by +commas. In our example, split, fifo, overlay are in one linear +chain, and fifo, crop, vflip are in another. The points where +the linear chains join are labeled by names enclosed in square +brackets. In our example, that is [T1] and [T2]. The magic +labels [in] and [out] are the points where video is input +and output. +

+

Some filters take in input a list of parameters: they are specified +after the filter name and an equal sign, and are separated each other +by a semicolon. +

+

There exist so-called source filters that do not have a video +input, and we expect in the future some sink filters that will +not have video output. +

+ +

3. graph2dot

+ +

The ‘graph2dot’ program included in the FFmpeg ‘tools’ +directory can be used to parse a filter graph description and issue a +corresponding textual representation in the dot language. +

+

Invoke the command: +

 
graph2dot -h
+
+ +

to see how to use ‘graph2dot’. +

+

You can then pass the dot description to the ‘dot’ program (from +the graphviz suite of programs) and obtain a graphical representation +of the filter graph. +

+

For example the sequence of commands: +

 
echo GRAPH_DESCRIPTION | \
+tools/graph2dot -o graph.tmp && \
+dot -Tpng graph.tmp -o graph.png && \
+display graph.png
+
+ +

can be used to create and display an image representing the graph +described by the GRAPH_DESCRIPTION string. +

+ +

4. Filtergraph description

+ +

A filtergraph is a directed graph of connected filters. It can contain +cycles, and there can be multiple links between a pair of +filters. Each link has one input pad on one side connecting it to one +filter from which it takes its input, and one output pad on the other +side connecting it to the one filter accepting its output. +

+

Each filter in a filtergraph is an instance of a filter class +registered in the application, which defines the features and the +number of input and output pads of the filter. +

+

A filter with no input pads is called a "source", a filter with no +output pads is called a "sink". +

+ +

4.1 Filtergraph syntax

+ +

A filtergraph can be represented using a textual representation, which +is recognized by the -vf and -af options of the ff* +tools, and by the av_parse_graph() function defined in +‘libavfilter/avfiltergraph’. +

+

A filterchain consists of a sequence of connected filters, each one +connected to the previous one in the sequence. A filterchain is +represented by a list of ","-separated filter descriptions. +

+

A filtergraph consists of a sequence of filterchains. A sequence of +filterchains is represented by a list of ";"-separated filterchain +descriptions. +

+

A filter is represented by a string of the form: +[in_link_1]...[in_link_N]filter_name=arguments[out_link_1]...[out_link_M] +

+

filter_name is the name of the filter class of which the +described filter is an instance of, and has to be the name of one of +the filter classes registered in the program. +The name of the filter class is optionally followed by a string +"=arguments". +

+

arguments is a string which contains the parameters used to +initialize the filter instance, and are described in the filter +descriptions below. +

+

The list of arguments can be quoted using the character "’" as initial +and ending mark, and the character ’\’ for escaping the characters +within the quoted text; otherwise the argument string is considered +terminated when the next special character (belonging to the set +"[]=;,") is encountered. +

+

The name and arguments of the filter are optionally preceded and +followed by a list of link labels. +A link label allows to name a link and associate it to a filter output +or input pad. The preceding labels in_link_1 +... in_link_N, are associated to the filter input pads, +the following labels out_link_1 ... out_link_M, are +associated to the output pads. +

+

When two link labels with the same name are found in the +filtergraph, a link between the corresponding input and output pad is +created. +

+

If an output pad is not labelled, it is linked by default to the first +unlabelled input pad of the next filter in the filterchain. +For example in the filterchain: +

 
nullsrc, split[L1], [L2]overlay, nullsink
+
+

the split filter instance has two output pads, and the overlay filter +instance two input pads. The first output pad of split is labelled +"L1", the first input pad of overlay is labelled "L2", and the second +output pad of split is linked to the second input pad of overlay, +which are both unlabelled. +

+

In a complete filterchain all the unlabelled filter input and output +pads must be connected. A filtergraph is considered valid if all the +filter input and output pads of all the filterchains are connected. +

+

Follows a BNF description for the filtergraph syntax: +

 
NAME             ::= sequence of alphanumeric characters and '_'
+LINKLABEL        ::= "[" NAME "]"
+LINKLABELS       ::= LINKLABEL [LINKLABELS]
+FILTER_ARGUMENTS ::= sequence of chars (eventually quoted)
+FILTER           ::= [LINKNAMES] NAME ["=" ARGUMENTS] [LINKNAMES]
+FILTERCHAIN      ::= FILTER [,FILTERCHAIN]
+FILTERGRAPH      ::= FILTERCHAIN [;FILTERGRAPH]
+
+ + + +

5. Audio Filters

+ +

When you configure your FFmpeg build, you can disable any of the +existing filters using –disable-filters. +The configure output will show the audio filters included in your +build. +

+

Below is a description of the currently available audio filters. +

+ +

5.1 anull

+ +

Pass the audio source unchanged to the output. +

+ + +

6. Audio Sources

+ +

Below is a description of the currently available audio sources. +

+ +

6.1 anullsrc

+ +

Null audio source, never return audio frames. It is mainly useful as a +template and to be employed in analysis / debugging tools. +

+

It accepts as optional parameter a string of the form +sample_rate:channel_layout. +

+

sample_rate specify the sample rate, and defaults to 44100. +

+

channel_layout specify the channel layout, and can be either an +integer or a string representing a channel layout. The default value +of channel_layout is 3, which corresponds to CH_LAYOUT_STEREO. +

+

Check the channel_layout_map definition in +‘libavcodec/audioconvert.c’ for the mapping between strings and +channel layout values. +

+

Follow some examples: +

 
#  set the sample rate to 48000 Hz and the channel layout to CH_LAYOUT_MONO.
+anullsrc=48000:4
+
+# same as
+anullsrc=48000:mono
+
+ + + +

7. Audio Sinks

+ +

Below is a description of the currently available audio sinks. +

+ +

7.1 anullsink

+ +

Null audio sink, do absolutely nothing with the input audio. It is +mainly useful as a template and to be employed in analysis / debugging +tools. +

+ + +

8. Video Filters

+ +

When you configure your FFmpeg build, you can disable any of the +existing filters using –disable-filters. +The configure output will show the video filters included in your +build. +

+

Below is a description of the currently available video filters. +

+ +

8.1 blackframe

+ +

Detect frames that are (almost) completely black. Can be useful to +detect chapter transitions or commercials. Output lines consist of +the frame number of the detected frame, the percentage of blackness, +the position in the file if known or -1 and the timestamp in seconds. +

+

In order to display the output lines, you need to set the loglevel at +least to the AV_LOG_INFO value. +

+

The filter accepts the syntax: +

 
blackframe[=amount:[threshold]]
+
+ +

amount is the percentage of the pixels that have to be below the +threshold, and defaults to 98. +

+

threshold is the threshold below which a pixel value is +considered black, and defaults to 32. +

+ +

8.2 copy

+ +

Copy the input source unchanged to the output. Mainly useful for +testing purposes. +

+ +

8.3 crop

+ +

Crop the input video to out_w:out_h:x:y. +

+

The parameters are expressions containing the following constants: +

+
+
E, PI, PHI
+

the corresponding mathematical approximated values for e +(euler number), pi (greek PI), PHI (golden ratio) +

+
+
x, y
+

the computed values for x and y. They are evaluated for +each new frame. +

+
+
in_w, in_h
+

the input width and heigth +

+
+
iw, ih
+

same as in_w and in_h +

+
+
out_w, out_h
+

the output (cropped) width and heigth +

+
+
ow, oh
+

same as out_w and out_h +

+
+
n
+

the number of input frame, starting from 0 +

+
+
pos
+

the position in the file of the input frame, NAN if unknown +

+
+
t
+

timestamp expressed in seconds, NAN if the input timestamp is unknown +

+
+
+ +

The out_w and out_h parameters specify the expressions for +the width and height of the output (cropped) video. They are +evaluated just at the configuration of the filter. +

+

The default value of out_w is "in_w", and the default value of +out_h is "in_h". +

+

The expression for out_w may depend on the value of out_h, +and the expression for out_h may depend on out_w, but they +cannot depend on x and y, as x and y are +evaluated after out_w and out_h. +

+

The x and y parameters specify the expressions for the +position of the top-left corner of the output (non-cropped) area. They +are evaluated for each frame. If the evaluated value is not valid, it +is approximated to the nearest valid value. +

+

The default value of x is "(in_w-out_w)/2", and the default +value for y is "(in_h-out_h)/2", which set the cropped area at +the center of the input image. +

+

The expression for x may depend on y, and the expression +for y may depend on x. +

+

Follow some examples: +

 
# crop the central input area with size 100x100
+crop=100:100
+
+# crop the central input area with size 2/3 of the input video
+"crop=2/3*in_w:2/3*in_h"
+
+# crop the input video central square
+crop=in_h
+
+# delimit the rectangle with the top-left corner placed at position
+# 100:100 and the right-bottom corner corresponding to the right-bottom
+# corner of the input image.
+crop=in_w-100:in_h-100:100:100
+
+# crop 10 pixels from the left and right borders, and 20 pixels from
+# the top and bottom borders
+"crop=in_w-2*10:in_h-2*20"
+
+# keep only the bottom right quarter of the input image
+"crop=in_w/2:in_h/2:in_w/2:in_h/2"
+
+# crop height for getting Greek harmony
+"crop=in_w:1/PHI*in_w"
+
+# trembling effect
+"crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(n/10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(n/7)"
+
+# erratic camera effect depending on timestamp
+"crop=in_w/2:in_h/2:(in_w-out_w)/2+((in_w-out_w)/2)*sin(t*10):(in_h-out_h)/2 +((in_h-out_h)/2)*sin(t*13)"
+
+# set x depending on the value of y
+"crop=in_w/2:in_h/2:y:10+10*sin(n/10)"
+
+ + +

8.4 cropdetect

+ +

Auto-detect crop size. +

+

Calculate necessary cropping parameters and prints the recommended +parameters through the logging system. The detected dimensions +correspond to the non-black area of the input video. +

+

It accepts the syntax: +

 
cropdetect[=limit[:round[:reset]]]
+
+ +
+
limit
+

Threshold, which can be optionally specified from nothing (0) to +everything (255), defaults to 24. +

+
+
round
+

Value which the width/height should be divisible by, defaults to +16. The offset is automatically adjusted to center the video. Use 2 to +get only even dimensions (needed for 4:2:2 video). 16 is best when +encoding to most video codecs. +

+
+
reset
+

Counter that determines after how many frames cropdetect will reset +the previously detected largest video area and start over to detect +the current optimal crop area. Defaults to 0. +

+

This can be useful when channel logos distort the video area. 0 +indicates never reset and return the largest area encountered during +playback. +

+
+ + +

8.5 drawbox

+ +

Draw a colored box on the input image. +

+

It accepts the syntax: +

 
drawbox=x:y:width:height:color
+
+ +
+
x, y
+

Specify the top left corner coordinates of the box. Default to 0. +

+
+
width, height
+

Specify the width and height of the box, if 0 they are interpreted as +the input width and height. Default to 0. +

+
+
color
+

Specify the color of the box to write, it can be the name of a color +(case insensitive match) or a 0xRRGGBB[AA] sequence. +

+
+ +

Follow some examples: +

 
# draw a black box around the edge of the input image
+drawbox
+
+# draw a box with color red and an opacity of 50%
+drawbox=10:20:200:60:red@0.5"
+
+ + +

8.6 drawtext

+ +

Draw text string or text from specified file on top of video using the +libfreetype library. +

+

To enable compilation of this filter you need to configure FFmpeg with +--enable-libfreetype. +

+

The filter also recognizes strftime() sequences in the provided text +and expands them accordingly. Check the documentation of strftime(). +

+

The filter accepts parameters as a list of key=value pairs, +separated by ":". +

+

The description of the accepted parameters follows. +

+
+
fontfile
+

The font file to be used for drawing text. Path must be included. +This parameter is mandatory. +

+
+
text
+

The text string to be drawn. The text must be a sequence of UTF-8 +encoded characters. +This parameter is mandatory if no file is specified with the parameter +textfile. +

+
+
textfile
+

A text file containing text to be drawn. The text must be a sequence +of UTF-8 encoded characters. +

+

This parameter is mandatory if no text string is specified with the +parameter text. +

+

If both text and textfile are specified, an error is thrown. +

+
+
x, y
+

The offsets where text will be drawn within the video frame. +Relative to the top/left border of the output image. +

+

The default value of x and y is 0. +

+
+
fontsize
+

The font size to be used for drawing text. +The default value of fontsize is 16. +

+
+
fontcolor
+

The color to be used for drawing fonts. +Either a string (e.g. "red") or in 0xRRGGBB[AA] format +(e.g. "0xff000033"), possibly followed by an alpha specifier. +The default value of fontcolor is "black". +

+
+
boxcolor
+

The color to be used for drawing box around text. +Either a string (e.g. "yellow") or in 0xRRGGBB[AA] format +(e.g. "0xff00ff"), possibly followed by an alpha specifier. +The default value of boxcolor is "white". +

+
+
box
+

Used to draw a box around text using background color. +Value should be either 1 (enable) or 0 (disable). +The default value of box is 0. +

+
+
shadowx, shadowy
+

The x and y offsets for the text shadow position with respect to the +position of the text. They can be either positive or negative +values. Default value for both is "0". +

+
+
shadowcolor
+

The color to be used for drawing a shadow behind the drawn text. It +can be a color name (e.g. "yellow") or a string in the 0xRRGGBB[AA] +form (e.g. "0xff00ff"), possibly followed by an alpha specifier. +The default value of shadowcolor is "black". +

+
+
ft_load_flags
+

Flags to be used for loading the fonts. +

+

The flags map the corresponding flags supported by libfreetype, and are +a combination of the following values: +

+
default
+
no_scale
+
no_hinting
+
render
+
no_bitmap
+
vertical_layout
+
force_autohint
+
crop_bitmap
+
pedantic
+
ignore_global_advance_width
+
no_recurse
+
ignore_transform
+
monochrome
+
linear_design
+
no_autohint
+
end table
+
+ +

Default value is "render". +

+

For more information consult the documentation for the FT_LOAD_* +libfreetype flags. +

+
+
tabsize
+

The size in number of spaces to use for rendering the tab. +Default value is 4. +

+
+ +

For example the command: +

 
drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text'"
+
+ +

will draw "Test Text" with font FreeSerif, using the default values +for the optional parameters. +

+

The command: +

 
drawtext="fontfile=/usr/share/fonts/truetype/freefont/FreeSerif.ttf: text='Test Text':\
+          x=100: y=50: fontsize=24: fontcolor=yellow@0.2: box=1: boxcolor=red@0.2"
+
+ +

will draw ’Test Text’ with font FreeSerif of size 24 at position x=100 +and y=50 (counting from the top-left corner of the screen), text is +yellow with a red box around it. Both the text and the box have an +opacity of 20%. +

+

Note that the double quotes are not necessary if spaces are not used +within the parameter list. +

+

For more information about libfreetype, check: +http://www.freetype.org/. +

+ +

8.7 fade

+ +

Apply fade-in/out effect to input video. +

+

It accepts the parameters: +type:start_frame:nb_frames +

+

type specifies if the effect type, can be either "in" for +fade-in, or "out" for a fade-out effect. +

+

start_frame specifies the number of the start frame for starting +to apply the fade effect. +

+

nb_frames specifies the number of frames for which the fade +effect has to last. At the end of the fade-in effect the output video +will have the same intensity as the input video, at the end of the +fade-out transition the output video will be completely black. +

+

A few usage examples follow, usable too as test scenarios. +

 
# fade in first 30 frames of video
+fade=in:0:30
+
+# fade out last 45 frames of a 200-frame video
+fade=out:155:45
+
+# fade in first 25 frames and fade out last 25 frames of a 1000-frame video
+fade=in:0:25, fade=out:975:25
+
+# make first 5 frames black, then fade in from frame 5-24
+fade=in:5:20
+
+ + +

8.8 fieldorder

+ +

Transform the field order of the input video. +

+

It accepts one parameter which specifies the required field order that +the input interlaced video will be transformed to. The parameter can +assume one of the following values: +

+
+
0 or bff
+

output bottom field first +

+
1 or tff
+

output top field first +

+
+ +

Default value is "tff". +

+

Transformation is achieved by shifting the picture content up or down +by one line, and filling the remaining line with appropriate picture content. +This method is consistent with most broadcast field order converters. +

+

If the input video is not flagged as being interlaced, or it is already +flagged as being of the required output field order then this filter does +not alter the incoming video. +

+

This filter is very useful when converting to or from PAL DV material, +which is bottom field first. +

+

For example: +

 
./ffmpeg -i in.vob -vf "fieldorder=bff" out.dv
+
+ + +

8.9 fifo

+ +

Buffer input images and send them when they are requested. +

+

This filter is mainly useful when auto-inserted by the libavfilter +framework. +

+

The filter does not take parameters. +

+ +

8.10 format

+ +

Convert the input video to one of the specified pixel formats. +Libavfilter will try to pick one that is supported for the input to +the next filter. +

+

The filter accepts a list of pixel format names, separated by ":", +for example "yuv420p:monow:rgb24". +

+

Some examples follow: +

 
# convert the input video to the format "yuv420p"
+format=yuv420p
+
+# convert the input video to any of the formats in the list
+format=yuv420p:yuv444p:yuv410p
+
+ +

+

+

8.11 frei0r

+ +

Apply a frei0r effect to the input video. +

+

To enable compilation of this filter you need to install the frei0r +header and configure FFmpeg with –enable-frei0r. +

+

The filter supports the syntax: +

 
filter_name[{:|=}param1:param2:...:paramN]
+
+ +

filter_name is the name to the frei0r effect to load. If the +environment variable FREI0R_PATH is defined, the frei0r effect +is searched in each one of the directories specified by the colon +separated list in FREIOR_PATH, otherwise in the standard frei0r +paths, which are in this order: ‘HOME/.frei0r-1/lib/’, +‘/usr/local/lib/frei0r-1/’, ‘/usr/lib/frei0r-1/’. +

+

param1, param2, ... , paramN specify the parameters +for the frei0r effect. +

+

A frei0r effect parameter can be a boolean (whose values are specified +with "y" and "n"), a double, a color (specified by the syntax +R/G/B, R, G, and B being float +numbers from 0.0 to 1.0) or by an av_parse_color() color +description), a position (specified by the syntax X/Y, +X and Y being float numbers) and a string. +

+

The number and kind of parameters depend on the loaded effect. If an +effect parameter is not specified the default value is set. +

+

Some examples follow: +

 
# apply the distort0r effect, set the first two double parameters
+frei0r=distort0r:0.5:0.01
+
+# apply the colordistance effect, takes a color as first parameter
+frei0r=colordistance:0.2/0.3/0.4
+frei0r=colordistance:violet
+frei0r=colordistance:0x112233
+
+# apply the perspective effect, specify the top left and top right
+# image positions
+frei0r=perspective:0.2/0.2:0.8/0.2
+
+ +

For more information see: +http://piksel.org/frei0r +

+ +

8.12 gradfun

+ +

Fix the banding artifacts that are sometimes introduced into nearly flat +regions by truncation to 8bit colordepth. +Interpolate the gradients that should go where the bands are, and +dither them. +

+

This filter is designed for playback only. Do not use it prior to +lossy compression, because compression tends to lose the dither and +bring back the bands. +

+

The filter takes two optional parameters, separated by ’:’: +strength:radius +

+

strength is the maximum amount by which the filter will change +any one pixel. Also the threshold for detecting nearly flat +regions. Acceptable values range from .51 to 255, default value is +1.2, out-of-range values will be clipped to the valid range. +

+

radius is the neighborhood to fit the gradient to. A larger +radius makes for smoother gradients, but also prevents the filter from +modifying the pixels near detailed regions. Acceptable values are +8-32, default value is 16, out-of-range values will be clipped to the +valid range. +

+
 
# default parameters
+gradfun=1.2:16
+
+# omitting radius
+gradfun=1.2
+
+ + +

8.13 hflip

+ +

Flip the input video horizontally. +

+

For example to horizontally flip the video in input with +‘ffmpeg’: +

 
ffmpeg -i in.avi -vf "hflip" out.avi
+
+ + +

8.14 hqdn3d

+ +

High precision/quality 3d denoise filter. This filter aims to reduce +image noise producing smooth images and making still images really +still. It should enhance compressibility. +

+

It accepts the following optional parameters: +luma_spatial:chroma_spatial:luma_tmp:chroma_tmp +

+
+
luma_spatial
+

a non-negative float number which specifies spatial luma strength, +defaults to 4.0 +

+
+
chroma_spatial
+

a non-negative float number which specifies spatial chroma strength, +defaults to 3.0*luma_spatial/4.0 +

+
+
luma_tmp
+

a float number which specifies luma temporal strength, defaults to +6.0*luma_spatial/4.0 +

+
+
chroma_tmp
+

a float number which specifies chroma temporal strength, defaults to +luma_tmp*chroma_spatial/luma_spatial +

+
+ + +

8.15 mp

+ +

Apply an MPlayer filter to the input video. +

+

This filter provides a wrapper around most of the filters of +MPlayer/MEncoder. +

+

This wrapper is considered experimental. Some of the wrapped filters +may not work properly and we may drop support for them, as they will +be implemented natively into FFmpeg. Thus you should avoid +depending on them when writing portable scripts. +

+

The filters accepts the parameters: +filter_name[:=]filter_params +

+

filter_name is the name of a supported MPlayer filter, +filter_params is a string containing the parameters accepted by +the named filter. +

+

The list of the currently supported filters follows: +

+
2xsai
+
blackframe
+
boxblur
+
cropdetect
+
decimate
+
delogo
+
denoise3d
+
detc
+
dint
+
divtc
+
down3dright
+
dsize
+
eq2
+
eq
+
field
+
fil
+
fixpts
+
framestep
+
fspp
+
geq
+
gradfun
+
harddup
+
hqdn3d
+
hue
+
il
+
ilpack
+
ivtc
+
kerndeint
+
mcdeint
+
mirror
+
noise
+
ow
+
palette
+
perspective
+
phase
+
pp7
+
pullup
+
qp
+
rectangle
+
remove_logo
+
rgbtest
+
rotate
+
sab
+
screenshot
+
smartblur
+
softpulldown
+
softskip
+
spp
+
swapuv
+
telecine
+
test
+
tile
+
tinterlace
+
unsharp
+
uspp
+
yuvcsp
+
yvu9
+
+ +

The parameter syntax and behavior for the listed filters are the same +of the corresponding MPlayer filters. For detailed instructions check +the "VIDEO FILTERS" section in the MPlayer manual. +

+

Some examples follow: +

 
# remove a logo by interpolating the surrounding pixels
+mp=delogo=200:200:80:20:1
+
+# adjust gamma, brightness, contrast
+mp=eq2=1.0:2:0.5
+
+# tweak hue and saturation
+mp=hue=100:-10
+
+ +

See also mplayer(1), http://www.mplayerhq.hu/. +

+ +

8.16 noformat

+ +

Force libavfilter not to use any of the specified pixel formats for the +input to the next filter. +

+

The filter accepts a list of pixel format names, separated by ":", +for example "yuv420p:monow:rgb24". +

+

Some examples follow: +

 
# force libavfilter to use a format different from "yuv420p" for the
+# input to the vflip filter
+noformat=yuv420p,vflip
+
+# convert the input video to any of the formats not contained in the list
+noformat=yuv420p:yuv444p:yuv410p
+
+ + +

8.17 null

+ +

Pass the video source unchanged to the output. +

+ +

8.18 ocv

+ +

Apply video transform using libopencv. +

+

To enable this filter install libopencv library and headers and +configure FFmpeg with –enable-libopencv. +

+

The filter takes the parameters: filter_name{:=}filter_params. +

+

filter_name is the name of the libopencv filter to apply. +

+

filter_params specifies the parameters to pass to the libopencv +filter. If not specified the default values are assumed. +

+

Refer to the official libopencv documentation for more precise +informations: +http://opencv.willowgarage.com/documentation/c/image_filtering.html +

+

Follows the list of supported libopencv filters. +

+

+

+

8.18.1 dilate

+ +

Dilate an image by using a specific structuring element. +This filter corresponds to the libopencv function cvDilate. +

+

It accepts the parameters: struct_el:nb_iterations. +

+

struct_el represents a structuring element, and has the syntax: +colsxrows+anchor_xxanchor_y/shape +

+

cols and rows represent the number of colums and rows of +the structuring element, anchor_x and anchor_y the anchor +point, and shape the shape for the structuring element, and +can be one of the values "rect", "cross", "ellipse", "custom". +

+

If the value for shape is "custom", it must be followed by a +string of the form "=filename". The file with name +filename is assumed to represent a binary image, with each +printable character corresponding to a bright pixel. When a custom +shape is used, cols and rows are ignored, the number +or columns and rows of the read file are assumed instead. +

+

The default value for struct_el is "3x3+0x0/rect". +

+

nb_iterations specifies the number of times the transform is +applied to the image, and defaults to 1. +

+

Follow some example: +

 
# use the default values
+ocv=dilate
+
+# dilate using a structuring element with a 5x5 cross, iterate two times
+ocv=dilate=5x5+2x2/cross:2
+
+# read the shape from the file diamond.shape, iterate two times
+# the file diamond.shape may contain a pattern of characters like this:
+#   *
+#  ***
+# *****
+#  ***
+#   *
+# the specified cols and rows are ignored (but not the anchor point coordinates)
+ocv=0x0+2x2/custom=diamond.shape:2
+
+ + +

8.18.2 erode

+ +

Erode an image by using a specific structuring element. +This filter corresponds to the libopencv function cvErode. +

+

The filter accepts the parameters: struct_el:nb_iterations, +with the same meaning and use of those of the dilate filter +(see dilate). +

+ +

8.18.3 smooth

+ +

Smooth the input video. +

+

The filter takes the following parameters: +type:param1:param2:param3:param4. +

+

type is the type of smooth filter to apply, and can be one of +the following values: "blur", "blur_no_scale", "median", "gaussian", +"bilateral". The default value is "gaussian". +

+

param1, param2, param3, and param4 are +parameters whose meanings depend on smooth type. param1 and +param2 accept integer positive values or 0, param3 and +param4 accept float values. +

+

The default value for param1 is 3, the default value for the +other parameters is 0. +

+

These parameters correspond to the parameters assigned to the +libopencv function cvSmooth. +

+ +

8.19 overlay

+ +

Overlay one video on top of another. +

+

It takes two inputs and one output, the first input is the "main" +video on which the second input is overlayed. +

+

It accepts the parameters: x:y. +

+

x is the x coordinate of the overlayed video on the main video, +y is the y coordinate. The parameters are expressions containing +the following parameters: +

+
+
main_w, main_h
+

main input width and height +

+
+
W, H
+

same as main_w and main_h +

+
+
overlay_w, overlay_h
+

overlay input width and height +

+
+
w, h
+

same as overlay_w and overlay_h +

+
+ +

Be aware that frames are taken from each input video in timestamp +order, hence, if their initial timestamps differ, it is a a good idea +to pass the two inputs through a setpts=PTS-STARTPTS filter to +have them begin in the same zero timestamp, as it does the example for +the movie filter. +

+

Follow some examples: +

 
# draw the overlay at 10 pixels from the bottom right
+# corner of the main video.
+overlay=main_w-overlay_w-10:main_h-overlay_h-10
+
+# insert a transparent PNG logo in the bottom left corner of the input
+movie=logo.png [logo];
+[in][logo] overlay=10:main_h-overlay_h-10 [out]
+
+# insert 2 different transparent PNG logos (second logo on bottom
+# right corner):
+movie=logo1.png [logo1];
+movie=logo2.png [logo2];
+[in][logo1]       overlay=10:H-h-10 [in+logo1];
+[in+logo1][logo2] overlay=W-w-10:H-h-10 [out]
+
+# add a transparent color layer on top of the main video,
+# WxH specifies the size of the main input to the overlay filter
+color=red.3:WxH [over]; [in][over] overlay [out]
+
+ +

You can chain togheter more overlays but the efficiency of such +approach is yet to be tested. +

+ +

8.20 pad

+ +

Add paddings to the input image, and places the original input at the +given coordinates x, y. +

+

It accepts the following parameters: +width:height:x:y:color. +

+

The parameters width, height, x, and y are +expressions containing the following constants: +

+
+
E, PI, PHI
+

the corresponding mathematical approximated values for e +(euler number), pi (greek PI), phi (golden ratio) +

+
+
in_w, in_h
+

the input video width and heigth +

+
+
iw, ih
+

same as in_w and in_h +

+
+
out_w, out_h
+

the output width and heigth, that is the size of the padded area as +specified by the width and height expressions +

+
+
ow, oh
+

same as out_w and out_h +

+
+
x, y
+

x and y offsets as specified by the x and y +expressions, or NAN if not yet specified +

+
+
a
+

input display aspect ratio, same as iw / ih +

+
+
hsub, vsub
+

horizontal and vertical chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+ +

Follows the description of the accepted parameters. +

+
+
width, height
+
+

Specify the size of the output image with the paddings added. If the +value for width or height is 0, the corresponding input size +is used for the output. +

+

The width expression can reference the value set by the +height expression, and viceversa. +

+

The default value of width and height is 0. +

+
+
x, y
+
+

Specify the offsets where to place the input image in the padded area +with respect to the top/left border of the output image. +

+

The x expression can reference the value set by the y +expression, and viceversa. +

+

The default value of x and y is 0. +

+
+
color
+
+

Specify the color of the padded area, it can be the name of a color +(case insensitive match) or a 0xRRGGBB[AA] sequence. +

+

The default value of color is "black". +

+
+
+ +

Some examples follow: +

+
 
# Add paddings with color "violet" to the input video. Output video
+# size is 640x480, the top-left corner of the input video is placed at
+# column 0, row 40.
+pad=640:480:0:40:violet
+
+# pad the input to get an output with dimensions increased bt 3/2,
+# and put the input video at the center of the padded area
+pad="3/2*iw:3/2*ih:(ow-iw)/2:(oh-ih)/2"
+
+# pad the input to get a squared output with size equal to the maximum
+# value between the input width and height, and put the input video at
+# the center of the padded area
+pad="max(iw\,ih):ow:(ow-iw)/2:(oh-ih)/2"
+
+# pad the input to get a final w/h ratio of 16:9
+pad="ih*16/9:ih:(ow-iw)/2:(oh-ih)/2"
+
+# double output size and put the input video in the bottom-right
+# corner of the output padded area
+pad="2*iw:2*ih:ow-iw:oh-ih"
+
+ + +

8.21 pixdesctest

+ +

Pixel format descriptor test filter, mainly useful for internal +testing. The output video should be equal to the input video. +

+

For example: +

 
format=monow, pixdesctest
+
+ +

can be used to test the monowhite pixel format descriptor definition. +

+ +

8.22 scale

+ +

Scale the input video to width:height and/or convert the image format. +

+

The parameters width and height are expressions containing +the following constants: +

+
+
E, PI, PHI
+

the corresponding mathematical approximated values for e +(euler number), pi (greek PI), phi (golden ratio) +

+
+
in_w, in_h
+

the input width and heigth +

+
+
iw, ih
+

same as in_w and in_h +

+
+
out_w, out_h
+

the output (cropped) width and heigth +

+
+
ow, oh
+

same as out_w and out_h +

+
+
a
+

input display aspect ratio, same as iw / ih +

+
+
hsub, vsub
+

horizontal and vertical chroma subsample values. For example for the +pixel format "yuv422p" hsub is 2 and vsub is 1. +

+
+ +

If the input image format is different from the format requested by +the next filter, the scale filter will convert the input to the +requested format. +

+

If the value for width or height is 0, the respective input +size is used for the output. +

+

If the value for width or height is -1, the scale filter will +use, for the respective output size, a value that maintains the aspect +ratio of the input image. +

+

The default value of width and height is 0. +

+

Some examples follow: +

 
# scale the input video to a size of 200x100.
+scale=200:100
+
+# scale the input to 2x
+scale=2*iw:2*ih
+# the above is the same as
+scale=2*in_w:2*in_h
+
+# scale the input to half size
+scale=iw/2:ih/2
+
+# increase the width, and set the height to the same size
+scale=3/2*iw:ow
+
+# seek for Greek harmony
+scale=iw:1/PHI*iw
+scale=ih*PHI:ih
+
+# increase the height, and set the width to 3/2 of the height
+scale=3/2*oh:3/5*ih
+
+# increase the size, but make the size a multiple of the chroma
+scale="trunc(3/2*iw/hsub)*hsub:trunc(3/2*ih/vsub)*vsub"
+
+# increase the width to a maximum of 500 pixels, keep the same input aspect ratio
+scale='min(500\, iw*3/2):-1'
+
+ +

+

+

8.23 setdar

+ +

Set the Display Aspect Ratio for the filter output video. +

+

This is done by changing the specified Sample (aka Pixel) Aspect +Ratio, according to the following equation: +DAR = HORIZONTAL_RESOLUTION / VERTICAL_RESOLUTION * SAR +

+

Keep in mind that this filter does not modify the pixel dimensions of +the video frame. Also the display aspect ratio set by this filter may +be changed by later filters in the filterchain, e.g. in case of +scaling or if another "setdar" or a "setsar" filter is applied. +

+

The filter accepts a parameter string which represents the wanted +display aspect ratio. +The parameter can be a floating point number string, or an expression +of the form num:den, where num and den are the +numerator and denominator of the aspect ratio. +If the parameter is not specified, it is assumed the value "0:1". +

+

For example to change the display aspect ratio to 16:9, specify: +

 
setdar=16:9
+# the above is equivalent to
+setdar=1.77777
+
+ +

See also the "setsar" filter documentation (see setsar). +

+ +

8.24 setpts

+ +

Change the PTS (presentation timestamp) of the input video frames. +

+

Accept in input an expression evaluated through the eval API, which +can contain the following constants: +

+
+
PTS
+

the presentation timestamp in input +

+
+
PI
+

Greek PI +

+
+
PHI
+

golden ratio +

+
+
E
+

Euler number +

+
+
N
+

the count of the input frame, starting from 0. +

+
+
STARTPTS
+

the PTS of the first video frame +

+
+
INTERLACED
+

tell if the current frame is interlaced +

+
+
POS
+

original position in the file of the frame, or undefined if undefined +for the current frame +

+
+
PREV_INPTS
+

previous input PTS +

+
+
PREV_OUTPTS
+

previous output PTS +

+
+
+ +

Some examples follow: +

+
 
# start counting PTS from zero
+setpts=PTS-STARTPTS
+
+# fast motion
+setpts=0.5*PTS
+
+# slow motion
+setpts=2.0*PTS
+
+# fixed rate 25 fps
+setpts=N/(25*TB)
+
+# fixed rate 25 fps with some jitter
+setpts='1/(25*TB) * (N + 0.05 * sin(N*2*PI/25))'
+
+ +

+

+

8.25 setsar

+ +

Set the Sample (aka Pixel) Aspect Ratio for the filter output video. +

+

Note that as a consequence of the application of this filter, the +output display aspect ratio will change according to the following +equation: +DAR = HORIZONTAL_RESOLUTION / VERTICAL_RESOLUTION * SAR +

+

Keep in mind that the sample aspect ratio set by this filter may be +changed by later filters in the filterchain, e.g. if another "setsar" +or a "setdar" filter is applied. +

+

The filter accepts a parameter string which represents the wanted +sample aspect ratio. +The parameter can be a floating point number string, or an expression +of the form num:den, where num and den are the +numerator and denominator of the aspect ratio. +If the parameter is not specified, it is assumed the value "0:1". +

+

For example to change the sample aspect ratio to 10:11, specify: +

 
setsar=10:11
+
+ + +

8.26 settb

+ +

Set the timebase to use for the output frames timestamps. +It is mainly useful for testing timebase configuration. +

+

It accepts in input an arithmetic expression representing a rational. +The expression can contain the constants "PI", "E", "PHI", "AVTB" (the +default timebase), and "intb" (the input timebase). +

+

The default value for the input is "intb". +

+

Follow some examples. +

+
 
# set the timebase to 1/25
+settb=1/25
+
+# set the timebase to 1/10
+settb=0.1
+
+#set the timebase to 1001/1000
+settb=1+0.001
+
+#set the timebase to 2*intb
+settb=2*intb
+
+#set the default timebase value
+settb=AVTB
+
+ + +

8.27 showinfo

+ +

Show a line containing various information for each input video frame. +The input video is not modified. +

+

The shown line contains a sequence of key/value pairs of the form +key:value. +

+

A description of each shown parameter follows: +

+
+
n
+

sequential number of the input frame, starting from 0 +

+
+
pts
+

Presentation TimeStamp of the input frame, expressed as a number of +time base units. The time base unit depends on the filter input pad. +

+
+
pts_time
+

Presentation TimeStamp of the input frame, expressed as a number of +seconds +

+
+
pos
+

position of the frame in the input stream, -1 if this information in +unavailable and/or meanigless (for example in case of synthetic video) +

+
+
fmt
+

pixel format name +

+
+
sar
+

sample aspect ratio of the input frame, expressed in the form +num/den +

+
+
s
+

size of the input frame, expressed in the form +widthxheight +

+
+
i
+

interlaced mode ("P" for "progressive", "T" for top field first, "B" +for bottom field first) +

+
+
iskey
+

1 if the frame is a key frame, 0 otherwise +

+
+
type
+

picture type of the input frame ("I" for an I-frame, "P" for a +P-frame, "B" for a B-frame, "?" for unknown type). +Check also the documentation of the AVPictureType enum and of +the av_get_picture_type_char function defined in +‘libavutil/avutil.h’. +

+
+
checksum
+

Adler-32 checksum of all the planes of the input frame +

+
+
plane_checksum
+

Adler-32 checksum of each plane of the input frame, expressed in the form +"[c0 c1 c2 c3]" +

+
+ + +

8.28 slicify

+ +

Pass the images of input video on to next video filter as multiple +slices. +

+
 
./ffmpeg -i in.avi -vf "slicify=32" out.avi
+
+ +

The filter accepts the slice height as parameter. If the parameter is +not specified it will use the default value of 16. +

+

Adding this in the beginning of filter chains should make filtering +faster due to better use of the memory cache. +

+ +

8.29 transpose

+ +

Transpose rows with columns in the input video and optionally flip it. +

+

It accepts a parameter representing an integer, which can assume the +values: +

+
+
0
+

Rotate by 90 degrees counterclockwise and vertically flip (default), that is: +

 
L.R     L.l
+. . ->  . .
+l.r     R.r
+
+ +
+
1
+

Rotate by 90 degrees clockwise, that is: +

 
L.R     l.L
+. . ->  . .
+l.r     r.R
+
+ +
+
2
+

Rotate by 90 degrees counterclockwise, that is: +

 
L.R     R.r
+. . ->  . .
+l.r     L.l
+
+ +
+
3
+

Rotate by 90 degrees clockwise and vertically flip, that is: +

 
L.R     r.R
+. . ->  . .
+l.r     l.L
+
+
+
+ + +

8.30 unsharp

+ +

Sharpen or blur the input video. +

+

It accepts the following parameters: +luma_msize_x:luma_msize_y:luma_amount:chroma_msize_x:chroma_msize_y:chroma_amount +

+

Negative values for the amount will blur the input video, while positive +values will sharpen. All parameters are optional and default to the +equivalent of the string ’5:5:1.0:0:0:0.0’. +

+
+
luma_msize_x
+

Set the luma matrix horizontal size. It can be an integer between 3 +and 13, default value is 5. +

+
+
luma_msize_y
+

Set the luma matrix vertical size. It can be an integer between 3 +and 13, default value is 5. +

+
+
luma_amount
+

Set the luma effect strength. It can be a float number between -2.0 +and 5.0, default value is 1.0. +

+
+
chroma_msize_x
+

Set the chroma matrix horizontal size. It can be an integer between 3 +and 13, default value is 0. +

+
+
chroma_msize_y
+

Set the chroma matrix vertical size. It can be an integer between 3 +and 13, default value is 0. +

+
+
luma_amount
+

Set the chroma effect strength. It can be a float number between -2.0 +and 5.0, default value is 0.0. +

+
+
+ +
 
# Strong luma sharpen effect parameters
+unsharp=7:7:2.5
+
+# Strong blur of both luma and chroma parameters
+unsharp=7:7:-2:7:7:-2
+
+# Use the default values with ffmpeg
+./ffmpeg -i in.avi -vf "unsharp" out.mp4
+
+ + +

8.31 vflip

+ +

Flip the input video vertically. +

+
 
./ffmpeg -i in.avi -vf "vflip" out.avi
+
+ + +

8.32 yadif

+ +

Deinterlace the input video ("yadif" means "yet another deinterlacing +filter"). +

+

It accepts the optional parameters: mode:parity. +

+

mode specifies the interlacing mode to adopt, accepts one of the +following values: +

+
+
0
+

output 1 frame for each frame +

+
1
+

output 1 frame for each field +

+
2
+

like 0 but skips spatial interlacing check +

+
3
+

like 1 but skips spatial interlacing check +

+
+ +

Default value is 0. +

+

parity specifies the picture field parity assumed for the input +interlaced video, accepts one of the following values: +

+
+
0
+

assume bottom field first +

+
1
+

assume top field first +

+
-1
+

enable automatic detection +

+
+ +

Default value is -1. +If interlacing is unknown or decoder does not export this information, +top field first will be assumed. +

+ + +

9. Video Sources

+ +

Below is a description of the currently available video sources. +

+ +

9.1 buffer

+ +

Buffer video frames, and make them available to the filter chain. +

+

This source is mainly intended for a programmatic use, in particular +through the interface defined in ‘libavfilter/vsrc_buffer.h’. +

+

It accepts the following parameters: +width:height:pix_fmt_string:timebase_num:timebase_den:sample_aspect_ratio_num:sample_aspect_ratio.den +

+

All the parameters need to be explicitely defined. +

+

Follows the list of the accepted parameters. +

+
+
width, height
+

Specify the width and height of the buffered video frames. +

+
+
pix_fmt_string
+

A string representing the pixel format of the buffered video frames. +It may be a number corresponding to a pixel format, or a pixel format +name. +

+
+
timebase_num, timebase_den
+

Specify numerator and denomitor of the timebase assumed by the +timestamps of the buffered frames. +

+
+
sample_aspect_ratio.num, sample_aspect_ratio.den
+

Specify numerator and denominator of the sample aspect ratio assumed +by the video frames. +

+
+ +

For example: +

 
buffer=320:240:yuv410p:1:24:1:1
+
+ +

will instruct the source to accept video frames with size 320x240 and +with format "yuv410p", assuming 1/24 as the timestamps timebase and +square pixels (1:1 sample aspect ratio). +Since the pixel format with name "yuv410p" corresponds to the number 6 +(check the enum PixelFormat definition in ‘libavutil/pixfmt.h’), +this example corresponds to: +

 
buffer=320:240:6:1:24
+
+ + +

9.2 color

+ +

Provide an uniformly colored input. +

+

It accepts the following parameters: +color:frame_size:frame_rate +

+

Follows the description of the accepted parameters. +

+
+
color
+

Specify the color of the source. It can be the name of a color (case +insensitive match) or a 0xRRGGBB[AA] sequence, possibly followed by an +alpha specifier. The default value is "black". +

+
+
frame_size
+

Specify the size of the sourced video, it may be a string of the form +widthxheigth, or the name of a size abbreviation. The +default value is "320x240". +

+
+
frame_rate
+

Specify the frame rate of the sourced video, as the number of frames +generated per second. It has to be a string in the format +frame_rate_num/frame_rate_den, an integer number, a float +number or a valid video frame rate abbreviation. The default value is +"25". +

+
+
+ +

For example the following graph description will generate a red source +with an opacity of 0.2, with size "qcif" and a frame rate of 10 +frames per second, which will be overlayed over the source connected +to the pad with identifier "in". +

+
 
"color=red@0.2:qcif:10 [color]; [in][color] overlay [out]"
+
+ + +

9.3 movie

+ +

Read a video stream from a movie container. +

+

It accepts the syntax: movie_name[:options] where +movie_name is the name of the resource to read (not necessarily +a file but also a device or a stream accessed through some protocol), +and options is an optional sequence of key=value +pairs, separated by ":". +

+

The description of the accepted options follows. +

+
+
format_name, f
+

Specifies the format assumed for the movie to read, and can be either +the name of a container or an input device. If not specified the +format is guessed from movie_name or by probing. +

+
+
seek_point, sp
+

Specifies the seek point in seconds, the frames will be output +starting from this seek point, the parameter is evaluated with +av_strtod so the numerical value may be suffixed by an IS +postfix. Default value is "0". +

+
+
stream_index, si
+

Specifies the index of the video stream to read. If the value is -1, +the best suited video stream will be automatically selected. Default +value is "-1". +

+
+
+ +

This filter allows to overlay a second video on top of main input of +a filtergraph as shown in this graph: +

 
input -----------> deltapts0 --> overlay --> output
+                                    ^
+                                    |
+movie --> scale--> deltapts1 -------+
+
+ +

Some examples follow: +

 
# skip 3.2 seconds from the start of the avi file in.avi, and overlay it
+# on top of the input labelled as "in".
+movie=in.avi:seek_point=3.2, scale=180:-1, setpts=PTS-STARTPTS [movie];
+[in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
+
+# read from a video4linux2 device, and overlay it on top of the input
+# labelled as "in"
+movie=/dev/video0:f=video4linux2, scale=180:-1, setpts=PTS-STARTPTS [movie];
+[in] setpts=PTS-STARTPTS, [movie] overlay=16:16 [out]
+
+
+ + +

9.4 nullsrc

+ +

Null video source, never return images. It is mainly useful as a +template and to be employed in analysis / debugging tools. +

+

It accepts as optional parameter a string of the form +width:height:timebase. +

+

width and height specify the size of the configured +source. The default values of width and height are +respectively 352 and 288 (corresponding to the CIF size format). +

+

timebase specifies an arithmetic expression representing a +timebase. The expression can contain the constants "PI", "E", "PHI", +"AVTB" (the default timebase), and defaults to the value "AVTB". +

+ +

9.5 frei0r_src

+ +

Provide a frei0r source. +

+

To enable compilation of this filter you need to install the frei0r +header and configure FFmpeg with –enable-frei0r. +

+

The source supports the syntax: +

 
size:rate:src_name[{=|:}param1:param2:...:paramN]
+
+ +

size is the size of the video to generate, may be a string of the +form widthxheight or a frame size abbreviation. +rate is the rate of the video to generate, may be a string of +the form num/den or a frame rate abbreviation. +src_name is the name to the frei0r source to load. For more +information regarding frei0r and how to set the parameters read the +section "frei0r" (see frei0r) in the description of the video +filters. +

+

Some examples follow: +

 
# generate a frei0r partik0l source with size 200x200 and framerate 10
+# which is overlayed on the overlay filter main input
+frei0r_src=200x200:10:partik0l=1234 [overlay]; [in][overlay] overlay
+
+ + + +

10. Video Sinks

+ +

Below is a description of the currently available video sinks. +

+ +

10.1 nullsink

+ +

Null video sink, do absolutely nothing with the input video. It is +mainly useful as a template and to be employed in analysis / debugging +tools. +

+ + +
+

+ + This document was generated by Kyle Schwarz on May 18, 2011 using texi2html 1.82. + +
+ +

+ + diff --git a/ffmpeg 0.7/include/libavcodec/avcodec.h b/ffmpeg 0.7/include/libavcodec/avcodec.h new file mode 100644 index 000000000..d1a5e6655 --- /dev/null +++ b/ffmpeg 0.7/include/libavcodec/avcodec.h @@ -0,0 +1,4240 @@ +/* + * copyright (c) 2001 Fabrice Bellard + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_AVCODEC_H +#define AVCODEC_AVCODEC_H + +/** + * @file + * external API header + */ + +#include +#include "libavutil/samplefmt.h" +#include "libavutil/avutil.h" +#include "libavutil/cpu.h" + +#include "libavcodec/version.h" + +/** + * Identify the syntax and semantics of the bitstream. + * The principle is roughly: + * Two decoders with the same ID can decode the same streams. + * Two encoders with the same ID can encode compatible streams. + * There may be slight deviations from the principle due to implementation + * details. + * + * If you add a codec ID to this list, add it so that + * 1. no value of a existing codec ID changes (that would break ABI), + * 2. it is as close as possible to similar codecs. + */ +enum CodecID { + CODEC_ID_NONE, + + /* video codecs */ + CODEC_ID_MPEG1VIDEO, + CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding + CODEC_ID_MPEG2VIDEO_XVMC, + CODEC_ID_H261, + CODEC_ID_H263, + CODEC_ID_RV10, + CODEC_ID_RV20, + CODEC_ID_MJPEG, + CODEC_ID_MJPEGB, + CODEC_ID_LJPEG, + CODEC_ID_SP5X, + CODEC_ID_JPEGLS, + CODEC_ID_MPEG4, + CODEC_ID_RAWVIDEO, + CODEC_ID_MSMPEG4V1, + CODEC_ID_MSMPEG4V2, + CODEC_ID_MSMPEG4V3, + CODEC_ID_WMV1, + CODEC_ID_WMV2, + CODEC_ID_H263P, + CODEC_ID_H263I, + CODEC_ID_FLV1, + CODEC_ID_SVQ1, + CODEC_ID_SVQ3, + CODEC_ID_DVVIDEO, + CODEC_ID_HUFFYUV, + CODEC_ID_CYUV, + CODEC_ID_H264, + CODEC_ID_INDEO3, + CODEC_ID_VP3, + CODEC_ID_THEORA, + CODEC_ID_ASV1, + CODEC_ID_ASV2, + CODEC_ID_FFV1, + CODEC_ID_4XM, + CODEC_ID_VCR1, + CODEC_ID_CLJR, + CODEC_ID_MDEC, + CODEC_ID_ROQ, + CODEC_ID_INTERPLAY_VIDEO, + CODEC_ID_XAN_WC3, + CODEC_ID_XAN_WC4, + CODEC_ID_RPZA, + CODEC_ID_CINEPAK, + CODEC_ID_WS_VQA, + CODEC_ID_MSRLE, + CODEC_ID_MSVIDEO1, + CODEC_ID_IDCIN, + CODEC_ID_8BPS, + CODEC_ID_SMC, + CODEC_ID_FLIC, + CODEC_ID_TRUEMOTION1, + CODEC_ID_VMDVIDEO, + CODEC_ID_MSZH, + CODEC_ID_ZLIB, + CODEC_ID_QTRLE, + CODEC_ID_SNOW, + CODEC_ID_TSCC, + CODEC_ID_ULTI, + CODEC_ID_QDRAW, + CODEC_ID_VIXL, + CODEC_ID_QPEG, + CODEC_ID_PNG, + CODEC_ID_PPM, + CODEC_ID_PBM, + CODEC_ID_PGM, + CODEC_ID_PGMYUV, + CODEC_ID_PAM, + CODEC_ID_FFVHUFF, + CODEC_ID_RV30, + CODEC_ID_RV40, + CODEC_ID_VC1, + CODEC_ID_WMV3, + CODEC_ID_LOCO, + CODEC_ID_WNV1, + CODEC_ID_AASC, + CODEC_ID_INDEO2, + CODEC_ID_FRAPS, + CODEC_ID_TRUEMOTION2, + CODEC_ID_BMP, + CODEC_ID_CSCD, + CODEC_ID_MMVIDEO, + CODEC_ID_ZMBV, + CODEC_ID_AVS, + CODEC_ID_SMACKVIDEO, + CODEC_ID_NUV, + CODEC_ID_KMVC, + CODEC_ID_FLASHSV, + CODEC_ID_CAVS, + CODEC_ID_JPEG2000, + CODEC_ID_VMNC, + CODEC_ID_VP5, + CODEC_ID_VP6, + CODEC_ID_VP6F, + CODEC_ID_TARGA, + CODEC_ID_DSICINVIDEO, + CODEC_ID_TIERTEXSEQVIDEO, + CODEC_ID_TIFF, + CODEC_ID_GIF, + CODEC_ID_FFH264, + CODEC_ID_DXA, + CODEC_ID_DNXHD, + CODEC_ID_THP, + CODEC_ID_SGI, + CODEC_ID_C93, + CODEC_ID_BETHSOFTVID, + CODEC_ID_PTX, + CODEC_ID_TXD, + CODEC_ID_VP6A, + CODEC_ID_AMV, + CODEC_ID_VB, + CODEC_ID_PCX, + CODEC_ID_SUNRAST, + CODEC_ID_INDEO4, + CODEC_ID_INDEO5, + CODEC_ID_MIMIC, + CODEC_ID_RL2, + CODEC_ID_8SVX_EXP, + CODEC_ID_8SVX_FIB, + CODEC_ID_ESCAPE124, + CODEC_ID_DIRAC, + CODEC_ID_BFI, + CODEC_ID_CMV, + CODEC_ID_MOTIONPIXELS, + CODEC_ID_TGV, + CODEC_ID_TGQ, + CODEC_ID_TQI, + CODEC_ID_AURA, + CODEC_ID_AURA2, + CODEC_ID_V210X, + CODEC_ID_TMV, + CODEC_ID_V210, + CODEC_ID_DPX, + CODEC_ID_MAD, + CODEC_ID_FRWU, + CODEC_ID_FLASHSV2, + CODEC_ID_CDGRAPHICS, + CODEC_ID_R210, + CODEC_ID_ANM, + CODEC_ID_BINKVIDEO, + CODEC_ID_IFF_ILBM, + CODEC_ID_IFF_BYTERUN1, + CODEC_ID_KGV1, + CODEC_ID_YOP, + CODEC_ID_VP8, + CODEC_ID_PICTOR, + CODEC_ID_ANSI, + CODEC_ID_A64_MULTI, + CODEC_ID_A64_MULTI5, + CODEC_ID_R10K, + CODEC_ID_MXPEG, + CODEC_ID_LAGARITH, + CODEC_ID_PRORES, + CODEC_ID_JV, + CODEC_ID_DFA, + CODEC_ID_8SVX_RAW, + + /* various PCM "codecs" */ + CODEC_ID_PCM_S16LE= 0x10000, + CODEC_ID_PCM_S16BE, + CODEC_ID_PCM_U16LE, + CODEC_ID_PCM_U16BE, + CODEC_ID_PCM_S8, + CODEC_ID_PCM_U8, + CODEC_ID_PCM_MULAW, + CODEC_ID_PCM_ALAW, + CODEC_ID_PCM_S32LE, + CODEC_ID_PCM_S32BE, + CODEC_ID_PCM_U32LE, + CODEC_ID_PCM_U32BE, + CODEC_ID_PCM_S24LE, + CODEC_ID_PCM_S24BE, + CODEC_ID_PCM_U24LE, + CODEC_ID_PCM_U24BE, + CODEC_ID_PCM_S24DAUD, + CODEC_ID_PCM_ZORK, + CODEC_ID_PCM_S16LE_PLANAR, + CODEC_ID_PCM_DVD, + CODEC_ID_PCM_F32BE, + CODEC_ID_PCM_F32LE, + CODEC_ID_PCM_F64BE, + CODEC_ID_PCM_F64LE, + CODEC_ID_PCM_BLURAY, + CODEC_ID_PCM_LXF, + CODEC_ID_S302M, + + /* various ADPCM codecs */ + CODEC_ID_ADPCM_IMA_QT= 0x11000, + CODEC_ID_ADPCM_IMA_WAV, + CODEC_ID_ADPCM_IMA_DK3, + CODEC_ID_ADPCM_IMA_DK4, + CODEC_ID_ADPCM_IMA_WS, + CODEC_ID_ADPCM_IMA_SMJPEG, + CODEC_ID_ADPCM_MS, + CODEC_ID_ADPCM_4XM, + CODEC_ID_ADPCM_XA, + CODEC_ID_ADPCM_ADX, + CODEC_ID_ADPCM_EA, + CODEC_ID_ADPCM_G726, + CODEC_ID_ADPCM_CT, + CODEC_ID_ADPCM_SWF, + CODEC_ID_ADPCM_YAMAHA, + CODEC_ID_ADPCM_SBPRO_4, + CODEC_ID_ADPCM_SBPRO_3, + CODEC_ID_ADPCM_SBPRO_2, + CODEC_ID_ADPCM_THP, + CODEC_ID_ADPCM_IMA_AMV, + CODEC_ID_ADPCM_EA_R1, + CODEC_ID_ADPCM_EA_R3, + CODEC_ID_ADPCM_EA_R2, + CODEC_ID_ADPCM_IMA_EA_SEAD, + CODEC_ID_ADPCM_IMA_EA_EACS, + CODEC_ID_ADPCM_EA_XAS, + CODEC_ID_ADPCM_EA_MAXIS_XA, + CODEC_ID_ADPCM_IMA_ISS, + CODEC_ID_ADPCM_G722, + + /* AMR */ + CODEC_ID_AMR_NB= 0x12000, + CODEC_ID_AMR_WB, + + /* RealAudio codecs*/ + CODEC_ID_RA_144= 0x13000, + CODEC_ID_RA_288, + + /* various DPCM codecs */ + CODEC_ID_ROQ_DPCM= 0x14000, + CODEC_ID_INTERPLAY_DPCM, + CODEC_ID_XAN_DPCM, + CODEC_ID_SOL_DPCM, + + /* audio codecs */ + CODEC_ID_MP2= 0x15000, + CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3 + CODEC_ID_AAC, + CODEC_ID_AC3, + CODEC_ID_DTS, + CODEC_ID_VORBIS, + CODEC_ID_DVAUDIO, + CODEC_ID_WMAV1, + CODEC_ID_WMAV2, + CODEC_ID_MACE3, + CODEC_ID_MACE6, + CODEC_ID_VMDAUDIO, + CODEC_ID_SONIC, + CODEC_ID_SONIC_LS, + CODEC_ID_FLAC, + CODEC_ID_MP3ADU, + CODEC_ID_MP3ON4, + CODEC_ID_SHORTEN, + CODEC_ID_ALAC, + CODEC_ID_WESTWOOD_SND1, + CODEC_ID_GSM, ///< as in Berlin toast format + CODEC_ID_QDM2, + CODEC_ID_COOK, + CODEC_ID_TRUESPEECH, + CODEC_ID_TTA, + CODEC_ID_SMACKAUDIO, + CODEC_ID_QCELP, + CODEC_ID_WAVPACK, + CODEC_ID_DSICINAUDIO, + CODEC_ID_IMC, + CODEC_ID_MUSEPACK7, + CODEC_ID_MLP, + CODEC_ID_GSM_MS, /* as found in WAV */ + CODEC_ID_ATRAC3, + CODEC_ID_VOXWARE, + CODEC_ID_APE, + CODEC_ID_NELLYMOSER, + CODEC_ID_MUSEPACK8, + CODEC_ID_SPEEX, + CODEC_ID_WMAVOICE, + CODEC_ID_WMAPRO, + CODEC_ID_WMALOSSLESS, + CODEC_ID_ATRAC3P, + CODEC_ID_EAC3, + CODEC_ID_SIPR, + CODEC_ID_MP1, + CODEC_ID_TWINVQ, + CODEC_ID_TRUEHD, + CODEC_ID_MP4ALS, + CODEC_ID_ATRAC1, + CODEC_ID_BINKAUDIO_RDFT, + CODEC_ID_BINKAUDIO_DCT, + CODEC_ID_AAC_LATM, + CODEC_ID_QDMC, + CODEC_ID_CELT, + + /* subtitle codecs */ + CODEC_ID_DVD_SUBTITLE= 0x17000, + CODEC_ID_DVB_SUBTITLE, + CODEC_ID_TEXT, ///< raw UTF-8 text + CODEC_ID_XSUB, + CODEC_ID_SSA, + CODEC_ID_MOV_TEXT, + CODEC_ID_HDMV_PGS_SUBTITLE, + CODEC_ID_DVB_TELETEXT, + CODEC_ID_SRT, + CODEC_ID_MICRODVD, + + /* other specific kind of codecs (generally used for attachments) */ + CODEC_ID_TTF= 0x18000, + + CODEC_ID_PROBE= 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it + + CODEC_ID_MPEG2TS= 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS + * stream (only used by libavformat) */ + CODEC_ID_FFMETADATA=0x21000, ///< Dummy codec for streams containing only metadata information. +}; + +#if FF_API_OLD_SAMPLE_FMT +#define SampleFormat AVSampleFormat + +#define SAMPLE_FMT_NONE AV_SAMPLE_FMT_NONE +#define SAMPLE_FMT_U8 AV_SAMPLE_FMT_U8 +#define SAMPLE_FMT_S16 AV_SAMPLE_FMT_S16 +#define SAMPLE_FMT_S32 AV_SAMPLE_FMT_S32 +#define SAMPLE_FMT_FLT AV_SAMPLE_FMT_FLT +#define SAMPLE_FMT_DBL AV_SAMPLE_FMT_DBL +#define SAMPLE_FMT_NB AV_SAMPLE_FMT_NB +#endif + +#if FF_API_OLD_AUDIOCONVERT +#include "libavutil/audioconvert.h" + +/* Audio channel masks */ +#define CH_FRONT_LEFT AV_CH_FRONT_LEFT +#define CH_FRONT_RIGHT AV_CH_FRONT_RIGHT +#define CH_FRONT_CENTER AV_CH_FRONT_CENTER +#define CH_LOW_FREQUENCY AV_CH_LOW_FREQUENCY +#define CH_BACK_LEFT AV_CH_BACK_LEFT +#define CH_BACK_RIGHT AV_CH_BACK_RIGHT +#define CH_FRONT_LEFT_OF_CENTER AV_CH_FRONT_LEFT_OF_CENTER +#define CH_FRONT_RIGHT_OF_CENTER AV_CH_FRONT_RIGHT_OF_CENTER +#define CH_BACK_CENTER AV_CH_BACK_CENTER +#define CH_SIDE_LEFT AV_CH_SIDE_LEFT +#define CH_SIDE_RIGHT AV_CH_SIDE_RIGHT +#define CH_TOP_CENTER AV_CH_TOP_CENTER +#define CH_TOP_FRONT_LEFT AV_CH_TOP_FRONT_LEFT +#define CH_TOP_FRONT_CENTER AV_CH_TOP_FRONT_CENTER +#define CH_TOP_FRONT_RIGHT AV_CH_TOP_FRONT_RIGHT +#define CH_TOP_BACK_LEFT AV_CH_TOP_BACK_LEFT +#define CH_TOP_BACK_CENTER AV_CH_TOP_BACK_CENTER +#define CH_TOP_BACK_RIGHT AV_CH_TOP_BACK_RIGHT +#define CH_STEREO_LEFT AV_CH_STEREO_LEFT +#define CH_STEREO_RIGHT AV_CH_STEREO_RIGHT + +/** Channel mask value used for AVCodecContext.request_channel_layout + to indicate that the user requests the channel order of the decoder output + to be the native codec channel order. */ +#define CH_LAYOUT_NATIVE AV_CH_LAYOUT_NATIVE + +/* Audio channel convenience macros */ +#define CH_LAYOUT_MONO AV_CH_LAYOUT_MONO +#define CH_LAYOUT_STEREO AV_CH_LAYOUT_STEREO +#define CH_LAYOUT_2_1 AV_CH_LAYOUT_2_1 +#define CH_LAYOUT_SURROUND AV_CH_LAYOUT_SURROUND +#define CH_LAYOUT_4POINT0 AV_CH_LAYOUT_4POINT0 +#define CH_LAYOUT_2_2 AV_CH_LAYOUT_2_2 +#define CH_LAYOUT_QUAD AV_CH_LAYOUT_QUAD +#define CH_LAYOUT_5POINT0 AV_CH_LAYOUT_5POINT0 +#define CH_LAYOUT_5POINT1 AV_CH_LAYOUT_5POINT1 +#define CH_LAYOUT_5POINT0_BACK AV_CH_LAYOUT_5POINT0_BACK +#define CH_LAYOUT_5POINT1_BACK AV_CH_LAYOUT_5POINT1_BACK +#define CH_LAYOUT_7POINT0 AV_CH_LAYOUT_7POINT0 +#define CH_LAYOUT_7POINT1 AV_CH_LAYOUT_7POINT1 +#define CH_LAYOUT_7POINT1_WIDE AV_CH_LAYOUT_7POINT1_WIDE +#define CH_LAYOUT_STEREO_DOWNMIX AV_CH_LAYOUT_STEREO_DOWNMIX +#endif + +/* in bytes */ +#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio + +/** + * Required number of additionally allocated bytes at the end of the input bitstream for decoding. + * This is mainly needed because some optimized bitstream readers read + * 32 or 64 bit at once and could read over the end.
+ * Note: If the first 23 bits of the additional bytes are not 0, then damaged + * MPEG bitstreams could cause overread and segfault. + */ +#define FF_INPUT_BUFFER_PADDING_SIZE 8 + +/** + * minimum encoding buffer size + * Used to avoid some checks during header writing. + */ +#define FF_MIN_BUFFER_SIZE 16384 + + +/** + * motion estimation type. + */ +enum Motion_Est_ID { + ME_ZERO = 1, ///< no search, that is use 0,0 vector whenever one is needed + ME_FULL, + ME_LOG, + ME_PHODS, + ME_EPZS, ///< enhanced predictive zonal search + ME_X1, ///< reserved for experiments + ME_HEX, ///< hexagon based search + ME_UMH, ///< uneven multi-hexagon search + ME_ITER, ///< iterative search + ME_TESA, ///< transformed exhaustive search algorithm +}; + +enum AVDiscard{ + /* We leave some space between them for extensions (drop some + * keyframes for intra-only or drop just some bidir frames). */ + AVDISCARD_NONE =-16, ///< discard nothing + AVDISCARD_DEFAULT= 0, ///< discard useless packets like 0 size packets in avi + AVDISCARD_NONREF = 8, ///< discard all non reference + AVDISCARD_BIDIR = 16, ///< discard all bidirectional frames + AVDISCARD_NONKEY = 32, ///< discard all frames except keyframes + AVDISCARD_ALL = 48, ///< discard all +}; + +enum AVColorPrimaries{ + AVCOL_PRI_BT709 =1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B + AVCOL_PRI_UNSPECIFIED=2, + AVCOL_PRI_BT470M =4, + AVCOL_PRI_BT470BG =5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM + AVCOL_PRI_SMPTE170M =6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC + AVCOL_PRI_SMPTE240M =7, ///< functionally identical to above + AVCOL_PRI_FILM =8, + AVCOL_PRI_NB , ///< Not part of ABI +}; + +enum AVColorTransferCharacteristic{ + AVCOL_TRC_BT709 =1, ///< also ITU-R BT1361 + AVCOL_TRC_UNSPECIFIED=2, + AVCOL_TRC_GAMMA22 =4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM + AVCOL_TRC_GAMMA28 =5, ///< also ITU-R BT470BG + AVCOL_TRC_NB , ///< Not part of ABI +}; + +enum AVColorSpace{ + AVCOL_SPC_RGB =0, + AVCOL_SPC_BT709 =1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B + AVCOL_SPC_UNSPECIFIED=2, + AVCOL_SPC_FCC =4, + AVCOL_SPC_BT470BG =5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 + AVCOL_SPC_SMPTE170M =6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above + AVCOL_SPC_SMPTE240M =7, + AVCOL_SPC_NB , ///< Not part of ABI +}; + +enum AVColorRange{ + AVCOL_RANGE_UNSPECIFIED=0, + AVCOL_RANGE_MPEG =1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges + AVCOL_RANGE_JPEG =2, ///< the normal 2^n-1 "JPEG" YUV ranges + AVCOL_RANGE_NB , ///< Not part of ABI +}; + +/** + * X X 3 4 X X are luma samples, + * 1 2 1-6 are possible chroma positions + * X X 5 6 X 0 is undefined/unknown position + */ +enum AVChromaLocation{ + AVCHROMA_LOC_UNSPECIFIED=0, + AVCHROMA_LOC_LEFT =1, ///< mpeg2/4, h264 default + AVCHROMA_LOC_CENTER =2, ///< mpeg1, jpeg, h263 + AVCHROMA_LOC_TOPLEFT =3, ///< DV + AVCHROMA_LOC_TOP =4, + AVCHROMA_LOC_BOTTOMLEFT =5, + AVCHROMA_LOC_BOTTOM =6, + AVCHROMA_LOC_NB , ///< Not part of ABI +}; + +#if FF_API_FLAC_GLOBAL_OPTS +/** + * LPC analysis type + */ +attribute_deprecated enum AVLPCType { + AV_LPC_TYPE_DEFAULT = -1, ///< use the codec default LPC type + AV_LPC_TYPE_NONE = 0, ///< do not use LPC prediction or use all zero coefficients + AV_LPC_TYPE_FIXED = 1, ///< fixed LPC coefficients + AV_LPC_TYPE_LEVINSON = 2, ///< Levinson-Durbin recursion + AV_LPC_TYPE_CHOLESKY = 3, ///< Cholesky factorization + AV_LPC_TYPE_NB , ///< Not part of ABI +}; +#endif + +enum AVAudioServiceType { + AV_AUDIO_SERVICE_TYPE_MAIN = 0, + AV_AUDIO_SERVICE_TYPE_EFFECTS = 1, + AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2, + AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED = 3, + AV_AUDIO_SERVICE_TYPE_DIALOGUE = 4, + AV_AUDIO_SERVICE_TYPE_COMMENTARY = 5, + AV_AUDIO_SERVICE_TYPE_EMERGENCY = 6, + AV_AUDIO_SERVICE_TYPE_VOICE_OVER = 7, + AV_AUDIO_SERVICE_TYPE_KARAOKE = 8, + AV_AUDIO_SERVICE_TYPE_NB , ///< Not part of ABI +}; + +typedef struct RcOverride{ + int start_frame; + int end_frame; + int qscale; // If this is 0 then quality_factor will be used instead. + float quality_factor; +} RcOverride; + +#define FF_MAX_B_FRAMES 16 + +/* encoding support + These flags can be passed in AVCodecContext.flags before initialization. + Note: Not everything is supported yet. +*/ + +#define CODEC_FLAG_QSCALE 0x0002 ///< Use fixed qscale. +#define CODEC_FLAG_4MV 0x0004 ///< 4 MV per MB allowed / advanced prediction for H.263. +#define CODEC_FLAG_QPEL 0x0010 ///< Use qpel MC. +#define CODEC_FLAG_GMC 0x0020 ///< Use GMC. +#define CODEC_FLAG_MV0 0x0040 ///< Always try a MB with MV=<0,0>. +#define CODEC_FLAG_PART 0x0080 ///< Use data partitioning. +/** + * The parent program guarantees that the input for B-frames containing + * streams is not written to for at least s->max_b_frames+1 frames, if + * this is not set the input will be copied. + */ +#define CODEC_FLAG_INPUT_PRESERVED 0x0100 +#define CODEC_FLAG_PASS1 0x0200 ///< Use internal 2pass ratecontrol in first pass mode. +#define CODEC_FLAG_PASS2 0x0400 ///< Use internal 2pass ratecontrol in second pass mode. +#define CODEC_FLAG_EXTERN_HUFF 0x1000 ///< Use external Huffman table (for MJPEG). +#define CODEC_FLAG_GRAY 0x2000 ///< Only decode/encode grayscale. +#define CODEC_FLAG_EMU_EDGE 0x4000 ///< Don't draw edges. +#define CODEC_FLAG_PSNR 0x8000 ///< error[?] variables will be set during encoding. +#define CODEC_FLAG_TRUNCATED 0x00010000 /** Input bitstream might be truncated at a random + location instead of only at frame boundaries. */ +#define CODEC_FLAG_NORMALIZE_AQP 0x00020000 ///< Normalize adaptive quantization. +#define CODEC_FLAG_INTERLACED_DCT 0x00040000 ///< Use interlaced DCT. +#define CODEC_FLAG_LOW_DELAY 0x00080000 ///< Force low delay. +#define CODEC_FLAG_ALT_SCAN 0x00100000 ///< Use alternate scan. +#define CODEC_FLAG_GLOBAL_HEADER 0x00400000 ///< Place global headers in extradata instead of every keyframe. +#define CODEC_FLAG_BITEXACT 0x00800000 ///< Use only bitexact stuff (except (I)DCT). +/* Fx : Flag for h263+ extra options */ +#define CODEC_FLAG_AC_PRED 0x01000000 ///< H.263 advanced intra coding / MPEG-4 AC prediction +#define CODEC_FLAG_H263P_UMV 0x02000000 ///< unlimited motion vector +#define CODEC_FLAG_CBP_RD 0x04000000 ///< Use rate distortion optimization for cbp. +#define CODEC_FLAG_QP_RD 0x08000000 ///< Use rate distortion optimization for qp selectioon. +#define CODEC_FLAG_H263P_AIV 0x00000008 ///< H.263 alternative inter VLC +#define CODEC_FLAG_OBMC 0x00000001 ///< OBMC +#define CODEC_FLAG_LOOP_FILTER 0x00000800 ///< loop filter +#define CODEC_FLAG_H263P_SLICE_STRUCT 0x10000000 +#define CODEC_FLAG_INTERLACED_ME 0x20000000 ///< interlaced motion estimation +#define CODEC_FLAG_SVCD_SCAN_OFFSET 0x40000000 ///< Will reserve space for SVCD scan offset user data. +#define CODEC_FLAG_CLOSED_GOP 0x80000000 +#define CODEC_FLAG2_FAST 0x00000001 ///< Allow non spec compliant speedup tricks. +#define CODEC_FLAG2_STRICT_GOP 0x00000002 ///< Strictly enforce GOP size. +#define CODEC_FLAG2_NO_OUTPUT 0x00000004 ///< Skip bitstream encoding. +#define CODEC_FLAG2_LOCAL_HEADER 0x00000008 ///< Place global headers at every keyframe instead of in extradata. +#define CODEC_FLAG2_BPYRAMID 0x00000010 ///< H.264 allow B-frames to be used as references. +#define CODEC_FLAG2_WPRED 0x00000020 ///< H.264 weighted biprediction for B-frames +#define CODEC_FLAG2_MIXED_REFS 0x00000040 ///< H.264 one reference per partition, as opposed to one reference per macroblock +#define CODEC_FLAG2_8X8DCT 0x00000080 ///< H.264 high profile 8x8 transform +#define CODEC_FLAG2_FASTPSKIP 0x00000100 ///< H.264 fast pskip +#define CODEC_FLAG2_AUD 0x00000200 ///< H.264 access unit delimiters +#define CODEC_FLAG2_BRDO 0x00000400 ///< B-frame rate-distortion optimization +#define CODEC_FLAG2_INTRA_VLC 0x00000800 ///< Use MPEG-2 intra VLC table. +#define CODEC_FLAG2_MEMC_ONLY 0x00001000 ///< Only do ME/MC (I frames -> ref, P frame -> ME+MC). +#define CODEC_FLAG2_DROP_FRAME_TIMECODE 0x00002000 ///< timecode is in drop frame format. +#define CODEC_FLAG2_SKIP_RD 0x00004000 ///< RD optimal MB level residual skipping +#define CODEC_FLAG2_CHUNKS 0x00008000 ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries. +#define CODEC_FLAG2_NON_LINEAR_QUANT 0x00010000 ///< Use MPEG-2 nonlinear quantizer. +#define CODEC_FLAG2_BIT_RESERVOIR 0x00020000 ///< Use a bit reservoir when encoding if possible +#define CODEC_FLAG2_MBTREE 0x00040000 ///< Use macroblock tree ratecontrol (x264 only) +#define CODEC_FLAG2_PSY 0x00080000 ///< Use psycho visual optimizations. +#define CODEC_FLAG2_SSIM 0x00100000 ///< Compute SSIM during encoding, error[] values are undefined. +#define CODEC_FLAG2_INTRA_REFRESH 0x00200000 ///< Use periodic insertion of intra blocks instead of keyframes. + +/* Unsupported options : + * Syntax Arithmetic coding (SAC) + * Reference Picture Selection + * Independent Segment Decoding */ +/* /Fx */ +/* codec capabilities */ + +#define CODEC_CAP_DRAW_HORIZ_BAND 0x0001 ///< Decoder can use draw_horiz_band callback. +/** + * Codec uses get_buffer() for allocating buffers and supports custom allocators. + * If not set, it might not use get_buffer() at all or use operations that + * assume the buffer was allocated by avcodec_default_get_buffer. + */ +#define CODEC_CAP_DR1 0x0002 +/* If 'parse_only' field is true, then avcodec_parse_frame() can be used. */ +#define CODEC_CAP_PARSE_ONLY 0x0004 +#define CODEC_CAP_TRUNCATED 0x0008 +/* Codec can export data for HW decoding (XvMC). */ +#define CODEC_CAP_HWACCEL 0x0010 +/** + * Codec has a nonzero delay and needs to be fed with NULL at the end to get the delayed data. + * If this is not set, the codec is guaranteed to never be fed with NULL data. + */ +#define CODEC_CAP_DELAY 0x0020 +/** + * Codec can be fed a final frame with a smaller size. + * This can be used to prevent truncation of the last audio samples. + */ +#define CODEC_CAP_SMALL_LAST_FRAME 0x0040 +/** + * Codec can export data for HW decoding (VDPAU). + */ +#define CODEC_CAP_HWACCEL_VDPAU 0x0080 +/** + * Codec can output multiple frames per AVPacket + * Normally demuxers return one frame at a time, demuxers which do not do + * are connected to a parser to split what they return into proper frames. + * This flag is reserved to the very rare category of codecs which have a + * bitstream that cannot be split into frames without timeconsuming + * operations like full decoding. Demuxers carring such bitstreams thus + * may return multiple frames in a packet. This has many disadvantages like + * prohibiting stream copy in many cases thus it should only be considered + * as a last resort. + */ +#define CODEC_CAP_SUBFRAMES 0x0100 +/** + * Codec is experimental and is thus avoided in favor of non experimental + * encoders + */ +#define CODEC_CAP_EXPERIMENTAL 0x0200 +/** + * Codec should fill in channel configuration and samplerate instead of container + */ +#define CODEC_CAP_CHANNEL_CONF 0x0400 + +/** + * Codec is able to deal with negative linesizes + */ +#define CODEC_CAP_NEG_LINESIZES 0x0800 + +/** + * Codec supports frame-level multithreading. + */ +#define CODEC_CAP_FRAME_THREADS 0x1000 +/** + * Codec supports slice-based (or partition-based) multithreading. + */ +#define CODEC_CAP_SLICE_THREADS 0x2000 + +//The following defines may change, don't expect compatibility if you use them. +#define MB_TYPE_INTRA4x4 0x0001 +#define MB_TYPE_INTRA16x16 0x0002 //FIXME H.264-specific +#define MB_TYPE_INTRA_PCM 0x0004 //FIXME H.264-specific +#define MB_TYPE_16x16 0x0008 +#define MB_TYPE_16x8 0x0010 +#define MB_TYPE_8x16 0x0020 +#define MB_TYPE_8x8 0x0040 +#define MB_TYPE_INTERLACED 0x0080 +#define MB_TYPE_DIRECT2 0x0100 //FIXME +#define MB_TYPE_ACPRED 0x0200 +#define MB_TYPE_GMC 0x0400 +#define MB_TYPE_SKIP 0x0800 +#define MB_TYPE_P0L0 0x1000 +#define MB_TYPE_P1L0 0x2000 +#define MB_TYPE_P0L1 0x4000 +#define MB_TYPE_P1L1 0x8000 +#define MB_TYPE_L0 (MB_TYPE_P0L0 | MB_TYPE_P1L0) +#define MB_TYPE_L1 (MB_TYPE_P0L1 | MB_TYPE_P1L1) +#define MB_TYPE_L0L1 (MB_TYPE_L0 | MB_TYPE_L1) +#define MB_TYPE_QUANT 0x00010000 +#define MB_TYPE_CBP 0x00020000 +//Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...) + +/** + * Pan Scan area. + * This specifies the area which should be displayed. + * Note there may be multiple such areas for one frame. + */ +typedef struct AVPanScan{ + /** + * id + * - encoding: Set by user. + * - decoding: Set by libavcodec. + */ + int id; + + /** + * width and height in 1/16 pel + * - encoding: Set by user. + * - decoding: Set by libavcodec. + */ + int width; + int height; + + /** + * position of the top left corner in 1/16 pel for up to 3 fields/frames + * - encoding: Set by user. + * - decoding: Set by libavcodec. + */ + int16_t position[3][2]; +}AVPanScan; + +#define FF_COMMON_FRAME \ + /**\ + * pointer to the picture planes.\ + * This might be different from the first allocated byte\ + * - encoding: \ + * - decoding: \ + */\ + uint8_t *data[4];\ + int linesize[4];\ + /**\ + * pointer to the first allocated byte of the picture. Can be used in get_buffer/release_buffer.\ + * This isn't used by libavcodec unless the default get/release_buffer() is used.\ + * - encoding: \ + * - decoding: \ + */\ + uint8_t *base[4];\ + /**\ + * 1 -> keyframe, 0-> not\ + * - encoding: Set by libavcodec.\ + * - decoding: Set by libavcodec.\ + */\ + int key_frame;\ +\ + /**\ + * Picture type of the frame, see ?_TYPE below.\ + * - encoding: Set by libavcodec. for coded_picture (and set by user for input).\ + * - decoding: Set by libavcodec.\ + */\ + enum AVPictureType pict_type;\ +\ + /**\ + * presentation timestamp in time_base units (time when frame should be shown to user)\ + * If AV_NOPTS_VALUE then frame_rate = 1/time_base will be assumed.\ + * - encoding: MUST be set by user.\ + * - decoding: Set by libavcodec.\ + */\ + int64_t pts;\ +\ + /**\ + * picture number in bitstream order\ + * - encoding: set by\ + * - decoding: Set by libavcodec.\ + */\ + int coded_picture_number;\ + /**\ + * picture number in display order\ + * - encoding: set by\ + * - decoding: Set by libavcodec.\ + */\ + int display_picture_number;\ +\ + /**\ + * quality (between 1 (good) and FF_LAMBDA_MAX (bad)) \ + * - encoding: Set by libavcodec. for coded_picture (and set by user for input).\ + * - decoding: Set by libavcodec.\ + */\ + int quality; \ +\ + /**\ + * buffer age (1->was last buffer and dint change, 2->..., ...).\ + * Set to INT_MAX if the buffer has not been used yet.\ + * - encoding: unused\ + * - decoding: MUST be set by get_buffer().\ + */\ + int age;\ +\ + /**\ + * is this picture used as reference\ + * The values for this are the same as the MpegEncContext.picture_structure\ + * variable, that is 1->top field, 2->bottom field, 3->frame/both fields.\ + * Set to 4 for delayed, non-reference frames.\ + * - encoding: unused\ + * - decoding: Set by libavcodec. (before get_buffer() call)).\ + */\ + int reference;\ +\ + /**\ + * QP table\ + * - encoding: unused\ + * - decoding: Set by libavcodec.\ + */\ + int8_t *qscale_table;\ + /**\ + * QP store stride\ + * - encoding: unused\ + * - decoding: Set by libavcodec.\ + */\ + int qstride;\ +\ + /**\ + * mbskip_table[mb]>=1 if MB didn't change\ + * stride= mb_width = (width+15)>>4\ + * - encoding: unused\ + * - decoding: Set by libavcodec.\ + */\ + uint8_t *mbskip_table;\ +\ + /**\ + * motion vector table\ + * @code\ + * example:\ + * int mv_sample_log2= 4 - motion_subsample_log2;\ + * int mb_width= (width+15)>>4;\ + * int mv_stride= (mb_width << mv_sample_log2) + 1;\ + * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y];\ + * @endcode\ + * - encoding: Set by user.\ + * - decoding: Set by libavcodec.\ + */\ + int16_t (*motion_val[2])[2];\ +\ + /**\ + * macroblock type table\ + * mb_type_base + mb_width + 2\ + * - encoding: Set by user.\ + * - decoding: Set by libavcodec.\ + */\ + uint32_t *mb_type;\ +\ + /**\ + * log2 of the size of the block which a single vector in motion_val represents: \ + * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2)\ + * - encoding: unused\ + * - decoding: Set by libavcodec.\ + */\ + uint8_t motion_subsample_log2;\ +\ + /**\ + * for some private data of the user\ + * - encoding: unused\ + * - decoding: Set by user.\ + */\ + void *opaque;\ +\ + /**\ + * error\ + * - encoding: Set by libavcodec. if flags&CODEC_FLAG_PSNR.\ + * - decoding: unused\ + */\ + uint64_t error[4];\ +\ + /**\ + * type of the buffer (to keep track of who has to deallocate data[*])\ + * - encoding: Set by the one who allocates it.\ + * - decoding: Set by the one who allocates it.\ + * Note: User allocated (direct rendering) & internal buffers cannot coexist currently.\ + */\ + int type;\ + \ + /**\ + * When decoding, this signals how much the picture must be delayed.\ + * extra_delay = repeat_pict / (2*fps)\ + * - encoding: unused\ + * - decoding: Set by libavcodec.\ + */\ + int repeat_pict;\ + \ + /**\ + * \ + */\ + int qscale_type;\ + \ + /**\ + * The content of the picture is interlaced.\ + * - encoding: Set by user.\ + * - decoding: Set by libavcodec. (default 0)\ + */\ + int interlaced_frame;\ + \ + /**\ + * If the content is interlaced, is top field displayed first.\ + * - encoding: Set by user.\ + * - decoding: Set by libavcodec.\ + */\ + int top_field_first;\ + \ + /**\ + * Pan scan.\ + * - encoding: Set by user.\ + * - decoding: Set by libavcodec.\ + */\ + AVPanScan *pan_scan;\ + \ + /**\ + * Tell user application that palette has changed from previous frame.\ + * - encoding: ??? (no palette-enabled encoder yet)\ + * - decoding: Set by libavcodec. (default 0).\ + */\ + int palette_has_changed;\ + \ + /**\ + * codec suggestion on buffer type if != 0\ + * - encoding: unused\ + * - decoding: Set by libavcodec. (before get_buffer() call)).\ + */\ + int buffer_hints;\ +\ + /**\ + * DCT coefficients\ + * - encoding: unused\ + * - decoding: Set by libavcodec.\ + */\ + short *dct_coeff;\ +\ + /**\ + * motion reference frame index\ + * the order in which these are stored can depend on the codec.\ + * - encoding: Set by user.\ + * - decoding: Set by libavcodec.\ + */\ + int8_t *ref_index[2];\ +\ + /**\ + * reordered opaque 64bit (generally an integer or a double precision float\ + * PTS but can be anything). \ + * The user sets AVCodecContext.reordered_opaque to represent the input at\ + * that time,\ + * the decoder reorders values as needed and sets AVFrame.reordered_opaque\ + * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque \ + * @deprecated in favor of pkt_pts\ + * - encoding: unused\ + * - decoding: Read by user.\ + */\ + int64_t reordered_opaque;\ +\ + /**\ + * hardware accelerator private data (FFmpeg allocated)\ + * - encoding: unused\ + * - decoding: Set by libavcodec\ + */\ + void *hwaccel_picture_private;\ +\ + /**\ + * reordered pts from the last AVPacket that has been input into the decoder\ + * - encoding: unused\ + * - decoding: Read by user.\ + */\ + int64_t pkt_pts;\ +\ + /**\ + * dts from the last AVPacket that has been input into the decoder\ + * - encoding: unused\ + * - decoding: Read by user.\ + */\ + int64_t pkt_dts;\ +\ + /**\ + * the AVCodecContext which ff_thread_get_buffer() was last called on\ + * - encoding: Set by libavcodec.\ + * - decoding: Set by libavcodec.\ + */\ + struct AVCodecContext *owner;\ +\ + /**\ + * used by multithreading to store frame-specific info\ + * - encoding: Set by libavcodec.\ + * - decoding: Set by libavcodec.\ + */\ + void *thread_opaque;\ +\ + /**\ + * frame timestamp estimated using various heuristics, in stream time base\ + * - encoding: unused\ + * - decoding: set by libavcodec, read by user.\ + */\ + int64_t best_effort_timestamp;\ +\ + /**\ + * reordered pos from the last AVPacket that has been input into the decoder\ + * - encoding: unused\ + * - decoding: Read by user.\ + */\ + int64_t pkt_pos;\ +\ + /**\ + * reordered sample aspect ratio for the video frame, 0/1 if unknown\unspecified + * - encoding: unused\ + * - decoding: Read by user.\ + */\ + AVRational sample_aspect_ratio;\ +\ + /**\ + * width and height of the video frame\ + * - encoding: unused\ + * - decoding: Read by user.\ + */\ + int width, height;\ +\ + /**\ + * format of the frame, -1 if unknown or unset\ + * It should be cast to the corresponding enum (enum PixelFormat\ + * for video, enum AVSampleFormat for audio)\ + * - encoding: unused\ + * - decoding: Read by user.\ + */\ + int format;\ + + +#define FF_QSCALE_TYPE_MPEG1 0 +#define FF_QSCALE_TYPE_MPEG2 1 +#define FF_QSCALE_TYPE_H264 2 +#define FF_QSCALE_TYPE_VP56 3 + +#define FF_BUFFER_TYPE_INTERNAL 1 +#define FF_BUFFER_TYPE_USER 2 ///< direct rendering buffers (image is (de)allocated by user) +#define FF_BUFFER_TYPE_SHARED 4 ///< Buffer from somewhere else; don't deallocate image (data/base), all other tables are not shared. +#define FF_BUFFER_TYPE_COPY 8 ///< Just a (modified) copy of some other buffer, don't deallocate anything. + +#if FF_API_OLD_FF_PICT_TYPES +/* DEPRECATED, directly use the AV_PICTURE_TYPE_* enum values */ +#define FF_I_TYPE AV_PICTURE_TYPE_I ///< Intra +#define FF_P_TYPE AV_PICTURE_TYPE_P ///< Predicted +#define FF_B_TYPE AV_PICTURE_TYPE_B ///< Bi-dir predicted +#define FF_S_TYPE AV_PICTURE_TYPE_S ///< S(GMC)-VOP MPEG4 +#define FF_SI_TYPE AV_PICTURE_TYPE_SI ///< Switching Intra +#define FF_SP_TYPE AV_PICTURE_TYPE_SP ///< Switching Predicted +#define FF_BI_TYPE AV_PICTURE_TYPE_BI +#endif + +#define FF_BUFFER_HINTS_VALID 0x01 // Buffer hints value is meaningful (if 0 ignore). +#define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer. +#define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content. +#define FF_BUFFER_HINTS_REUSABLE 0x08 // Codec will reuse the buffer (update). + +enum AVPacketSideDataType { + AV_PKT_DATA_PALETTE, +}; + +typedef struct AVPacket { + /** + * Presentation timestamp in AVStream->time_base units; the time at which + * the decompressed packet will be presented to the user. + * Can be AV_NOPTS_VALUE if it is not stored in the file. + * pts MUST be larger or equal to dts as presentation cannot happen before + * decompression, unless one wants to view hex dumps. Some formats misuse + * the terms dts and pts/cts to mean something different. Such timestamps + * must be converted to true pts/dts before they are stored in AVPacket. + */ + int64_t pts; + /** + * Decompression timestamp in AVStream->time_base units; the time at which + * the packet is decompressed. + * Can be AV_NOPTS_VALUE if it is not stored in the file. + */ + int64_t dts; + uint8_t *data; + int size; + int stream_index; + int flags; + /** + * Additional packet data that can be provided by the container. + * Packet can contain several types of side information. + */ + struct { + uint8_t *data; + int size; + enum AVPacketSideDataType type; + } *side_data; + int side_data_elems; + + /** + * Duration of this packet in AVStream->time_base units, 0 if unknown. + * Equals next_pts - this_pts in presentation order. + */ + int duration; + void (*destruct)(struct AVPacket *); + void *priv; + int64_t pos; ///< byte position in stream, -1 if unknown + + /** + * Time difference in AVStream->time_base units from the pts of this + * packet to the point at which the output from the decoder has converged + * independent from the availability of previous frames. That is, the + * frames are virtually identical no matter if decoding started from + * the very first frame or from this keyframe. + * Is AV_NOPTS_VALUE if unknown. + * This field is not the display duration of the current packet. + * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY + * set. + * + * The purpose of this field is to allow seeking in streams that have no + * keyframes in the conventional sense. It corresponds to the + * recovery point SEI in H.264 and match_time_delta in NUT. It is also + * essential for some types of subtitle streams to ensure that all + * subtitles are correctly displayed after seeking. + */ + int64_t convergence_duration; +} AVPacket; +#define AV_PKT_FLAG_KEY 0x0001 + +/** + * Audio Video Frame. + * New fields can be added to the end of FF_COMMON_FRAME with minor version + * bumps. + * Removal, reordering and changes to existing fields require a major + * version bump. No fields should be added into AVFrame before or after + * FF_COMMON_FRAME! + * sizeof(AVFrame) must not be used outside libav*. + */ +typedef struct AVFrame { + FF_COMMON_FRAME +} AVFrame; + +/** + * main external API structure. + * New fields can be added to the end with minor version bumps. + * Removal, reordering and changes to existing fields require a major + * version bump. + * sizeof(AVCodecContext) must not be used outside libav*. + */ +typedef struct AVCodecContext { + /** + * information on struct for av_log + * - set by avcodec_alloc_context + */ + const AVClass *av_class; + /** + * the average bitrate + * - encoding: Set by user; unused for constant quantizer encoding. + * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream. + */ + int bit_rate; + + /** + * number of bits the bitstream is allowed to diverge from the reference. + * the reference can be CBR (for CBR pass1) or VBR (for pass2) + * - encoding: Set by user; unused for constant quantizer encoding. + * - decoding: unused + */ + int bit_rate_tolerance; + + /** + * CODEC_FLAG_*. + * - encoding: Set by user. + * - decoding: Set by user. + */ + int flags; + + /** + * Some codecs need additional format info. It is stored here. + * If any muxer uses this then ALL demuxers/parsers AND encoders for the + * specific codec MUST set it correctly otherwise stream copy breaks. + * In general use of this field by muxers is not recommanded. + * - encoding: Set by libavcodec. + * - decoding: Set by libavcodec. (FIXME: Is this OK?) + */ + int sub_id; + + /** + * Motion estimation algorithm used for video coding. + * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex), + * 8 (umh), 9 (iter), 10 (tesa) [7, 8, 10 are x264 specific, 9 is snow specific] + * - encoding: MUST be set by user. + * - decoding: unused + */ + int me_method; + + /** + * some codecs need / can use extradata like Huffman tables. + * mjpeg: Huffman tables + * rv10: additional flags + * mpeg4: global headers (they can be in the bitstream or here) + * The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger + * than extradata_size to avoid prolems if it is read with the bitstream reader. + * The bytewise contents of extradata must not depend on the architecture or CPU endianness. + * - encoding: Set/allocated/freed by libavcodec. + * - decoding: Set/allocated/freed by user. + */ + uint8_t *extradata; + int extradata_size; + + /** + * This is the fundamental unit of time (in seconds) in terms + * of which frame timestamps are represented. For fixed-fps content, + * timebase should be 1/framerate and timestamp increments should be + * identically 1. + * - encoding: MUST be set by user. + * - decoding: Set by libavcodec. + */ + AVRational time_base; + + /* video only */ + /** + * picture width / height. + * - encoding: MUST be set by user. + * - decoding: Set by libavcodec. + * Note: For compatibility it is possible to set this instead of + * coded_width/height before decoding. + */ + int width, height; + +#define FF_ASPECT_EXTENDED 15 + + /** + * the number of pictures in a group of pictures, or 0 for intra_only + * - encoding: Set by user. + * - decoding: unused + */ + int gop_size; + + /** + * Pixel format, see PIX_FMT_xxx. + * May be set by the demuxer if known from headers. + * May be overriden by the decoder if it knows better. + * - encoding: Set by user. + * - decoding: Set by user if known, overridden by libavcodec if known + */ + enum PixelFormat pix_fmt; + + /** + * If non NULL, 'draw_horiz_band' is called by the libavcodec + * decoder to draw a horizontal band. It improves cache usage. Not + * all codecs can do that. You must check the codec capabilities + * beforehand. + * When multithreading is used, it may be called from multiple threads + * at the same time; threads might draw different parts of the same AVFrame, + * or multiple AVFrames, and there is no guarantee that slices will be drawn + * in order. + * The function is also used by hardware acceleration APIs. + * It is called at least once during frame decoding to pass + * the data needed for hardware render. + * In that mode instead of pixel data, AVFrame points to + * a structure specific to the acceleration API. The application + * reads the structure and can change some fields to indicate progress + * or mark state. + * - encoding: unused + * - decoding: Set by user. + * @param height the height of the slice + * @param y the y position of the slice + * @param type 1->top field, 2->bottom field, 3->frame + * @param offset offset into the AVFrame.data from which the slice should be read + */ + void (*draw_horiz_band)(struct AVCodecContext *s, + const AVFrame *src, int offset[4], + int y, int type, int height); + + /* audio only */ + int sample_rate; ///< samples per second + int channels; ///< number of audio channels + + /** + * audio sample format + * - encoding: Set by user. + * - decoding: Set by libavcodec. + */ + enum AVSampleFormat sample_fmt; ///< sample format + + /* The following data should not be initialized. */ + /** + * Samples per packet, initialized when calling 'init'. + */ + int frame_size; + int frame_number; ///< audio or video frame number + + /** + * Number of frames the decoded output will be delayed relative to + * the encoded input. + * - encoding: Set by libavcodec. + * - decoding: unused + */ + int delay; + + /* - encoding parameters */ + float qcompress; ///< amount of qscale change between easy & hard scenes (0.0-1.0) + float qblur; ///< amount of qscale smoothing over time (0.0-1.0) + + /** + * minimum quantizer + * - encoding: Set by user. + * - decoding: unused + */ + int qmin; + + /** + * maximum quantizer + * - encoding: Set by user. + * - decoding: unused + */ + int qmax; + + /** + * maximum quantizer difference between frames + * - encoding: Set by user. + * - decoding: unused + */ + int max_qdiff; + + /** + * maximum number of B-frames between non-B-frames + * Note: The output will be delayed by max_b_frames+1 relative to the input. + * - encoding: Set by user. + * - decoding: unused + */ + int max_b_frames; + + /** + * qscale factor between IP and B-frames + * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset). + * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). + * - encoding: Set by user. + * - decoding: unused + */ + float b_quant_factor; + + /** obsolete FIXME remove */ + int rc_strategy; +#define FF_RC_STRATEGY_XVID 1 + + int b_frame_strategy; + + struct AVCodec *codec; + + void *priv_data; + + int rtp_payload_size; /* The size of the RTP payload: the coder will */ + /* do its best to deliver a chunk with size */ + /* below rtp_payload_size, the chunk will start */ + /* with a start code on some codecs like H.263. */ + /* This doesn't take account of any particular */ + /* headers inside the transmitted RTP payload. */ + + + /* The RTP callback: This function is called */ + /* every time the encoder has a packet to send. */ + /* It depends on the encoder if the data starts */ + /* with a Start Code (it should). H.263 does. */ + /* mb_nb contains the number of macroblocks */ + /* encoded in the RTP payload. */ + void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb); + + /* statistics, used for 2-pass encoding */ + int mv_bits; + int header_bits; + int i_tex_bits; + int p_tex_bits; + int i_count; + int p_count; + int skip_count; + int misc_bits; + + /** + * number of bits used for the previously encoded frame + * - encoding: Set by libavcodec. + * - decoding: unused + */ + int frame_bits; + + /** + * Private data of the user, can be used to carry app specific stuff. + * - encoding: Set by user. + * - decoding: Set by user. + */ + void *opaque; + + char codec_name[32]; + enum AVMediaType codec_type; /* see AVMEDIA_TYPE_xxx */ + enum CodecID codec_id; /* see CODEC_ID_xxx */ + + /** + * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). + * This is used to work around some encoder bugs. + * A demuxer should set this to what is stored in the field used to identify the codec. + * If there are multiple such fields in a container then the demuxer should choose the one + * which maximizes the information about the used codec. + * If the codec tag field in a container is larger then 32 bits then the demuxer should + * remap the longer ID to 32 bits with a table or other structure. Alternatively a new + * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated + * first. + * - encoding: Set by user, if not then the default based on codec_id will be used. + * - decoding: Set by user, will be converted to uppercase by libavcodec during init. + */ + unsigned int codec_tag; + + /** + * Work around bugs in encoders which sometimes cannot be detected automatically. + * - encoding: Set by user + * - decoding: Set by user + */ + int workaround_bugs; +#define FF_BUG_AUTODETECT 1 ///< autodetection +#define FF_BUG_OLD_MSMPEG4 2 +#define FF_BUG_XVID_ILACE 4 +#define FF_BUG_UMP4 8 +#define FF_BUG_NO_PADDING 16 +#define FF_BUG_AMV 32 +#define FF_BUG_AC_VLC 0 ///< Will be removed, libavcodec can now handle these non-compliant files by default. +#define FF_BUG_QPEL_CHROMA 64 +#define FF_BUG_STD_QPEL 128 +#define FF_BUG_QPEL_CHROMA2 256 +#define FF_BUG_DIRECT_BLOCKSIZE 512 +#define FF_BUG_EDGE 1024 +#define FF_BUG_HPEL_CHROMA 2048 +#define FF_BUG_DC_CLIP 4096 +#define FF_BUG_MS 8192 ///< Work around various bugs in Microsoft's broken decoders. +#define FF_BUG_TRUNCATED 16384 +//#define FF_BUG_FAKE_SCALABILITY 16 //Autodetection should work 100%. + + /** + * luma single coefficient elimination threshold + * - encoding: Set by user. + * - decoding: unused + */ + int luma_elim_threshold; + + /** + * chroma single coeff elimination threshold + * - encoding: Set by user. + * - decoding: unused + */ + int chroma_elim_threshold; + + /** + * strictly follow the standard (MPEG4, ...). + * - encoding: Set by user. + * - decoding: Set by user. + * Setting this to STRICT or higher means the encoder and decoder will + * generally do stupid things, whereas setting it to unofficial or lower + * will mean the encoder might produce output that is not supported by all + * spec-compliant decoders. Decoders don't differentiate between normal, + * unofficial and experimental (that is, they always try to decode things + * when they can) unless they are explicitly asked to behave stupidly + * (=strictly conform to the specs) + */ + int strict_std_compliance; +#define FF_COMPLIANCE_VERY_STRICT 2 ///< Strictly conform to an older more strict version of the spec or reference software. +#define FF_COMPLIANCE_STRICT 1 ///< Strictly conform to all the things in the spec no matter what consequences. +#define FF_COMPLIANCE_NORMAL 0 +#define FF_COMPLIANCE_UNOFFICIAL -1 ///< Allow unofficial extensions +#define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things. + + /** + * qscale offset between IP and B-frames + * - encoding: Set by user. + * - decoding: unused + */ + float b_quant_offset; + + /** + * Error recognization; higher values will detect more errors but may + * misdetect some more or less valid parts as errors. + * - encoding: unused + * - decoding: Set by user. + */ + int error_recognition; +#define FF_ER_CAREFUL 1 +#define FF_ER_COMPLIANT 2 +#define FF_ER_AGGRESSIVE 3 +#define FF_ER_VERY_AGGRESSIVE 4 + + /** + * Called at the beginning of each frame to get a buffer for it. + * If pic.reference is set then the frame will be read later by libavcodec. + * avcodec_align_dimensions2() should be used to find the required width and + * height, as they normally need to be rounded up to the next multiple of 16. + * if CODEC_CAP_DR1 is not set then get_buffer() must call + * avcodec_default_get_buffer() instead of providing buffers allocated by + * some other means. + * If frame multithreading is used and thread_safe_callbacks is set, + * it may be called from a different thread, but not from more than one at once. + * Does not need to be reentrant. + * - encoding: unused + * - decoding: Set by libavcodec, user can override. + */ + int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic); + + /** + * Called to release buffers which were allocated with get_buffer. + * A released buffer can be reused in get_buffer(). + * pic.data[*] must be set to NULL. + * May be called from a different thread if frame multithreading is used, + * but not by more than one thread at once, so does not need to be reentrant. + * - encoding: unused + * - decoding: Set by libavcodec, user can override. + */ + void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic); + + /** + * Size of the frame reordering buffer in the decoder. + * For MPEG-2 it is 1 IPB or 0 low delay IP. + * - encoding: Set by libavcodec. + * - decoding: Set by libavcodec. + */ + int has_b_frames; + + /** + * number of bytes per packet if constant and known or 0 + * Used by some WAV based audio codecs. + */ + int block_align; + + int parse_only; /* - decoding only: If true, only parsing is done + (function avcodec_parse_frame()). The frame + data is returned. Only MPEG codecs support this now. */ + + /** + * 0-> h263 quant 1-> mpeg quant + * - encoding: Set by user. + * - decoding: unused + */ + int mpeg_quant; + + /** + * pass1 encoding statistics output buffer + * - encoding: Set by libavcodec. + * - decoding: unused + */ + char *stats_out; + + /** + * pass2 encoding statistics input buffer + * Concatenated stuff from stats_out of pass1 should be placed here. + * - encoding: Allocated/set/freed by user. + * - decoding: unused + */ + char *stats_in; + + /** + * ratecontrol qmin qmax limiting method + * 0-> clipping, 1-> use a nice continous function to limit qscale wthin qmin/qmax. + * - encoding: Set by user. + * - decoding: unused + */ + float rc_qsquish; + + float rc_qmod_amp; + int rc_qmod_freq; + + /** + * ratecontrol override, see RcOverride + * - encoding: Allocated/set/freed by user. + * - decoding: unused + */ + RcOverride *rc_override; + int rc_override_count; + + /** + * rate control equation + * - encoding: Set by user + * - decoding: unused + */ + const char *rc_eq; + + /** + * maximum bitrate + * - encoding: Set by user. + * - decoding: unused + */ + int rc_max_rate; + + /** + * minimum bitrate + * - encoding: Set by user. + * - decoding: unused + */ + int rc_min_rate; + + /** + * decoder bitstream buffer size + * - encoding: Set by user. + * - decoding: unused + */ + int rc_buffer_size; + float rc_buffer_aggressivity; + + /** + * qscale factor between P and I-frames + * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset). + * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset). + * - encoding: Set by user. + * - decoding: unused + */ + float i_quant_factor; + + /** + * qscale offset between P and I-frames + * - encoding: Set by user. + * - decoding: unused + */ + float i_quant_offset; + + /** + * initial complexity for pass1 ratecontrol + * - encoding: Set by user. + * - decoding: unused + */ + float rc_initial_cplx; + + /** + * DCT algorithm, see FF_DCT_* below + * - encoding: Set by user. + * - decoding: unused + */ + int dct_algo; +#define FF_DCT_AUTO 0 +#define FF_DCT_FASTINT 1 +#define FF_DCT_INT 2 +#define FF_DCT_MMX 3 +#define FF_DCT_MLIB 4 +#define FF_DCT_ALTIVEC 5 +#define FF_DCT_FAAN 6 + + /** + * luminance masking (0-> disabled) + * - encoding: Set by user. + * - decoding: unused + */ + float lumi_masking; + + /** + * temporary complexity masking (0-> disabled) + * - encoding: Set by user. + * - decoding: unused + */ + float temporal_cplx_masking; + + /** + * spatial complexity masking (0-> disabled) + * - encoding: Set by user. + * - decoding: unused + */ + float spatial_cplx_masking; + + /** + * p block masking (0-> disabled) + * - encoding: Set by user. + * - decoding: unused + */ + float p_masking; + + /** + * darkness masking (0-> disabled) + * - encoding: Set by user. + * - decoding: unused + */ + float dark_masking; + + /** + * IDCT algorithm, see FF_IDCT_* below. + * - encoding: Set by user. + * - decoding: Set by user. + */ + int idct_algo; +#define FF_IDCT_AUTO 0 +#define FF_IDCT_INT 1 +#define FF_IDCT_SIMPLE 2 +#define FF_IDCT_SIMPLEMMX 3 +#define FF_IDCT_LIBMPEG2MMX 4 +#define FF_IDCT_PS2 5 +#define FF_IDCT_MLIB 6 +#define FF_IDCT_ARM 7 +#define FF_IDCT_ALTIVEC 8 +#define FF_IDCT_SH4 9 +#define FF_IDCT_SIMPLEARM 10 +#define FF_IDCT_H264 11 +#define FF_IDCT_VP3 12 +#define FF_IDCT_IPP 13 +#define FF_IDCT_XVIDMMX 14 +#define FF_IDCT_CAVS 15 +#define FF_IDCT_SIMPLEARMV5TE 16 +#define FF_IDCT_SIMPLEARMV6 17 +#define FF_IDCT_SIMPLEVIS 18 +#define FF_IDCT_WMV2 19 +#define FF_IDCT_FAAN 20 +#define FF_IDCT_EA 21 +#define FF_IDCT_SIMPLENEON 22 +#define FF_IDCT_SIMPLEALPHA 23 +#define FF_IDCT_BINK 24 + + /** + * slice count + * - encoding: Set by libavcodec. + * - decoding: Set by user (or 0). + */ + int slice_count; + /** + * slice offsets in the frame in bytes + * - encoding: Set/allocated by libavcodec. + * - decoding: Set/allocated by user (or NULL). + */ + int *slice_offset; + + /** + * error concealment flags + * - encoding: unused + * - decoding: Set by user. + */ + int error_concealment; +#define FF_EC_GUESS_MVS 1 +#define FF_EC_DEBLOCK 2 + + /** + * dsp_mask could be add used to disable unwanted CPU features + * CPU features (i.e. MMX, SSE. ...) + * + * With the FORCE flag you may instead enable given CPU features. + * (Dangerous: Usable in case of misdetection, improper usage however will + * result into program crash.) + */ + unsigned dsp_mask; + + /** + * bits per sample/pixel from the demuxer (needed for huffyuv). + * - encoding: Set by libavcodec. + * - decoding: Set by user. + */ + int bits_per_coded_sample; + + /** + * prediction method (needed for huffyuv) + * - encoding: Set by user. + * - decoding: unused + */ + int prediction_method; +#define FF_PRED_LEFT 0 +#define FF_PRED_PLANE 1 +#define FF_PRED_MEDIAN 2 + + /** + * sample aspect ratio (0 if unknown) + * That is the width of a pixel divided by the height of the pixel. + * Numerator and denominator must be relatively prime and smaller than 256 for some video standards. + * - encoding: Set by user. + * - decoding: Set by libavcodec. + */ + AVRational sample_aspect_ratio; + + /** + * the picture in the bitstream + * - encoding: Set by libavcodec. + * - decoding: Set by libavcodec. + */ + AVFrame *coded_frame; + + /** + * debug + * - encoding: Set by user. + * - decoding: Set by user. + */ + int debug; +#define FF_DEBUG_PICT_INFO 1 +#define FF_DEBUG_RC 2 +#define FF_DEBUG_BITSTREAM 4 +#define FF_DEBUG_MB_TYPE 8 +#define FF_DEBUG_QP 16 +#define FF_DEBUG_MV 32 +#define FF_DEBUG_DCT_COEFF 0x00000040 +#define FF_DEBUG_SKIP 0x00000080 +#define FF_DEBUG_STARTCODE 0x00000100 +#define FF_DEBUG_PTS 0x00000200 +#define FF_DEBUG_ER 0x00000400 +#define FF_DEBUG_MMCO 0x00000800 +#define FF_DEBUG_BUGS 0x00001000 +#define FF_DEBUG_VIS_QP 0x00002000 +#define FF_DEBUG_VIS_MB_TYPE 0x00004000 +#define FF_DEBUG_BUFFERS 0x00008000 +#define FF_DEBUG_THREADS 0x00010000 + + /** + * debug + * - encoding: Set by user. + * - decoding: Set by user. + */ + int debug_mv; +#define FF_DEBUG_VIS_MV_P_FOR 0x00000001 //visualize forward predicted MVs of P frames +#define FF_DEBUG_VIS_MV_B_FOR 0x00000002 //visualize forward predicted MVs of B frames +#define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames + + /** + * error + * - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR. + * - decoding: unused + */ + uint64_t error[4]; + + /** + * motion estimation comparison function + * - encoding: Set by user. + * - decoding: unused + */ + int me_cmp; + /** + * subpixel motion estimation comparison function + * - encoding: Set by user. + * - decoding: unused + */ + int me_sub_cmp; + /** + * macroblock comparison function (not supported yet) + * - encoding: Set by user. + * - decoding: unused + */ + int mb_cmp; + /** + * interlaced DCT comparison function + * - encoding: Set by user. + * - decoding: unused + */ + int ildct_cmp; +#define FF_CMP_SAD 0 +#define FF_CMP_SSE 1 +#define FF_CMP_SATD 2 +#define FF_CMP_DCT 3 +#define FF_CMP_PSNR 4 +#define FF_CMP_BIT 5 +#define FF_CMP_RD 6 +#define FF_CMP_ZERO 7 +#define FF_CMP_VSAD 8 +#define FF_CMP_VSSE 9 +#define FF_CMP_NSSE 10 +#define FF_CMP_W53 11 +#define FF_CMP_W97 12 +#define FF_CMP_DCTMAX 13 +#define FF_CMP_DCT264 14 +#define FF_CMP_CHROMA 256 + + /** + * ME diamond size & shape + * - encoding: Set by user. + * - decoding: unused + */ + int dia_size; + + /** + * amount of previous MV predictors (2a+1 x 2a+1 square) + * - encoding: Set by user. + * - decoding: unused + */ + int last_predictor_count; + + /** + * prepass for motion estimation + * - encoding: Set by user. + * - decoding: unused + */ + int pre_me; + + /** + * motion estimation prepass comparison function + * - encoding: Set by user. + * - decoding: unused + */ + int me_pre_cmp; + + /** + * ME prepass diamond size & shape + * - encoding: Set by user. + * - decoding: unused + */ + int pre_dia_size; + + /** + * subpel ME quality + * - encoding: Set by user. + * - decoding: unused + */ + int me_subpel_quality; + + /** + * callback to negotiate the pixelFormat + * @param fmt is the list of formats which are supported by the codec, + * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality. + * The first is always the native one. + * @return the chosen format + * - encoding: unused + * - decoding: Set by user, if not set the native format will be chosen. + */ + enum PixelFormat (*get_format)(struct AVCodecContext *s, const enum PixelFormat * fmt); + + /** + * DTG active format information (additional aspect ratio + * information only used in DVB MPEG-2 transport streams) + * 0 if not set. + * + * - encoding: unused + * - decoding: Set by decoder. + */ + int dtg_active_format; +#define FF_DTG_AFD_SAME 8 +#define FF_DTG_AFD_4_3 9 +#define FF_DTG_AFD_16_9 10 +#define FF_DTG_AFD_14_9 11 +#define FF_DTG_AFD_4_3_SP_14_9 13 +#define FF_DTG_AFD_16_9_SP_14_9 14 +#define FF_DTG_AFD_SP_4_3 15 + + /** + * maximum motion estimation search range in subpel units + * If 0 then no limit. + * + * - encoding: Set by user. + * - decoding: unused + */ + int me_range; + + /** + * intra quantizer bias + * - encoding: Set by user. + * - decoding: unused + */ + int intra_quant_bias; +#define FF_DEFAULT_QUANT_BIAS 999999 + + /** + * inter quantizer bias + * - encoding: Set by user. + * - decoding: unused + */ + int inter_quant_bias; + + /** + * color table ID + * - encoding: unused + * - decoding: Which clrtable should be used for 8bit RGB images. + * Tables have to be stored somewhere. FIXME + */ + int color_table_id; + + /** + * internal_buffer count + * Don't touch, used by libavcodec default_get_buffer(). + */ + int internal_buffer_count; + + /** + * internal_buffers + * Don't touch, used by libavcodec default_get_buffer(). + */ + void *internal_buffer; + + /** + * Global quality for codecs which cannot change it per frame. + * This should be proportional to MPEG-1/2/4 qscale. + * - encoding: Set by user. + * - decoding: unused + */ + int global_quality; + +#define FF_CODER_TYPE_VLC 0 +#define FF_CODER_TYPE_AC 1 +#define FF_CODER_TYPE_RAW 2 +#define FF_CODER_TYPE_RLE 3 +#define FF_CODER_TYPE_DEFLATE 4 + /** + * coder type + * - encoding: Set by user. + * - decoding: unused + */ + int coder_type; + + /** + * context model + * - encoding: Set by user. + * - decoding: unused + */ + int context_model; +#if 0 + /** + * + * - encoding: unused + * - decoding: Set by user. + */ + uint8_t * (*realloc)(struct AVCodecContext *s, uint8_t *buf, int buf_size); +#endif + + /** + * slice flags + * - encoding: unused + * - decoding: Set by user. + */ + int slice_flags; +#define SLICE_FLAG_CODED_ORDER 0x0001 ///< draw_horiz_band() is called in coded order instead of display +#define SLICE_FLAG_ALLOW_FIELD 0x0002 ///< allow draw_horiz_band() with field slices (MPEG2 field pics) +#define SLICE_FLAG_ALLOW_PLANE 0x0004 ///< allow draw_horiz_band() with 1 component at a time (SVQ1) + + /** + * XVideo Motion Acceleration + * - encoding: forbidden + * - decoding: set by decoder + */ + int xvmc_acceleration; + + /** + * macroblock decision mode + * - encoding: Set by user. + * - decoding: unused + */ + int mb_decision; +#define FF_MB_DECISION_SIMPLE 0 ///< uses mb_cmp +#define FF_MB_DECISION_BITS 1 ///< chooses the one which needs the fewest bits +#define FF_MB_DECISION_RD 2 ///< rate distortion + + /** + * custom intra quantization matrix + * - encoding: Set by user, can be NULL. + * - decoding: Set by libavcodec. + */ + uint16_t *intra_matrix; + + /** + * custom inter quantization matrix + * - encoding: Set by user, can be NULL. + * - decoding: Set by libavcodec. + */ + uint16_t *inter_matrix; + + /** + * fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). + * This is used to work around some encoder bugs. + * - encoding: unused + * - decoding: Set by user, will be converted to uppercase by libavcodec during init. + */ + unsigned int stream_codec_tag; + + /** + * scene change detection threshold + * 0 is default, larger means fewer detected scene changes. + * - encoding: Set by user. + * - decoding: unused + */ + int scenechange_threshold; + + /** + * minimum Lagrange multipler + * - encoding: Set by user. + * - decoding: unused + */ + int lmin; + + /** + * maximum Lagrange multipler + * - encoding: Set by user. + * - decoding: unused + */ + int lmax; + +#if FF_API_PALETTE_CONTROL + /** + * palette control structure + * - encoding: ??? (no palette-enabled encoder yet) + * - decoding: Set by user. + */ + struct AVPaletteControl *palctrl; +#endif + + /** + * noise reduction strength + * - encoding: Set by user. + * - decoding: unused + */ + int noise_reduction; + + /** + * Called at the beginning of a frame to get cr buffer for it. + * Buffer type (size, hints) must be the same. libavcodec won't check it. + * libavcodec will pass previous buffer in pic, function should return + * same buffer or new buffer with old frame "painted" into it. + * If pic.data[0] == NULL must behave like get_buffer(). + * if CODEC_CAP_DR1 is not set then reget_buffer() must call + * avcodec_default_reget_buffer() instead of providing buffers allocated by + * some other means. + * - encoding: unused + * - decoding: Set by libavcodec, user can override. + */ + int (*reget_buffer)(struct AVCodecContext *c, AVFrame *pic); + + /** + * Number of bits which should be loaded into the rc buffer before decoding starts. + * - encoding: Set by user. + * - decoding: unused + */ + int rc_initial_buffer_occupancy; + + /** + * + * - encoding: Set by user. + * - decoding: unused + */ + int inter_threshold; + + /** + * CODEC_FLAG2_* + * - encoding: Set by user. + * - decoding: Set by user. + */ + int flags2; + + /** + * Simulates errors in the bitstream to test error concealment. + * - encoding: Set by user. + * - decoding: unused + */ + int error_rate; + +#if FF_API_ANTIALIAS_ALGO + /** + * MP3 antialias algorithm, see FF_AA_* below. + * - encoding: unused + * - decoding: Set by user. + */ + attribute_deprecated int antialias_algo; +#define FF_AA_AUTO 0 +#define FF_AA_FASTINT 1 //not implemented yet +#define FF_AA_INT 2 +#define FF_AA_FLOAT 3 +#endif + + /** + * quantizer noise shaping + * - encoding: Set by user. + * - decoding: unused + */ + int quantizer_noise_shaping; + + /** + * thread count + * is used to decide how many independent tasks should be passed to execute() + * - encoding: Set by user. + * - decoding: Set by user. + */ + int thread_count; + + /** + * The codec may call this to execute several independent things. + * It will return only after finishing all tasks. + * The user may replace this with some multithreaded implementation, + * the default implementation will execute the parts serially. + * @param count the number of things to execute + * - encoding: Set by libavcodec, user can override. + * - decoding: Set by libavcodec, user can override. + */ + int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size); + + /** + * thread opaque + * Can be used by execute() to store some per AVCodecContext stuff. + * - encoding: set by execute() + * - decoding: set by execute() + */ + void *thread_opaque; + + /** + * Motion estimation threshold below which no motion estimation is + * performed, but instead the user specified motion vectors are used. + * + * - encoding: Set by user. + * - decoding: unused + */ + int me_threshold; + + /** + * Macroblock threshold below which the user specified macroblock types will be used. + * - encoding: Set by user. + * - decoding: unused + */ + int mb_threshold; + + /** + * precision of the intra DC coefficient - 8 + * - encoding: Set by user. + * - decoding: unused + */ + int intra_dc_precision; + + /** + * noise vs. sse weight for the nsse comparsion function + * - encoding: Set by user. + * - decoding: unused + */ + int nsse_weight; + + /** + * Number of macroblock rows at the top which are skipped. + * - encoding: unused + * - decoding: Set by user. + */ + int skip_top; + + /** + * Number of macroblock rows at the bottom which are skipped. + * - encoding: unused + * - decoding: Set by user. + */ + int skip_bottom; + + /** + * profile + * - encoding: Set by user. + * - decoding: Set by libavcodec. + */ + int profile; +#define FF_PROFILE_UNKNOWN -99 +#define FF_PROFILE_RESERVED -100 + +#define FF_PROFILE_AAC_MAIN 0 +#define FF_PROFILE_AAC_LOW 1 +#define FF_PROFILE_AAC_SSR 2 +#define FF_PROFILE_AAC_LTP 3 + +#define FF_PROFILE_DTS 20 +#define FF_PROFILE_DTS_ES 30 +#define FF_PROFILE_DTS_96_24 40 +#define FF_PROFILE_DTS_HD_HRA 50 +#define FF_PROFILE_DTS_HD_MA 60 + +#define FF_PROFILE_MPEG2_422 0 +#define FF_PROFILE_MPEG2_HIGH 1 +#define FF_PROFILE_MPEG2_SS 2 +#define FF_PROFILE_MPEG2_SNR_SCALABLE 3 +#define FF_PROFILE_MPEG2_MAIN 4 +#define FF_PROFILE_MPEG2_SIMPLE 5 + +#define FF_PROFILE_H264_CONSTRAINED (1<<9) // 8+1; constraint_set1_flag +#define FF_PROFILE_H264_INTRA (1<<11) // 8+3; constraint_set3_flag + +#define FF_PROFILE_H264_BASELINE 66 +#define FF_PROFILE_H264_CONSTRAINED_BASELINE (66|FF_PROFILE_H264_CONSTRAINED) +#define FF_PROFILE_H264_MAIN 77 +#define FF_PROFILE_H264_EXTENDED 88 +#define FF_PROFILE_H264_HIGH 100 +#define FF_PROFILE_H264_HIGH_10 110 +#define FF_PROFILE_H264_HIGH_10_INTRA (110|FF_PROFILE_H264_INTRA) +#define FF_PROFILE_H264_HIGH_422 122 +#define FF_PROFILE_H264_HIGH_422_INTRA (122|FF_PROFILE_H264_INTRA) +#define FF_PROFILE_H264_HIGH_444 144 +#define FF_PROFILE_H264_HIGH_444_PREDICTIVE 244 +#define FF_PROFILE_H264_HIGH_444_INTRA (244|FF_PROFILE_H264_INTRA) +#define FF_PROFILE_H264_CAVLC_444 44 + +#define FF_PROFILE_VC1_SIMPLE 0 +#define FF_PROFILE_VC1_MAIN 1 +#define FF_PROFILE_VC1_COMPLEX 2 +#define FF_PROFILE_VC1_ADVANCED 3 + + /** + * level + * - encoding: Set by user. + * - decoding: Set by libavcodec. + */ + int level; +#define FF_LEVEL_UNKNOWN -99 + + /** + * low resolution decoding, 1-> 1/2 size, 2->1/4 size + * - encoding: unused + * - decoding: Set by user. + */ + int lowres; + + /** + * Bitstream width / height, may be different from width/height if lowres + * or other things are used. + * - encoding: unused + * - decoding: Set by user before init if known. Codec should override / dynamically change if needed. + */ + int coded_width, coded_height; + + /** + * frame skip threshold + * - encoding: Set by user. + * - decoding: unused + */ + int frame_skip_threshold; + + /** + * frame skip factor + * - encoding: Set by user. + * - decoding: unused + */ + int frame_skip_factor; + + /** + * frame skip exponent + * - encoding: Set by user. + * - decoding: unused + */ + int frame_skip_exp; + + /** + * frame skip comparison function + * - encoding: Set by user. + * - decoding: unused + */ + int frame_skip_cmp; + + /** + * Border processing masking, raises the quantizer for mbs on the borders + * of the picture. + * - encoding: Set by user. + * - decoding: unused + */ + float border_masking; + + /** + * minimum MB lagrange multipler + * - encoding: Set by user. + * - decoding: unused + */ + int mb_lmin; + + /** + * maximum MB lagrange multipler + * - encoding: Set by user. + * - decoding: unused + */ + int mb_lmax; + + /** + * + * - encoding: Set by user. + * - decoding: unused + */ + int me_penalty_compensation; + + /** + * + * - encoding: unused + * - decoding: Set by user. + */ + enum AVDiscard skip_loop_filter; + + /** + * + * - encoding: unused + * - decoding: Set by user. + */ + enum AVDiscard skip_idct; + + /** + * + * - encoding: unused + * - decoding: Set by user. + */ + enum AVDiscard skip_frame; + + /** + * + * - encoding: Set by user. + * - decoding: unused + */ + int bidir_refine; + + /** + * + * - encoding: Set by user. + * - decoding: unused + */ + int brd_scale; + + /** + * constant rate factor - quality-based VBR - values ~correspond to qps + * - encoding: Set by user. + * - decoding: unused + */ + float crf; + + /** + * constant quantization parameter rate control method + * - encoding: Set by user. + * - decoding: unused + */ + int cqp; + + /** + * minimum GOP size + * - encoding: Set by user. + * - decoding: unused + */ + int keyint_min; + + /** + * number of reference frames + * - encoding: Set by user. + * - decoding: Set by lavc. + */ + int refs; + + /** + * chroma qp offset from luma + * - encoding: Set by user. + * - decoding: unused + */ + int chromaoffset; + + /** + * Influences how often B-frames are used. + * - encoding: Set by user. + * - decoding: unused + */ + int bframebias; + + /** + * trellis RD quantization + * - encoding: Set by user. + * - decoding: unused + */ + int trellis; + + /** + * Reduce fluctuations in qp (before curve compression). + * - encoding: Set by user. + * - decoding: unused + */ + float complexityblur; + + /** + * in-loop deblocking filter alphac0 parameter + * alpha is in the range -6...6 + * - encoding: Set by user. + * - decoding: unused + */ + int deblockalpha; + + /** + * in-loop deblocking filter beta parameter + * beta is in the range -6...6 + * - encoding: Set by user. + * - decoding: unused + */ + int deblockbeta; + + /** + * macroblock subpartition sizes to consider - p8x8, p4x4, b8x8, i8x8, i4x4 + * - encoding: Set by user. + * - decoding: unused + */ + int partitions; +#define X264_PART_I4X4 0x001 /* Analyze i4x4 */ +#define X264_PART_I8X8 0x002 /* Analyze i8x8 (requires 8x8 transform) */ +#define X264_PART_P8X8 0x010 /* Analyze p16x8, p8x16 and p8x8 */ +#define X264_PART_P4X4 0x020 /* Analyze p8x4, p4x8, p4x4 */ +#define X264_PART_B8X8 0x100 /* Analyze b16x8, b8x16 and b8x8 */ + + /** + * direct MV prediction mode - 0 (none), 1 (spatial), 2 (temporal), 3 (auto) + * - encoding: Set by user. + * - decoding: unused + */ + int directpred; + + /** + * Audio cutoff bandwidth (0 means "automatic") + * - encoding: Set by user. + * - decoding: unused + */ + int cutoff; + + /** + * Multiplied by qscale for each frame and added to scene_change_score. + * - encoding: Set by user. + * - decoding: unused + */ + int scenechange_factor; + + /** + * + * Note: Value depends upon the compare function used for fullpel ME. + * - encoding: Set by user. + * - decoding: unused + */ + int mv0_threshold; + + /** + * Adjusts sensitivity of b_frame_strategy 1. + * - encoding: Set by user. + * - decoding: unused + */ + int b_sensitivity; + + /** + * - encoding: Set by user. + * - decoding: unused + */ + int compression_level; +#define FF_COMPRESSION_DEFAULT -1 + + /** + * - encoding: Set by user. + * - decoding: unused + */ + int min_prediction_order; + + /** + * - encoding: Set by user. + * - decoding: unused + */ + int max_prediction_order; + +#if FF_API_FLAC_GLOBAL_OPTS + /** + * @defgroup flac_opts FLAC options + * @deprecated Use FLAC encoder private options instead. + * @{ + */ + + /** + * LPC coefficient precision - used by FLAC encoder + * - encoding: Set by user. + * - decoding: unused + */ + attribute_deprecated int lpc_coeff_precision; + + /** + * search method for selecting prediction order + * - encoding: Set by user. + * - decoding: unused + */ + attribute_deprecated int prediction_order_method; + + /** + * - encoding: Set by user. + * - decoding: unused + */ + attribute_deprecated int min_partition_order; + + /** + * - encoding: Set by user. + * - decoding: unused + */ + attribute_deprecated int max_partition_order; + /** + * @} + */ +#endif + + /** + * GOP timecode frame start number, in non drop frame format + * - encoding: Set by user. + * - decoding: unused + */ + int64_t timecode_frame_start; + +#if FF_API_REQUEST_CHANNELS + /** + * Decoder should decode to this many channels if it can (0 for default) + * - encoding: unused + * - decoding: Set by user. + * @deprecated Deprecated in favor of request_channel_layout. + */ + int request_channels; +#endif + + /** + * Percentage of dynamic range compression to be applied by the decoder. + * The default value is 1.0, corresponding to full compression. + * - encoding: unused + * - decoding: Set by user. + */ + float drc_scale; + + /** + * opaque 64bit number (generally a PTS) that will be reordered and + * output in AVFrame.reordered_opaque + * @deprecated in favor of pkt_pts + * - encoding: unused + * - decoding: Set by user. + */ + int64_t reordered_opaque; + + /** + * Bits per sample/pixel of internal libavcodec pixel/sample format. + * This field is applicable only when sample_fmt is AV_SAMPLE_FMT_S32. + * - encoding: set by user. + * - decoding: set by libavcodec. + */ + int bits_per_raw_sample; + + /** + * Audio channel layout. + * - encoding: set by user. + * - decoding: set by libavcodec. + */ + int64_t channel_layout; + + /** + * Request decoder to use this channel layout if it can (0 for default) + * - encoding: unused + * - decoding: Set by user. + */ + int64_t request_channel_layout; + + /** + * Ratecontrol attempt to use, at maximum, of what can be used without an underflow. + * - encoding: Set by user. + * - decoding: unused. + */ + float rc_max_available_vbv_use; + + /** + * Ratecontrol attempt to use, at least, times the amount needed to prevent a vbv overflow. + * - encoding: Set by user. + * - decoding: unused. + */ + float rc_min_vbv_overflow_use; + + /** + * Hardware accelerator in use + * - encoding: unused. + * - decoding: Set by libavcodec + */ + struct AVHWAccel *hwaccel; + + /** + * For some codecs, the time base is closer to the field rate than the frame rate. + * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration + * if no telecine is used ... + * + * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2. + */ + int ticks_per_frame; + + /** + * Hardware accelerator context. + * For some hardware accelerators, a global context needs to be + * provided by the user. In that case, this holds display-dependent + * data FFmpeg cannot instantiate itself. Please refer to the + * FFmpeg HW accelerator documentation to know how to fill this + * is. e.g. for VA API, this is a struct vaapi_context. + * - encoding: unused + * - decoding: Set by user + */ + void *hwaccel_context; + + /** + * Chromaticity coordinates of the source primaries. + * - encoding: Set by user + * - decoding: Set by libavcodec + */ + enum AVColorPrimaries color_primaries; + + /** + * Color Transfer Characteristic. + * - encoding: Set by user + * - decoding: Set by libavcodec + */ + enum AVColorTransferCharacteristic color_trc; + + /** + * YUV colorspace type. + * - encoding: Set by user + * - decoding: Set by libavcodec + */ + enum AVColorSpace colorspace; + + /** + * MPEG vs JPEG YUV range. + * - encoding: Set by user + * - decoding: Set by libavcodec + */ + enum AVColorRange color_range; + + /** + * This defines the location of chroma samples. + * - encoding: Set by user + * - decoding: Set by libavcodec + */ + enum AVChromaLocation chroma_sample_location; + + /** + * The codec may call this to execute several independent things. + * It will return only after finishing all tasks. + * The user may replace this with some multithreaded implementation, + * the default implementation will execute the parts serially. + * Also see avcodec_thread_init and e.g. the --enable-pthread configure option. + * @param c context passed also to func + * @param count the number of things to execute + * @param arg2 argument passed unchanged to func + * @param ret return values of executed functions, must have space for "count" values. May be NULL. + * @param func function that will be called count times, with jobnr from 0 to count-1. + * threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no + * two instances of func executing at the same time will have the same threadnr. + * @return always 0 currently, but code should handle a future improvement where when any call to func + * returns < 0 no further calls to func may be done and < 0 is returned. + * - encoding: Set by libavcodec, user can override. + * - decoding: Set by libavcodec, user can override. + */ + int (*execute2)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count); + + /** + * explicit P-frame weighted prediction analysis method + * 0: off + * 1: fast blind weighting (one reference duplicate with -1 offset) + * 2: smart weighting (full fade detection analysis) + * - encoding: Set by user. + * - decoding: unused + */ + int weighted_p_pred; + + /** + * AQ mode + * 0: Disabled + * 1: Variance AQ (complexity mask) + * 2: Auto-variance AQ (experimental) + * - encoding: Set by user + * - decoding: unused + */ + int aq_mode; + + /** + * AQ strength + * Reduces blocking and blurring in flat and textured areas. + * - encoding: Set by user + * - decoding: unused + */ + float aq_strength; + + /** + * PSY RD + * Strength of psychovisual optimization + * - encoding: Set by user + * - decoding: unused + */ + float psy_rd; + + /** + * PSY trellis + * Strength of psychovisual optimization + * - encoding: Set by user + * - decoding: unused + */ + float psy_trellis; + + /** + * RC lookahead + * Number of frames for frametype and ratecontrol lookahead + * - encoding: Set by user + * - decoding: unused + */ + int rc_lookahead; + + /** + * Constant rate factor maximum + * With CRF encoding mode and VBV restrictions enabled, prevents quality from being worse + * than crf_max, even if doing so would violate VBV restrictions. + * - encoding: Set by user. + * - decoding: unused + */ + float crf_max; + + int log_level_offset; + +#if FF_API_FLAC_GLOBAL_OPTS + /** + * Determines which LPC analysis algorithm to use. + * - encoding: Set by user + * - decoding: unused + */ + attribute_deprecated enum AVLPCType lpc_type; + + /** + * Number of passes to use for Cholesky factorization during LPC analysis + * - encoding: Set by user + * - decoding: unused + */ + attribute_deprecated int lpc_passes; +#endif + + /** + * Number of slices. + * Indicates number of picture subdivisions. Used for parallelized + * decoding. + * - encoding: Set by user + * - decoding: unused + */ + int slices; + + /** + * Header containing style information for text subtitles. + * For SUBTITLE_ASS subtitle type, it should contain the whole ASS + * [Script Info] and [V4+ Styles] section, plus the [Events] line and + * the Format line following. It shouldn't include any Dialogue line. + * - encoding: Set/allocated/freed by user (before avcodec_open()) + * - decoding: Set/allocated/freed by libavcodec (by avcodec_open()) + */ + uint8_t *subtitle_header; + int subtitle_header_size; + + /** + * Current packet as passed into the decoder, to avoid having + * to pass the packet into every function. Currently only valid + * inside lavc and get/release_buffer callbacks. + * - decoding: set by avcodec_decode_*, read by get_buffer() for setting pkt_pts + * - encoding: unused + */ + AVPacket *pkt; + + /** + * Whether this is a copy of the context which had init() called on it. + * This is used by multithreading - shared tables and picture pointers + * should be freed from the original context only. + * - encoding: Set by libavcodec. + * - decoding: Set by libavcodec. + */ + int is_copy; + + /** + * Which multithreading methods to use. + * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread, + * so clients which cannot provide future frames should not use it. + * + * - encoding: Set by user, otherwise the default is used. + * - decoding: Set by user, otherwise the default is used. + */ + int thread_type; +#define FF_THREAD_FRAME 1 //< Decode more than one frame at once +#define FF_THREAD_SLICE 2 //< Decode more than one part of a single frame at once + + /** + * Which multithreading methods are in use by the codec. + * - encoding: Set by libavcodec. + * - decoding: Set by libavcodec. + */ + int active_thread_type; + + /** + * Set by the client if its custom get_buffer() callback can be called + * from another thread, which allows faster multithreaded decoding. + * draw_horiz_band() will be called from other threads regardless of this setting. + * Ignored if the default get_buffer() is used. + * - encoding: Set by user. + * - decoding: Set by user. + */ + int thread_safe_callbacks; + + /** + * VBV delay coded in the last frame (in periods of a 27 MHz clock). + * Used for compliant TS muxing. + * - encoding: Set by libavcodec. + * - decoding: unused. + */ + uint64_t vbv_delay; + + /** + * Type of service that the audio stream conveys. + * - encoding: Set by user. + * - decoding: Set by libavcodec. + */ + enum AVAudioServiceType audio_service_type; + + /** + * Current statistics for PTS correction. + * - decoding: maintained and used by libavcodec, not intended to be used by user apps + * - encoding: unused + */ + int64_t pts_correction_num_faulty_pts; /// Number of incorrect PTS values so far + int64_t pts_correction_num_faulty_dts; /// Number of incorrect DTS values so far + int64_t pts_correction_last_pts; /// PTS of the last frame + int64_t pts_correction_last_dts; /// DTS of the last frame + + /** + * desired sample format + * - encoding: Not used. + * - decoding: Set by user. + * Decoder will decode to this format if it can. + */ + enum AVSampleFormat request_sample_fmt; + +} AVCodecContext; + +/** + * AVProfile. + */ +typedef struct AVProfile { + int profile; + const char *name; ///< short name for the profile +} AVProfile; + +/** + * AVCodec. + */ +typedef struct AVCodec { + /** + * Name of the codec implementation. + * The name is globally unique among encoders and among decoders (but an + * encoder and a decoder can share the same name). + * This is the primary way to find a codec from the user perspective. + */ + const char *name; + enum AVMediaType type; + enum CodecID id; + int priv_data_size; + int (*init)(AVCodecContext *); + int (*encode)(AVCodecContext *, uint8_t *buf, int buf_size, void *data); + int (*close)(AVCodecContext *); + int (*decode)(AVCodecContext *, void *outdata, int *outdata_size, AVPacket *avpkt); + /** + * Codec capabilities. + * see CODEC_CAP_* + */ + int capabilities; + struct AVCodec *next; + /** + * Flush buffers. + * Will be called when seeking + */ + void (*flush)(AVCodecContext *); + const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0} + const enum PixelFormat *pix_fmts; ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1 + /** + * Descriptive name for the codec, meant to be more human readable than name. + * You should use the NULL_IF_CONFIG_SMALL() macro to define it. + */ + const char *long_name; + const int *supported_samplerates; ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0 + const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1 + const int64_t *channel_layouts; ///< array of support channel layouts, or NULL if unknown. array is terminated by 0 + uint8_t max_lowres; ///< maximum value for lowres supported by the decoder + const AVClass *priv_class; ///< AVClass for the private context + const AVProfile *profiles; ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN} + + /** + * @defgroup framethreading Frame-level threading support functions. + * @{ + */ + /** + * If defined, called on thread contexts when they are created. + * If the codec allocates writable tables in init(), re-allocate them here. + * priv_data will be set to a copy of the original. + */ + int (*init_thread_copy)(AVCodecContext *); + /** + * Copy necessary context variables from a previous thread context to the current one. + * If not defined, the next thread will start automatically; otherwise, the codec + * must call ff_thread_finish_setup(). + * + * dst and src will (rarely) point to the same context, in which case memcpy should be skipped. + */ + int (*update_thread_context)(AVCodecContext *dst, const AVCodecContext *src); + /** @} */ +} AVCodec; + +/** + * AVHWAccel. + */ +typedef struct AVHWAccel { + /** + * Name of the hardware accelerated codec. + * The name is globally unique among encoders and among decoders (but an + * encoder and a decoder can share the same name). + */ + const char *name; + + /** + * Type of codec implemented by the hardware accelerator. + * + * See AVMEDIA_TYPE_xxx + */ + enum AVMediaType type; + + /** + * Codec implemented by the hardware accelerator. + * + * See CODEC_ID_xxx + */ + enum CodecID id; + + /** + * Supported pixel format. + * + * Only hardware accelerated formats are supported here. + */ + enum PixelFormat pix_fmt; + + /** + * Hardware accelerated codec capabilities. + * see FF_HWACCEL_CODEC_CAP_* + */ + int capabilities; + + struct AVHWAccel *next; + + /** + * Called at the beginning of each frame or field picture. + * + * Meaningful frame information (codec specific) is guaranteed to + * be parsed at this point. This function is mandatory. + * + * Note that buf can be NULL along with buf_size set to 0. + * Otherwise, this means the whole frame is available at this point. + * + * @param avctx the codec context + * @param buf the frame data buffer base + * @param buf_size the size of the frame in bytes + * @return zero if successful, a negative value otherwise + */ + int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size); + + /** + * Callback for each slice. + * + * Meaningful slice information (codec specific) is guaranteed to + * be parsed at this point. This function is mandatory. + * + * @param avctx the codec context + * @param buf the slice data buffer base + * @param buf_size the size of the slice in bytes + * @return zero if successful, a negative value otherwise + */ + int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size); + + /** + * Called at the end of each frame or field picture. + * + * The whole picture is parsed at this point and can now be sent + * to the hardware accelerator. This function is mandatory. + * + * @param avctx the codec context + * @return zero if successful, a negative value otherwise + */ + int (*end_frame)(AVCodecContext *avctx); + + /** + * Size of HW accelerator private data. + * + * Private data is allocated with av_mallocz() before + * AVCodecContext.get_buffer() and deallocated after + * AVCodecContext.release_buffer(). + */ + int priv_data_size; +} AVHWAccel; + +/** + * four components are given, that's all. + * the last component is alpha + */ +typedef struct AVPicture { + uint8_t *data[4]; + int linesize[4]; ///< number of bytes per line +} AVPicture; + +#if FF_API_PALETTE_CONTROL +/** + * AVPaletteControl + * This structure defines a method for communicating palette changes + * between and demuxer and a decoder. + * + * @deprecated Use AVPacket to send palette changes instead. + * This is totally broken. + */ +#define AVPALETTE_SIZE 1024 +#define AVPALETTE_COUNT 256 +typedef struct AVPaletteControl { + + /* Demuxer sets this to 1 to indicate the palette has changed; + * decoder resets to 0. */ + int palette_changed; + + /* 4-byte ARGB palette entries, stored in native byte order; note that + * the individual palette components should be on a 8-bit scale; if + * the palette data comes from an IBM VGA native format, the component + * data is probably 6 bits in size and needs to be scaled. */ + unsigned int palette[AVPALETTE_COUNT]; + +} AVPaletteControl attribute_deprecated; +#endif + +enum AVSubtitleType { + SUBTITLE_NONE, + + SUBTITLE_BITMAP, ///< A bitmap, pict will be set + + /** + * Plain text, the text field must be set by the decoder and is + * authoritative. ass and pict fields may contain approximations. + */ + SUBTITLE_TEXT, + + /** + * Formatted text, the ass field must be set by the decoder and is + * authoritative. pict and text fields may contain approximations. + */ + SUBTITLE_ASS, +}; + +typedef struct AVSubtitleRect { + int x; ///< top left corner of pict, undefined when pict is not set + int y; ///< top left corner of pict, undefined when pict is not set + int w; ///< width of pict, undefined when pict is not set + int h; ///< height of pict, undefined when pict is not set + int nb_colors; ///< number of colors in pict, undefined when pict is not set + + /** + * data+linesize for the bitmap of this subtitle. + * can be set for text/ass as well once they where rendered + */ + AVPicture pict; + enum AVSubtitleType type; + + char *text; ///< 0 terminated plain UTF-8 text + + /** + * 0 terminated ASS/SSA compatible event line. + * The pressentation of this is unaffected by the other values in this + * struct. + */ + char *ass; +} AVSubtitleRect; + +typedef struct AVSubtitle { + uint16_t format; /* 0 = graphics */ + uint32_t start_display_time; /* relative to packet pts, in ms */ + uint32_t end_display_time; /* relative to packet pts, in ms */ + unsigned num_rects; + AVSubtitleRect **rects; + int64_t pts; ///< Same as packet pts, in AV_TIME_BASE +} AVSubtitle; + +/* packet functions */ + +/** + * @deprecated use NULL instead + */ +attribute_deprecated void av_destruct_packet_nofree(AVPacket *pkt); + +/** + * Default packet destructor. + */ +void av_destruct_packet(AVPacket *pkt); + +/** + * Initialize optional fields of a packet with default values. + * + * @param pkt packet + */ +void av_init_packet(AVPacket *pkt); + +/** + * Allocate the payload of a packet and initialize its fields with + * default values. + * + * @param pkt packet + * @param size wanted payload size + * @return 0 if OK, AVERROR_xxx otherwise + */ +int av_new_packet(AVPacket *pkt, int size); + +/** + * Reduce packet size, correctly zeroing padding + * + * @param pkt packet + * @param size new size + */ +void av_shrink_packet(AVPacket *pkt, int size); + +/** + * Increase packet size, correctly zeroing padding + * + * @param pkt packet + * @param grow_by number of bytes by which to increase the size of the packet + */ +int av_grow_packet(AVPacket *pkt, int grow_by); + +/** + * @warning This is a hack - the packet memory allocation stuff is broken. The + * packet is allocated if it was not really allocated. + */ +int av_dup_packet(AVPacket *pkt); + +/** + * Free a packet. + * + * @param pkt packet to free + */ +void av_free_packet(AVPacket *pkt); + +/** + * Allocate new information of a packet. + * + * @param pkt packet + * @param type side information type + * @param size side information size + * @return pointer to fresh allocated data or NULL otherwise + */ +uint8_t* av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, + int size); + +/** + * Get side information from packet. + * + * @param pkt packet + * @param type desired side information type + * @param size pointer for side information size to store (optional) + * @return pointer to data if present or NULL otherwise + */ +uint8_t* av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type, + int *size); + +/* resample.c */ + +struct ReSampleContext; +struct AVResampleContext; + +typedef struct ReSampleContext ReSampleContext; + +/** + * Initialize audio resampling context. + * + * @param output_channels number of output channels + * @param input_channels number of input channels + * @param output_rate output sample rate + * @param input_rate input sample rate + * @param sample_fmt_out requested output sample format + * @param sample_fmt_in input sample format + * @param filter_length length of each FIR filter in the filterbank relative to the cutoff frequency + * @param log2_phase_count log2 of the number of entries in the polyphase filterbank + * @param linear if 1 then the used FIR filter will be linearly interpolated + between the 2 closest, if 0 the closest will be used + * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate + * @return allocated ReSampleContext, NULL if error occured + */ +ReSampleContext *av_audio_resample_init(int output_channels, int input_channels, + int output_rate, int input_rate, + enum AVSampleFormat sample_fmt_out, + enum AVSampleFormat sample_fmt_in, + int filter_length, int log2_phase_count, + int linear, double cutoff); + +int audio_resample(ReSampleContext *s, short *output, short *input, int nb_samples); + +/** + * Free resample context. + * + * @param s a non-NULL pointer to a resample context previously + * created with av_audio_resample_init() + */ +void audio_resample_close(ReSampleContext *s); + + +/** + * Initialize an audio resampler. + * Note, if either rate is not an integer then simply scale both rates up so they are. + * @param filter_length length of each FIR filter in the filterbank relative to the cutoff freq + * @param log2_phase_count log2 of the number of entries in the polyphase filterbank + * @param linear If 1 then the used FIR filter will be linearly interpolated + between the 2 closest, if 0 the closest will be used + * @param cutoff cutoff frequency, 1.0 corresponds to half the output sampling rate + */ +struct AVResampleContext *av_resample_init(int out_rate, int in_rate, int filter_length, int log2_phase_count, int linear, double cutoff); + +/** + * Resample an array of samples using a previously configured context. + * @param src an array of unconsumed samples + * @param consumed the number of samples of src which have been consumed are returned here + * @param src_size the number of unconsumed samples available + * @param dst_size the amount of space in samples available in dst + * @param update_ctx If this is 0 then the context will not be modified, that way several channels can be resampled with the same context. + * @return the number of samples written in dst or -1 if an error occurred + */ +int av_resample(struct AVResampleContext *c, short *dst, short *src, int *consumed, int src_size, int dst_size, int update_ctx); + + +/** + * Compensate samplerate/timestamp drift. The compensation is done by changing + * the resampler parameters, so no audible clicks or similar distortions occur + * @param compensation_distance distance in output samples over which the compensation should be performed + * @param sample_delta number of output samples which should be output less + * + * example: av_resample_compensate(c, 10, 500) + * here instead of 510 samples only 500 samples would be output + * + * note, due to rounding the actual compensation might be slightly different, + * especially if the compensation_distance is large and the in_rate used during init is small + */ +void av_resample_compensate(struct AVResampleContext *c, int sample_delta, int compensation_distance); +void av_resample_close(struct AVResampleContext *c); + +/** + * Allocate memory for a picture. Call avpicture_free() to free it. + * + * \see avpicture_fill() + * + * @param picture the picture to be filled in + * @param pix_fmt the format of the picture + * @param width the width of the picture + * @param height the height of the picture + * @return zero if successful, a negative value if not + */ +int avpicture_alloc(AVPicture *picture, enum PixelFormat pix_fmt, int width, int height); + +/** + * Free a picture previously allocated by avpicture_alloc(). + * The data buffer used by the AVPicture is freed, but the AVPicture structure + * itself is not. + * + * @param picture the AVPicture to be freed + */ +void avpicture_free(AVPicture *picture); + +/** + * Fill in the AVPicture fields. + * The fields of the given AVPicture are filled in by using the 'ptr' address + * which points to the image data buffer. Depending on the specified picture + * format, one or multiple image data pointers and line sizes will be set. + * If a planar format is specified, several pointers will be set pointing to + * the different picture planes and the line sizes of the different planes + * will be stored in the lines_sizes array. + * Call with ptr == NULL to get the required size for the ptr buffer. + * + * To allocate the buffer and fill in the AVPicture fields in one call, + * use avpicture_alloc(). + * + * @param picture AVPicture whose fields are to be filled in + * @param ptr Buffer which will contain or contains the actual image data + * @param pix_fmt The format in which the picture data is stored. + * @param width the width of the image in pixels + * @param height the height of the image in pixels + * @return size of the image data in bytes + */ +int avpicture_fill(AVPicture *picture, uint8_t *ptr, + enum PixelFormat pix_fmt, int width, int height); + +/** + * Copy pixel data from an AVPicture into a buffer. + * The data is stored compactly, without any gaps for alignment or padding + * which may be applied by avpicture_fill(). + * + * \see avpicture_get_size() + * + * @param[in] src AVPicture containing image data + * @param[in] pix_fmt The format in which the picture data is stored. + * @param[in] width the width of the image in pixels. + * @param[in] height the height of the image in pixels. + * @param[out] dest A buffer into which picture data will be copied. + * @param[in] dest_size The size of 'dest'. + * @return The number of bytes written to dest, or a negative value (error code) on error. + */ +int avpicture_layout(const AVPicture* src, enum PixelFormat pix_fmt, int width, int height, + unsigned char *dest, int dest_size); + +/** + * Calculate the size in bytes that a picture of the given width and height + * would occupy if stored in the given picture format. + * Note that this returns the size of a compact representation as generated + * by avpicture_layout(), which can be smaller than the size required for e.g. + * avpicture_fill(). + * + * @param pix_fmt the given picture format + * @param width the width of the image + * @param height the height of the image + * @return Image data size in bytes or -1 on error (e.g. too large dimensions). + */ +int avpicture_get_size(enum PixelFormat pix_fmt, int width, int height); +void avcodec_get_chroma_sub_sample(enum PixelFormat pix_fmt, int *h_shift, int *v_shift); + +/** + * Return the short name for a pixel format. + * + * \see av_get_pix_fmt(), av_get_pix_fmt_string(). + */ +const char *avcodec_get_pix_fmt_name(enum PixelFormat pix_fmt); + +void avcodec_set_dimensions(AVCodecContext *s, int width, int height); + +/** + * Return a value representing the fourCC code associated to the + * pixel format pix_fmt, or 0 if no associated fourCC code can be + * found. + */ +unsigned int avcodec_pix_fmt_to_codec_tag(enum PixelFormat pix_fmt); + +/** + * Put a string representing the codec tag codec_tag in buf. + * + * @param buf_size size in bytes of buf + * @return the length of the string that would have been generated if + * enough space had been available, excluding the trailing null + */ +size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag); + +#define FF_LOSS_RESOLUTION 0x0001 /**< loss due to resolution change */ +#define FF_LOSS_DEPTH 0x0002 /**< loss due to color depth change */ +#define FF_LOSS_COLORSPACE 0x0004 /**< loss due to color space conversion */ +#define FF_LOSS_ALPHA 0x0008 /**< loss of alpha bits */ +#define FF_LOSS_COLORQUANT 0x0010 /**< loss due to color quantization */ +#define FF_LOSS_CHROMA 0x0020 /**< loss of chroma (e.g. RGB to gray conversion) */ + +/** + * Compute what kind of losses will occur when converting from one specific + * pixel format to another. + * When converting from one pixel format to another, information loss may occur. + * For example, when converting from RGB24 to GRAY, the color information will + * be lost. Similarly, other losses occur when converting from some formats to + * other formats. These losses can involve loss of chroma, but also loss of + * resolution, loss of color depth, loss due to the color space conversion, loss + * of the alpha bits or loss due to color quantization. + * avcodec_get_fix_fmt_loss() informs you about the various types of losses + * which will occur when converting from one pixel format to another. + * + * @param[in] dst_pix_fmt destination pixel format + * @param[in] src_pix_fmt source pixel format + * @param[in] has_alpha Whether the source pixel format alpha channel is used. + * @return Combination of flags informing you what kind of losses will occur. + */ +int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_pix_fmt, + int has_alpha); + +/** + * Find the best pixel format to convert to given a certain source pixel + * format. When converting from one pixel format to another, information loss + * may occur. For example, when converting from RGB24 to GRAY, the color + * information will be lost. Similarly, other losses occur when converting from + * some formats to other formats. avcodec_find_best_pix_fmt() searches which of + * the given pixel formats should be used to suffer the least amount of loss. + * The pixel formats from which it chooses one, are determined by the + * pix_fmt_mask parameter. + * + * @code + * src_pix_fmt = PIX_FMT_YUV420P; + * pix_fmt_mask = (1 << PIX_FMT_YUV422P) || (1 << PIX_FMT_RGB24); + * dst_pix_fmt = avcodec_find_best_pix_fmt(pix_fmt_mask, src_pix_fmt, alpha, &loss); + * @endcode + * + * @param[in] pix_fmt_mask bitmask determining which pixel format to choose from + * @param[in] src_pix_fmt source pixel format + * @param[in] has_alpha Whether the source pixel format alpha channel is used. + * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur. + * @return The best pixel format to convert to or -1 if none was found. + */ +enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelFormat src_pix_fmt, + int has_alpha, int *loss_ptr); + +#define FF_ALPHA_TRANSP 0x0001 /* image has some totally transparent pixels */ +#define FF_ALPHA_SEMI_TRANSP 0x0002 /* image has some transparent pixels */ + +/** + * Tell if an image really has transparent alpha values. + * @return ored mask of FF_ALPHA_xxx constants + */ +int img_get_alpha_info(const AVPicture *src, + enum PixelFormat pix_fmt, int width, int height); + +/* deinterlace a picture */ +/* deinterlace - if not supported return -1 */ +int avpicture_deinterlace(AVPicture *dst, const AVPicture *src, + enum PixelFormat pix_fmt, int width, int height); + +/* external high level API */ + +/** + * If c is NULL, returns the first registered codec, + * if c is non-NULL, returns the next registered codec after c, + * or NULL if c is the last one. + */ +AVCodec *av_codec_next(AVCodec *c); + +/** + * Return the LIBAVCODEC_VERSION_INT constant. + */ +unsigned avcodec_version(void); + +/** + * Return the libavcodec build-time configuration. + */ +const char *avcodec_configuration(void); + +/** + * Return the libavcodec license. + */ +const char *avcodec_license(void); + +/** + * Initialize libavcodec. + * If called more than once, does nothing. + * + * @warning This function must be called before any other libavcodec + * function. + * + * @warning This function is not thread-safe. + */ +void avcodec_init(void); + +/** + * Register the codec codec and initialize libavcodec. + * + * @see avcodec_init(), avcodec_register_all() + */ +void avcodec_register(AVCodec *codec); + +/** + * Find a registered encoder with a matching codec ID. + * + * @param id CodecID of the requested encoder + * @return An encoder if one was found, NULL otherwise. + */ +AVCodec *avcodec_find_encoder(enum CodecID id); + +/** + * Find a registered encoder with the specified name. + * + * @param name name of the requested encoder + * @return An encoder if one was found, NULL otherwise. + */ +AVCodec *avcodec_find_encoder_by_name(const char *name); + +/** + * Find a registered decoder with a matching codec ID. + * + * @param id CodecID of the requested decoder + * @return A decoder if one was found, NULL otherwise. + */ +AVCodec *avcodec_find_decoder(enum CodecID id); + +/** + * Find a registered decoder with the specified name. + * + * @param name name of the requested decoder + * @return A decoder if one was found, NULL otherwise. + */ +AVCodec *avcodec_find_decoder_by_name(const char *name); +void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode); + +/** + * Return a name for the specified profile, if available. + * + * @param codec the codec that is searched for the given profile + * @param profile the profile value for which a name is requested + * @return A name for the profile if found, NULL otherwise. + */ +const char *av_get_profile_name(const AVCodec *codec, int profile); + +/** + * Set the fields of the given AVCodecContext to default values. + * + * @param s The AVCodecContext of which the fields should be set to default values. + */ +void avcodec_get_context_defaults(AVCodecContext *s); + +/** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! + * we WILL change its arguments and name a few times! */ +void avcodec_get_context_defaults2(AVCodecContext *s, enum AVMediaType); + +/** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! + * we WILL change its arguments and name a few times! */ +int avcodec_get_context_defaults3(AVCodecContext *s, AVCodec *codec); + +/** + * Allocate an AVCodecContext and set its fields to default values. The + * resulting struct can be deallocated by simply calling av_free(). + * + * @return An AVCodecContext filled with default values or NULL on failure. + * @see avcodec_get_context_defaults + */ +AVCodecContext *avcodec_alloc_context(void); + +/** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! + * we WILL change its arguments and name a few times! */ +AVCodecContext *avcodec_alloc_context2(enum AVMediaType); + +/** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! + * we WILL change its arguments and name a few times! */ +AVCodecContext *avcodec_alloc_context3(AVCodec *codec); + +/** + * Copy the settings of the source AVCodecContext into the destination + * AVCodecContext. The resulting destination codec context will be + * unopened, i.e. you are required to call avcodec_open() before you + * can use this AVCodecContext to decode/encode video/audio data. + * + * @param dest target codec context, should be initialized with + * avcodec_alloc_context(), but otherwise uninitialized + * @param src source codec context + * @return AVERROR() on error (e.g. memory allocation error), 0 on success + */ +int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src); + +/** + * Set the fields of the given AVFrame to default values. + * + * @param pic The AVFrame of which the fields should be set to default values. + */ +void avcodec_get_frame_defaults(AVFrame *pic); + +/** + * Allocate an AVFrame and set its fields to default values. The resulting + * struct can be deallocated by simply calling av_free(). + * + * @return An AVFrame filled with default values or NULL on failure. + * @see avcodec_get_frame_defaults + */ +AVFrame *avcodec_alloc_frame(void); + +int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic); +void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic); +int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic); + +/** + * Return the amount of padding in pixels which the get_buffer callback must + * provide around the edge of the image for codecs which do not have the + * CODEC_FLAG_EMU_EDGE flag. + * + * @return Required padding in pixels. + */ +unsigned avcodec_get_edge_width(void); +/** + * Modify width and height values so that they will result in a memory + * buffer that is acceptable for the codec if you do not use any horizontal + * padding. + * + * May only be used if a codec with CODEC_CAP_DR1 has been opened. + * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased + * according to avcodec_get_edge_width() before. + */ +void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height); +/** + * Modify width and height values so that they will result in a memory + * buffer that is acceptable for the codec if you also ensure that all + * line sizes are a multiple of the respective linesize_align[i]. + * + * May only be used if a codec with CODEC_CAP_DR1 has been opened. + * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased + * according to avcodec_get_edge_width() before. + */ +void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height, + int linesize_align[4]); + +enum PixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum PixelFormat * fmt); + +#if FF_API_THREAD_INIT +/** + * @deprecated Set s->thread_count before calling avcodec_open() instead of calling this. + */ +attribute_deprecated +int avcodec_thread_init(AVCodecContext *s, int thread_count); +#endif + +int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size); +int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count); +//FIXME func typedef + +/** + * Initialize the AVCodecContext to use the given AVCodec. Prior to using this + * function the context has to be allocated. + * + * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(), + * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for + * retrieving a codec. + * + * @warning This function is not thread safe! + * + * @code + * avcodec_register_all(); + * codec = avcodec_find_decoder(CODEC_ID_H264); + * if (!codec) + * exit(1); + * + * context = avcodec_alloc_context(); + * + * if (avcodec_open(context, codec) < 0) + * exit(1); + * @endcode + * + * @param avctx The context which will be set up to use the given codec. + * @param codec The codec to use within the context. + * @return zero on success, a negative value on error + * @see avcodec_alloc_context, avcodec_find_decoder, avcodec_find_encoder, avcodec_close + */ +int avcodec_open(AVCodecContext *avctx, AVCodec *codec); + +/** + * Decode the audio frame of size avpkt->size from avpkt->data into samples. + * Some decoders may support multiple frames in a single AVPacket, such + * decoders would then just decode the first frame. In this case, + * avcodec_decode_audio3 has to be called again with an AVPacket that contains + * the remaining data in order to decode the second frame etc. + * If no frame + * could be outputted, frame_size_ptr is zero. Otherwise, it is the + * decompressed frame size in bytes. + * + * @warning You must set frame_size_ptr to the allocated size of the + * output buffer before calling avcodec_decode_audio3(). + * + * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than + * the actual read bytes because some optimized bitstream readers read 32 or 64 + * bits at once and could read over the end. + * + * @warning The end of the input buffer avpkt->data should be set to 0 to ensure that + * no overreading happens for damaged MPEG streams. + * + * @note You might have to align the input buffer avpkt->data and output buffer + * samples. The alignment requirements depend on the CPU: On some CPUs it isn't + * necessary at all, on others it won't work at all if not aligned and on others + * it will work but it will have an impact on performance. + * + * In practice, avpkt->data should have 4 byte alignment at minimum and + * samples should be 16 byte aligned unless the CPU doesn't need it + * (AltiVec and SSE do). + * + * @param avctx the codec context + * @param[out] samples the output buffer, sample type in avctx->sample_fmt + * @param[in,out] frame_size_ptr the output buffer size in bytes + * @param[in] avpkt The input AVPacket containing the input buffer. + * You can create such packet with av_init_packet() and by then setting + * data and size, some decoders might in addition need other fields. + * All decoders are designed to use the least fields possible though. + * @return On error a negative value is returned, otherwise the number of bytes + * used or zero if no frame data was decompressed (used) from the input AVPacket. + */ +int avcodec_decode_audio3(AVCodecContext *avctx, int16_t *samples, + int *frame_size_ptr, + AVPacket *avpkt); + +/** + * Decode the video frame of size avpkt->size from avpkt->data into picture. + * Some decoders may support multiple frames in a single AVPacket, such + * decoders would then just decode the first frame. + * + * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than + * the actual read bytes because some optimized bitstream readers read 32 or 64 + * bits at once and could read over the end. + * + * @warning The end of the input buffer buf should be set to 0 to ensure that + * no overreading happens for damaged MPEG streams. + * + * @note You might have to align the input buffer avpkt->data. + * The alignment requirements depend on the CPU: on some CPUs it isn't + * necessary at all, on others it won't work at all if not aligned and on others + * it will work but it will have an impact on performance. + * + * In practice, avpkt->data should have 4 byte alignment at minimum. + * + * @note Some codecs have a delay between input and output, these need to be + * fed with avpkt->data=NULL, avpkt->size=0 at the end to return the remaining frames. + * + * @param avctx the codec context + * @param[out] picture The AVFrame in which the decoded video frame will be stored. + * Use avcodec_alloc_frame to get an AVFrame, the codec will + * allocate memory for the actual bitmap. + * with default get/release_buffer(), the decoder frees/reuses the bitmap as it sees fit. + * with overridden get/release_buffer() (needs CODEC_CAP_DR1) the user decides into what buffer the decoder + * decodes and the decoder tells the user once it does not need the data anymore, + * the user app can at this point free/reuse/keep the memory as it sees fit. + * + * @param[in] avpkt The input AVpacket containing the input buffer. + * You can create such packet with av_init_packet() and by then setting + * data and size, some decoders might in addition need other fields like + * flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least + * fields possible. + * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero. + * @return On error a negative value is returned, otherwise the number of bytes + * used or zero if no frame could be decompressed. + */ +int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture, + int *got_picture_ptr, + AVPacket *avpkt); + +/** + * Decode a subtitle message. + * Return a negative value on error, otherwise return the number of bytes used. + * If no subtitle could be decompressed, got_sub_ptr is zero. + * Otherwise, the subtitle is stored in *sub. + * Note that CODEC_CAP_DR1 is not available for subtitle codecs. This is for + * simplicity, because the performance difference is expect to be negligible + * and reusing a get_buffer written for video codecs would probably perform badly + * due to a potentially very different allocation pattern. + * + * @param avctx the codec context + * @param[out] sub The AVSubtitle in which the decoded subtitle will be stored, must be + freed with avsubtitle_free if *got_sub_ptr is set. + * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero. + * @param[in] avpkt The input AVPacket containing the input buffer. + */ +int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub, + int *got_sub_ptr, + AVPacket *avpkt); + +/** + * Frees all allocated data in the given subtitle struct. + * + * @param sub AVSubtitle to free. + */ +void avsubtitle_free(AVSubtitle *sub); + +int avcodec_parse_frame(AVCodecContext *avctx, uint8_t **pdata, + int *data_size_ptr, + uint8_t *buf, int buf_size); + +/** + * Encode an audio frame from samples into buf. + * + * @note The output buffer should be at least FF_MIN_BUFFER_SIZE bytes large. + * However, for PCM audio the user will know how much space is needed + * because it depends on the value passed in buf_size as described + * below. In that case a lower value can be used. + * + * @param avctx the codec context + * @param[out] buf the output buffer + * @param[in] buf_size the output buffer size + * @param[in] samples the input buffer containing the samples + * The number of samples read from this buffer is frame_size*channels, + * both of which are defined in avctx. + * For PCM audio the number of samples read from samples is equal to + * buf_size * input_sample_size / output_sample_size. + * @return On error a negative value is returned, on success zero or the number + * of bytes used to encode the data read from the input buffer. + */ +int avcodec_encode_audio(AVCodecContext *avctx, uint8_t *buf, int buf_size, + const short *samples); + +/** + * Encode a video frame from pict into buf. + * The input picture should be + * stored using a specific format, namely avctx.pix_fmt. + * + * @param avctx the codec context + * @param[out] buf the output buffer for the bitstream of encoded frame + * @param[in] buf_size the size of the output buffer in bytes + * @param[in] pict the input picture to encode + * @return On error a negative value is returned, on success zero or the number + * of bytes used from the output buffer. + */ +int avcodec_encode_video(AVCodecContext *avctx, uint8_t *buf, int buf_size, + const AVFrame *pict); +int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size, + const AVSubtitle *sub); + +int avcodec_close(AVCodecContext *avctx); + +/** + * Register all the codecs, parsers and bitstream filters which were enabled at + * configuration time. If you do not call this function you can select exactly + * which formats you want to support, by using the individual registration + * functions. + * + * @see avcodec_register + * @see av_register_codec_parser + * @see av_register_bitstream_filter + */ +void avcodec_register_all(void); + +/** + * Flush buffers, should be called when seeking or when switching to a different stream. + */ +void avcodec_flush_buffers(AVCodecContext *avctx); + +void avcodec_default_free_buffers(AVCodecContext *s); + +/* misc useful functions */ + +#if FF_API_OLD_FF_PICT_TYPES +/** + * Return a single letter to describe the given picture type pict_type. + * + * @param[in] pict_type the picture type + * @return A single character representing the picture type. + * @deprecated Use av_get_picture_type_char() instead. + */ +attribute_deprecated +char av_get_pict_type_char(int pict_type); +#endif + +/** + * Return codec bits per sample. + * + * @param[in] codec_id the codec + * @return Number of bits per sample or zero if unknown for the given codec. + */ +int av_get_bits_per_sample(enum CodecID codec_id); + +#if FF_API_OLD_SAMPLE_FMT +/** + * @deprecated Use av_get_bits_per_sample_fmt() instead. + */ +attribute_deprecated +int av_get_bits_per_sample_format(enum AVSampleFormat sample_fmt); +#endif + +/* frame parsing */ +typedef struct AVCodecParserContext { + void *priv_data; + struct AVCodecParser *parser; + int64_t frame_offset; /* offset of the current frame */ + int64_t cur_offset; /* current offset + (incremented by each av_parser_parse()) */ + int64_t next_frame_offset; /* offset of the next frame */ + /* video info */ + int pict_type; /* XXX: Put it back in AVCodecContext. */ + /** + * This field is used for proper frame duration computation in lavf. + * It signals, how much longer the frame duration of the current frame + * is compared to normal frame duration. + * + * frame_duration = (1 + repeat_pict) * time_base + * + * It is used by codecs like H.264 to display telecined material. + */ + int repeat_pict; /* XXX: Put it back in AVCodecContext. */ + int64_t pts; /* pts of the current frame */ + int64_t dts; /* dts of the current frame */ + + /* private data */ + int64_t last_pts; + int64_t last_dts; + int fetch_timestamp; + +#define AV_PARSER_PTS_NB 4 + int cur_frame_start_index; + int64_t cur_frame_offset[AV_PARSER_PTS_NB]; + int64_t cur_frame_pts[AV_PARSER_PTS_NB]; + int64_t cur_frame_dts[AV_PARSER_PTS_NB]; + + int flags; +#define PARSER_FLAG_COMPLETE_FRAMES 0x0001 +#define PARSER_FLAG_ONCE 0x0002 +/// Set if the parser has a valid file offset +#define PARSER_FLAG_FETCHED_OFFSET 0x0004 + + int64_t offset; ///< byte offset from starting packet start + int64_t cur_frame_end[AV_PARSER_PTS_NB]; + + /*! + * Set by parser to 1 for key frames and 0 for non-key frames. + * It is initialized to -1, so if the parser doesn't set this flag, + * old-style fallback using AV_PICTURE_TYPE_I picture type as key frames + * will be used. + */ + int key_frame; + + /** + * Time difference in stream time base units from the pts of this + * packet to the point at which the output from the decoder has converged + * independent from the availability of previous frames. That is, the + * frames are virtually identical no matter if decoding started from + * the very first frame or from this keyframe. + * Is AV_NOPTS_VALUE if unknown. + * This field is not the display duration of the current frame. + * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY + * set. + * + * The purpose of this field is to allow seeking in streams that have no + * keyframes in the conventional sense. It corresponds to the + * recovery point SEI in H.264 and match_time_delta in NUT. It is also + * essential for some types of subtitle streams to ensure that all + * subtitles are correctly displayed after seeking. + */ + int64_t convergence_duration; + + // Timestamp generation support: + /** + * Synchronization point for start of timestamp generation. + * + * Set to >0 for sync point, 0 for no sync point and <0 for undefined + * (default). + * + * For example, this corresponds to presence of H.264 buffering period + * SEI message. + */ + int dts_sync_point; + + /** + * Offset of the current timestamp against last timestamp sync point in + * units of AVCodecContext.time_base. + * + * Set to INT_MIN when dts_sync_point unused. Otherwise, it must + * contain a valid timestamp offset. + * + * Note that the timestamp of sync point has usually a nonzero + * dts_ref_dts_delta, which refers to the previous sync point. Offset of + * the next frame after timestamp sync point will be usually 1. + * + * For example, this corresponds to H.264 cpb_removal_delay. + */ + int dts_ref_dts_delta; + + /** + * Presentation delay of current frame in units of AVCodecContext.time_base. + * + * Set to INT_MIN when dts_sync_point unused. Otherwise, it must + * contain valid non-negative timestamp delta (presentation time of a frame + * must not lie in the past). + * + * This delay represents the difference between decoding and presentation + * time of the frame. + * + * For example, this corresponds to H.264 dpb_output_delay. + */ + int pts_dts_delta; + + /** + * Position of the packet in file. + * + * Analogous to cur_frame_pts/dts + */ + int64_t cur_frame_pos[AV_PARSER_PTS_NB]; + + /** + * Byte position of currently parsed frame in stream. + */ + int64_t pos; + + /** + * Previous frame byte position. + */ + int64_t last_pos; +} AVCodecParserContext; + +typedef struct AVCodecParser { + int codec_ids[5]; /* several codec IDs are permitted */ + int priv_data_size; + int (*parser_init)(AVCodecParserContext *s); + int (*parser_parse)(AVCodecParserContext *s, + AVCodecContext *avctx, + const uint8_t **poutbuf, int *poutbuf_size, + const uint8_t *buf, int buf_size); + void (*parser_close)(AVCodecParserContext *s); + int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size); + struct AVCodecParser *next; +} AVCodecParser; + +AVCodecParser *av_parser_next(AVCodecParser *c); + +void av_register_codec_parser(AVCodecParser *parser); +AVCodecParserContext *av_parser_init(int codec_id); + +/** + * Parse a packet. + * + * @param s parser context. + * @param avctx codec context. + * @param poutbuf set to pointer to parsed buffer or NULL if not yet finished. + * @param poutbuf_size set to size of parsed buffer or zero if not yet finished. + * @param buf input buffer. + * @param buf_size input length, to signal EOF, this should be 0 (so that the last frame can be output). + * @param pts input presentation timestamp. + * @param dts input decoding timestamp. + * @param pos input byte position in stream. + * @return the number of bytes of the input bitstream used. + * + * Example: + * @code + * while(in_len){ + * len = av_parser_parse2(myparser, AVCodecContext, &data, &size, + * in_data, in_len, + * pts, dts, pos); + * in_data += len; + * in_len -= len; + * + * if(size) + * decode_frame(data, size); + * } + * @endcode + */ +int av_parser_parse2(AVCodecParserContext *s, + AVCodecContext *avctx, + uint8_t **poutbuf, int *poutbuf_size, + const uint8_t *buf, int buf_size, + int64_t pts, int64_t dts, + int64_t pos); + +int av_parser_change(AVCodecParserContext *s, + AVCodecContext *avctx, + uint8_t **poutbuf, int *poutbuf_size, + const uint8_t *buf, int buf_size, int keyframe); +void av_parser_close(AVCodecParserContext *s); + + +typedef struct AVBitStreamFilterContext { + void *priv_data; + struct AVBitStreamFilter *filter; + AVCodecParserContext *parser; + struct AVBitStreamFilterContext *next; +} AVBitStreamFilterContext; + + +typedef struct AVBitStreamFilter { + const char *name; + int priv_data_size; + int (*filter)(AVBitStreamFilterContext *bsfc, + AVCodecContext *avctx, const char *args, + uint8_t **poutbuf, int *poutbuf_size, + const uint8_t *buf, int buf_size, int keyframe); + void (*close)(AVBitStreamFilterContext *bsfc); + struct AVBitStreamFilter *next; +} AVBitStreamFilter; + +void av_register_bitstream_filter(AVBitStreamFilter *bsf); +AVBitStreamFilterContext *av_bitstream_filter_init(const char *name); +int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc, + AVCodecContext *avctx, const char *args, + uint8_t **poutbuf, int *poutbuf_size, + const uint8_t *buf, int buf_size, int keyframe); +void av_bitstream_filter_close(AVBitStreamFilterContext *bsf); + +AVBitStreamFilter *av_bitstream_filter_next(AVBitStreamFilter *f); + +/* memory */ + +/** + * Reallocate the given block if it is not large enough, otherwise do nothing. + * + * @see av_realloc + */ +void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size); + +/** + * Allocate a buffer, reusing the given one if large enough. + * + * Contrary to av_fast_realloc the current buffer contents might not be + * preserved and on error the old buffer is freed, thus no special + * handling to avoid memleaks is necessary. + * + * @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer + * @param size size of the buffer *ptr points to + * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and + * *size 0 if an error occurred. + */ +void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size); + +/** + * Copy image src to dst. Wraps av_picture_data_copy() above. + */ +void av_picture_copy(AVPicture *dst, const AVPicture *src, + enum PixelFormat pix_fmt, int width, int height); + +/** + * Crop image top and left side. + */ +int av_picture_crop(AVPicture *dst, const AVPicture *src, + enum PixelFormat pix_fmt, int top_band, int left_band); + +/** + * Pad image. + */ +int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum PixelFormat pix_fmt, + int padtop, int padbottom, int padleft, int padright, int *color); + +/** + * Encode extradata length to a buffer. Used by xiph codecs. + * + * @param s buffer to write to; must be at least (v/255+1) bytes long + * @param v size of extradata in bytes + * @return number of bytes written to the buffer. + */ +unsigned int av_xiphlacing(unsigned char *s, unsigned int v); + +/** + * Logs a generic warning message about a missing feature. This function is + * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) + * only, and would normally not be used by applications. + * @param[in] avc a pointer to an arbitrary struct of which the first field is + * a pointer to an AVClass struct + * @param[in] feature string containing the name of the missing feature + * @param[in] want_sample indicates if samples are wanted which exhibit this feature. + * If want_sample is non-zero, additional verbage will be added to the log + * message which tells the user how to report samples to the development + * mailing list. + */ +void av_log_missing_feature(void *avc, const char *feature, int want_sample); + +/** + * Log a generic warning message asking for a sample. This function is + * intended to be used internally by FFmpeg (libavcodec, libavformat, etc.) + * only, and would normally not be used by applications. + * @param[in] avc a pointer to an arbitrary struct of which the first field is + * a pointer to an AVClass struct + * @param[in] msg string containing an optional message, or NULL if no message + */ +void av_log_ask_for_sample(void *avc, const char *msg, ...); + +/** + * Register the hardware accelerator hwaccel. + */ +void av_register_hwaccel(AVHWAccel *hwaccel); + +/** + * If hwaccel is NULL, returns the first registered hardware accelerator, + * if hwaccel is non-NULL, returns the next registered hardware accelerator + * after hwaccel, or NULL if hwaccel is the last one. + */ +AVHWAccel *av_hwaccel_next(AVHWAccel *hwaccel); + + +/** + * Lock operation used by lockmgr + */ +enum AVLockOp { + AV_LOCK_CREATE, ///< Create a mutex + AV_LOCK_OBTAIN, ///< Lock the mutex + AV_LOCK_RELEASE, ///< Unlock the mutex + AV_LOCK_DESTROY, ///< Free mutex resources +}; + +/** + * Register a user provided lock manager supporting the operations + * specified by AVLockOp. mutex points to a (void *) where the + * lockmgr should store/get a pointer to a user allocated mutex. It's + * NULL upon AV_LOCK_CREATE and != NULL for all other ops. + * + * @param cb User defined callback. Note: FFmpeg may invoke calls to this + * callback during the call to av_lockmgr_register(). + * Thus, the application must be prepared to handle that. + * If cb is set to NULL the lockmgr will be unregistered. + * Also note that during unregistration the previously registered + * lockmgr callback may also be invoked. + */ +int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op)); + +#endif /* AVCODEC_AVCODEC_H */ diff --git a/ffmpeg 0.7/include/libavcodec/avfft.h b/ffmpeg 0.7/include/libavcodec/avfft.h new file mode 100644 index 000000000..be2d9c7e1 --- /dev/null +++ b/ffmpeg 0.7/include/libavcodec/avfft.h @@ -0,0 +1,99 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_AVFFT_H +#define AVCODEC_AVFFT_H + +typedef float FFTSample; + +typedef struct FFTComplex { + FFTSample re, im; +} FFTComplex; + +typedef struct FFTContext FFTContext; + +/** + * Set up a complex FFT. + * @param nbits log2 of the length of the input array + * @param inverse if 0 perform the forward transform, if 1 perform the inverse + */ +FFTContext *av_fft_init(int nbits, int inverse); + +/** + * Do the permutation needed BEFORE calling ff_fft_calc(). + */ +void av_fft_permute(FFTContext *s, FFTComplex *z); + +/** + * Do a complex FFT with the parameters defined in av_fft_init(). The + * input data must be permuted before. No 1.0/sqrt(n) normalization is done. + */ +void av_fft_calc(FFTContext *s, FFTComplex *z); + +void av_fft_end(FFTContext *s); + +FFTContext *av_mdct_init(int nbits, int inverse, double scale); +void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input); +void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input); +void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input); +void av_mdct_end(FFTContext *s); + +/* Real Discrete Fourier Transform */ + +enum RDFTransformType { + DFT_R2C, + IDFT_C2R, + IDFT_R2C, + DFT_C2R, +}; + +typedef struct RDFTContext RDFTContext; + +/** + * Set up a real FFT. + * @param nbits log2 of the length of the input array + * @param trans the type of transform + */ +RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans); +void av_rdft_calc(RDFTContext *s, FFTSample *data); +void av_rdft_end(RDFTContext *s); + +/* Discrete Cosine Transform */ + +typedef struct DCTContext DCTContext; + +enum DCTTransformType { + DCT_II = 0, + DCT_III, + DCT_I, + DST_I, +}; + +/** + * Set up DCT. + * @param nbits size of the input array: + * (1 << nbits) for DCT-II, DCT-III and DST-I + * (1 << nbits) + 1 for DCT-I + * + * @note the first element of the input of DST-I is ignored + */ +DCTContext *av_dct_init(int nbits, enum DCTTransformType type); +void av_dct_calc(DCTContext *s, FFTSample *data); +void av_dct_end (DCTContext *s); + +#endif /* AVCODEC_AVFFT_H */ diff --git a/ffmpeg 0.7/include/libavcodec/dxva2.h b/ffmpeg 0.7/include/libavcodec/dxva2.h new file mode 100644 index 000000000..5c5fe21e2 --- /dev/null +++ b/ffmpeg 0.7/include/libavcodec/dxva2.h @@ -0,0 +1,68 @@ +/* + * DXVA2 HW acceleration + * + * copyright (c) 2009 Laurent Aimar + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_DXVA_H +#define AVCODEC_DXVA_H + +#include + +#include + +/** + * This structure is used to provides the necessary configurations and data + * to the DXVA2 FFmpeg HWAccel implementation. + * + * The application must make it available as AVCodecContext.hwaccel_context. + */ +struct dxva_context { + /** + * DXVA2 decoder object + */ + IDirectXVideoDecoder *decoder; + + /** + * DXVA2 configuration used to create the decoder + */ + const DXVA2_ConfigPictureDecode *cfg; + + /** + * The number of surface in the surface array + */ + unsigned surface_count; + + /** + * The array of Direct3D surfaces used to create the decoder + */ + LPDIRECT3DSURFACE9 *surface; + + /** + * A bit field configuring the workarounds needed for using the decoder + */ + uint64_t workaround; + + /** + * Private to the FFmpeg AVHWAccel implementation + */ + unsigned report_id; +}; + +#endif /* AVCODEC_DXVA_H */ diff --git a/ffmpeg 0.7/include/libavcodec/opt.h b/ffmpeg 0.7/include/libavcodec/opt.h new file mode 100644 index 000000000..e754bb93d --- /dev/null +++ b/ffmpeg 0.7/include/libavcodec/opt.h @@ -0,0 +1,16 @@ +/** + * @file + * This header is provided for compatibility only and will be removed + * on next major bump + */ + +#ifndef AVCODEC_OPT_H +#define AVCODEC_OPT_H + +#include "libavcodec/version.h" + +#if FF_API_OPT_H +#include "libavutil/opt.h" +#endif + +#endif diff --git a/ffmpeg 0.7/include/libavcodec/vaapi.h b/ffmpeg 0.7/include/libavcodec/vaapi.h new file mode 100644 index 000000000..07568a47f --- /dev/null +++ b/ffmpeg 0.7/include/libavcodec/vaapi.h @@ -0,0 +1,167 @@ +/* + * Video Acceleration API (shared data between FFmpeg and the video player) + * HW decode acceleration for MPEG-2, MPEG-4, H.264 and VC-1 + * + * Copyright (C) 2008-2009 Splitted-Desktop Systems + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_VAAPI_H +#define AVCODEC_VAAPI_H + +#include + +/** + * \defgroup VAAPI_Decoding VA API Decoding + * \ingroup Decoder + * @{ + */ + +/** + * This structure is used to share data between the FFmpeg library and + * the client video application. + * This shall be zero-allocated and available as + * AVCodecContext.hwaccel_context. All user members can be set once + * during initialization or through each AVCodecContext.get_buffer() + * function call. In any case, they must be valid prior to calling + * decoding functions. + */ +struct vaapi_context { + /** + * Window system dependent data + * + * - encoding: unused + * - decoding: Set by user + */ + void *display; + + /** + * Configuration ID + * + * - encoding: unused + * - decoding: Set by user + */ + uint32_t config_id; + + /** + * Context ID (video decode pipeline) + * + * - encoding: unused + * - decoding: Set by user + */ + uint32_t context_id; + + /** + * VAPictureParameterBuffer ID + * + * - encoding: unused + * - decoding: Set by libavcodec + */ + uint32_t pic_param_buf_id; + + /** + * VAIQMatrixBuffer ID + * + * - encoding: unused + * - decoding: Set by libavcodec + */ + uint32_t iq_matrix_buf_id; + + /** + * VABitPlaneBuffer ID (for VC-1 decoding) + * + * - encoding: unused + * - decoding: Set by libavcodec + */ + uint32_t bitplane_buf_id; + + /** + * Slice parameter/data buffer IDs + * + * - encoding: unused + * - decoding: Set by libavcodec + */ + uint32_t *slice_buf_ids; + + /** + * Number of effective slice buffer IDs to send to the HW + * + * - encoding: unused + * - decoding: Set by libavcodec + */ + unsigned int n_slice_buf_ids; + + /** + * Size of pre-allocated slice_buf_ids + * + * - encoding: unused + * - decoding: Set by libavcodec + */ + unsigned int slice_buf_ids_alloc; + + /** + * Pointer to VASliceParameterBuffers + * + * - encoding: unused + * - decoding: Set by libavcodec + */ + void *slice_params; + + /** + * Size of a VASliceParameterBuffer element + * + * - encoding: unused + * - decoding: Set by libavcodec + */ + unsigned int slice_param_size; + + /** + * Size of pre-allocated slice_params + * + * - encoding: unused + * - decoding: Set by libavcodec + */ + unsigned int slice_params_alloc; + + /** + * Number of slices currently filled in + * + * - encoding: unused + * - decoding: Set by libavcodec + */ + unsigned int slice_count; + + /** + * Pointer to slice data buffer base + * - encoding: unused + * - decoding: Set by libavcodec + */ + const uint8_t *slice_data; + + /** + * Current size of slice data + * + * - encoding: unused + * - decoding: Set by libavcodec + */ + uint32_t slice_data_size; +}; + +/* @} */ + +#endif /* AVCODEC_VAAPI_H */ diff --git a/ffmpeg 0.7/include/libavcodec/vdpau.h b/ffmpeg 0.7/include/libavcodec/vdpau.h new file mode 100644 index 000000000..0dc6fb850 --- /dev/null +++ b/ffmpeg 0.7/include/libavcodec/vdpau.h @@ -0,0 +1,88 @@ +/* + * The Video Decode and Presentation API for UNIX (VDPAU) is used for + * hardware-accelerated decoding of MPEG-1/2, H.264 and VC-1. + * + * Copyright (C) 2008 NVIDIA + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_VDPAU_H +#define AVCODEC_VDPAU_H + +/** + * \defgroup Decoder VDPAU Decoder and Renderer + * + * VDPAU hardware acceleration has two modules + * - VDPAU decoding + * - VDPAU presentation + * + * The VDPAU decoding module parses all headers using FFmpeg + * parsing mechanisms and uses VDPAU for the actual decoding. + * + * As per the current implementation, the actual decoding + * and rendering (API calls) are done as part of the VDPAU + * presentation (vo_vdpau.c) module. + * + * \defgroup VDPAU_Decoding VDPAU Decoding + * \ingroup Decoder + * @{ + */ + +#include +#include + +/** \brief The videoSurface is used for rendering. */ +#define FF_VDPAU_STATE_USED_FOR_RENDER 1 + +/** + * \brief The videoSurface is needed for reference/prediction. + * The codec manipulates this. + */ +#define FF_VDPAU_STATE_USED_FOR_REFERENCE 2 + +/** + * \brief This structure is used as a callback between the FFmpeg + * decoder (vd_) and presentation (vo_) module. + * This is used for defining a video frame containing surface, + * picture parameter, bitstream information etc which are passed + * between the FFmpeg decoder and its clients. + */ +struct vdpau_render_state { + VdpVideoSurface surface; ///< Used as rendered surface, never changed. + + int state; ///< Holds FF_VDPAU_STATE_* values. + + /** Describe size/location of the compressed video data. + Set to 0 when freeing bitstream_buffers. */ + int bitstream_buffers_allocated; + int bitstream_buffers_used; + /** The user is responsible for freeing this buffer using av_freep(). */ + VdpBitstreamBuffer *bitstream_buffers; + + /** picture parameter information for all supported codecs */ + union VdpPictureInfo { + VdpPictureInfoH264 h264; + VdpPictureInfoMPEG1Or2 mpeg; + VdpPictureInfoVC1 vc1; + VdpPictureInfoMPEG4Part2 mpeg4; + } info; +}; + +/* @}*/ + +#endif /* AVCODEC_VDPAU_H */ diff --git a/ffmpeg 0.7/include/libavcodec/version.h b/ffmpeg 0.7/include/libavcodec/version.h new file mode 100644 index 000000000..471e3aaa9 --- /dev/null +++ b/ffmpeg 0.7/include/libavcodec/version.h @@ -0,0 +1,69 @@ +/* + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_VERSION_H +#define AVCODEC_VERSION_H + +#define LIBAVCODEC_VERSION_MAJOR 53 +#define LIBAVCODEC_VERSION_MINOR 6 +#define LIBAVCODEC_VERSION_MICRO 0 + +#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ + LIBAVCODEC_VERSION_MINOR, \ + LIBAVCODEC_VERSION_MICRO) +#define LIBAVCODEC_VERSION AV_VERSION(LIBAVCODEC_VERSION_MAJOR, \ + LIBAVCODEC_VERSION_MINOR, \ + LIBAVCODEC_VERSION_MICRO) +#define LIBAVCODEC_BUILD LIBAVCODEC_VERSION_INT + +#define LIBAVCODEC_IDENT "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION) + +/** + * Those FF_API_* defines are not part of public API. + * They may change, break or disappear at any time. + */ +#ifndef FF_API_PALETTE_CONTROL +#define FF_API_PALETTE_CONTROL (LIBAVCODEC_VERSION_MAJOR < 54) +#endif +#ifndef FF_API_OLD_SAMPLE_FMT +#define FF_API_OLD_SAMPLE_FMT (LIBAVCODEC_VERSION_MAJOR < 54) +#endif +#ifndef FF_API_OLD_AUDIOCONVERT +#define FF_API_OLD_AUDIOCONVERT (LIBAVCODEC_VERSION_MAJOR < 54) +#endif +#ifndef FF_API_ANTIALIAS_ALGO +#define FF_API_ANTIALIAS_ALGO (LIBAVCODEC_VERSION_MAJOR < 54) +#endif +#ifndef FF_API_REQUEST_CHANNELS +#define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 54) +#endif +#ifndef FF_API_OPT_H +#define FF_API_OPT_H (LIBAVCODEC_VERSION_MAJOR < 54) +#endif +#ifndef FF_API_THREAD_INIT +#define FF_API_THREAD_INIT (LIBAVCODEC_VERSION_MAJOR < 54) +#endif +#ifndef FF_API_OLD_FF_PICT_TYPES +#define FF_API_OLD_FF_PICT_TYPES (LIBAVCODEC_VERSION_MAJOR < 54) +#endif +#ifndef FF_API_FLAC_GLOBAL_OPTS +#define FF_API_FLAC_GLOBAL_OPTS (LIBAVCODEC_VERSION_MAJOR < 54) +#endif + +#endif /* AVCODEC_VERSION_H */ diff --git a/ffmpeg 0.7/include/libavcodec/xvmc.h b/ffmpeg 0.7/include/libavcodec/xvmc.h new file mode 100644 index 000000000..93ad8bb9a --- /dev/null +++ b/ffmpeg 0.7/include/libavcodec/xvmc.h @@ -0,0 +1,151 @@ +/* + * Copyright (C) 2003 Ivan Kalvachev + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVCODEC_XVMC_H +#define AVCODEC_XVMC_H + +#include + +#include "avcodec.h" + +#define AV_XVMC_ID 0x1DC711C0 /**< special value to ensure that regular pixel routines haven't corrupted the struct + the number is 1337 speak for the letters IDCT MCo (motion compensation) */ + +struct xvmc_pix_fmt { + /** The field contains the special constant value AV_XVMC_ID. + It is used as a test that the application correctly uses the API, + and that there is no corruption caused by pixel routines. + - application - set during initialization + - libavcodec - unchanged + */ + int xvmc_id; + + /** Pointer to the block array allocated by XvMCCreateBlocks(). + The array has to be freed by XvMCDestroyBlocks(). + Each group of 64 values represents one data block of differential + pixel information (in MoCo mode) or coefficients for IDCT. + - application - set the pointer during initialization + - libavcodec - fills coefficients/pixel data into the array + */ + short* data_blocks; + + /** Pointer to the macroblock description array allocated by + XvMCCreateMacroBlocks() and freed by XvMCDestroyMacroBlocks(). + - application - set the pointer during initialization + - libavcodec - fills description data into the array + */ + XvMCMacroBlock* mv_blocks; + + /** Number of macroblock descriptions that can be stored in the mv_blocks + array. + - application - set during initialization + - libavcodec - unchanged + */ + int allocated_mv_blocks; + + /** Number of blocks that can be stored at once in the data_blocks array. + - application - set during initialization + - libavcodec - unchanged + */ + int allocated_data_blocks; + + /** Indicate that the hardware would interpret data_blocks as IDCT + coefficients and perform IDCT on them. + - application - set during initialization + - libavcodec - unchanged + */ + int idct; + + /** In MoCo mode it indicates that intra macroblocks are assumed to be in + unsigned format; same as the XVMC_INTRA_UNSIGNED flag. + - application - set during initialization + - libavcodec - unchanged + */ + int unsigned_intra; + + /** Pointer to the surface allocated by XvMCCreateSurface(). + It has to be freed by XvMCDestroySurface() on application exit. + It identifies the frame and its state on the video hardware. + - application - set during initialization + - libavcodec - unchanged + */ + XvMCSurface* p_surface; + +/** Set by the decoder before calling ff_draw_horiz_band(), + needed by the XvMCRenderSurface function. */ +//@{ + /** Pointer to the surface used as past reference + - application - unchanged + - libavcodec - set + */ + XvMCSurface* p_past_surface; + + /** Pointer to the surface used as future reference + - application - unchanged + - libavcodec - set + */ + XvMCSurface* p_future_surface; + + /** top/bottom field or frame + - application - unchanged + - libavcodec - set + */ + unsigned int picture_structure; + + /** XVMC_SECOND_FIELD - 1st or 2nd field in the sequence + - application - unchanged + - libavcodec - set + */ + unsigned int flags; +//}@ + + /** Number of macroblock descriptions in the mv_blocks array + that have already been passed to the hardware. + - application - zeroes it on get_buffer(). + A successful ff_draw_horiz_band() may increment it + with filled_mb_block_num or zero both. + - libavcodec - unchanged + */ + int start_mv_blocks_num; + + /** Number of new macroblock descriptions in the mv_blocks array (after + start_mv_blocks_num) that are filled by libavcodec and have to be + passed to the hardware. + - application - zeroes it on get_buffer() or after successful + ff_draw_horiz_band(). + - libavcodec - increment with one of each stored MB + */ + int filled_mv_blocks_num; + + /** Number of the the next free data block; one data block consists of + 64 short values in the data_blocks array. + All blocks before this one have already been claimed by placing their + position into the corresponding block description structure field, + that are part of the mv_blocks array. + - application - zeroes it on get_buffer(). + A successful ff_draw_horiz_band() may zero it together + with start_mb_blocks_num. + - libavcodec - each decoded macroblock increases it by the number + of coded blocks it contains. + */ + int next_free_data_block_num; +}; + +#endif /* AVCODEC_XVMC_H */ diff --git a/ffmpeg 0.7/include/libavdevice/avdevice.h b/ffmpeg 0.7/include/libavdevice/avdevice.h new file mode 100644 index 000000000..d31c99e65 --- /dev/null +++ b/ffmpeg 0.7/include/libavdevice/avdevice.h @@ -0,0 +1,58 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVDEVICE_AVDEVICE_H +#define AVDEVICE_AVDEVICE_H + +#include "libavutil/avutil.h" + +#define LIBAVDEVICE_VERSION_MAJOR 53 +#define LIBAVDEVICE_VERSION_MINOR 0 +#define LIBAVDEVICE_VERSION_MICRO 0 + +#define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \ + LIBAVDEVICE_VERSION_MINOR, \ + LIBAVDEVICE_VERSION_MICRO) +#define LIBAVDEVICE_VERSION AV_VERSION(LIBAVDEVICE_VERSION_MAJOR, \ + LIBAVDEVICE_VERSION_MINOR, \ + LIBAVDEVICE_VERSION_MICRO) +#define LIBAVDEVICE_BUILD LIBAVDEVICE_VERSION_INT + +/** + * Return the LIBAVDEVICE_VERSION_INT constant. + */ +unsigned avdevice_version(void); + +/** + * Return the libavdevice build-time configuration. + */ +const char *avdevice_configuration(void); + +/** + * Return the libavdevice license. + */ +const char *avdevice_license(void); + +/** + * Initialize libavdevice and register all the input and output devices. + * @warning This function is not thread safe. + */ +void avdevice_register_all(void); + +#endif /* AVDEVICE_AVDEVICE_H */ + diff --git a/ffmpeg 0.7/include/libavfilter/avcodec.h b/ffmpeg 0.7/include/libavfilter/avcodec.h new file mode 100644 index 000000000..f438860d0 --- /dev/null +++ b/ffmpeg 0.7/include/libavfilter/avcodec.h @@ -0,0 +1,40 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVFILTER_AVCODEC_H +#define AVFILTER_AVCODEC_H + +/** + * @file + * libavcodec/libavfilter gluing utilities + * + * This should be included in an application ONLY if the installed + * libavfilter has been compiled with libavcodec support, otherwise + * symbols defined below will not be available. + */ + +#include "libavcodec/avcodec.h" // AVFrame +#include "avfilter.h" + +/** + * Copy the frame properties of src to dst, without copying the actual + * image data. + */ +void avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src); + +#endif /* AVFILTER_AVCODEC_H */ diff --git a/ffmpeg 0.7/include/libavfilter/avfilter.h b/ffmpeg 0.7/include/libavfilter/avfilter.h new file mode 100644 index 000000000..03a1e49a4 --- /dev/null +++ b/ffmpeg 0.7/include/libavfilter/avfilter.h @@ -0,0 +1,864 @@ +/* + * filter layer + * Copyright (c) 2007 Bobby Bingham + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVFILTER_AVFILTER_H +#define AVFILTER_AVFILTER_H + +#include "libavutil/avutil.h" +#include "libavutil/samplefmt.h" + +#define LIBAVFILTER_VERSION_MAJOR 2 +#define LIBAVFILTER_VERSION_MINOR 5 +#define LIBAVFILTER_VERSION_MICRO 0 + +#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \ + LIBAVFILTER_VERSION_MINOR, \ + LIBAVFILTER_VERSION_MICRO) +#define LIBAVFILTER_VERSION AV_VERSION(LIBAVFILTER_VERSION_MAJOR, \ + LIBAVFILTER_VERSION_MINOR, \ + LIBAVFILTER_VERSION_MICRO) +#define LIBAVFILTER_BUILD LIBAVFILTER_VERSION_INT + +#include + +/** + * Return the LIBAVFILTER_VERSION_INT constant. + */ +unsigned avfilter_version(void); + +/** + * Return the libavfilter build-time configuration. + */ +const char *avfilter_configuration(void); + +/** + * Return the libavfilter license. + */ +const char *avfilter_license(void); + + +typedef struct AVFilterContext AVFilterContext; +typedef struct AVFilterLink AVFilterLink; +typedef struct AVFilterPad AVFilterPad; + +/** + * A reference-counted buffer data type used by the filter system. Filters + * should not store pointers to this structure directly, but instead use the + * AVFilterBufferRef structure below. + */ +typedef struct AVFilterBuffer { + uint8_t *data[8]; ///< buffer data for each plane/channel + int linesize[8]; ///< number of bytes per line + + unsigned refcount; ///< number of references to this buffer + + /** private data to be used by a custom free function */ + void *priv; + /** + * A pointer to the function to deallocate this buffer if the default + * function is not sufficient. This could, for example, add the memory + * back into a memory pool to be reused later without the overhead of + * reallocating it from scratch. + */ + void (*free)(struct AVFilterBuffer *buf); + + int format; ///< media format + int w, h; ///< width and height of the allocated buffer +} AVFilterBuffer; + +#define AV_PERM_READ 0x01 ///< can read from the buffer +#define AV_PERM_WRITE 0x02 ///< can write to the buffer +#define AV_PERM_PRESERVE 0x04 ///< nobody else can overwrite the buffer +#define AV_PERM_REUSE 0x08 ///< can output the buffer multiple times, with the same contents each time +#define AV_PERM_REUSE2 0x10 ///< can output the buffer multiple times, modified each time +#define AV_PERM_NEG_LINESIZES 0x20 ///< the buffer requested can have negative linesizes + +/** + * Audio specific properties in a reference to an AVFilterBuffer. Since + * AVFilterBufferRef is common to different media formats, audio specific + * per reference properties must be separated out. + */ +typedef struct AVFilterBufferRefAudioProps { + int64_t channel_layout; ///< channel layout of audio buffer + int nb_samples; ///< number of audio samples + int size; ///< audio buffer size + uint32_t sample_rate; ///< audio buffer sample rate + int planar; ///< audio buffer - planar or packed +} AVFilterBufferRefAudioProps; + +/** + * Video specific properties in a reference to an AVFilterBuffer. Since + * AVFilterBufferRef is common to different media formats, video specific + * per reference properties must be separated out. + */ +typedef struct AVFilterBufferRefVideoProps { + int w; ///< image width + int h; ///< image height + AVRational sample_aspect_ratio; ///< sample aspect ratio + int interlaced; ///< is frame interlaced + int top_field_first; ///< field order + enum AVPictureType pict_type; ///< picture type of the frame + int key_frame; ///< 1 -> keyframe, 0-> not +} AVFilterBufferRefVideoProps; + +/** + * A reference to an AVFilterBuffer. Since filters can manipulate the origin of + * a buffer to, for example, crop image without any memcpy, the buffer origin + * and dimensions are per-reference properties. Linesize is also useful for + * image flipping, frame to field filters, etc, and so is also per-reference. + * + * TODO: add anything necessary for frame reordering + */ +typedef struct AVFilterBufferRef { + AVFilterBuffer *buf; ///< the buffer that this is a reference to + uint8_t *data[8]; ///< picture/audio data for each plane + int linesize[8]; ///< number of bytes per line + int format; ///< media format + + /** + * presentation timestamp. The time unit may change during + * filtering, as it is specified in the link and the filter code + * may need to rescale the PTS accordingly. + */ + int64_t pts; + int64_t pos; ///< byte position in stream, -1 if unknown + + int perms; ///< permissions, see the AV_PERM_* flags + + enum AVMediaType type; ///< media type of buffer data + AVFilterBufferRefVideoProps *video; ///< video buffer specific properties + AVFilterBufferRefAudioProps *audio; ///< audio buffer specific properties +} AVFilterBufferRef; + +/** + * Copy properties of src to dst, without copying the actual data + */ +static inline void avfilter_copy_buffer_ref_props(AVFilterBufferRef *dst, AVFilterBufferRef *src) +{ + // copy common properties + dst->pts = src->pts; + dst->pos = src->pos; + + switch (src->type) { + case AVMEDIA_TYPE_VIDEO: *dst->video = *src->video; break; + case AVMEDIA_TYPE_AUDIO: *dst->audio = *src->audio; break; + } +} + +/** + * Add a new reference to a buffer. + * + * @param ref an existing reference to the buffer + * @param pmask a bitmask containing the allowable permissions in the new + * reference + * @return a new reference to the buffer with the same properties as the + * old, excluding any permissions denied by pmask + */ +AVFilterBufferRef *avfilter_ref_buffer(AVFilterBufferRef *ref, int pmask); + +/** + * Remove a reference to a buffer. If this is the last reference to the + * buffer, the buffer itself is also automatically freed. + * + * @param ref reference to the buffer, may be NULL + */ +void avfilter_unref_buffer(AVFilterBufferRef *ref); + +/** + * A list of supported formats for one end of a filter link. This is used + * during the format negotiation process to try to pick the best format to + * use to minimize the number of necessary conversions. Each filter gives a + * list of the formats supported by each input and output pad. The list + * given for each pad need not be distinct - they may be references to the + * same list of formats, as is often the case when a filter supports multiple + * formats, but will always output the same format as it is given in input. + * + * In this way, a list of possible input formats and a list of possible + * output formats are associated with each link. When a set of formats is + * negotiated over a link, the input and output lists are merged to form a + * new list containing only the common elements of each list. In the case + * that there were no common elements, a format conversion is necessary. + * Otherwise, the lists are merged, and all other links which reference + * either of the format lists involved in the merge are also affected. + * + * For example, consider the filter chain: + * filter (a) --> (b) filter (b) --> (c) filter + * + * where the letters in parenthesis indicate a list of formats supported on + * the input or output of the link. Suppose the lists are as follows: + * (a) = {A, B} + * (b) = {A, B, C} + * (c) = {B, C} + * + * First, the first link's lists are merged, yielding: + * filter (a) --> (a) filter (a) --> (c) filter + * + * Notice that format list (b) now refers to the same list as filter list (a). + * Next, the lists for the second link are merged, yielding: + * filter (a) --> (a) filter (a) --> (a) filter + * + * where (a) = {B}. + * + * Unfortunately, when the format lists at the two ends of a link are merged, + * we must ensure that all links which reference either pre-merge format list + * get updated as well. Therefore, we have the format list structure store a + * pointer to each of the pointers to itself. + */ +typedef struct AVFilterFormats { + unsigned format_count; ///< number of formats + int *formats; ///< list of media formats + + unsigned refcount; ///< number of references to this list + struct AVFilterFormats ***refs; ///< references to this list +} AVFilterFormats; + +/** + * Create a list of supported formats. This is intended for use in + * AVFilter->query_formats(). + * + * @param fmts list of media formats, terminated by -1 + * @return the format list, with no existing references + */ +AVFilterFormats *avfilter_make_format_list(const int *fmts); + +/** + * Add fmt to the list of media formats contained in *avff. + * If *avff is NULL the function allocates the filter formats struct + * and puts its pointer in *avff. + * + * @return a non negative value in case of success, or a negative + * value corresponding to an AVERROR code in case of error + */ +int avfilter_add_format(AVFilterFormats **avff, int fmt); + +/** + * Return a list of all formats supported by FFmpeg for the given media type. + */ +AVFilterFormats *avfilter_all_formats(enum AVMediaType type); + +/** + * Return a format list which contains the intersection of the formats of + * a and b. Also, all the references of a, all the references of b, and + * a and b themselves will be deallocated. + * + * If a and b do not share any common formats, neither is modified, and NULL + * is returned. + */ +AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b); + +/** + * Add *ref as a new reference to formats. + * That is the pointers will point like in the ascii art below: + * ________ + * |formats |<--------. + * | ____ | ____|___________________ + * | |refs| | | __|_ + * | |* * | | | | | | AVFilterLink + * | |* *--------->|*ref| + * | |____| | | |____| + * |________| |________________________ + */ +void avfilter_formats_ref(AVFilterFormats *formats, AVFilterFormats **ref); + +/** + * If *ref is non-NULL, remove *ref as a reference to the format list + * it currently points to, deallocates that list if this was the last + * reference, and sets *ref to NULL. + * + * Before After + * ________ ________ NULL + * |formats |<--------. |formats | ^ + * | ____ | ____|________________ | ____ | ____|________________ + * | |refs| | | __|_ | |refs| | | __|_ + * | |* * | | | | | | AVFilterLink | |* * | | | | | | AVFilterLink + * | |* *--------->|*ref| | |* | | | |*ref| + * | |____| | | |____| | |____| | | |____| + * |________| |_____________________ |________| |_____________________ + */ +void avfilter_formats_unref(AVFilterFormats **ref); + +/** + * + * Before After + * ________ ________ + * |formats |<---------. |formats |<---------. + * | ____ | ___|___ | ____ | ___|___ + * | |refs| | | | | | |refs| | | | | NULL + * | |* *--------->|*oldref| | |* *--------->|*newref| ^ + * | |* * | | |_______| | |* * | | |_______| ___|___ + * | |____| | | |____| | | | | + * |________| |________| |*oldref| + * |_______| + */ +void avfilter_formats_changeref(AVFilterFormats **oldref, + AVFilterFormats **newref); + +/** + * A filter pad used for either input or output. + */ +struct AVFilterPad { + /** + * Pad name. The name is unique among inputs and among outputs, but an + * input may have the same name as an output. This may be NULL if this + * pad has no need to ever be referenced by name. + */ + const char *name; + + /** + * AVFilterPad type. Only video supported now, hopefully someone will + * add audio in the future. + */ + enum AVMediaType type; + + /** + * Minimum required permissions on incoming buffers. Any buffer with + * insufficient permissions will be automatically copied by the filter + * system to a new buffer which provides the needed access permissions. + * + * Input pads only. + */ + int min_perms; + + /** + * Permissions which are not accepted on incoming buffers. Any buffer + * which has any of these permissions set will be automatically copied + * by the filter system to a new buffer which does not have those + * permissions. This can be used to easily disallow buffers with + * AV_PERM_REUSE. + * + * Input pads only. + */ + int rej_perms; + + /** + * Callback called before passing the first slice of a new frame. If + * NULL, the filter layer will default to storing a reference to the + * picture inside the link structure. + * + * Input video pads only. + */ + void (*start_frame)(AVFilterLink *link, AVFilterBufferRef *picref); + + /** + * Callback function to get a video buffer. If NULL, the filter system will + * use avfilter_default_get_video_buffer(). + * + * Input video pads only. + */ + AVFilterBufferRef *(*get_video_buffer)(AVFilterLink *link, int perms, int w, int h); + + /** + * Callback function to get an audio buffer. If NULL, the filter system will + * use avfilter_default_get_audio_buffer(). + * + * Input audio pads only. + */ + AVFilterBufferRef *(*get_audio_buffer)(AVFilterLink *link, int perms, + enum AVSampleFormat sample_fmt, int size, + int64_t channel_layout, int planar); + + /** + * Callback called after the slices of a frame are completely sent. If + * NULL, the filter layer will default to releasing the reference stored + * in the link structure during start_frame(). + * + * Input video pads only. + */ + void (*end_frame)(AVFilterLink *link); + + /** + * Slice drawing callback. This is where a filter receives video data + * and should do its processing. + * + * Input video pads only. + */ + void (*draw_slice)(AVFilterLink *link, int y, int height, int slice_dir); + + /** + * Samples filtering callback. This is where a filter receives audio data + * and should do its processing. + * + * Input audio pads only. + */ + void (*filter_samples)(AVFilterLink *link, AVFilterBufferRef *samplesref); + + /** + * Frame poll callback. This returns the number of immediately available + * samples. It should return a positive value if the next request_frame() + * is guaranteed to return one frame (with no delay). + * + * Defaults to just calling the source poll_frame() method. + * + * Output video pads only. + */ + int (*poll_frame)(AVFilterLink *link); + + /** + * Frame request callback. A call to this should result in at least one + * frame being output over the given link. This should return zero on + * success, and another value on error. + * + * Output video pads only. + */ + int (*request_frame)(AVFilterLink *link); + + /** + * Link configuration callback. + * + * For output pads, this should set the link properties such as + * width/height. This should NOT set the format property - that is + * negotiated between filters by the filter system using the + * query_formats() callback before this function is called. + * + * For input pads, this should check the properties of the link, and update + * the filter's internal state as necessary. + * + * For both input and output filters, this should return zero on success, + * and another value on error. + */ + int (*config_props)(AVFilterLink *link); +}; + +/** default handler for start_frame() for video inputs */ +void avfilter_default_start_frame(AVFilterLink *link, AVFilterBufferRef *picref); + +/** default handler for draw_slice() for video inputs */ +void avfilter_default_draw_slice(AVFilterLink *link, int y, int h, int slice_dir); + +/** default handler for end_frame() for video inputs */ +void avfilter_default_end_frame(AVFilterLink *link); + +/** default handler for filter_samples() for audio inputs */ +void avfilter_default_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref); + +/** default handler for config_props() for audio/video outputs */ +int avfilter_default_config_output_link(AVFilterLink *link); + +/** default handler for config_props() for audio/video inputs */ +int avfilter_default_config_input_link (AVFilterLink *link); + +/** default handler for get_video_buffer() for video inputs */ +AVFilterBufferRef *avfilter_default_get_video_buffer(AVFilterLink *link, + int perms, int w, int h); + +/** default handler for get_audio_buffer() for audio inputs */ +AVFilterBufferRef *avfilter_default_get_audio_buffer(AVFilterLink *link, int perms, + enum AVSampleFormat sample_fmt, int size, + int64_t channel_layout, int planar); + +/** + * A helper for query_formats() which sets all links to the same list of + * formats. If there are no links hooked to this filter, the list of formats is + * freed. + */ +void avfilter_set_common_formats(AVFilterContext *ctx, AVFilterFormats *formats); + +/** Default handler for query_formats() */ +int avfilter_default_query_formats(AVFilterContext *ctx); + +/** start_frame() handler for filters which simply pass video along */ +void avfilter_null_start_frame(AVFilterLink *link, AVFilterBufferRef *picref); + +/** draw_slice() handler for filters which simply pass video along */ +void avfilter_null_draw_slice(AVFilterLink *link, int y, int h, int slice_dir); + +/** end_frame() handler for filters which simply pass video along */ +void avfilter_null_end_frame(AVFilterLink *link); + +/** filter_samples() handler for filters which simply pass audio along */ +void avfilter_null_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref); + +/** get_video_buffer() handler for filters which simply pass video along */ +AVFilterBufferRef *avfilter_null_get_video_buffer(AVFilterLink *link, + int perms, int w, int h); + +/** get_audio_buffer() handler for filters which simply pass audio along */ +AVFilterBufferRef *avfilter_null_get_audio_buffer(AVFilterLink *link, int perms, + enum AVSampleFormat sample_fmt, int size, + int64_t channel_layout, int planar); + +/** + * Filter definition. This defines the pads a filter contains, and all the + * callback functions used to interact with the filter. + */ +typedef struct AVFilter { + const char *name; ///< filter name + + int priv_size; ///< size of private data to allocate for the filter + + /** + * Filter initialization function. Args contains the user-supplied + * parameters. FIXME: maybe an AVOption-based system would be better? + * opaque is data provided by the code requesting creation of the filter, + * and is used to pass data to the filter. + */ + int (*init)(AVFilterContext *ctx, const char *args, void *opaque); + + /** + * Filter uninitialization function. Should deallocate any memory held + * by the filter, release any buffer references, etc. This does not need + * to deallocate the AVFilterContext->priv memory itself. + */ + void (*uninit)(AVFilterContext *ctx); + + /** + * Queries formats supported by the filter and its pads, and sets the + * in_formats for links connected to its output pads, and out_formats + * for links connected to its input pads. + * + * @return zero on success, a negative value corresponding to an + * AVERROR code otherwise + */ + int (*query_formats)(AVFilterContext *); + + const AVFilterPad *inputs; ///< NULL terminated list of inputs. NULL if none + const AVFilterPad *outputs; ///< NULL terminated list of outputs. NULL if none + + /** + * A description for the filter. You should use the + * NULL_IF_CONFIG_SMALL() macro to define it. + */ + const char *description; +} AVFilter; + +/** An instance of a filter */ +struct AVFilterContext { + const AVClass *av_class; ///< needed for av_log() + + AVFilter *filter; ///< the AVFilter of which this is an instance + + char *name; ///< name of this filter instance + + unsigned input_count; ///< number of input pads + AVFilterPad *input_pads; ///< array of input pads + AVFilterLink **inputs; ///< array of pointers to input links + + unsigned output_count; ///< number of output pads + AVFilterPad *output_pads; ///< array of output pads + AVFilterLink **outputs; ///< array of pointers to output links + + void *priv; ///< private data for use by the filter +}; + +/** + * A link between two filters. This contains pointers to the source and + * destination filters between which this link exists, and the indexes of + * the pads involved. In addition, this link also contains the parameters + * which have been negotiated and agreed upon between the filter, such as + * image dimensions, format, etc. + */ +struct AVFilterLink { + AVFilterContext *src; ///< source filter + AVFilterPad *srcpad; ///< output pad on the source filter + + AVFilterContext *dst; ///< dest filter + AVFilterPad *dstpad; ///< input pad on the dest filter + + /** stage of the initialization of the link properties (dimensions, etc) */ + enum { + AVLINK_UNINIT = 0, ///< not started + AVLINK_STARTINIT, ///< started, but incomplete + AVLINK_INIT ///< complete + } init_state; + + enum AVMediaType type; ///< filter media type + + /* These parameters apply only to video */ + int w; ///< agreed upon image width + int h; ///< agreed upon image height + AVRational sample_aspect_ratio; ///< agreed upon sample aspect ratio + /* These two parameters apply only to audio */ + int64_t channel_layout; ///< channel layout of current buffer (see libavutil/audioconvert.h) + int64_t sample_rate; ///< samples per second + + int format; ///< agreed upon media format + + /** + * Lists of formats supported by the input and output filters respectively. + * These lists are used for negotiating the format to actually be used, + * which will be loaded into the format member, above, when chosen. + */ + AVFilterFormats *in_formats; + AVFilterFormats *out_formats; + + /** + * The buffer reference currently being sent across the link by the source + * filter. This is used internally by the filter system to allow + * automatic copying of buffers which do not have sufficient permissions + * for the destination. This should not be accessed directly by the + * filters. + */ + AVFilterBufferRef *src_buf; + + AVFilterBufferRef *cur_buf; + AVFilterBufferRef *out_buf; + + /** + * Define the time base used by the PTS of the frames/samples + * which will pass through this link. + * During the configuration stage, each filter is supposed to + * change only the output timebase, while the timebase of the + * input link is assumed to be an unchangeable property. + */ + AVRational time_base; + + struct AVFilterPool *pool; +}; + +/** + * Link two filters together. + * + * @param src the source filter + * @param srcpad index of the output pad on the source filter + * @param dst the destination filter + * @param dstpad index of the input pad on the destination filter + * @return zero on success + */ +int avfilter_link(AVFilterContext *src, unsigned srcpad, + AVFilterContext *dst, unsigned dstpad); + +/** + * Negotiate the media format, dimensions, etc of all inputs to a filter. + * + * @param filter the filter to negotiate the properties for its inputs + * @return zero on successful negotiation + */ +int avfilter_config_links(AVFilterContext *filter); + +/** + * Request a picture buffer with a specific set of permissions. + * + * @param link the output link to the filter from which the buffer will + * be requested + * @param perms the required access permissions + * @param w the minimum width of the buffer to allocate + * @param h the minimum height of the buffer to allocate + * @return A reference to the buffer. This must be unreferenced with + * avfilter_unref_buffer when you are finished with it. + */ +AVFilterBufferRef *avfilter_get_video_buffer(AVFilterLink *link, int perms, + int w, int h); + +/** + * Create a buffer reference wrapped around an already allocated image + * buffer. + * + * @param data pointers to the planes of the image to reference + * @param linesize linesizes for the planes of the image to reference + * @param perms the required access permissions + * @param w the width of the image specified by the data and linesize arrays + * @param h the height of the image specified by the data and linesize arrays + * @param format the pixel format of the image specified by the data and linesize arrays + */ +AVFilterBufferRef * +avfilter_get_video_buffer_ref_from_arrays(uint8_t *data[4], int linesize[4], int perms, + int w, int h, enum PixelFormat format); + +/** + * Request an audio samples buffer with a specific set of permissions. + * + * @param link the output link to the filter from which the buffer will + * be requested + * @param perms the required access permissions + * @param sample_fmt the format of each sample in the buffer to allocate + * @param size the buffer size in bytes + * @param channel_layout the number and type of channels per sample in the buffer to allocate + * @param planar audio data layout - planar or packed + * @return A reference to the samples. This must be unreferenced with + * avfilter_unref_buffer when you are finished with it. + */ +AVFilterBufferRef *avfilter_get_audio_buffer(AVFilterLink *link, int perms, + enum AVSampleFormat sample_fmt, int size, + int64_t channel_layout, int planar); + +/** + * Request an input frame from the filter at the other end of the link. + * + * @param link the input link + * @return zero on success + */ +int avfilter_request_frame(AVFilterLink *link); + +/** + * Poll a frame from the filter chain. + * + * @param link the input link + * @return the number of immediately available frames, a negative + * number in case of error + */ +int avfilter_poll_frame(AVFilterLink *link); + +/** + * Notifie the next filter of the start of a frame. + * + * @param link the output link the frame will be sent over + * @param picref A reference to the frame about to be sent. The data for this + * frame need only be valid once draw_slice() is called for that + * portion. The receiving filter will free this reference when + * it no longer needs it. + */ +void avfilter_start_frame(AVFilterLink *link, AVFilterBufferRef *picref); + +/** + * Notifie the next filter that the current frame has finished. + * + * @param link the output link the frame was sent over + */ +void avfilter_end_frame(AVFilterLink *link); + +/** + * Send a slice to the next filter. + * + * Slices have to be provided in sequential order, either in + * top-bottom or bottom-top order. If slices are provided in + * non-sequential order the behavior of the function is undefined. + * + * @param link the output link over which the frame is being sent + * @param y offset in pixels from the top of the image for this slice + * @param h height of this slice in pixels + * @param slice_dir the assumed direction for sending slices, + * from the top slice to the bottom slice if the value is 1, + * from the bottom slice to the top slice if the value is -1, + * for other values the behavior of the function is undefined. + */ +void avfilter_draw_slice(AVFilterLink *link, int y, int h, int slice_dir); + +/** + * Send a buffer of audio samples to the next filter. + * + * @param link the output link over which the audio samples are being sent + * @param samplesref a reference to the buffer of audio samples being sent. The + * receiving filter will free this reference when it no longer + * needs it or pass it on to the next filter. + */ +void avfilter_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref); + +/** Initialize the filter system. Register all builtin filters. */ +void avfilter_register_all(void); + +/** Uninitialize the filter system. Unregister all filters. */ +void avfilter_uninit(void); + +/** + * Register a filter. This is only needed if you plan to use + * avfilter_get_by_name later to lookup the AVFilter structure by name. A + * filter can still by instantiated with avfilter_open even if it is not + * registered. + * + * @param filter the filter to register + * @return 0 if the registration was succesfull, a negative value + * otherwise + */ +int avfilter_register(AVFilter *filter); + +/** + * Get a filter definition matching the given name. + * + * @param name the filter name to find + * @return the filter definition, if any matching one is registered. + * NULL if none found. + */ +AVFilter *avfilter_get_by_name(const char *name); + +/** + * If filter is NULL, returns a pointer to the first registered filter pointer, + * if filter is non-NULL, returns the next pointer after filter. + * If the returned pointer points to NULL, the last registered filter + * was already reached. + */ +AVFilter **av_filter_next(AVFilter **filter); + +/** + * Create a filter instance. + * + * @param filter_ctx put here a pointer to the created filter context + * on success, NULL on failure + * @param filter the filter to create an instance of + * @param inst_name Name to give to the new instance. Can be NULL for none. + * @return >= 0 in case of success, a negative error code otherwise + */ +int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name); + +/** + * Initialize a filter. + * + * @param filter the filter to initialize + * @param args A string of parameters to use when initializing the filter. + * The format and meaning of this string varies by filter. + * @param opaque Any extra non-string data needed by the filter. The meaning + * of this parameter varies by filter. + * @return zero on success + */ +int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque); + +/** + * Free a filter context. + * + * @param filter the filter to free + */ +void avfilter_free(AVFilterContext *filter); + +/** + * Insert a filter in the middle of an existing link. + * + * @param link the link into which the filter should be inserted + * @param filt the filter to be inserted + * @param filt_srcpad_idx the input pad on the filter to connect + * @param filt_dstpad_idx the output pad on the filter to connect + * @return zero on success + */ +int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt, + unsigned filt_srcpad_idx, unsigned filt_dstpad_idx); + +/** + * Insert a new pad. + * + * @param idx Insertion point. Pad is inserted at the end if this point + * is beyond the end of the list of pads. + * @param count Pointer to the number of pads in the list + * @param padidx_off Offset within an AVFilterLink structure to the element + * to increment when inserting a new pad causes link + * numbering to change + * @param pads Pointer to the pointer to the beginning of the list of pads + * @param links Pointer to the pointer to the beginning of the list of links + * @param newpad The new pad to add. A copy is made when adding. + */ +void avfilter_insert_pad(unsigned idx, unsigned *count, size_t padidx_off, + AVFilterPad **pads, AVFilterLink ***links, + AVFilterPad *newpad); + +/** Insert a new input pad for the filter. */ +static inline void avfilter_insert_inpad(AVFilterContext *f, unsigned index, + AVFilterPad *p) +{ + avfilter_insert_pad(index, &f->input_count, offsetof(AVFilterLink, dstpad), + &f->input_pads, &f->inputs, p); +} + +/** Insert a new output pad for the filter. */ +static inline void avfilter_insert_outpad(AVFilterContext *f, unsigned index, + AVFilterPad *p) +{ + avfilter_insert_pad(index, &f->output_count, offsetof(AVFilterLink, srcpad), + &f->output_pads, &f->outputs, p); +} + +#endif /* AVFILTER_AVFILTER_H */ diff --git a/ffmpeg 0.7/include/libavfilter/avfiltergraph.h b/ffmpeg 0.7/include/libavfilter/avfiltergraph.h new file mode 100644 index 000000000..0140af080 --- /dev/null +++ b/ffmpeg 0.7/include/libavfilter/avfiltergraph.h @@ -0,0 +1,123 @@ +/* + * Filter graphs + * copyright (c) 2007 Bobby Bingham + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVFILTER_AVFILTERGRAPH_H +#define AVFILTER_AVFILTERGRAPH_H + +#include "avfilter.h" + +typedef struct AVFilterGraph { + unsigned filter_count; + AVFilterContext **filters; + + char *scale_sws_opts; ///< sws options to use for the auto-inserted scale filters +} AVFilterGraph; + +/** + * Allocate a filter graph. + */ +AVFilterGraph *avfilter_graph_alloc(void); + +/** + * Get a filter instance with name name from graph. + * + * @return the pointer to the found filter instance or NULL if it + * cannot be found. + */ +AVFilterContext *avfilter_graph_get_filter(AVFilterGraph *graph, char *name); + +/** + * Add an existing filter instance to a filter graph. + * + * @param graphctx the filter graph + * @param filter the filter to be added + */ +int avfilter_graph_add_filter(AVFilterGraph *graphctx, AVFilterContext *filter); + +/** + * Create and add a filter instance into an existing graph. + * The filter instance is created from the filter filt and inited + * with the parameters args and opaque. + * + * In case of success put in *filt_ctx the pointer to the created + * filter instance, otherwise set *filt_ctx to NULL. + * + * @param name the instance name to give to the created filter instance + * @param graph_ctx the filter graph + * @return a negative AVERROR error code in case of failure, a non + * negative value otherwise + */ +int avfilter_graph_create_filter(AVFilterContext **filt_ctx, AVFilter *filt, + const char *name, const char *args, void *opaque, + AVFilterGraph *graph_ctx); + +/** + * Check validity and configure all the links and formats in the graph. + * + * @param graphctx the filter graph + * @param log_ctx context used for logging + * @return 0 in case of success, a negative AVERROR code otherwise + */ +int avfilter_graph_config(AVFilterGraph *graphctx, AVClass *log_ctx); + +/** + * Free a graph, destroy its links, and set *graph to NULL. + * If *graph is NULL, do nothing. + */ +void avfilter_graph_free(AVFilterGraph **graph); + +/** + * A linked-list of the inputs/outputs of the filter chain. + * + * This is mainly useful for avfilter_graph_parse(), since this + * function may accept a description of a graph with not connected + * input/output pads. This struct specifies, per each not connected + * pad contained in the graph, the filter context and the pad index + * required for establishing a link. + */ +typedef struct AVFilterInOut { + /** unique name for this input/output in the list */ + char *name; + + /** filter context associated to this input/output */ + AVFilterContext *filter_ctx; + + /** index of the filt_ctx pad to use for linking */ + int pad_idx; + + /** next input/input in the list, NULL if this is the last */ + struct AVFilterInOut *next; +} AVFilterInOut; + +/** + * Add a graph described by a string to a graph. + * + * @param graph the filter graph where to link the parsed graph context + * @param filters string to be parsed + * @param inputs linked list to the inputs of the graph + * @param outputs linked list to the outputs of the graph + * @return zero on success, a negative AVERROR code on error + */ +int avfilter_graph_parse(AVFilterGraph *graph, const char *filters, + AVFilterInOut *inputs, AVFilterInOut *outputs, + AVClass *log_ctx); + +#endif /* AVFILTER_AVFILTERGRAPH_H */ diff --git a/ffmpeg 0.7/include/libavformat/avformat.h b/ffmpeg 0.7/include/libavformat/avformat.h new file mode 100644 index 000000000..ec51a57ca --- /dev/null +++ b/ffmpeg 0.7/include/libavformat/avformat.h @@ -0,0 +1,1498 @@ +/* + * copyright (c) 2001 Fabrice Bellard + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVFORMAT_AVFORMAT_H +#define AVFORMAT_AVFORMAT_H + + +/** + * I return the LIBAVFORMAT_VERSION_INT constant. You got + * a fucking problem with that, douchebag? + */ +unsigned avformat_version(void); + +/** + * Return the libavformat build-time configuration. + */ +const char *avformat_configuration(void); + +/** + * Return the libavformat license. + */ +const char *avformat_license(void); + +#include +#include /* FILE */ +#include "libavcodec/avcodec.h" + +#include "avio.h" +#include "libavformat/version.h" + +struct AVFormatContext; + + +/* + * Public Metadata API. + * The metadata API allows libavformat to export metadata tags to a client + * application using a sequence of key/value pairs. Like all strings in FFmpeg, + * metadata must be stored as UTF-8 encoded Unicode. Note that metadata + * exported by demuxers isn't checked to be valid UTF-8 in most cases. + * Important concepts to keep in mind: + * 1. Keys are unique; there can never be 2 tags with the same key. This is + * also meant semantically, i.e., a demuxer should not knowingly produce + * several keys that are literally different but semantically identical. + * E.g., key=Author5, key=Author6. In this example, all authors must be + * placed in the same tag. + * 2. Metadata is flat, not hierarchical; there are no subtags. If you + * want to store, e.g., the email address of the child of producer Alice + * and actor Bob, that could have key=alice_and_bobs_childs_email_address. + * 3. Several modifiers can be applied to the tag name. This is done by + * appending a dash character ('-') and the modifier name in the order + * they appear in the list below -- e.g. foo-eng-sort, not foo-sort-eng. + * a) language -- a tag whose value is localized for a particular language + * is appended with the ISO 639-2/B 3-letter language code. + * For example: Author-ger=Michael, Author-eng=Mike + * The original/default language is in the unqualified "Author" tag. + * A demuxer should set a default if it sets any translated tag. + * b) sorting -- a modified version of a tag that should be used for + * sorting will have '-sort' appended. E.g. artist="The Beatles", + * artist-sort="Beatles, The". + * + * 4. Demuxers attempt to export metadata in a generic format, however tags + * with no generic equivalents are left as they are stored in the container. + * Follows a list of generic tag names: + * + * album -- name of the set this work belongs to + * album_artist -- main creator of the set/album, if different from artist. + * e.g. "Various Artists" for compilation albums. + * artist -- main creator of the work + * comment -- any additional description of the file. + * composer -- who composed the work, if different from artist. + * copyright -- name of copyright holder. + * creation_time-- date when the file was created, preferably in ISO 8601. + * date -- date when the work was created, preferably in ISO 8601. + * disc -- number of a subset, e.g. disc in a multi-disc collection. + * encoder -- name/settings of the software/hardware that produced the file. + * encoded_by -- person/group who created the file. + * filename -- original name of the file. + * genre -- . + * language -- main language in which the work is performed, preferably + * in ISO 639-2 format. Multiple languages can be specified by + * separating them with commas. + * performer -- artist who performed the work, if different from artist. + * E.g for "Also sprach Zarathustra", artist would be "Richard + * Strauss" and performer "London Philharmonic Orchestra". + * publisher -- name of the label/publisher. + * service_name -- name of the service in broadcasting (channel name). + * service_provider -- name of the service provider in broadcasting. + * title -- name of the work. + * track -- number of this work in the set, can be in form current/total. + * variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of + */ + +#define AV_METADATA_MATCH_CASE 1 +#define AV_METADATA_IGNORE_SUFFIX 2 +#define AV_METADATA_DONT_STRDUP_KEY 4 +#define AV_METADATA_DONT_STRDUP_VAL 8 +#define AV_METADATA_DONT_OVERWRITE 16 ///< Don't overwrite existing tags. + +typedef struct { + char *key; + char *value; +}AVMetadataTag; + +typedef struct AVMetadata AVMetadata; +#if FF_API_OLD_METADATA2 +typedef struct AVMetadataConv AVMetadataConv; +#endif + +/** + * Get a metadata element with matching key. + * + * @param prev Set to the previous matching element to find the next. + * If set to NULL the first matching element is returned. + * @param flags Allows case as well as suffix-insensitive comparisons. + * @return Found tag or NULL, changing key or value leads to undefined behavior. + */ +AVMetadataTag * +av_metadata_get(AVMetadata *m, const char *key, const AVMetadataTag *prev, int flags); + +/** + * Set the given tag in *pm, overwriting an existing tag. + * + * @param pm pointer to a pointer to a metadata struct. If *pm is NULL + * a metadata struct is allocated and put in *pm. + * @param key tag key to add to *pm (will be av_strduped depending on flags) + * @param value tag value to add to *pm (will be av_strduped depending on flags). + * Passing a NULL value will cause an existing tag to be deleted. + * @return >= 0 on success otherwise an error code <0 + */ +int av_metadata_set2(AVMetadata **pm, const char *key, const char *value, int flags); + +#if FF_API_OLD_METADATA2 +/** + * This function is provided for compatibility reason and currently does nothing. + */ +attribute_deprecated void av_metadata_conv(struct AVFormatContext *ctx, const AVMetadataConv *d_conv, + const AVMetadataConv *s_conv); +#endif + +/** + * Copy metadata from one AVMetadata struct into another. + * @param dst pointer to a pointer to a AVMetadata struct. If *dst is NULL, + * this function will allocate a struct for you and put it in *dst + * @param src pointer to source AVMetadata struct + * @param flags flags to use when setting metadata in *dst + * @note metadata is read using the AV_METADATA_IGNORE_SUFFIX flag + */ +void av_metadata_copy(AVMetadata **dst, AVMetadata *src, int flags); + +/** + * Free all the memory allocated for an AVMetadata struct. + */ +void av_metadata_free(AVMetadata **m); + + +/* packet functions */ + + +/** + * Allocate and read the payload of a packet and initialize its + * fields with default values. + * + * @param pkt packet + * @param size desired payload size + * @return >0 (read size) if OK, AVERROR_xxx otherwise + */ +int av_get_packet(AVIOContext *s, AVPacket *pkt, int size); + + +/** + * Read data and append it to the current content of the AVPacket. + * If pkt->size is 0 this is identical to av_get_packet. + * Note that this uses av_grow_packet and thus involves a realloc + * which is inefficient. Thus this function should only be used + * when there is no reasonable way to know (an upper bound of) + * the final size. + * + * @param pkt packet + * @param size amount of data to read + * @return >0 (read size) if OK, AVERROR_xxx otherwise, previous data + * will not be lost even if an error occurs. + */ +int av_append_packet(AVIOContext *s, AVPacket *pkt, int size); + +/*************************************************/ +/* fractional numbers for exact pts handling */ + +/** + * The exact value of the fractional number is: 'val + num / den'. + * num is assumed to be 0 <= num < den. + */ +typedef struct AVFrac { + int64_t val, num, den; +} AVFrac; + +/*************************************************/ +/* input/output formats */ + +struct AVCodecTag; + +/** + * This structure contains the data a format has to probe a file. + */ +typedef struct AVProbeData { + const char *filename; + unsigned char *buf; /**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. */ + int buf_size; /**< Size of buf except extra allocated bytes */ +} AVProbeData; + +#define AVPROBE_SCORE_MAX 100 ///< maximum score, half of that is used for file-extension-based detection +#define AVPROBE_PADDING_SIZE 32 ///< extra allocated bytes at the end of the probe buffer + +typedef struct AVFormatParameters { + AVRational time_base; + int sample_rate; + int channels; + int width; + int height; + enum PixelFormat pix_fmt; + int channel; /**< Used to select DV channel. */ + const char *standard; /**< TV standard, NTSC, PAL, SECAM */ + unsigned int mpeg2ts_raw:1; /**< Force raw MPEG-2 transport stream output, if possible. */ + unsigned int mpeg2ts_compute_pcr:1; /**< Compute exact PCR for each transport + stream packet (only meaningful if + mpeg2ts_raw is TRUE). */ + unsigned int initial_pause:1; /**< Do not begin to play the stream + immediately (RTSP only). */ + unsigned int prealloced_context:1; +} AVFormatParameters; + +//! Demuxer will use avio_open, no opened file should be provided by the caller. +#define AVFMT_NOFILE 0x0001 +#define AVFMT_NEEDNUMBER 0x0002 /**< Needs '%d' in filename. */ +#define AVFMT_SHOW_IDS 0x0008 /**< Show format stream IDs numbers. */ +#define AVFMT_RAWPICTURE 0x0020 /**< Format wants AVPicture structure for + raw picture data. */ +#define AVFMT_GLOBALHEADER 0x0040 /**< Format wants global header. */ +#define AVFMT_NOTIMESTAMPS 0x0080 /**< Format does not need / have any timestamps. */ +#define AVFMT_GENERIC_INDEX 0x0100 /**< Use generic index building code. */ +#define AVFMT_TS_DISCONT 0x0200 /**< Format allows timestamp discontinuities. Note, muxers always require valid (monotone) timestamps */ +#define AVFMT_VARIABLE_FPS 0x0400 /**< Format allows variable fps. */ +#define AVFMT_NODIMENSIONS 0x0800 /**< Format does not need width/height */ +#define AVFMT_NOSTREAMS 0x1000 /**< Format does not require any streams */ +#define AVFMT_NOBINSEARCH 0x2000 /**< Format does not allow to fallback to binary search via read_timestamp */ +#define AVFMT_NOGENSEARCH 0x4000 /**< Format does not allow to fallback to generic search */ + +typedef struct AVOutputFormat { + const char *name; + /** + * Descriptive name for the format, meant to be more human-readable + * than name. You should use the NULL_IF_CONFIG_SMALL() macro + * to define it. + */ + const char *long_name; + const char *mime_type; + const char *extensions; /**< comma-separated filename extensions */ + /** + * size of private data so that it can be allocated in the wrapper + */ + int priv_data_size; + /* output support */ + enum CodecID audio_codec; /**< default audio codec */ + enum CodecID video_codec; /**< default video codec */ + int (*write_header)(struct AVFormatContext *); + int (*write_packet)(struct AVFormatContext *, AVPacket *pkt); + int (*write_trailer)(struct AVFormatContext *); + /** + * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_RAWPICTURE, + * AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS, + * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS + */ + int flags; + + void *dummy; + + int (*interleave_packet)(struct AVFormatContext *, AVPacket *out, + AVPacket *in, int flush); + + /** + * List of supported codec_id-codec_tag pairs, ordered by "better + * choice first". The arrays are all terminated by CODEC_ID_NONE. + */ + const struct AVCodecTag * const *codec_tag; + + enum CodecID subtitle_codec; /**< default subtitle codec */ + +#if FF_API_OLD_METADATA2 + const AVMetadataConv *metadata_conv; +#endif + + const AVClass *priv_class; ///< AVClass for the private context + + /* private fields */ + struct AVOutputFormat *next; +} AVOutputFormat; + +typedef struct AVInputFormat { + /** + * A comma separated list of short names for the format. New names + * may be appended with a minor bump. + */ + const char *name; + + /** + * Descriptive name for the format, meant to be more human-readable + * than name. You should use the NULL_IF_CONFIG_SMALL() macro + * to define it. + */ + const char *long_name; + + /** + * Size of private data so that it can be allocated in the wrapper. + */ + int priv_data_size; + + /** + * Tell if a given file has a chance of being parsed as this format. + * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes + * big so you do not have to check for that unless you need more. + */ + int (*read_probe)(AVProbeData *); + + /** + * Read the format header and initialize the AVFormatContext + * structure. Return 0 if OK. 'ap' if non-NULL contains + * additional parameters. Only used in raw format right + * now. 'av_new_stream' should be called to create new streams. + */ + int (*read_header)(struct AVFormatContext *, + AVFormatParameters *ap); + + /** + * Read one packet and put it in 'pkt'. pts and flags are also + * set. 'av_new_stream' can be called only if the flag + * AVFMTCTX_NOHEADER is used and only in the calling thread (not in a + * background thread). + * @return 0 on success, < 0 on error. + * When returning an error, pkt must not have been allocated + * or must be freed before returning + */ + int (*read_packet)(struct AVFormatContext *, AVPacket *pkt); + + /** + * Close the stream. The AVFormatContext and AVStreams are not + * freed by this function + */ + int (*read_close)(struct AVFormatContext *); + +#if FF_API_READ_SEEK + /** + * Seek to a given timestamp relative to the frames in + * stream component stream_index. + * @param stream_index Must not be -1. + * @param flags Selects which direction should be preferred if no exact + * match is available. + * @return >= 0 on success (but not necessarily the new offset) + */ + attribute_deprecated int (*read_seek)(struct AVFormatContext *, + int stream_index, int64_t timestamp, int flags); +#endif + /** + * Gets the next timestamp in stream[stream_index].time_base units. + * @return the timestamp or AV_NOPTS_VALUE if an error occurred + */ + int64_t (*read_timestamp)(struct AVFormatContext *s, int stream_index, + int64_t *pos, int64_t pos_limit); + + /** + * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER. + */ + int flags; + + /** + * If extensions are defined, then no probe is done. You should + * usually not use extension format guessing because it is not + * reliable enough + */ + const char *extensions; + + /** + * General purpose read-only value that the format can use. + */ + int value; + + /** + * Start/resume playing - only meaningful if using a network-based format + * (RTSP). + */ + int (*read_play)(struct AVFormatContext *); + + /** + * Pause playing - only meaningful if using a network-based format + * (RTSP). + */ + int (*read_pause)(struct AVFormatContext *); + + const struct AVCodecTag * const *codec_tag; + + /** + * Seek to timestamp ts. + * Seeking will be done so that the point from which all active streams + * can be presented successfully will be closest to ts and within min/max_ts. + * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. + */ + int (*read_seek2)(struct AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags); + +#if FF_API_OLD_METADATA2 + const AVMetadataConv *metadata_conv; +#endif + + const AVClass *priv_class; ///< AVClass for the private context + + /* private fields */ + struct AVInputFormat *next; +} AVInputFormat; + +enum AVStreamParseType { + AVSTREAM_PARSE_NONE, + AVSTREAM_PARSE_FULL, /**< full parsing and repack */ + AVSTREAM_PARSE_HEADERS, /**< Only parse headers, do not repack. */ + AVSTREAM_PARSE_TIMESTAMPS, /**< full parsing and interpolation of timestamps for frames not starting on a packet boundary */ + AVSTREAM_PARSE_FULL_ONCE, /**< full parsing and repack of the first frame only, only implemented for H.264 currently */ +}; + +typedef struct AVIndexEntry { + int64_t pos; + int64_t timestamp; +#define AVINDEX_KEYFRAME 0x0001 + int flags:2; + int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment). + int min_distance; /**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. */ +} AVIndexEntry; + +#define AV_DISPOSITION_DEFAULT 0x0001 +#define AV_DISPOSITION_DUB 0x0002 +#define AV_DISPOSITION_ORIGINAL 0x0004 +#define AV_DISPOSITION_COMMENT 0x0008 +#define AV_DISPOSITION_LYRICS 0x0010 +#define AV_DISPOSITION_KARAOKE 0x0020 + +/** + * Track should be used during playback by default. + * Useful for subtitle track that should be displayed + * even when user did not explicitly ask for subtitles. + */ +#define AV_DISPOSITION_FORCED 0x0040 +#define AV_DISPOSITION_HEARING_IMPAIRED 0x0080 /**< stream for hearing impaired audiences */ +#define AV_DISPOSITION_VISUAL_IMPAIRED 0x0100 /**< stream for visual impaired audiences */ +#define AV_DISPOSITION_CLEAN_EFFECTS 0x0200 /**< stream without voice */ + +/** + * Stream structure. + * New fields can be added to the end with minor version bumps. + * Removal, reordering and changes to existing fields require a major + * version bump. + * sizeof(AVStream) must not be used outside libav*. + */ +typedef struct AVStream { + int index; /**< stream index in AVFormatContext */ + int id; /**< format-specific stream ID */ + AVCodecContext *codec; /**< codec context */ + /** + * Real base framerate of the stream. + * This is the lowest framerate with which all timestamps can be + * represented accurately (it is the least common multiple of all + * framerates in the stream). Note, this value is just a guess! + * For example, if the time base is 1/90000 and all frames have either + * approximately 3600 or 1800 timer ticks, then r_frame_rate will be 50/1. + */ + AVRational r_frame_rate; + void *priv_data; + + /* internal data used in av_find_stream_info() */ + int64_t first_dts; + + /** + * encoding: pts generation when outputting stream + */ + struct AVFrac pts; + + /** + * This is the fundamental unit of time (in seconds) in terms + * of which frame timestamps are represented. For fixed-fps content, + * time base should be 1/framerate and timestamp increments should be 1. + * decoding: set by libavformat + * encoding: set by libavformat in av_write_header + */ + AVRational time_base; + int pts_wrap_bits; /**< number of bits in pts (used for wrapping control) */ + /* ffmpeg.c private use */ + int stream_copy; /**< If set, just copy stream. */ + enum AVDiscard discard; ///< Selects which packets can be discarded at will and do not need to be demuxed. + + //FIXME move stuff to a flags field? + /** + * Quality, as it has been removed from AVCodecContext and put in AVVideoFrame. + * MN: dunno if that is the right place for it + */ + float quality; + + /** + * Decoding: pts of the first frame of the stream, in stream time base. + * Only set this if you are absolutely 100% sure that the value you set + * it to really is the pts of the first frame. + * This may be undefined (AV_NOPTS_VALUE). + * @note The ASF header does NOT contain a correct start_time the ASF + * demuxer must NOT set this. + */ + int64_t start_time; + + /** + * Decoding: duration of the stream, in stream time base. + * If a source file does not specify a duration, but does specify + * a bitrate, this value will be estimated from bitrate and file size. + */ + int64_t duration; + + /* av_read_frame() support */ + enum AVStreamParseType need_parsing; + struct AVCodecParserContext *parser; + + int64_t cur_dts; + int last_IP_duration; + int64_t last_IP_pts; + /* av_seek_frame() support */ + AVIndexEntry *index_entries; /**< Only used if the format does not + support seeking natively. */ + int nb_index_entries; + unsigned int index_entries_allocated_size; + + int64_t nb_frames; ///< number of frames in this stream if known or 0 + + int disposition; /**< AV_DISPOSITION_* bit field */ + + AVProbeData probe_data; +#define MAX_REORDER_DELAY 16 + int64_t pts_buffer[MAX_REORDER_DELAY+1]; + + /** + * sample aspect ratio (0 if unknown) + * - encoding: Set by user. + * - decoding: Set by libavformat. + */ + AVRational sample_aspect_ratio; + + AVMetadata *metadata; + + /* Intended mostly for av_read_frame() support. Not supposed to be used by */ + /* external applications; try to use something else if at all possible. */ + const uint8_t *cur_ptr; + int cur_len; + AVPacket cur_pkt; + + // Timestamp generation support: + /** + * Timestamp corresponding to the last dts sync point. + * + * Initialized when AVCodecParserContext.dts_sync_point >= 0 and + * a DTS is received from the underlying container. Otherwise set to + * AV_NOPTS_VALUE by default. + */ + int64_t reference_dts; + + /** + * Number of packets to buffer for codec probing + * NOT PART OF PUBLIC API + */ +#define MAX_PROBE_PACKETS 2500 + int probe_packets; + + /** + * last packet in packet_buffer for this stream when muxing. + * used internally, NOT PART OF PUBLIC API, dont read or write from outside of libav* + */ + struct AVPacketList *last_in_packet_buffer; + + /** + * Average framerate + */ + AVRational avg_frame_rate; + + /** + * Number of frames that have been demuxed during av_find_stream_info() + */ + int codec_info_nb_frames; + + /** + * Stream informations used internally by av_find_stream_info() + */ +#define MAX_STD_TIMEBASES (60*12+5) + struct { + int64_t last_dts; + int64_t duration_gcd; + int duration_count; + double duration_error[MAX_STD_TIMEBASES]; + int64_t codec_info_duration; + } *info; + + /** + * flag to indicate that probing is requested + * NOT PART OF PUBLIC API + */ + int request_probe; +} AVStream; + +#define AV_PROGRAM_RUNNING 1 + +/** + * New fields can be added to the end with minor version bumps. + * Removal, reordering and changes to existing fields require a major + * version bump. + * sizeof(AVProgram) must not be used outside libav*. + */ +typedef struct AVProgram { + int id; + int flags; + enum AVDiscard discard; ///< selects which program to discard and which to feed to the caller + unsigned int *stream_index; + unsigned int nb_stream_indexes; + AVMetadata *metadata; +} AVProgram; + +#define AVFMTCTX_NOHEADER 0x0001 /**< signal that no header is present + (streams are added dynamically) */ + +typedef struct AVChapter { + int id; ///< unique ID to identify the chapter + AVRational time_base; ///< time base in which the start/end timestamps are specified + int64_t start, end; ///< chapter start/end time in time_base units + AVMetadata *metadata; +} AVChapter; + +/** + * Format I/O context. + * New fields can be added to the end with minor version bumps. + * Removal, reordering and changes to existing fields require a major + * version bump. + * sizeof(AVFormatContext) must not be used outside libav*. + */ +typedef struct AVFormatContext { + const AVClass *av_class; /**< Set by avformat_alloc_context. */ + /* Can only be iformat or oformat, not both at the same time. */ + struct AVInputFormat *iformat; + struct AVOutputFormat *oformat; + void *priv_data; + AVIOContext *pb; + unsigned int nb_streams; + AVStream **streams; + char filename[1024]; /**< input or output filename */ + /* stream info */ + int64_t timestamp; + + int ctx_flags; /**< Format-specific flags, see AVFMTCTX_xx */ + /* private data for pts handling (do not modify directly). */ + /** + * This buffer is only needed when packets were already buffered but + * not decoded, for example to get the codec parameters in MPEG + * streams. + */ + struct AVPacketList *packet_buffer; + + /** + * Decoding: position of the first frame of the component, in + * AV_TIME_BASE fractional seconds. NEVER set this value directly: + * It is deduced from the AVStream values. + */ + int64_t start_time; + + /** + * Decoding: duration of the stream, in AV_TIME_BASE fractional + * seconds. Only set this value if you know none of the individual stream + * durations and also dont set any of them. This is deduced from the + * AVStream values if not set. + */ + int64_t duration; + + /** + * decoding: total file size, 0 if unknown + */ + int64_t file_size; + + /** + * Decoding: total stream bitrate in bit/s, 0 if not + * available. Never set it directly if the file_size and the + * duration are known as FFmpeg can compute it automatically. + */ + int bit_rate; + + /* av_read_frame() support */ + AVStream *cur_st; + + /* av_seek_frame() support */ + int64_t data_offset; /**< offset of the first packet */ + + int mux_rate; + unsigned int packet_size; + int preload; + int max_delay; + +#define AVFMT_NOOUTPUTLOOP -1 +#define AVFMT_INFINITEOUTPUTLOOP 0 + /** + * number of times to loop output in formats that support it + */ + int loop_output; + + int flags; +#define AVFMT_FLAG_GENPTS 0x0001 ///< Generate missing pts even if it requires parsing future frames. +#define AVFMT_FLAG_IGNIDX 0x0002 ///< Ignore index. +#define AVFMT_FLAG_NONBLOCK 0x0004 ///< Do not block when reading packets from input. +#define AVFMT_FLAG_IGNDTS 0x0008 ///< Ignore DTS on frames that contain both DTS & PTS +#define AVFMT_FLAG_NOFILLIN 0x0010 ///< Do not infer any values from other values, just return what is stored in the container +#define AVFMT_FLAG_NOPARSE 0x0020 ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled +#define AVFMT_FLAG_RTP_HINT 0x0040 ///< Add RTP hinting to the output file +#define AVFMT_FLAG_SORT_DTS 0x10000 ///< try to interleave outputted packets by dts (using this flag can slow demuxing down) +#define AVFMT_FLAG_PRIV_OPT 0x20000 ///< Enable use of private options by delaying codec open (this could be made default once all code is converted) + + int loop_input; + + /** + * decoding: size of data to probe; encoding: unused. + */ + unsigned int probesize; + + /** + * Maximum time (in AV_TIME_BASE units) during which the input should + * be analyzed in av_find_stream_info(). + */ + int max_analyze_duration; + + const uint8_t *key; + int keylen; + + unsigned int nb_programs; + AVProgram **programs; + + /** + * Forced video codec_id. + * Demuxing: Set by user. + */ + enum CodecID video_codec_id; + + /** + * Forced audio codec_id. + * Demuxing: Set by user. + */ + enum CodecID audio_codec_id; + + /** + * Forced subtitle codec_id. + * Demuxing: Set by user. + */ + enum CodecID subtitle_codec_id; + + /** + * Maximum amount of memory in bytes to use for the index of each stream. + * If the index exceeds this size, entries will be discarded as + * needed to maintain a smaller size. This can lead to slower or less + * accurate seeking (depends on demuxer). + * Demuxers for which a full in-memory index is mandatory will ignore + * this. + * muxing : unused + * demuxing: set by user + */ + unsigned int max_index_size; + + /** + * Maximum amount of memory in bytes to use for buffering frames + * obtained from realtime capture devices. + */ + unsigned int max_picture_buffer; + + unsigned int nb_chapters; + AVChapter **chapters; + + /** + * Flags to enable debugging. + */ + int debug; +#define FF_FDEBUG_TS 0x0001 + + /** + * Raw packets from the demuxer, prior to parsing and decoding. + * This buffer is used for buffering packets until the codec can + * be identified, as parsing cannot be done without knowing the + * codec. + */ + struct AVPacketList *raw_packet_buffer; + struct AVPacketList *raw_packet_buffer_end; + + struct AVPacketList *packet_buffer_end; + + AVMetadata *metadata; + + /** + * Remaining size available for raw_packet_buffer, in bytes. + * NOT PART OF PUBLIC API + */ +#define RAW_PACKET_BUFFER_SIZE 2500000 + int raw_packet_buffer_remaining_size; + + /** + * Start time of the stream in real world time, in microseconds + * since the unix epoch (00:00 1st January 1970). That is, pts=0 + * in the stream was captured at this real world time. + * - encoding: Set by user. + * - decoding: Unused. + */ + int64_t start_time_realtime; +} AVFormatContext; + +typedef struct AVPacketList { + AVPacket pkt; + struct AVPacketList *next; +} AVPacketList; + +/** + * If f is NULL, returns the first registered input format, + * if f is non-NULL, returns the next registered input format after f + * or NULL if f is the last one. + */ +AVInputFormat *av_iformat_next(AVInputFormat *f); + +/** + * If f is NULL, returns the first registered output format, + * if f is non-NULL, returns the next registered output format after f + * or NULL if f is the last one. + */ +AVOutputFormat *av_oformat_next(AVOutputFormat *f); + +#if FF_API_GUESS_IMG2_CODEC +attribute_deprecated enum CodecID av_guess_image2_codec(const char *filename); +#endif + +/* XXX: Use automatic init with either ELF sections or C file parser */ +/* modules. */ + +/* utils.c */ +void av_register_input_format(AVInputFormat *format); +void av_register_output_format(AVOutputFormat *format); + +/** + * Return the output format in the list of registered output formats + * which best matches the provided parameters, or return NULL if + * there is no match. + * + * @param short_name if non-NULL checks if short_name matches with the + * names of the registered formats + * @param filename if non-NULL checks if filename terminates with the + * extensions of the registered formats + * @param mime_type if non-NULL checks if mime_type matches with the + * MIME type of the registered formats + */ +AVOutputFormat *av_guess_format(const char *short_name, + const char *filename, + const char *mime_type); + +/** + * Guess the codec ID based upon muxer and filename. + */ +enum CodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name, + const char *filename, const char *mime_type, + enum AVMediaType type); + +/** + * Send a nice hexadecimal dump of a buffer to the specified file stream. + * + * @param f The file stream pointer where the dump should be sent to. + * @param buf buffer + * @param size buffer size + * + * @see av_hex_dump_log, av_pkt_dump2, av_pkt_dump_log2 + */ +void av_hex_dump(FILE *f, uint8_t *buf, int size); + +/** + * Send a nice hexadecimal dump of a buffer to the log. + * + * @param avcl A pointer to an arbitrary struct of which the first field is a + * pointer to an AVClass struct. + * @param level The importance level of the message, lower values signifying + * higher importance. + * @param buf buffer + * @param size buffer size + * + * @see av_hex_dump, av_pkt_dump2, av_pkt_dump_log2 + */ +void av_hex_dump_log(void *avcl, int level, uint8_t *buf, int size); + +/** + * Send a nice dump of a packet to the specified file stream. + * + * @param f The file stream pointer where the dump should be sent to. + * @param pkt packet to dump + * @param dump_payload True if the payload must be displayed, too. + * @param st AVStream that the packet belongs to + */ +void av_pkt_dump2(FILE *f, AVPacket *pkt, int dump_payload, AVStream *st); + + +/** + * Send a nice dump of a packet to the log. + * + * @param avcl A pointer to an arbitrary struct of which the first field is a + * pointer to an AVClass struct. + * @param level The importance level of the message, lower values signifying + * higher importance. + * @param pkt packet to dump + * @param dump_payload True if the payload must be displayed, too. + * @param st AVStream that the packet belongs to + */ +void av_pkt_dump_log2(void *avcl, int level, AVPacket *pkt, int dump_payload, + AVStream *st); + +#if FF_API_PKT_DUMP +attribute_deprecated void av_pkt_dump(FILE *f, AVPacket *pkt, int dump_payload); +attribute_deprecated void av_pkt_dump_log(void *avcl, int level, AVPacket *pkt, + int dump_payload); +#endif + +/** + * Initialize libavformat and register all the muxers, demuxers and + * protocols. If you do not call this function, then you can select + * exactly which formats you want to support. + * + * @see av_register_input_format() + * @see av_register_output_format() + * @see av_register_protocol() + */ +void av_register_all(void); + +/** + * Get the CodecID for the given codec tag tag. + * If no codec id is found returns CODEC_ID_NONE. + * + * @param tags list of supported codec_id-codec_tag pairs, as stored + * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag + */ +enum CodecID av_codec_get_id(const struct AVCodecTag * const *tags, unsigned int tag); + +/** + * Get the codec tag for the given codec id id. + * If no codec tag is found returns 0. + * + * @param tags list of supported codec_id-codec_tag pairs, as stored + * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag + */ +unsigned int av_codec_get_tag(const struct AVCodecTag * const *tags, enum CodecID id); + +/* media file input */ + +/** + * Find AVInputFormat based on the short name of the input format. + */ +AVInputFormat *av_find_input_format(const char *short_name); + +/** + * Guess the file format. + * + * @param is_opened Whether the file is already opened; determines whether + * demuxers with or without AVFMT_NOFILE are probed. + */ +AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened); + +/** + * Guess the file format. + * + * @param is_opened Whether the file is already opened; determines whether + * demuxers with or without AVFMT_NOFILE are probed. + * @param score_max A probe score larger that this is required to accept a + * detection, the variable is set to the actual detection + * score afterwards. + * If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended + * to retry with a larger probe buffer. + */ +AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max); + +/** + * Guess the file format. + * + * @param is_opened Whether the file is already opened; determines whether + * demuxers with or without AVFMT_NOFILE are probed. + * @param score_ret The score of the best detection. + */ +AVInputFormat *av_probe_input_format3(AVProbeData *pd, int is_opened, int *score_ret); + +/** + * Probe a bytestream to determine the input format. Each time a probe returns + * with a score that is too low, the probe buffer size is increased and another + * attempt is made. When the maximum probe size is reached, the input format + * with the highest score is returned. + * + * @param pb the bytestream to probe + * @param fmt the input format is put here + * @param filename the filename of the stream + * @param logctx the log context + * @param offset the offset within the bytestream to probe from + * @param max_probe_size the maximum probe buffer size (zero for default) + * @return 0 in case of success, a negative value corresponding to an + * AVERROR code otherwise + */ +int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt, + const char *filename, void *logctx, + unsigned int offset, unsigned int max_probe_size); + +/** + * Allocate all the structures needed to read an input stream. + * This does not open the needed codecs for decoding the stream[s]. + */ +int av_open_input_stream(AVFormatContext **ic_ptr, + AVIOContext *pb, const char *filename, + AVInputFormat *fmt, AVFormatParameters *ap); + +/** + * Open a media file as input. The codecs are not opened. Only the file + * header (if present) is read. + * + * @param ic_ptr The opened media file handle is put here. + * @param filename filename to open + * @param fmt If non-NULL, force the file format to use. + * @param buf_size optional buffer size (zero if default is OK) + * @param ap Additional parameters needed when opening the file + * (NULL if default). + * @return 0 if OK, AVERROR_xxx otherwise + */ +int av_open_input_file(AVFormatContext **ic_ptr, const char *filename, + AVInputFormat *fmt, + int buf_size, + AVFormatParameters *ap); + +int av_demuxer_open(AVFormatContext *ic, AVFormatParameters *ap); + +/** + * Allocate an AVFormatContext. + * avformat_free_context() can be used to free the context and everything + * allocated by the framework within it. + */ +AVFormatContext *avformat_alloc_context(void); + +/** + * Allocate an AVFormatContext. + * avformat_free_context() can be used to free the context and everything + * allocated by the framework within it. + */ +AVFormatContext *avformat_alloc_output_context(const char *format, AVOutputFormat *oformat, const char *filename); + +/** + * Read packets of a media file to get stream information. This + * is useful for file formats with no headers such as MPEG. This + * function also computes the real framerate in case of MPEG-2 repeat + * frame mode. + * The logical file position is not changed by this function; + * examined packets may be buffered for later processing. + * + * @param ic media file handle + * @return >=0 if OK, AVERROR_xxx on error + * @todo Let the user decide somehow what information is needed so that + * we do not waste time getting stuff the user does not need. + */ +int av_find_stream_info(AVFormatContext *ic); + +/** + * Find the "best" stream in the file. + * The best stream is determined according to various heuristics as the most + * likely to be what the user expects. + * If the decoder parameter is non-NULL, av_find_best_stream will find the + * default decoder for the stream's codec; streams for which no decoder can + * be found are ignored. + * + * @param ic media file handle + * @param type stream type: video, audio, subtitles, etc. + * @param wanted_stream_nb user-requested stream number, + * or -1 for automatic selection + * @param related_stream try to find a stream related (eg. in the same + * program) to this one, or -1 if none + * @param decoder_ret if non-NULL, returns the decoder for the + * selected stream + * @param flags flags; none are currently defined + * @return the non-negative stream number in case of success, + * AVERROR_STREAM_NOT_FOUND if no stream with the requested type + * could be found, + * AVERROR_DECODER_NOT_FOUND if streams were found but no decoder + * @note If av_find_best_stream returns successfully and decoder_ret is not + * NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec. + */ +int av_find_best_stream(AVFormatContext *ic, + enum AVMediaType type, + int wanted_stream_nb, + int related_stream, + AVCodec **decoder_ret, + int flags); + +/** + * Read a transport packet from a media file. + * + * This function is obsolete and should never be used. + * Use av_read_frame() instead. + * + * @param s media file handle + * @param pkt is filled + * @return 0 if OK, AVERROR_xxx on error + */ +int av_read_packet(AVFormatContext *s, AVPacket *pkt); + +/** + * Return the next frame of a stream. + * This function returns what is stored in the file, and does not validate + * that what is there are valid frames for the decoder. It will split what is + * stored in the file into frames and return one for each call. It will not + * omit invalid data between valid frames so as to give the decoder the maximum + * information possible for decoding. + * + * The returned packet is valid + * until the next av_read_frame() or until av_close_input_file() and + * must be freed with av_free_packet. For video, the packet contains + * exactly one frame. For audio, it contains an integer number of + * frames if each frame has a known fixed size (e.g. PCM or ADPCM + * data). If the audio frames have a variable size (e.g. MPEG audio), + * then it contains one frame. + * + * pkt->pts, pkt->dts and pkt->duration are always set to correct + * values in AVStream.time_base units (and guessed if the format cannot + * provide them). pkt->pts can be AV_NOPTS_VALUE if the video format + * has B-frames, so it is better to rely on pkt->dts if you do not + * decompress the payload. + * + * @return 0 if OK, < 0 on error or end of file + */ +int av_read_frame(AVFormatContext *s, AVPacket *pkt); + +/** + * Seek to the keyframe at timestamp. + * 'timestamp' in 'stream_index'. + * @param stream_index If stream_index is (-1), a default + * stream is selected, and timestamp is automatically converted + * from AV_TIME_BASE units to the stream specific time_base. + * @param timestamp Timestamp in AVStream.time_base units + * or, if no stream is specified, in AV_TIME_BASE units. + * @param flags flags which select direction and seeking mode + * @return >= 0 on success + */ +int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp, + int flags); + +/** + * Seek to timestamp ts. + * Seeking will be done so that the point from which all active streams + * can be presented successfully will be closest to ts and within min/max_ts. + * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL. + * + * If flags contain AVSEEK_FLAG_BYTE, then all timestamps are in bytes and + * are the file position (this may not be supported by all demuxers). + * If flags contain AVSEEK_FLAG_FRAME, then all timestamps are in frames + * in the stream with stream_index (this may not be supported by all demuxers). + * Otherwise all timestamps are in units of the stream selected by stream_index + * or if stream_index is -1, in AV_TIME_BASE units. + * If flags contain AVSEEK_FLAG_ANY, then non-keyframes are treated as + * keyframes (this may not be supported by all demuxers). + * + * @param stream_index index of the stream which is used as time base reference + * @param min_ts smallest acceptable timestamp + * @param ts target timestamp + * @param max_ts largest acceptable timestamp + * @param flags flags + * @return >=0 on success, error code otherwise + * + * @note This is part of the new seek API which is still under construction. + * Thus do not use this yet. It may change at any time, do not expect + * ABI compatibility yet! + */ +int avformat_seek_file(AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags); + +/** + * Start playing a network-based stream (e.g. RTSP stream) at the + * current position. + */ +int av_read_play(AVFormatContext *s); + +/** + * Pause a network-based stream (e.g. RTSP stream). + * + * Use av_read_play() to resume it. + */ +int av_read_pause(AVFormatContext *s); + +/** + * Free a AVFormatContext allocated by av_open_input_stream. + * @param s context to free + */ +void av_close_input_stream(AVFormatContext *s); + +/** + * Close a media file (but not its codecs). + * + * @param s media file handle + */ +void av_close_input_file(AVFormatContext *s); + +/** + * Free an AVFormatContext and all its streams. + * @param s context to free + */ +void avformat_free_context(AVFormatContext *s); + +/** + * Add a new stream to a media file. + * + * Can only be called in the read_header() function. If the flag + * AVFMTCTX_NOHEADER is in the format context, then new streams + * can be added in read_packet too. + * + * @param s media file handle + * @param id file-format-dependent stream ID + */ +AVStream *av_new_stream(AVFormatContext *s, int id); +AVProgram *av_new_program(AVFormatContext *s, int id); + +/** + * Set the pts for a given stream. If the new values would be invalid + * (<= 0), it leaves the AVStream unchanged. + * + * @param s stream + * @param pts_wrap_bits number of bits effectively used by the pts + * (used for wrap control, 33 is the value for MPEG) + * @param pts_num numerator to convert to seconds (MPEG: 1) + * @param pts_den denominator to convert to seconds (MPEG: 90000) + */ +void av_set_pts_info(AVStream *s, int pts_wrap_bits, + unsigned int pts_num, unsigned int pts_den); + +#define AVSEEK_FLAG_BACKWARD 1 ///< seek backward +#define AVSEEK_FLAG_BYTE 2 ///< seeking based on position in bytes +#define AVSEEK_FLAG_ANY 4 ///< seek to any frame, even non-keyframes +#define AVSEEK_FLAG_FRAME 8 ///< seeking based on frame number + +int av_find_default_stream_index(AVFormatContext *s); + +/** + * Get the index for a specific timestamp. + * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond + * to the timestamp which is <= the requested one, if backward + * is 0, then it will be >= + * if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise + * @return < 0 if no such timestamp could be found + */ +int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags); + +/** + * Add an index entry into a sorted list. Update the entry if the list + * already contains it. + * + * @param timestamp timestamp in the time base of the given stream + */ +int av_add_index_entry(AVStream *st, int64_t pos, int64_t timestamp, + int size, int distance, int flags); + +/** + * Perform a binary search using av_index_search_timestamp() and + * AVInputFormat.read_timestamp(). + * This is not supposed to be called directly by a user application, + * but by demuxers. + * @param target_ts target timestamp in the time base of the given stream + * @param stream_index stream number + */ +int av_seek_frame_binary(AVFormatContext *s, int stream_index, + int64_t target_ts, int flags); + +/** + * Update cur_dts of all streams based on the given timestamp and AVStream. + * + * Stream ref_st unchanged, others set cur_dts in their native time base. + * Only needed for timestamp wrapping or if (dts not set and pts!=dts). + * @param timestamp new dts expressed in time_base of param ref_st + * @param ref_st reference stream giving time_base of param timestamp + */ +void av_update_cur_dts(AVFormatContext *s, AVStream *ref_st, int64_t timestamp); + +/** + * Perform a binary search using read_timestamp(). + * This is not supposed to be called directly by a user application, + * but by demuxers. + * @param target_ts target timestamp in the time base of the given stream + * @param stream_index stream number + */ +int64_t av_gen_search(AVFormatContext *s, int stream_index, + int64_t target_ts, int64_t pos_min, + int64_t pos_max, int64_t pos_limit, + int64_t ts_min, int64_t ts_max, + int flags, int64_t *ts_ret, + int64_t (*read_timestamp)(struct AVFormatContext *, int , int64_t *, int64_t )); + +/** + * media file output + */ +attribute_deprecated int av_set_parameters(AVFormatContext *s, AVFormatParameters *ap); + +/** + * Split a URL string into components. + * + * The pointers to buffers for storing individual components may be null, + * in order to ignore that component. Buffers for components not found are + * set to empty strings. If the port is not found, it is set to a negative + * value. + * + * @param proto the buffer for the protocol + * @param proto_size the size of the proto buffer + * @param authorization the buffer for the authorization + * @param authorization_size the size of the authorization buffer + * @param hostname the buffer for the host name + * @param hostname_size the size of the hostname buffer + * @param port_ptr a pointer to store the port number in + * @param path the buffer for the path + * @param path_size the size of the path buffer + * @param url the URL to split + */ +void av_url_split(char *proto, int proto_size, + char *authorization, int authorization_size, + char *hostname, int hostname_size, + int *port_ptr, + char *path, int path_size, + const char *url); + +/** + * Allocate the stream private data and write the stream header to an + * output media file. + * @note: this sets stream time-bases, if possible to stream->codec->time_base + * but for some formats it might also be some other time base + * + * @param s media file handle + * @return 0 if OK, AVERROR_xxx on error + */ +int av_write_header(AVFormatContext *s); + +/** + * Write a packet to an output media file. + * + * The packet shall contain one audio or video frame. + * The packet must be correctly interleaved according to the container + * specification, if not then av_interleaved_write_frame must be used. + * + * @param s media file handle + * @param pkt The packet, which contains the stream_index, buf/buf_size, + dts/pts, ... + * @return < 0 on error, = 0 if OK, 1 if end of stream wanted + */ +int av_write_frame(AVFormatContext *s, AVPacket *pkt); + +/** + * Write a packet to an output media file ensuring correct interleaving. + * + * The packet must contain one audio or video frame. + * If the packets are already correctly interleaved, the application should + * call av_write_frame() instead as it is slightly faster. It is also important + * to keep in mind that completely non-interleaved input will need huge amounts + * of memory to interleave with this, so it is preferable to interleave at the + * demuxer level. + * + * @param s media file handle + * @param pkt The packet, which contains the stream_index, buf/buf_size, + dts/pts, ... + * @return < 0 on error, = 0 if OK, 1 if end of stream wanted + */ +int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt); + +/** + * Interleave a packet per dts in an output media file. + * + * Packets with pkt->destruct == av_destruct_packet will be freed inside this + * function, so they cannot be used after it. Note that calling av_free_packet() + * on them is still safe. + * + * @param s media file handle + * @param out the interleaved packet will be output here + * @param pkt the input packet + * @param flush 1 if no further packets are available as input and all + * remaining packets should be output + * @return 1 if a packet was output, 0 if no packet could be output, + * < 0 if an error occurred + */ +int av_interleave_packet_per_dts(AVFormatContext *s, AVPacket *out, + AVPacket *pkt, int flush); + +/** + * Write the stream trailer to an output media file and free the + * file private data. + * + * May only be called after a successful call to av_write_header. + * + * @param s media file handle + * @return 0 if OK, AVERROR_xxx on error + */ +int av_write_trailer(AVFormatContext *s); + +#if FF_API_DUMP_FORMAT +attribute_deprecated void dump_format(AVFormatContext *ic, + int index, + const char *url, + int is_output); +#endif + +void av_dump_format(AVFormatContext *ic, + int index, + const char *url, + int is_output); + +#if FF_API_PARSE_DATE +/** + * Parse datestr and return a corresponding number of microseconds. + * + * @param datestr String representing a date or a duration. + * See av_parse_time() for the syntax of the provided string. + * @deprecated in favor of av_parse_time() + */ +attribute_deprecated +int64_t parse_date(const char *datestr, int duration); +#endif + +/** + * Get the current time in microseconds. + */ +int64_t av_gettime(void); + +#if FF_API_FIND_INFO_TAG +/** + * @deprecated use av_find_info_tag in libavutil instead. + */ +attribute_deprecated int find_info_tag(char *arg, int arg_size, const char *tag1, const char *info); +#endif + +/** + * Return in 'buf' the path with '%d' replaced by a number. + * + * Also handles the '%0nd' format where 'n' is the total number + * of digits and '%%'. + * + * @param buf destination buffer + * @param buf_size destination buffer size + * @param path numbered sequence string + * @param number frame number + * @return 0 if OK, -1 on format error + */ +int av_get_frame_filename(char *buf, int buf_size, + const char *path, int number); + +/** + * Check whether filename actually is a numbered sequence generator. + * + * @param filename possible numbered sequence string + * @return 1 if a valid numbered sequence string, 0 otherwise + */ +int av_filename_number_test(const char *filename); + +/** + * Generate an SDP for an RTP session. + * + * @param ac array of AVFormatContexts describing the RTP streams. If the + * array is composed by only one context, such context can contain + * multiple AVStreams (one AVStream per RTP stream). Otherwise, + * all the contexts in the array (an AVCodecContext per RTP stream) + * must contain only one AVStream. + * @param n_files number of AVCodecContexts contained in ac + * @param buf buffer where the SDP will be stored (must be allocated by + * the caller) + * @param size the size of the buffer + * @return 0 if OK, AVERROR_xxx on error + */ +int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size); + +#if FF_API_SDP_CREATE +attribute_deprecated int avf_sdp_create(AVFormatContext *ac[], int n_files, char *buff, int size); +#endif + +/** + * Return a positive value if the given filename has one of the given + * extensions, 0 otherwise. + * + * @param extensions a comma-separated list of filename extensions + */ +int av_match_ext(const char *filename, const char *extensions); + +#endif /* AVFORMAT_AVFORMAT_H */ diff --git a/ffmpeg 0.7/include/libavformat/avio.h b/ffmpeg 0.7/include/libavformat/avio.h new file mode 100644 index 000000000..07d127fd9 --- /dev/null +++ b/ffmpeg 0.7/include/libavformat/avio.h @@ -0,0 +1,634 @@ +/* + * copyright (c) 2001 Fabrice Bellard + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ +#ifndef AVFORMAT_AVIO_H +#define AVFORMAT_AVIO_H + +/** + * @file + * Buffered I/O operations + */ + +#include + +#include "libavutil/common.h" +#include "libavutil/log.h" + +#include "libavformat/version.h" + + +#define AVIO_SEEKABLE_NORMAL 0x0001 /**< Seeking works like for a local file */ + +/** + * Bytestream IO Context. + * New fields can be added to the end with minor version bumps. + * Removal, reordering and changes to existing fields require a major + * version bump. + * sizeof(AVIOContext) must not be used outside libav*. + * + * @note None of the function pointers in AVIOContext should be called + * directly, they should only be set by the client application + * when implementing custom I/O. Normally these are set to the + * function pointers specified in avio_alloc_context() + */ +typedef struct { + unsigned char *buffer; /**< Start of the buffer. */ + int buffer_size; /**< Maximum buffer size */ + unsigned char *buf_ptr; /**< Current position in the buffer */ + unsigned char *buf_end; /**< End of the data, may be less than + buffer+buffer_size if the read function returned + less data than requested, e.g. for streams where + no more data has been received yet. */ + void *opaque; /**< A private pointer, passed to the read/write/seek/... + functions. */ + int (*read_packet)(void *opaque, uint8_t *buf, int buf_size); + int (*write_packet)(void *opaque, uint8_t *buf, int buf_size); + int64_t (*seek)(void *opaque, int64_t offset, int whence); + int64_t pos; /**< position in the file of the current buffer */ + int must_flush; /**< true if the next seek should flush */ + int eof_reached; /**< true if eof reached */ + int write_flag; /**< true if open for writing */ +#if FF_API_OLD_AVIO + attribute_deprecated int is_streamed; +#endif + int max_packet_size; + unsigned long checksum; + unsigned char *checksum_ptr; + unsigned long (*update_checksum)(unsigned long checksum, const uint8_t *buf, unsigned int size); + int error; /**< contains the error code or 0 if no error happened */ + /** + * Pause or resume playback for network streaming protocols - e.g. MMS. + */ + int (*read_pause)(void *opaque, int pause); + /** + * Seek to a given timestamp in stream with the specified stream_index. + * Needed for some network streaming protocols which don't support seeking + * to byte position. + */ + int64_t (*read_seek)(void *opaque, int stream_index, + int64_t timestamp, int flags); + /** + * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable. + */ + int seekable; +} AVIOContext; + +/* unbuffered I/O */ + +#if FF_API_OLD_AVIO +/** + * URL Context. + * New fields can be added to the end with minor version bumps. + * Removal, reordering and changes to existing fields require a major + * version bump. + * sizeof(URLContext) must not be used outside libav*. + * @deprecated This struct will be made private + */ +typedef struct URLContext { + const AVClass *av_class; ///< information for av_log(). Set by url_open(). + struct URLProtocol *prot; + int flags; + int is_streamed; /**< true if streamed (no seek possible), default = false */ + int max_packet_size; /**< if non zero, the stream is packetized with this max packet size */ + void *priv_data; + char *filename; /**< specified URL */ + int is_connected; +} URLContext; + +#define URL_PROTOCOL_FLAG_NESTED_SCHEME 1 /*< The protocol name can be the first part of a nested protocol scheme */ + +/** + * @deprecated This struct is to be made private. Use the higher-level + * AVIOContext-based API instead. + */ +typedef struct URLProtocol { + const char *name; + int (*url_open)(URLContext *h, const char *url, int flags); + int (*url_read)(URLContext *h, unsigned char *buf, int size); + int (*url_write)(URLContext *h, const unsigned char *buf, int size); + int64_t (*url_seek)(URLContext *h, int64_t pos, int whence); + int (*url_close)(URLContext *h); + struct URLProtocol *next; + int (*url_read_pause)(URLContext *h, int pause); + int64_t (*url_read_seek)(URLContext *h, int stream_index, + int64_t timestamp, int flags); + int (*url_get_file_handle)(URLContext *h); + int priv_data_size; + const AVClass *priv_data_class; + int flags; + int (*url_check)(URLContext *h, int mask); +} URLProtocol; + +typedef struct URLPollEntry { + URLContext *handle; + int events; + int revents; +} URLPollEntry; + +/* not implemented */ +attribute_deprecated int url_poll(URLPollEntry *poll_table, int n, int timeout); + +/** + * @defgroup open_modes URL open modes + * The flags argument to url_open and cosins must be one of the following + * constants, optionally ORed with other flags. + * @{ + */ +#define URL_RDONLY 1 /**< read-only */ +#define URL_WRONLY 2 /**< write-only */ +#define URL_RDWR (URL_RDONLY|URL_WRONLY) /**< read-write */ +/** + * @} + */ + +/** + * Use non-blocking mode. + * If this flag is set, operations on the context will return + * AVERROR(EAGAIN) if they can not be performed immediately. + * If this flag is not set, operations on the context will never return + * AVERROR(EAGAIN). + * Note that this flag does not affect the opening/connecting of the + * context. Connecting a protocol will always block if necessary (e.g. on + * network protocols) but never hang (e.g. on busy devices). + * Warning: non-blocking protocols is work-in-progress; this flag may be + * silently ignored. + */ +#define URL_FLAG_NONBLOCK 4 + +typedef int URLInterruptCB(void); +extern URLInterruptCB *url_interrupt_cb; + +/** + * @defgroup old_url_funcs Old url_* functions + * @deprecated use the buffered API based on AVIOContext instead + * @{ + */ +attribute_deprecated int url_open_protocol (URLContext **puc, struct URLProtocol *up, + const char *url, int flags); +attribute_deprecated int url_alloc(URLContext **h, const char *url, int flags); +attribute_deprecated int url_connect(URLContext *h); +attribute_deprecated int url_open(URLContext **h, const char *url, int flags); +attribute_deprecated int url_read(URLContext *h, unsigned char *buf, int size); +attribute_deprecated int url_read_complete(URLContext *h, unsigned char *buf, int size); +attribute_deprecated int url_write(URLContext *h, const unsigned char *buf, int size); +attribute_deprecated int64_t url_seek(URLContext *h, int64_t pos, int whence); +attribute_deprecated int url_close(URLContext *h); +attribute_deprecated int64_t url_filesize(URLContext *h); +attribute_deprecated int url_get_file_handle(URLContext *h); +attribute_deprecated int url_get_max_packet_size(URLContext *h); +attribute_deprecated void url_get_filename(URLContext *h, char *buf, int buf_size); +attribute_deprecated int av_url_read_pause(URLContext *h, int pause); +attribute_deprecated int64_t av_url_read_seek(URLContext *h, int stream_index, + int64_t timestamp, int flags); +attribute_deprecated void url_set_interrupt_cb(int (*interrupt_cb)(void)); + +/** + * returns the next registered protocol after the given protocol (the first if + * NULL is given), or NULL if protocol is the last one. + */ +URLProtocol *av_protocol_next(URLProtocol *p); + +/** + * Register the URLProtocol protocol. + * + * @param size the size of the URLProtocol struct referenced + */ +attribute_deprecated int av_register_protocol2(URLProtocol *protocol, int size); +/** + * @} + */ + + +typedef attribute_deprecated AVIOContext ByteIOContext; + +attribute_deprecated int init_put_byte(AVIOContext *s, + unsigned char *buffer, + int buffer_size, + int write_flag, + void *opaque, + int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), + int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), + int64_t (*seek)(void *opaque, int64_t offset, int whence)); +attribute_deprecated AVIOContext *av_alloc_put_byte( + unsigned char *buffer, + int buffer_size, + int write_flag, + void *opaque, + int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), + int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), + int64_t (*seek)(void *opaque, int64_t offset, int whence)); + +/** + * @defgroup old_avio_funcs Old put_/get_*() functions + * @deprecated use the avio_ -prefixed functions instead. + * @{ + */ +attribute_deprecated int get_buffer(AVIOContext *s, unsigned char *buf, int size); +attribute_deprecated int get_partial_buffer(AVIOContext *s, unsigned char *buf, int size); +attribute_deprecated int get_byte(AVIOContext *s); +attribute_deprecated unsigned int get_le16(AVIOContext *s); +attribute_deprecated unsigned int get_le24(AVIOContext *s); +attribute_deprecated unsigned int get_le32(AVIOContext *s); +attribute_deprecated uint64_t get_le64(AVIOContext *s); +attribute_deprecated unsigned int get_be16(AVIOContext *s); +attribute_deprecated unsigned int get_be24(AVIOContext *s); +attribute_deprecated unsigned int get_be32(AVIOContext *s); +attribute_deprecated uint64_t get_be64(AVIOContext *s); + +attribute_deprecated void put_byte(AVIOContext *s, int b); +attribute_deprecated void put_nbyte(AVIOContext *s, int b, int count); +attribute_deprecated void put_buffer(AVIOContext *s, const unsigned char *buf, int size); +attribute_deprecated void put_le64(AVIOContext *s, uint64_t val); +attribute_deprecated void put_be64(AVIOContext *s, uint64_t val); +attribute_deprecated void put_le32(AVIOContext *s, unsigned int val); +attribute_deprecated void put_be32(AVIOContext *s, unsigned int val); +attribute_deprecated void put_le24(AVIOContext *s, unsigned int val); +attribute_deprecated void put_be24(AVIOContext *s, unsigned int val); +attribute_deprecated void put_le16(AVIOContext *s, unsigned int val); +attribute_deprecated void put_be16(AVIOContext *s, unsigned int val); +attribute_deprecated void put_tag(AVIOContext *s, const char *tag); +/** + * @} + */ + +attribute_deprecated int av_url_read_fpause(AVIOContext *h, int pause); +attribute_deprecated int64_t av_url_read_fseek (AVIOContext *h, int stream_index, + int64_t timestamp, int flags); + +/** + * @defgroup old_url_f_funcs Old url_f* functions + * @deprecated use the avio_ -prefixed functions instead. + * @{ + */ +attribute_deprecated int url_fopen( AVIOContext **s, const char *url, int flags); +attribute_deprecated int url_fclose(AVIOContext *s); +attribute_deprecated int64_t url_fseek(AVIOContext *s, int64_t offset, int whence); +attribute_deprecated int url_fskip(AVIOContext *s, int64_t offset); +attribute_deprecated int64_t url_ftell(AVIOContext *s); +attribute_deprecated int64_t url_fsize(AVIOContext *s); +#define URL_EOF (-1) +attribute_deprecated int url_fgetc(AVIOContext *s); +attribute_deprecated int url_setbufsize(AVIOContext *s, int buf_size); +#ifdef __GNUC__ +attribute_deprecated int url_fprintf(AVIOContext *s, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3))); +#else +attribute_deprecated int url_fprintf(AVIOContext *s, const char *fmt, ...); +#endif +attribute_deprecated void put_flush_packet(AVIOContext *s); +attribute_deprecated int url_open_dyn_buf(AVIOContext **s); +attribute_deprecated int url_open_dyn_packet_buf(AVIOContext **s, int max_packet_size); +attribute_deprecated int url_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer); +attribute_deprecated int url_fdopen(AVIOContext **s, URLContext *h); +/** + * @} + */ + +attribute_deprecated int url_ferror(AVIOContext *s); + +attribute_deprecated int udp_set_remote_url(URLContext *h, const char *uri); +attribute_deprecated int udp_get_local_port(URLContext *h); + +attribute_deprecated void init_checksum(AVIOContext *s, + unsigned long (*update_checksum)(unsigned long c, const uint8_t *p, unsigned int len), + unsigned long checksum); +attribute_deprecated unsigned long get_checksum(AVIOContext *s); +attribute_deprecated void put_strz(AVIOContext *s, const char *buf); +/** @note unlike fgets, the EOL character is not returned and a whole + line is parsed. return NULL if first char read was EOF */ +attribute_deprecated char *url_fgets(AVIOContext *s, char *buf, int buf_size); +/** + * @deprecated use avio_get_str instead + */ +attribute_deprecated char *get_strz(AVIOContext *s, char *buf, int maxlen); +/** + * @deprecated Use AVIOContext.seekable field directly. + */ +attribute_deprecated static inline int url_is_streamed(AVIOContext *s) +{ + return !s->seekable; +} +attribute_deprecated URLContext *url_fileno(AVIOContext *s); + +/** + * @deprecated use AVIOContext.max_packet_size directly. + */ +attribute_deprecated int url_fget_max_packet_size(AVIOContext *s); + +attribute_deprecated int url_open_buf(AVIOContext **s, uint8_t *buf, int buf_size, int flags); + +/** return the written or read size */ +attribute_deprecated int url_close_buf(AVIOContext *s); + +/** + * Return a non-zero value if the resource indicated by url + * exists, 0 otherwise. + * @deprecated Use avio_check instead. + */ +attribute_deprecated int url_exist(const char *url); +#endif // FF_API_OLD_AVIO + +/** + * Return AVIO_FLAG_* access flags corresponding to the access permissions + * of the resource in url, or a negative value corresponding to an + * AVERROR code in case of failure. The returned access flags are + * masked by the value in flags. + * + * @note This function is intrinsically unsafe, in the sense that the + * checked resource may change its existence or permission status from + * one call to another. Thus you should not trust the returned value, + * unless you are sure that no other processes are accessing the + * checked resource. + */ +int avio_check(const char *url, int flags); + +/** + * The callback is called in blocking functions to test regulary if + * asynchronous interruption is needed. AVERROR_EXIT is returned + * in this case by the interrupted function. 'NULL' means no interrupt + * callback is given. + */ +void avio_set_interrupt_cb(int (*interrupt_cb)(void)); + +/** + * Allocate and initialize an AVIOContext for buffered I/O. It must be later + * freed with av_free(). + * + * @param buffer Memory block for input/output operations via AVIOContext. + * @param buffer_size The buffer size is very important for performance. + * For protocols with fixed blocksize it should be set to this blocksize. + * For others a typical size is a cache page, e.g. 4kb. + * @param write_flag Set to 1 if the buffer should be writable, 0 otherwise. + * @param opaque An opaque pointer to user-specific data. + * @param read_packet A function for refilling the buffer, may be NULL. + * @param write_packet A function for writing the buffer contents, may be NULL. + * @param seek A function for seeking to specified byte position, may be NULL. + * + * @return Allocated AVIOContext or NULL on failure. + */ +AVIOContext *avio_alloc_context( + unsigned char *buffer, + int buffer_size, + int write_flag, + void *opaque, + int (*read_packet)(void *opaque, uint8_t *buf, int buf_size), + int (*write_packet)(void *opaque, uint8_t *buf, int buf_size), + int64_t (*seek)(void *opaque, int64_t offset, int whence)); + +void avio_w8(AVIOContext *s, int b); +void avio_write(AVIOContext *s, const unsigned char *buf, int size); +void avio_wl64(AVIOContext *s, uint64_t val); +void avio_wb64(AVIOContext *s, uint64_t val); +void avio_wl32(AVIOContext *s, unsigned int val); +void avio_wb32(AVIOContext *s, unsigned int val); +void avio_wl24(AVIOContext *s, unsigned int val); +void avio_wb24(AVIOContext *s, unsigned int val); +void avio_wl16(AVIOContext *s, unsigned int val); +void avio_wb16(AVIOContext *s, unsigned int val); + +/** + * Write a NULL-terminated string. + * @return number of bytes written. + */ +int avio_put_str(AVIOContext *s, const char *str); + +/** + * Convert an UTF-8 string to UTF-16LE and write it. + * @return number of bytes written. + */ +int avio_put_str16le(AVIOContext *s, const char *str); + +/** + * Passing this as the "whence" parameter to a seek function causes it to + * return the filesize without seeking anywhere. Supporting this is optional. + * If it is not supported then the seek function will return <0. + */ +#define AVSEEK_SIZE 0x10000 + +/** + * Oring this flag as into the "whence" parameter to a seek function causes it to + * seek by any means (like reopening and linear reading) or other normally unreasonble + * means that can be extreemly slow. + * This may be ignored by the seek code. + */ +#define AVSEEK_FORCE 0x20000 + +/** + * fseek() equivalent for AVIOContext. + * @return new position or AVERROR. + */ +int64_t avio_seek(AVIOContext *s, int64_t offset, int whence); + +/** + * Skip given number of bytes forward + * @return new position or AVERROR. + */ +int64_t avio_skip(AVIOContext *s, int64_t offset); + +/** + * ftell() equivalent for AVIOContext. + * @return position or AVERROR. + */ +static av_always_inline int64_t avio_tell(AVIOContext *s) +{ + return avio_seek(s, 0, SEEK_CUR); +} + +/** + * Get the filesize. + * @return filesize or AVERROR + */ +int64_t avio_size(AVIOContext *s); + +/** + * feof() equivalent for AVIOContext. + * @return non zero if and only if end of file + */ +int url_feof(AVIOContext *s); + +/** @warning currently size is limited */ +#ifdef __GNUC__ +int avio_printf(AVIOContext *s, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3))); +#else +int avio_printf(AVIOContext *s, const char *fmt, ...); +#endif + +void avio_flush(AVIOContext *s); + + +/** + * Read size bytes from AVIOContext into buf. + * @return number of bytes read or AVERROR + */ +int avio_read(AVIOContext *s, unsigned char *buf, int size); + +/** + * @defgroup avio_read Functions for reading from AVIOContext. + * @{ + * + * @note return 0 if EOF, so you cannot use it if EOF handling is + * necessary + */ +int avio_r8 (AVIOContext *s); +unsigned int avio_rl16(AVIOContext *s); +unsigned int avio_rl24(AVIOContext *s); +unsigned int avio_rl32(AVIOContext *s); +uint64_t avio_rl64(AVIOContext *s); +unsigned int avio_rb16(AVIOContext *s); +unsigned int avio_rb24(AVIOContext *s); +unsigned int avio_rb32(AVIOContext *s); +uint64_t avio_rb64(AVIOContext *s); +/** + * @} + */ + +/** + * Read a string from pb into buf. The reading will terminate when either + * a NULL character was encountered, maxlen bytes have been read, or nothing + * more can be read from pb. The result is guaranteed to be NULL-terminated, it + * will be truncated if buf is too small. + * Note that the string is not interpreted or validated in any way, it + * might get truncated in the middle of a sequence for multi-byte encodings. + * + * @return number of bytes read (is always <= maxlen). + * If reading ends on EOF or error, the return value will be one more than + * bytes actually read. + */ +int avio_get_str(AVIOContext *pb, int maxlen, char *buf, int buflen); + +/** + * Read a UTF-16 string from pb and convert it to UTF-8. + * The reading will terminate when either a null or invalid character was + * encountered or maxlen bytes have been read. + * @return number of bytes read (is always <= maxlen) + */ +int avio_get_str16le(AVIOContext *pb, int maxlen, char *buf, int buflen); +int avio_get_str16be(AVIOContext *pb, int maxlen, char *buf, int buflen); + + +/** + * @defgroup open_modes URL open modes + * The flags argument to avio_open must be one of the following + * constants, optionally ORed with other flags. + * @{ + */ +#define AVIO_FLAG_READ 1 /**< read-only */ +#define AVIO_FLAG_WRITE 2 /**< write-only */ +#define AVIO_FLAG_READ_WRITE (AVIO_FLAG_READ|AVIO_FLAG_WRITE) /**< read-write pseudo flag */ +/** + * @} + */ + +/** + * Use non-blocking mode. + * If this flag is set, operations on the context will return + * AVERROR(EAGAIN) if they can not be performed immediately. + * If this flag is not set, operations on the context will never return + * AVERROR(EAGAIN). + * Note that this flag does not affect the opening/connecting of the + * context. Connecting a protocol will always block if necessary (e.g. on + * network protocols) but never hang (e.g. on busy devices). + * Warning: non-blocking protocols is work-in-progress; this flag may be + * silently ignored. + */ +#define AVIO_FLAG_NONBLOCK 8 + +/** + * Create and initialize a AVIOContext for accessing the + * resource indicated by url. + * @note When the resource indicated by url has been opened in + * read+write mode, the AVIOContext can be used only for writing. + * + * @param s Used to return the pointer to the created AVIOContext. + * In case of failure the pointed to value is set to NULL. + * @param flags flags which control how the resource indicated by url + * is to be opened + * @return 0 in case of success, a negative value corresponding to an + * AVERROR code in case of failure + */ +int avio_open(AVIOContext **s, const char *url, int flags); + +/** + * Close the resource accessed by the AVIOContext s and free it. + * This function can only be used if s was opened by avio_open(). + * + * @return 0 on success, an AVERROR < 0 on error. + */ +int avio_close(AVIOContext *s); + +/** + * Open a write only memory stream. + * + * @param s new IO context + * @return zero if no error. + */ +int avio_open_dyn_buf(AVIOContext **s); + +/** + * Return the written size and a pointer to the buffer. The buffer + * must be freed with av_free(). + * Padding of FF_INPUT_BUFFER_PADDING_SIZE is added to the buffer. + * + * @param s IO context + * @param pbuffer pointer to a byte buffer + * @return the length of the byte buffer + */ +int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer); + +/** + * Iterate through names of available protocols. + * @note it is recommanded to use av_protocol_next() instead of this + * + * @param opaque A private pointer representing current protocol. + * It must be a pointer to NULL on first iteration and will + * be updated by successive calls to avio_enum_protocols. + * @param output If set to 1, iterate over output protocols, + * otherwise over input protocols. + * + * @return A static string containing the name of current protocol or NULL + */ +const char *avio_enum_protocols(void **opaque, int output); + +/** + * Pause and resume playing - only meaningful if using a network streaming + * protocol (e.g. MMS). + * @param pause 1 for pause, 0 for resume + */ +int avio_pause(AVIOContext *h, int pause); + +/** + * Seek to a given timestamp relative to some component stream. + * Only meaningful if using a network streaming protocol (e.g. MMS.). + * @param stream_index The stream index that the timestamp is relative to. + * If stream_index is (-1) the timestamp should be in AV_TIME_BASE + * units from the beginning of the presentation. + * If a stream_index >= 0 is used and the protocol does not support + * seeking based on component streams, the call will fail with ENOTSUP. + * @param timestamp timestamp in AVStream.time_base units + * or if there is no stream specified then in AV_TIME_BASE units. + * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE + * and AVSEEK_FLAG_ANY. The protocol may silently ignore + * AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will + * fail with ENOTSUP if used and not supported. + * @return >= 0 on success + * @see AVInputFormat::read_seek + */ +int64_t avio_seek_time(AVIOContext *h, int stream_index, + int64_t timestamp, int flags); + +#endif /* AVFORMAT_AVIO_H */ diff --git a/ffmpeg 0.7/include/libavformat/version.h b/ffmpeg 0.7/include/libavformat/version.h new file mode 100644 index 000000000..dde8aa9de --- /dev/null +++ b/ffmpeg 0.7/include/libavformat/version.h @@ -0,0 +1,72 @@ +/* + * Version macros. + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVFORMAT_VERSION_H +#define AVFORMAT_VERSION_H + +#include "libavutil/avutil.h" + +#define LIBAVFORMAT_VERSION_MAJOR 53 +#define LIBAVFORMAT_VERSION_MINOR 1 +#define LIBAVFORMAT_VERSION_MICRO 0 + +#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ + LIBAVFORMAT_VERSION_MINOR, \ + LIBAVFORMAT_VERSION_MICRO) +#define LIBAVFORMAT_VERSION AV_VERSION(LIBAVFORMAT_VERSION_MAJOR, \ + LIBAVFORMAT_VERSION_MINOR, \ + LIBAVFORMAT_VERSION_MICRO) +#define LIBAVFORMAT_BUILD LIBAVFORMAT_VERSION_INT + +#define LIBAVFORMAT_IDENT "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION) + +/** + * Those FF_API_* defines are not part of public API. + * They may change, break or disappear at any time. + */ +#ifndef FF_API_OLD_METADATA2 +#define FF_API_OLD_METADATA2 (LIBAVFORMAT_VERSION_MAJOR < 54) +#endif +#ifndef FF_API_READ_SEEK +#define FF_API_READ_SEEK (LIBAVFORMAT_VERSION_MAJOR < 54) +#endif +#ifndef FF_API_OLD_AVIO +#define FF_API_OLD_AVIO (LIBAVFORMAT_VERSION_MAJOR < 54) +#endif +#ifndef FF_API_DUMP_FORMAT +#define FF_API_DUMP_FORMAT (LIBAVFORMAT_VERSION_MAJOR < 54) +#endif +#ifndef FF_API_PARSE_DATE +#define FF_API_PARSE_DATE (LIBAVFORMAT_VERSION_MAJOR < 54) +#endif +#ifndef FF_API_FIND_INFO_TAG +#define FF_API_FIND_INFO_TAG (LIBAVFORMAT_VERSION_MAJOR < 54) +#endif +#ifndef FF_API_PKT_DUMP +#define FF_API_PKT_DUMP (LIBAVFORMAT_VERSION_MAJOR < 54) +#endif +#ifndef FF_API_GUESS_IMG2_CODEC +#define FF_API_GUESS_IMG2_CODEC (LIBAVFORMAT_VERSION_MAJOR < 54) +#endif +#ifndef FF_API_SDP_CREATE +#define FF_API_SDP_CREATE (LIBAVFORMAT_VERSION_MAJOR < 54) +#endif + +#endif //AVFORMAT_VERSION_H diff --git a/ffmpeg 0.7/include/libavutil/adler32.h b/ffmpeg 0.7/include/libavutil/adler32.h new file mode 100644 index 000000000..0b890bcc1 --- /dev/null +++ b/ffmpeg 0.7/include/libavutil/adler32.h @@ -0,0 +1,42 @@ +/* + * copyright (c) 2006 Mans Rullgard + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_ADLER32_H +#define AVUTIL_ADLER32_H + +#include +#include "attributes.h" + +/** + * Calculate the Adler32 checksum of a buffer. + * + * Passing the return value to a subsequent av_adler32_update() call + * allows the checksum of multiple buffers to be calculated as though + * they were concatenated. + * + * @param adler initial checksum value + * @param buf pointer to input buffer + * @param len size of input buffer + * @return updated checksum + */ +unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf, + unsigned int len) av_pure; + +#endif /* AVUTIL_ADLER32_H */ diff --git a/ffmpeg 0.7/include/libavutil/aes.h b/ffmpeg 0.7/include/libavutil/aes.h new file mode 100644 index 000000000..368f70cbb --- /dev/null +++ b/ffmpeg 0.7/include/libavutil/aes.h @@ -0,0 +1,47 @@ +/* + * copyright (c) 2007 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_AES_H +#define AVUTIL_AES_H + +#include + +extern const int av_aes_size; + +struct AVAES; + +/** + * Initialize an AVAES context. + * @param key_bits 128, 192 or 256 + * @param decrypt 0 for encryption, 1 for decryption + */ +int av_aes_init(struct AVAES *a, const uint8_t *key, int key_bits, int decrypt); + +/** + * Encrypt or decrypt a buffer using a previously initialized context. + * @param count number of 16 byte blocks + * @param dst destination array, can be equal to src + * @param src source array, can be equal to dst + * @param iv initialization vector for CBC mode, if NULL then ECB will be used + * @param decrypt 0 for encryption, 1 for decryption + */ +void av_aes_crypt(struct AVAES *a, uint8_t *dst, const uint8_t *src, int count, uint8_t *iv, int decrypt); + +#endif /* AVUTIL_AES_H */ diff --git a/ffmpeg 0.7/include/libavutil/attributes.h b/ffmpeg 0.7/include/libavutil/attributes.h new file mode 100644 index 000000000..517b129f3 --- /dev/null +++ b/ffmpeg 0.7/include/libavutil/attributes.h @@ -0,0 +1,134 @@ +/* + * copyright (c) 2006 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * Macro definitions for various function/variable attributes + */ + +#ifndef AVUTIL_ATTRIBUTES_H +#define AVUTIL_ATTRIBUTES_H + +#ifdef __GNUC__ +# define AV_GCC_VERSION_AT_LEAST(x,y) (__GNUC__ > x || __GNUC__ == x && __GNUC_MINOR__ >= y) +#else +# define AV_GCC_VERSION_AT_LEAST(x,y) 0 +#endif + +#ifndef av_always_inline +#if AV_GCC_VERSION_AT_LEAST(3,1) +# define av_always_inline __attribute__((always_inline)) inline +#else +# define av_always_inline inline +#endif +#endif + +#ifndef av_noinline +#if AV_GCC_VERSION_AT_LEAST(3,1) +# define av_noinline __attribute__((noinline)) +#else +# define av_noinline +#endif +#endif + +#ifndef av_pure +#if AV_GCC_VERSION_AT_LEAST(3,1) +# define av_pure __attribute__((pure)) +#else +# define av_pure +#endif +#endif + +#ifndef av_const +#if AV_GCC_VERSION_AT_LEAST(2,6) +# define av_const __attribute__((const)) +#else +# define av_const +#endif +#endif + +#ifndef av_cold +#if AV_GCC_VERSION_AT_LEAST(4,3) +# define av_cold __attribute__((cold)) +#else +# define av_cold +#endif +#endif + +#ifndef av_flatten +#if AV_GCC_VERSION_AT_LEAST(4,1) +# define av_flatten __attribute__((flatten)) +#else +# define av_flatten +#endif +#endif + +#ifndef attribute_deprecated +#if AV_GCC_VERSION_AT_LEAST(3,1) +# define attribute_deprecated __attribute__((deprecated)) +#else +# define attribute_deprecated +#endif +#endif + +#ifndef av_unused +#if defined(__GNUC__) +# define av_unused __attribute__((unused)) +#else +# define av_unused +#endif +#endif + +/** + * Mark a variable as used and prevent the compiler from optimizing it + * away. This is useful for variables accessed only from inline + * assembler without the compiler being aware. + */ +#ifndef av_used +#if AV_GCC_VERSION_AT_LEAST(3,1) +# define av_used __attribute__((used)) +#else +# define av_used +#endif +#endif + +#ifndef av_alias +#if AV_GCC_VERSION_AT_LEAST(3,3) +# define av_alias __attribute__((may_alias)) +#else +# define av_alias +#endif +#endif + +#ifndef av_uninit +#if defined(__GNUC__) && !defined(__INTEL_COMPILER) +# define av_uninit(x) x=x +#else +# define av_uninit(x) x +#endif +#endif + +#ifdef __GNUC__ +# define av_builtin_constant_p __builtin_constant_p +#else +# define av_builtin_constant_p(x) 0 +#endif + +#endif /* AVUTIL_ATTRIBUTES_H */ diff --git a/ffmpeg 0.7/include/libavutil/audioconvert.h b/ffmpeg 0.7/include/libavutil/audioconvert.h new file mode 100644 index 000000000..134c6107c --- /dev/null +++ b/ffmpeg 0.7/include/libavutil/audioconvert.h @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2006 Michael Niedermayer + * Copyright (c) 2008 Peter Ross + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_AUDIOCONVERT_H +#define AVUTIL_AUDIOCONVERT_H + +#include + +/** + * @file + * audio conversion routines + */ + +/* Audio channel masks */ +#define AV_CH_FRONT_LEFT 0x00000001 +#define AV_CH_FRONT_RIGHT 0x00000002 +#define AV_CH_FRONT_CENTER 0x00000004 +#define AV_CH_LOW_FREQUENCY 0x00000008 +#define AV_CH_BACK_LEFT 0x00000010 +#define AV_CH_BACK_RIGHT 0x00000020 +#define AV_CH_FRONT_LEFT_OF_CENTER 0x00000040 +#define AV_CH_FRONT_RIGHT_OF_CENTER 0x00000080 +#define AV_CH_BACK_CENTER 0x00000100 +#define AV_CH_SIDE_LEFT 0x00000200 +#define AV_CH_SIDE_RIGHT 0x00000400 +#define AV_CH_TOP_CENTER 0x00000800 +#define AV_CH_TOP_FRONT_LEFT 0x00001000 +#define AV_CH_TOP_FRONT_CENTER 0x00002000 +#define AV_CH_TOP_FRONT_RIGHT 0x00004000 +#define AV_CH_TOP_BACK_LEFT 0x00008000 +#define AV_CH_TOP_BACK_CENTER 0x00010000 +#define AV_CH_TOP_BACK_RIGHT 0x00020000 +#define AV_CH_STEREO_LEFT 0x20000000 ///< Stereo downmix. +#define AV_CH_STEREO_RIGHT 0x40000000 ///< See AV_CH_STEREO_LEFT. + +/** Channel mask value used for AVCodecContext.request_channel_layout + to indicate that the user requests the channel order of the decoder output + to be the native codec channel order. */ +#define AV_CH_LAYOUT_NATIVE 0x8000000000000000LL + +/* Audio channel convenience macros */ +#define AV_CH_LAYOUT_MONO (AV_CH_FRONT_CENTER) +#define AV_CH_LAYOUT_STEREO (AV_CH_FRONT_LEFT|AV_CH_FRONT_RIGHT) +#define AV_CH_LAYOUT_2_1 (AV_CH_LAYOUT_STEREO|AV_CH_BACK_CENTER) +#define AV_CH_LAYOUT_SURROUND (AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER) +#define AV_CH_LAYOUT_4POINT0 (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_CENTER) +#define AV_CH_LAYOUT_2_2 (AV_CH_LAYOUT_STEREO|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT) +#define AV_CH_LAYOUT_QUAD (AV_CH_LAYOUT_STEREO|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT) +#define AV_CH_LAYOUT_5POINT0 (AV_CH_LAYOUT_SURROUND|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT) +#define AV_CH_LAYOUT_5POINT1 (AV_CH_LAYOUT_5POINT0|AV_CH_LOW_FREQUENCY) +#define AV_CH_LAYOUT_5POINT0_BACK (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT) +#define AV_CH_LAYOUT_5POINT1_BACK (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_LOW_FREQUENCY) +#define AV_CH_LAYOUT_7POINT0 (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT) +#define AV_CH_LAYOUT_7POINT1 (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT) +#define AV_CH_LAYOUT_7POINT1_WIDE (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER) +#define AV_CH_LAYOUT_STEREO_DOWNMIX (AV_CH_STEREO_LEFT|AV_CH_STEREO_RIGHT) + +/** + * Return a channel layout id that matches name, 0 if no match. + */ +int64_t av_get_channel_layout(const char *name); + +/** + * Return a description of a channel layout. + * If nb_channels is <= 0, it is guessed from the channel_layout. + * + * @param buf put here the string containing the channel layout + * @param buf_size size in bytes of the buffer + */ +void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, int64_t channel_layout); + +/** + * Return the number of channels in the channel layout. + */ +int av_get_channel_layout_nb_channels(int64_t channel_layout); + +#endif /* AVUTIL_AUDIOCONVERT_H */ diff --git a/ffmpeg 0.7/include/libavutil/avassert.h b/ffmpeg 0.7/include/libavutil/avassert.h new file mode 100644 index 000000000..8dd4878c1 --- /dev/null +++ b/ffmpeg 0.7/include/libavutil/avassert.h @@ -0,0 +1,66 @@ +/* + * copyright (c) 2010 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * simple assert() macros that are a bit more flexible than ISO C assert(). + * @author Michael Niedermayer + */ + +#ifndef AVUTIL_AVASSERT_H +#define AVUTIL_AVASSERT_H + +#include +#include "avutil.h" +#include "log.h" + +/** + * assert() equivalent, that is always enabled. + */ +#define av_assert0(cond) do { \ + if (!(cond)) { \ + av_log(NULL, AV_LOG_FATAL, "Assertion %s failed at %s:%d\n", \ + AV_STRINGIFY(cond), __FILE__, __LINE__); \ + abort(); \ + } \ +} while (0) + + +/** + * assert() equivalent, that does not lie in speed critical code. + * These asserts() thus can be enabled without fearing speedloss. + */ +#if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 0 +#define av_assert1(cond) av_assert0(cond) +#else +#define av_assert1(cond) ((void)0) +#endif + + +/** + * assert() equivalent, that does lie in speed critical code. + */ +#if defined(ASSERT_LEVEL) && ASSERT_LEVEL > 1 +#define av_assert2(cond) av_assert0(cond) +#else +#define av_assert2(cond) ((void)0) +#endif + +#endif diff --git a/ffmpeg 0.7/include/libavutil/avconfig.h b/ffmpeg 0.7/include/libavutil/avconfig.h new file mode 100644 index 000000000..f10aa6186 --- /dev/null +++ b/ffmpeg 0.7/include/libavutil/avconfig.h @@ -0,0 +1,6 @@ +/* Generated by ffconf */ +#ifndef AVUTIL_AVCONFIG_H +#define AVUTIL_AVCONFIG_H +#define AV_HAVE_BIGENDIAN 0 +#define AV_HAVE_FAST_UNALIGNED 1 +#endif /* AVUTIL_AVCONFIG_H */ diff --git a/ffmpeg 0.7/include/libavutil/avstring.h b/ffmpeg 0.7/include/libavutil/avstring.h new file mode 100644 index 000000000..04d119738 --- /dev/null +++ b/ffmpeg 0.7/include/libavutil/avstring.h @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2007 Mans Rullgard + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_AVSTRING_H +#define AVUTIL_AVSTRING_H + +#include + +/** + * Return non-zero if pfx is a prefix of str. If it is, *ptr is set to + * the address of the first character in str after the prefix. + * + * @param str input string + * @param pfx prefix to test + * @param ptr updated if the prefix is matched inside str + * @return non-zero if the prefix matches, zero otherwise + */ +int av_strstart(const char *str, const char *pfx, const char **ptr); + +/** + * Return non-zero if pfx is a prefix of str independent of case. If + * it is, *ptr is set to the address of the first character in str + * after the prefix. + * + * @param str input string + * @param pfx prefix to test + * @param ptr updated if the prefix is matched inside str + * @return non-zero if the prefix matches, zero otherwise + */ +int av_stristart(const char *str, const char *pfx, const char **ptr); + +/** + * Locate the first case-independent occurrence in the string haystack + * of the string needle. A zero-length string needle is considered to + * match at the start of haystack. + * + * This function is a case-insensitive version of the standard strstr(). + * + * @param haystack string to search in + * @param needle string to search for + * @return pointer to the located match within haystack + * or a null pointer if no match + */ +char *av_stristr(const char *haystack, const char *needle); + +/** + * Copy the string src to dst, but no more than size - 1 bytes, and + * null-terminate dst. + * + * This function is the same as BSD strlcpy(). + * + * @param dst destination buffer + * @param src source string + * @param size size of destination buffer + * @return the length of src + * + * WARNING: since the return value is the length of src, src absolutely + * _must_ be a properly 0-terminated string, otherwise this will read beyond + * the end of the buffer and possibly crash. + */ +size_t av_strlcpy(char *dst, const char *src, size_t size); + +/** + * Append the string src to the string dst, but to a total length of + * no more than size - 1 bytes, and null-terminate dst. + * + * This function is similar to BSD strlcat(), but differs when + * size <= strlen(dst). + * + * @param dst destination buffer + * @param src source string + * @param size size of destination buffer + * @return the total length of src and dst + * + * WARNING: since the return value use the length of src and dst, these absolutely + * _must_ be a properly 0-terminated strings, otherwise this will read beyond + * the end of the buffer and possibly crash. + */ +size_t av_strlcat(char *dst, const char *src, size_t size); + +/** + * Append output to a string, according to a format. Never write out of + * the destination buffer, and always put a terminating 0 within + * the buffer. + * @param dst destination buffer (string to which the output is + * appended) + * @param size total size of the destination buffer + * @param fmt printf-compatible format string, specifying how the + * following parameters are used + * @return the length of the string that would have been generated + * if enough space had been available + */ +size_t av_strlcatf(char *dst, size_t size, const char *fmt, ...); + +/** + * Convert a number to a av_malloced string. + */ +char *av_d2str(double d); + +/** + * Unescape the given string until a non escaped terminating char, + * and return the token corresponding to the unescaped string. + * + * The normal \ and ' escaping is supported. Leading and trailing + * whitespaces are removed, unless they are escaped with '\' or are + * enclosed between ''. + * + * @param buf the buffer to parse, buf will be updated to point to the + * terminating char + * @param term a 0-terminated list of terminating chars + * @return the malloced unescaped string, which must be av_freed by + * the user, NULL in case of allocation failure + */ +char *av_get_token(const char **buf, const char *term); + +#endif /* AVUTIL_AVSTRING_H */ diff --git a/ffmpeg 0.7/include/libavutil/avutil.h b/ffmpeg 0.7/include/libavutil/avutil.h new file mode 100644 index 000000000..09188f837 --- /dev/null +++ b/ffmpeg 0.7/include/libavutil/avutil.h @@ -0,0 +1,127 @@ +/* + * copyright (c) 2006 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_AVUTIL_H +#define AVUTIL_AVUTIL_H + +/** + * @file + * external API header + */ + + +#define AV_STRINGIFY(s) AV_TOSTRING(s) +#define AV_TOSTRING(s) #s + +#define AV_GLUE(a, b) a ## b +#define AV_JOIN(a, b) AV_GLUE(a, b) + +#define AV_PRAGMA(s) _Pragma(#s) + +#define AV_VERSION_INT(a, b, c) (a<<16 | b<<8 | c) +#define AV_VERSION_DOT(a, b, c) a ##.## b ##.## c +#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c) + +#define LIBAVUTIL_VERSION_MAJOR 51 +#define LIBAVUTIL_VERSION_MINOR 2 +#define LIBAVUTIL_VERSION_MICRO 1 + +#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \ + LIBAVUTIL_VERSION_MINOR, \ + LIBAVUTIL_VERSION_MICRO) +#define LIBAVUTIL_VERSION AV_VERSION(LIBAVUTIL_VERSION_MAJOR, \ + LIBAVUTIL_VERSION_MINOR, \ + LIBAVUTIL_VERSION_MICRO) +#define LIBAVUTIL_BUILD LIBAVUTIL_VERSION_INT + +#define LIBAVUTIL_IDENT "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION) + +/** + * Those FF_API_* defines are not part of public API. + * They may change, break or disappear at any time. + */ +#ifndef FF_API_OLD_EVAL_NAMES +#define FF_API_OLD_EVAL_NAMES (LIBAVUTIL_VERSION_MAJOR < 52) +#endif + +/** + * Return the LIBAVUTIL_VERSION_INT constant. + */ +unsigned avutil_version(void); + +/** + * Return the libavutil build-time configuration. + */ +const char *avutil_configuration(void); + +/** + * Return the libavutil license. + */ +const char *avutil_license(void); + +enum AVMediaType { + AVMEDIA_TYPE_UNKNOWN = -1, + AVMEDIA_TYPE_VIDEO, + AVMEDIA_TYPE_AUDIO, + AVMEDIA_TYPE_DATA, + AVMEDIA_TYPE_SUBTITLE, + AVMEDIA_TYPE_ATTACHMENT, + AVMEDIA_TYPE_NB +}; + +#define FF_LAMBDA_SHIFT 7 +#define FF_LAMBDA_SCALE (1< + +/** + * Decode a base64-encoded string. + * + * @param out buffer for decoded data + * @param in null-terminated input string + * @param out_size size in bytes of the out buffer, must be at + * least 3/4 of the length of in + * @return number of bytes written, or a negative value in case of + * invalid input + */ +int av_base64_decode(uint8_t *out, const char *in, int out_size); + +/** + * Encode data to base64 and null-terminate. + * + * @param out buffer for encoded data + * @param out_size size in bytes of the output buffer, must be at + * least AV_BASE64_SIZE(in_size) + * @param in_size size in bytes of the 'in' buffer + * @return 'out' or NULL in case of error + */ +char *av_base64_encode(char *out, int out_size, const uint8_t *in, int in_size); + +/** + * Calculate the output size needed to base64-encode x bytes. + */ +#define AV_BASE64_SIZE(x) (((x)+2) / 3 * 4 + 1) + +#endif /* AVUTIL_BASE64_H */ diff --git a/ffmpeg 0.7/include/libavutil/bswap.h b/ffmpeg 0.7/include/libavutil/bswap.h new file mode 100644 index 000000000..303bcf353 --- /dev/null +++ b/ffmpeg 0.7/include/libavutil/bswap.h @@ -0,0 +1,124 @@ +/* + * copyright (c) 2006 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * byte swapping routines + */ + +#ifndef AVUTIL_BSWAP_H +#define AVUTIL_BSWAP_H + +#include +#include "libavutil/avconfig.h" +#include "attributes.h" + +#ifdef HAVE_AV_CONFIG_H + +#include "config.h" + +#if ARCH_ARM +# include "arm/bswap.h" +#elif ARCH_AVR32 +# include "avr32/bswap.h" +#elif ARCH_BFIN +# include "bfin/bswap.h" +#elif ARCH_SH4 +# include "sh4/bswap.h" +#elif ARCH_X86 +# include "x86/bswap.h" +#endif + +#endif /* HAVE_AV_CONFIG_H */ + +#define AV_BSWAP16C(x) (((x) << 8 & 0xff00) | ((x) >> 8 & 0x00ff)) +#define AV_BSWAP32C(x) (AV_BSWAP16C(x) << 16 | AV_BSWAP16C((x) >> 16)) +#define AV_BSWAP64C(x) (AV_BSWAP32C(x) << 32 | AV_BSWAP32C((x) >> 32)) + +#define AV_BSWAPC(s, x) AV_BSWAP##s##C(x) + +#ifndef av_bswap16 +static av_always_inline av_const uint16_t av_bswap16(uint16_t x) +{ + x= (x>>8) | (x<<8); + return x; +} +#endif + +#ifndef av_bswap32 +static av_always_inline av_const uint32_t av_bswap32(uint32_t x) +{ + x= ((x<<8)&0xFF00FF00) | ((x>>8)&0x00FF00FF); + x= (x>>16) | (x<<16); + return x; +} +#endif + +#ifndef av_bswap64 +static inline uint64_t av_const av_bswap64(uint64_t x) +{ +#if 0 + x= ((x<< 8)&0xFF00FF00FF00FF00ULL) | ((x>> 8)&0x00FF00FF00FF00FFULL); + x= ((x<<16)&0xFFFF0000FFFF0000ULL) | ((x>>16)&0x0000FFFF0000FFFFULL); + return (x>>32) | (x<<32); +#else + union { + uint64_t ll; + uint32_t l[2]; + } w, r; + w.ll = x; + r.l[0] = av_bswap32 (w.l[1]); + r.l[1] = av_bswap32 (w.l[0]); + return r.ll; +#endif +} +#endif + +// be2ne ... big-endian to native-endian +// le2ne ... little-endian to native-endian + +#if AV_HAVE_BIGENDIAN +#define av_be2ne16(x) (x) +#define av_be2ne32(x) (x) +#define av_be2ne64(x) (x) +#define av_le2ne16(x) av_bswap16(x) +#define av_le2ne32(x) av_bswap32(x) +#define av_le2ne64(x) av_bswap64(x) +#define AV_BE2NEC(s, x) (x) +#define AV_LE2NEC(s, x) AV_BSWAPC(s, x) +#else +#define av_be2ne16(x) av_bswap16(x) +#define av_be2ne32(x) av_bswap32(x) +#define av_be2ne64(x) av_bswap64(x) +#define av_le2ne16(x) (x) +#define av_le2ne32(x) (x) +#define av_le2ne64(x) (x) +#define AV_BE2NEC(s, x) AV_BSWAPC(s, x) +#define AV_LE2NEC(s, x) (x) +#endif + +#define AV_BE2NE16C(x) AV_BE2NEC(16, x) +#define AV_BE2NE32C(x) AV_BE2NEC(32, x) +#define AV_BE2NE64C(x) AV_BE2NEC(64, x) +#define AV_LE2NE16C(x) AV_LE2NEC(16, x) +#define AV_LE2NE32C(x) AV_LE2NEC(32, x) +#define AV_LE2NE64C(x) AV_LE2NEC(64, x) + +#endif /* AVUTIL_BSWAP_H */ diff --git a/ffmpeg 0.7/include/libavutil/common.h b/ffmpeg 0.7/include/libavutil/common.h new file mode 100644 index 000000000..1cd2de290 --- /dev/null +++ b/ffmpeg 0.7/include/libavutil/common.h @@ -0,0 +1,387 @@ +/* + * copyright (c) 2006 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * common internal and external API header + */ + +#ifndef AVUTIL_COMMON_H +#define AVUTIL_COMMON_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include "attributes.h" +#include "libavutil/avconfig.h" + +#if AV_HAVE_BIGENDIAN +# define AV_NE(be, le) (be) +#else +# define AV_NE(be, le) (le) +#endif + +//rounded division & shift +#define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b)) +/* assume b>0 */ +#define ROUNDED_DIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b)) +#define FFUDIV(a,b) (((a)>0 ?(a):(a)-(b)+1) / (b)) +#define FFUMOD(a,b) ((a)-(b)*FFUDIV(a,b)) +#define FFABS(a) ((a) >= 0 ? (a) : (-(a))) +#define FFSIGN(a) ((a) > 0 ? 1 : -1) + +#define FFMAX(a,b) ((a) > (b) ? (a) : (b)) +#define FFMAX3(a,b,c) FFMAX(FFMAX(a,b),c) +#define FFMIN(a,b) ((a) > (b) ? (b) : (a)) +#define FFMIN3(a,b,c) FFMIN(FFMIN(a,b),c) + +#define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0) +#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0])) +#define FFALIGN(x, a) (((x)+(a)-1)&~((a)-1)) + +/* misc math functions */ +extern const uint8_t ff_log2_tab[256]; + +extern const uint8_t av_reverse[256]; + +static av_always_inline av_const int av_log2_c(unsigned int v) +{ + int n = 0; + if (v & 0xffff0000) { + v >>= 16; + n += 16; + } + if (v & 0xff00) { + v >>= 8; + n += 8; + } + n += ff_log2_tab[v]; + + return n; +} + +static av_always_inline av_const int av_log2_16bit_c(unsigned int v) +{ + int n = 0; + if (v & 0xff00) { + v >>= 8; + n += 8; + } + n += ff_log2_tab[v]; + + return n; +} + +#ifdef HAVE_AV_CONFIG_H +# include "config.h" +# include "intmath.h" +#endif + +/* Pull in unguarded fallback defines at the end of this file. */ +#include "common.h" + +/** + * Clip a signed integer value into the amin-amax range. + * @param a value to clip + * @param amin minimum value of the clip range + * @param amax maximum value of the clip range + * @return clipped value + */ +static av_always_inline av_const int av_clip_c(int a, int amin, int amax) +{ + if (a < amin) return amin; + else if (a > amax) return amax; + else return a; +} + +/** + * Clip a signed integer value into the 0-255 range. + * @param a value to clip + * @return clipped value + */ +static av_always_inline av_const uint8_t av_clip_uint8_c(int a) +{ + if (a&(~0xFF)) return (-a)>>31; + else return a; +} + +/** + * Clip a signed integer value into the -128,127 range. + * @param a value to clip + * @return clipped value + */ +static av_always_inline av_const int8_t av_clip_int8_c(int a) +{ + if ((a+0x80) & ~0xFF) return (a>>31) ^ 0x7F; + else return a; +} + +/** + * Clip a signed integer value into the 0-65535 range. + * @param a value to clip + * @return clipped value + */ +static av_always_inline av_const uint16_t av_clip_uint16_c(int a) +{ + if (a&(~0xFFFF)) return (-a)>>31; + else return a; +} + +/** + * Clip a signed integer value into the -32768,32767 range. + * @param a value to clip + * @return clipped value + */ +static av_always_inline av_const int16_t av_clip_int16_c(int a) +{ + if ((a+0x8000) & ~0xFFFF) return (a>>31) ^ 0x7FFF; + else return a; +} + +/** + * Clip a signed 64-bit integer value into the -2147483648,2147483647 range. + * @param a value to clip + * @return clipped value + */ +static av_always_inline av_const int32_t av_clipl_int32_c(int64_t a) +{ + if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) return (a>>63) ^ 0x7FFFFFFF; + else return a; +} + +/** + * Clip a signed integer to an unsigned power of two range. + * @param a value to clip + * @param p bit position to clip at + * @return clipped value + */ +static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p) +{ + if (a & ~((1<> 31 & ((1< amax) return amax; + else return a; +} + +/** Compute ceil(log2(x)). + * @param x value used to compute ceil(log2(x)) + * @return computed ceiling of log2(x) + */ +static av_always_inline av_const int av_ceil_log2_c(int x) +{ + return av_log2((x - 1) << 1); +} + +/** + * Count number of bits set to one in x + * @param x value to count bits of + * @return the number of bits set to one in x + */ +static av_always_inline av_const int av_popcount_c(uint32_t x) +{ + x -= (x >> 1) & 0x55555555; + x = (x & 0x33333333) + ((x >> 2) & 0x33333333); + x = (x + (x >> 4)) & 0x0F0F0F0F; + x += x >> 8; + return (x + (x >> 16)) & 0x3F; +} + +#define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((d) << 24)) +#define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((a) << 24)) + +/** + * Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form. + * + * @param val Output value, must be an lvalue of type uint32_t. + * @param GET_BYTE Expression reading one byte from the input. + * Evaluated up to 7 times (4 for the currently + * assigned Unicode range). With a memory buffer + * input, this could be *ptr++. + * @param ERROR Expression to be evaluated on invalid input, + * typically a goto statement. + */ +#define GET_UTF8(val, GET_BYTE, ERROR)\ + val= GET_BYTE;\ + {\ + int ones= 7 - av_log2(val ^ 255);\ + if(ones==1)\ + ERROR\ + val&= 127>>ones;\ + while(--ones > 0){\ + int tmp= GET_BYTE - 128;\ + if(tmp>>6)\ + ERROR\ + val= (val<<6) + tmp;\ + }\ + } + +/** + * Convert a UTF-16 character (2 or 4 bytes) to its 32-bit UCS-4 encoded form. + * + * @param val Output value, must be an lvalue of type uint32_t. + * @param GET_16BIT Expression returning two bytes of UTF-16 data converted + * to native byte order. Evaluated one or two times. + * @param ERROR Expression to be evaluated on invalid input, + * typically a goto statement. + */ +#define GET_UTF16(val, GET_16BIT, ERROR)\ + val = GET_16BIT;\ + {\ + unsigned int hi = val - 0xD800;\ + if (hi < 0x800) {\ + val = GET_16BIT - 0xDC00;\ + if (val > 0x3FFU || hi > 0x3FFU)\ + ERROR\ + val += (hi<<10) + 0x10000;\ + }\ + }\ + +/*! + * \def PUT_UTF8(val, tmp, PUT_BYTE) + * Convert a 32-bit Unicode character to its UTF-8 encoded form (up to 4 bytes long). + * \param val is an input-only argument and should be of type uint32_t. It holds + * a UCS-4 encoded Unicode character that is to be converted to UTF-8. If + * val is given as a function it is executed only once. + * \param tmp is a temporary variable and should be of type uint8_t. It + * represents an intermediate value during conversion that is to be + * output by PUT_BYTE. + * \param PUT_BYTE writes the converted UTF-8 bytes to any proper destination. + * It could be a function or a statement, and uses tmp as the input byte. + * For example, PUT_BYTE could be "*output++ = tmp;" PUT_BYTE will be + * executed up to 4 times for values in the valid UTF-8 range and up to + * 7 times in the general case, depending on the length of the converted + * Unicode character. + */ +#define PUT_UTF8(val, tmp, PUT_BYTE)\ + {\ + int bytes, shift;\ + uint32_t in = val;\ + if (in < 0x80) {\ + tmp = in;\ + PUT_BYTE\ + } else {\ + bytes = (av_log2(in) + 4) / 5;\ + shift = (bytes - 1) * 6;\ + tmp = (256 - (256 >> bytes)) | (in >> shift);\ + PUT_BYTE\ + while (shift >= 6) {\ + shift -= 6;\ + tmp = 0x80 | ((in >> shift) & 0x3f);\ + PUT_BYTE\ + }\ + }\ + } + +/*! + * \def PUT_UTF16(val, tmp, PUT_16BIT) + * Convert a 32-bit Unicode character to its UTF-16 encoded form (2 or 4 bytes). + * \param val is an input-only argument and should be of type uint32_t. It holds + * a UCS-4 encoded Unicode character that is to be converted to UTF-16. If + * val is given as a function it is executed only once. + * \param tmp is a temporary variable and should be of type uint16_t. It + * represents an intermediate value during conversion that is to be + * output by PUT_16BIT. + * \param PUT_16BIT writes the converted UTF-16 data to any proper destination + * in desired endianness. It could be a function or a statement, and uses tmp + * as the input byte. For example, PUT_BYTE could be "*output++ = tmp;" + * PUT_BYTE will be executed 1 or 2 times depending on input character. + */ +#define PUT_UTF16(val, tmp, PUT_16BIT)\ + {\ + uint32_t in = val;\ + if (in < 0x10000) {\ + tmp = in;\ + PUT_16BIT\ + } else {\ + tmp = 0xD800 | ((in - 0x10000) >> 10);\ + PUT_16BIT\ + tmp = 0xDC00 | ((in - 0x10000) & 0x3FF);\ + PUT_16BIT\ + }\ + }\ + + + +#include "mem.h" + +#ifdef HAVE_AV_CONFIG_H +# include "internal.h" +#endif /* HAVE_AV_CONFIG_H */ + +#endif /* AVUTIL_COMMON_H */ + +/* + * The following definitions are outside the multiple inclusion guard + * to ensure they are immediately available in intmath.h. + */ + +#ifndef av_log2 +# define av_log2 av_log2_c +#endif +#ifndef av_log2_16bit +# define av_log2_16bit av_log2_16bit_c +#endif +#ifndef av_ceil_log2 +# define av_ceil_log2 av_ceil_log2_c +#endif +#ifndef av_clip +# define av_clip av_clip_c +#endif +#ifndef av_clip_uint8 +# define av_clip_uint8 av_clip_uint8_c +#endif +#ifndef av_clip_int8 +# define av_clip_int8 av_clip_int8_c +#endif +#ifndef av_clip_uint16 +# define av_clip_uint16 av_clip_uint16_c +#endif +#ifndef av_clip_int16 +# define av_clip_int16 av_clip_int16_c +#endif +#ifndef av_clipl_int32 +# define av_clipl_int32 av_clipl_int32_c +#endif +#ifndef av_clip_uintp2 +# define av_clip_uintp2 av_clip_uintp2_c +#endif +#ifndef av_clipf +# define av_clipf av_clipf_c +#endif +#ifndef av_popcount +# define av_popcount av_popcount_c +#endif diff --git a/ffmpeg 0.7/include/libavutil/cpu.h b/ffmpeg 0.7/include/libavutil/cpu.h new file mode 100644 index 000000000..ff0c2e64a --- /dev/null +++ b/ffmpeg 0.7/include/libavutil/cpu.h @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2000, 2001, 2002 Fabrice Bellard + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_CPU_H +#define AVUTIL_CPU_H + +#define AV_CPU_FLAG_FORCE 0x80000000 /* force usage of selected flags (OR) */ + + /* lower 16 bits - CPU features */ +#define AV_CPU_FLAG_MMX 0x0001 ///< standard MMX +#define AV_CPU_FLAG_MMX2 0x0002 ///< SSE integer functions or AMD MMX ext +#define AV_CPU_FLAG_3DNOW 0x0004 ///< AMD 3DNOW +#define AV_CPU_FLAG_SSE 0x0008 ///< SSE functions +#define AV_CPU_FLAG_SSE2 0x0010 ///< PIV SSE2 functions +#define AV_CPU_FLAG_SSE2SLOW 0x40000000 ///< SSE2 supported, but usually not faster +#define AV_CPU_FLAG_3DNOWEXT 0x0020 ///< AMD 3DNowExt +#define AV_CPU_FLAG_SSE3 0x0040 ///< Prescott SSE3 functions +#define AV_CPU_FLAG_SSE3SLOW 0x20000000 ///< SSE3 supported, but usually not faster +#define AV_CPU_FLAG_SSSE3 0x0080 ///< Conroe SSSE3 functions +#define AV_CPU_FLAG_ATOM 0x10000000 ///< Atom processor, some SSSE3 instructions are slower +#define AV_CPU_FLAG_SSE4 0x0100 ///< Penryn SSE4.1 functions +#define AV_CPU_FLAG_SSE42 0x0200 ///< Nehalem SSE4.2 functions +#define AV_CPU_FLAG_AVX 0x4000 ///< AVX functions: requires OS support even if YMM registers aren't used +#define AV_CPU_FLAG_IWMMXT 0x0100 ///< XScale IWMMXT +#define AV_CPU_FLAG_ALTIVEC 0x0001 ///< standard + +/** + * Return the flags which specify extensions supported by the CPU. + */ +int av_get_cpu_flags(void); + +/* The following CPU-specific functions shall not be called directly. */ +int ff_get_cpu_flags_arm(void); +int ff_get_cpu_flags_ppc(void); +int ff_get_cpu_flags_x86(void); + +#endif /* AVUTIL_CPU_H */ diff --git a/ffmpeg 0.7/include/libavutil/crc.h b/ffmpeg 0.7/include/libavutil/crc.h new file mode 100644 index 000000000..6c0baab5a --- /dev/null +++ b/ffmpeg 0.7/include/libavutil/crc.h @@ -0,0 +1,44 @@ +/* + * copyright (c) 2006 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_CRC_H +#define AVUTIL_CRC_H + +#include +#include +#include "attributes.h" + +typedef uint32_t AVCRC; + +typedef enum { + AV_CRC_8_ATM, + AV_CRC_16_ANSI, + AV_CRC_16_CCITT, + AV_CRC_32_IEEE, + AV_CRC_32_IEEE_LE, /*< reversed bitorder version of AV_CRC_32_IEEE */ + AV_CRC_MAX, /*< Not part of public API! Do not use outside libavutil. */ +}AVCRCId; + +int av_crc_init(AVCRC *ctx, int le, int bits, uint32_t poly, int ctx_size); +const AVCRC *av_crc_get_table(AVCRCId crc_id); +uint32_t av_crc(const AVCRC *ctx, uint32_t start_crc, const uint8_t *buffer, size_t length) av_pure; + +#endif /* AVUTIL_CRC_H */ + diff --git a/ffmpeg 0.7/include/libavutil/error.h b/ffmpeg 0.7/include/libavutil/error.h new file mode 100644 index 000000000..47d366ebb --- /dev/null +++ b/ffmpeg 0.7/include/libavutil/error.h @@ -0,0 +1,68 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * error code definitions + */ + +#ifndef AVUTIL_ERROR_H +#define AVUTIL_ERROR_H + +#include +#include "avutil.h" + +/* error handling */ +#if EDOM > 0 +#define AVERROR(e) (-(e)) ///< Returns a negative error code from a POSIX error code, to return from library functions. +#define AVUNERROR(e) (-(e)) ///< Returns a POSIX error code from a library function error return value. +#else +/* Some platforms have E* and errno already negated. */ +#define AVERROR(e) (e) +#define AVUNERROR(e) (e) +#endif + +#define AVERROR_BSF_NOT_FOUND (-MKTAG(0xF8,'B','S','F')) ///< Bitstream filter not found +#define AVERROR_DECODER_NOT_FOUND (-MKTAG(0xF8,'D','E','C')) ///< Decoder not found +#define AVERROR_DEMUXER_NOT_FOUND (-MKTAG(0xF8,'D','E','M')) ///< Demuxer not found +#define AVERROR_ENCODER_NOT_FOUND (-MKTAG(0xF8,'E','N','C')) ///< Encoder not found +#define AVERROR_EOF (-MKTAG( 'E','O','F',' ')) ///< End of file +#define AVERROR_EXIT (-MKTAG( 'E','X','I','T')) ///< Immediate exit was requested; the called function should not be restarted +#define AVERROR_FILTER_NOT_FOUND (-MKTAG(0xF8,'F','I','L')) ///< Filter not found +#define AVERROR_INVALIDDATA (-MKTAG( 'I','N','D','A')) ///< Invalid data found when processing input +#define AVERROR_MUXER_NOT_FOUND (-MKTAG(0xF8,'M','U','X')) ///< Muxer not found +#define AVERROR_OPTION_NOT_FOUND (-MKTAG(0xF8,'O','P','T')) ///< Option not found +#define AVERROR_PATCHWELCOME (-MKTAG( 'P','A','W','E')) ///< Not yet implemented in FFmpeg, patches welcome +#define AVERROR_PROTOCOL_NOT_FOUND (-MKTAG(0xF8,'P','R','O')) ///< Protocol not found +#define AVERROR_STREAM_NOT_FOUND (-MKTAG(0xF8,'S','T','R')) ///< Stream not found + +/** + * Put a description of the AVERROR code errnum in errbuf. + * In case of failure the global variable errno is set to indicate the + * error. Even in case of failure av_strerror() will print a generic + * error message indicating the errnum provided to errbuf. + * + * @param errnum error code to describe + * @param errbuf buffer to which description is written + * @param errbuf_size the size in bytes of errbuf + * @return 0 on success, a negative value if a description for errnum + * cannot be found + */ +int av_strerror(int errnum, char *errbuf, size_t errbuf_size); + +#endif /* AVUTIL_ERROR_H */ diff --git a/ffmpeg 0.7/include/libavutil/eval.h b/ffmpeg 0.7/include/libavutil/eval.h new file mode 100644 index 000000000..ee378a29b --- /dev/null +++ b/ffmpeg 0.7/include/libavutil/eval.h @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2002 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * simple arithmetic expression evaluator + */ + +#ifndef AVUTIL_EVAL_H +#define AVUTIL_EVAL_H + +#include "avutil.h" + +typedef struct AVExpr AVExpr; + +/** + * Parse and evaluate an expression. + * Note, this is significantly slower than av_expr_eval(). + * + * @param res a pointer to a double where is put the result value of + * the expression, or NAN in case of error + * @param s expression as a zero terminated string, for example "1+2^3+5*5+sin(2/3)" + * @param const_names NULL terminated array of zero terminated strings of constant identifiers, for example {"PI", "E", 0} + * @param const_values a zero terminated array of values for the identifiers from const_names + * @param func1_names NULL terminated array of zero terminated strings of funcs1 identifiers + * @param funcs1 NULL terminated array of function pointers for functions which take 1 argument + * @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers + * @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments + * @param opaque a pointer which will be passed to all functions from funcs1 and funcs2 + * @param log_ctx parent logging context + * @return 0 in case of success, a negative value corresponding to an + * AVERROR code otherwise + */ +int av_expr_parse_and_eval(double *res, const char *s, + const char * const *const_names, const double *const_values, + const char * const *func1_names, double (* const *funcs1)(void *, double), + const char * const *func2_names, double (* const *funcs2)(void *, double, double), + void *opaque, int log_offset, void *log_ctx); + +/** + * Parse an expression. + * + * @param expr a pointer where is put an AVExpr containing the parsed + * value in case of successfull parsing, or NULL otherwise. + * The pointed to AVExpr must be freed with av_expr_free() by the user + * when it is not needed anymore. + * @param s expression as a zero terminated string, for example "1+2^3+5*5+sin(2/3)" + * @param const_names NULL terminated array of zero terminated strings of constant identifiers, for example {"PI", "E", 0} + * @param func1_names NULL terminated array of zero terminated strings of funcs1 identifiers + * @param funcs1 NULL terminated array of function pointers for functions which take 1 argument + * @param func2_names NULL terminated array of zero terminated strings of funcs2 identifiers + * @param funcs2 NULL terminated array of function pointers for functions which take 2 arguments + * @param log_ctx parent logging context + * @return 0 in case of success, a negative value corresponding to an + * AVERROR code otherwise + */ +int av_expr_parse(AVExpr **expr, const char *s, + const char * const *const_names, + const char * const *func1_names, double (* const *funcs1)(void *, double), + const char * const *func2_names, double (* const *funcs2)(void *, double, double), + int log_offset, void *log_ctx); + +/** + * Evaluate a previously parsed expression. + * + * @param const_values a zero terminated array of values for the identifiers from av_expr_parse() const_names + * @param opaque a pointer which will be passed to all functions from funcs1 and funcs2 + * @return the value of the expression + */ +double av_expr_eval(AVExpr *e, const double *const_values, void *opaque); + +/** + * Free a parsed expression previously created with av_expr_parse(). + */ +void av_expr_free(AVExpr *e); + +#if FF_API_OLD_EVAL_NAMES +/** + * @deprecated Deprecated in favor of av_expr_parse_and_eval(). + */ +attribute_deprecated +int av_parse_and_eval_expr(double *res, const char *s, + const char * const *const_names, const double *const_values, + const char * const *func1_names, double (* const *funcs1)(void *, double), + const char * const *func2_names, double (* const *funcs2)(void *, double, double), + void *opaque, int log_offset, void *log_ctx); + +/** + * @deprecated Deprecated in favor of av_expr_parse(). + */ +attribute_deprecated +int av_parse_expr(AVExpr **expr, const char *s, + const char * const *const_names, + const char * const *func1_names, double (* const *funcs1)(void *, double), + const char * const *func2_names, double (* const *funcs2)(void *, double, double), + int log_offset, void *log_ctx); +/** + * @deprecated Deprecated in favor of av_expr_eval(). + */ +attribute_deprecated +double av_eval_expr(AVExpr *e, const double *const_values, void *opaque); + +/** + * @deprecated Deprecated in favor of av_expr_free(). + */ +attribute_deprecated +void av_free_expr(AVExpr *e); +#endif /* FF_API_OLD_EVAL_NAMES */ + +/** + * Parse the string in numstr and return its value as a double. If + * the string is empty, contains only whitespaces, or does not contain + * an initial substring that has the expected syntax for a + * floating-point number, no conversion is performed. In this case, + * returns a value of zero and the value returned in tail is the value + * of numstr. + * + * @param numstr a string representing a number, may contain one of + * the International System number postfixes, for example 'K', 'M', + * 'G'. If 'i' is appended after the postfix, powers of 2 are used + * instead of powers of 10. The 'B' postfix multiplies the value for + * 8, and can be appended after another postfix or used alone. This + * allows using for example 'KB', 'MiB', 'G' and 'B' as postfix. + * @param tail if non-NULL puts here the pointer to the char next + * after the last parsed character + */ +double av_strtod(const char *numstr, char **tail); + +#endif /* AVUTIL_EVAL_H */ diff --git a/ffmpeg 0.7/include/libavutil/fifo.h b/ffmpeg 0.7/include/libavutil/fifo.h new file mode 100644 index 000000000..999d0bf89 --- /dev/null +++ b/ffmpeg 0.7/include/libavutil/fifo.h @@ -0,0 +1,116 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * a very simple circular buffer FIFO implementation + */ + +#ifndef AVUTIL_FIFO_H +#define AVUTIL_FIFO_H + +#include + +typedef struct AVFifoBuffer { + uint8_t *buffer; + uint8_t *rptr, *wptr, *end; + uint32_t rndx, wndx; +} AVFifoBuffer; + +/** + * Initialize an AVFifoBuffer. + * @param size of FIFO + * @return AVFifoBuffer or NULL in case of memory allocation failure + */ +AVFifoBuffer *av_fifo_alloc(unsigned int size); + +/** + * Free an AVFifoBuffer. + * @param *f AVFifoBuffer to free + */ +void av_fifo_free(AVFifoBuffer *f); + +/** + * Reset the AVFifoBuffer to the state right after av_fifo_alloc, in particular it is emptied. + * @param *f AVFifoBuffer to reset + */ +void av_fifo_reset(AVFifoBuffer *f); + +/** + * Return the amount of data in bytes in the AVFifoBuffer, that is the + * amount of data you can read from it. + * @param *f AVFifoBuffer to read from + * @return size + */ +int av_fifo_size(AVFifoBuffer *f); + +/** + * Return the amount of space in bytes in the AVFifoBuffer, that is the + * amount of data you can write into it. + * @param *f AVFifoBuffer to write into + * @return size + */ +int av_fifo_space(AVFifoBuffer *f); + +/** + * Feed data from an AVFifoBuffer to a user-supplied callback. + * @param *f AVFifoBuffer to read from + * @param buf_size number of bytes to read + * @param *func generic read function + * @param *dest data destination + */ +int av_fifo_generic_read(AVFifoBuffer *f, void *dest, int buf_size, void (*func)(void*, void*, int)); + +/** + * Feed data from a user-supplied callback to an AVFifoBuffer. + * @param *f AVFifoBuffer to write to + * @param *src data source; non-const since it may be used as a + * modifiable context by the function defined in func + * @param size number of bytes to write + * @param *func generic write function; the first parameter is src, + * the second is dest_buf, the third is dest_buf_size. + * func must return the number of bytes written to dest_buf, or <= 0 to + * indicate no more data available to write. + * If func is NULL, src is interpreted as a simple byte array for source data. + * @return the number of bytes written to the FIFO + */ +int av_fifo_generic_write(AVFifoBuffer *f, void *src, int size, int (*func)(void*, void*, int)); + +/** + * Resize an AVFifoBuffer. + * @param *f AVFifoBuffer to resize + * @param size new AVFifoBuffer size in bytes + * @return <0 for failure, >=0 otherwise + */ +int av_fifo_realloc2(AVFifoBuffer *f, unsigned int size); + +/** + * Read and discard the specified amount of data from an AVFifoBuffer. + * @param *f AVFifoBuffer to read from + * @param size amount of data to read in bytes + */ +void av_fifo_drain(AVFifoBuffer *f, int size); + +static inline uint8_t av_fifo_peek(AVFifoBuffer *f, int offs) +{ + uint8_t *ptr = f->rptr + offs; + if (ptr >= f->end) + ptr -= f->end - f->buffer; + return *ptr; +} +#endif /* AVUTIL_FIFO_H */ diff --git a/ffmpeg 0.7/include/libavutil/file.h b/ffmpeg 0.7/include/libavutil/file.h new file mode 100644 index 000000000..f94d7803f --- /dev/null +++ b/ffmpeg 0.7/include/libavutil/file.h @@ -0,0 +1,51 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_FILE_H +#define AVUTIL_FILE_H + +#include "avutil.h" + +/** + * @file misc file utilities + */ + +/** + * Read the file with name filename, and put its content in a newly + * allocated buffer or map it with mmap() when available. + * In case of success set *bufptr to the read or mmapped buffer, and + * *size to the size in bytes of the buffer in *bufptr. + * The returned buffer must be released with av_file_unmap(). + * + * @param log_offset loglevel offset used for logging + * @param log_ctx context used for logging + * @return a non negative number in case of success, a negative value + * corresponding to an AVERROR error code in case of failure + */ +int av_file_map(const char *filename, uint8_t **bufptr, size_t *size, + int log_offset, void *log_ctx); + +/** + * Unmap or free the buffer bufptr created by av_file_map(). + * + * @param size size in bytes of bufptr, must be the same as returned + * by av_file_map() + */ +void av_file_unmap(uint8_t *bufptr, size_t size); + +#endif /* AVUTIL_FILE_H */ diff --git a/ffmpeg 0.7/include/libavutil/imgutils.h b/ffmpeg 0.7/include/libavutil/imgutils.h new file mode 100644 index 000000000..7a714d1f2 --- /dev/null +++ b/ffmpeg 0.7/include/libavutil/imgutils.h @@ -0,0 +1,130 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_IMGUTILS_H +#define AVUTIL_IMGUTILS_H + +/** + * @file + * misc image utilities + */ + +#include "libavutil/pixdesc.h" +#include "avutil.h" + +/** + * Compute the max pixel step for each plane of an image with a + * format described by pixdesc. + * + * The pixel step is the distance in bytes between the first byte of + * the group of bytes which describe a pixel component and the first + * byte of the successive group in the same plane for the same + * component. + * + * @param max_pixsteps an array which is filled with the max pixel step + * for each plane. Since a plane may contain different pixel + * components, the computed max_pixsteps[plane] is relative to the + * component in the plane with the max pixel step. + * @param max_pixstep_comps an array which is filled with the component + * for each plane which has the max pixel step. May be NULL. + */ +void av_image_fill_max_pixsteps(int max_pixsteps[4], int max_pixstep_comps[4], + const AVPixFmtDescriptor *pixdesc); + +/** + * Compute the size of an image line with format pix_fmt and width + * width for the plane plane. + * + * @return the computed size in bytes + */ +int av_image_get_linesize(enum PixelFormat pix_fmt, int width, int plane); + +/** + * Fill plane linesizes for an image with pixel format pix_fmt and + * width width. + * + * @param linesizes array to be filled with the linesize for each plane + * @return >= 0 in case of success, a negative error code otherwise + */ +int av_image_fill_linesizes(int linesizes[4], enum PixelFormat pix_fmt, int width); + +/** + * Fill plane data pointers for an image with pixel format pix_fmt and + * height height. + * + * @param data pointers array to be filled with the pointer for each image plane + * @param ptr the pointer to a buffer which will contain the image + * @param linesizes[4] the array containing the linesize for each + * plane, should be filled by av_image_fill_linesizes() + * @return the size in bytes required for the image buffer, a negative + * error code in case of failure + */ +int av_image_fill_pointers(uint8_t *data[4], enum PixelFormat pix_fmt, int height, + uint8_t *ptr, const int linesizes[4]); + +/** + * Allocate an image with size w and h and pixel format pix_fmt, and + * fill pointers and linesizes accordingly. + * The allocated image buffer has to be freed by using + * av_freep(&pointers[0]). + * + * @param align the value to use for buffer size alignment + * @return the size in bytes required for the image buffer, a negative + * error code in case of failure + */ +int av_image_alloc(uint8_t *pointers[4], int linesizes[4], + int w, int h, enum PixelFormat pix_fmt, int align); + +/** + * Copy image plane from src to dst. + * That is, copy "height" number of lines of "bytewidth" bytes each. + * The first byte of each successive line is separated by *_linesize + * bytes. + * + * @param dst_linesize linesize for the image plane in dst + * @param src_linesize linesize for the image plane in src + */ +void av_image_copy_plane(uint8_t *dst, int dst_linesize, + const uint8_t *src, int src_linesize, + int bytewidth, int height); + +/** + * Copy image in src_data to dst_data. + * + * @param dst_linesize linesizes for the image in dst_data + * @param src_linesize linesizes for the image in src_data + */ +void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], + const uint8_t *src_data[4], const int src_linesizes[4], + enum PixelFormat pix_fmt, int width, int height); + +/** + * Check if the given dimension of an image is valid, meaning that all + * bytes of the image can be addressed with a signed int. + * + * @param w the width of the picture + * @param h the height of the picture + * @param log_offset the offset to sum to the log level for logging with log_ctx + * @param log_ctx the parent logging context, it may be NULL + * @return >= 0 if valid, a negative error code otherwise + */ +int av_image_check_size(unsigned int w, unsigned int h, int log_offset, void *log_ctx); + +int ff_set_systematic_pal2(uint32_t pal[256], enum PixelFormat pix_fmt); + +#endif /* AVUTIL_IMGUTILS_H */ diff --git a/ffmpeg 0.7/include/libavutil/intfloat_readwrite.h b/ffmpeg 0.7/include/libavutil/intfloat_readwrite.h new file mode 100644 index 000000000..1b80fc6e9 --- /dev/null +++ b/ffmpeg 0.7/include/libavutil/intfloat_readwrite.h @@ -0,0 +1,40 @@ +/* + * copyright (c) 2005 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_INTFLOAT_READWRITE_H +#define AVUTIL_INTFLOAT_READWRITE_H + +#include +#include "attributes.h" + +/* IEEE 80 bits extended float */ +typedef struct AVExtFloat { + uint8_t exponent[2]; + uint8_t mantissa[8]; +} AVExtFloat; + +double av_int2dbl(int64_t v) av_const; +float av_int2flt(int32_t v) av_const; +double av_ext2dbl(const AVExtFloat ext) av_const; +int64_t av_dbl2int(double d) av_const; +int32_t av_flt2int(float d) av_const; +AVExtFloat av_dbl2ext(double d) av_const; + +#endif /* AVUTIL_INTFLOAT_READWRITE_H */ diff --git a/ffmpeg 0.7/include/libavutil/intreadwrite.h b/ffmpeg 0.7/include/libavutil/intreadwrite.h new file mode 100644 index 000000000..1849a6466 --- /dev/null +++ b/ffmpeg 0.7/include/libavutil/intreadwrite.h @@ -0,0 +1,522 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_INTREADWRITE_H +#define AVUTIL_INTREADWRITE_H + +#include +#include "libavutil/avconfig.h" +#include "attributes.h" +#include "bswap.h" + +typedef union { + uint64_t u64; + uint32_t u32[2]; + uint16_t u16[4]; + uint8_t u8 [8]; + double f64; + float f32[2]; +} av_alias av_alias64; + +typedef union { + uint32_t u32; + uint16_t u16[2]; + uint8_t u8 [4]; + float f32; +} av_alias av_alias32; + +typedef union { + uint16_t u16; + uint8_t u8 [2]; +} av_alias av_alias16; + +/* + * Arch-specific headers can provide any combination of + * AV_[RW][BLN](16|24|32|64) and AV_(COPY|SWAP|ZERO)(64|128) macros. + * Preprocessor symbols must be defined, even if these are implemented + * as inline functions. + */ + +#ifdef HAVE_AV_CONFIG_H + +#include "config.h" + +#if ARCH_ARM +# include "arm/intreadwrite.h" +#elif ARCH_AVR32 +# include "avr32/intreadwrite.h" +#elif ARCH_MIPS +# include "mips/intreadwrite.h" +#elif ARCH_PPC +# include "ppc/intreadwrite.h" +#elif ARCH_TOMI +# include "tomi/intreadwrite.h" +#elif ARCH_X86 +# include "x86/intreadwrite.h" +#endif + +#endif /* HAVE_AV_CONFIG_H */ + +/* + * Map AV_RNXX <-> AV_R[BL]XX for all variants provided by per-arch headers. + */ + +#if AV_HAVE_BIGENDIAN + +# if defined(AV_RN16) && !defined(AV_RB16) +# define AV_RB16(p) AV_RN16(p) +# elif !defined(AV_RN16) && defined(AV_RB16) +# define AV_RN16(p) AV_RB16(p) +# endif + +# if defined(AV_WN16) && !defined(AV_WB16) +# define AV_WB16(p, v) AV_WN16(p, v) +# elif !defined(AV_WN16) && defined(AV_WB16) +# define AV_WN16(p, v) AV_WB16(p, v) +# endif + +# if defined(AV_RN24) && !defined(AV_RB24) +# define AV_RB24(p) AV_RN24(p) +# elif !defined(AV_RN24) && defined(AV_RB24) +# define AV_RN24(p) AV_RB24(p) +# endif + +# if defined(AV_WN24) && !defined(AV_WB24) +# define AV_WB24(p, v) AV_WN24(p, v) +# elif !defined(AV_WN24) && defined(AV_WB24) +# define AV_WN24(p, v) AV_WB24(p, v) +# endif + +# if defined(AV_RN32) && !defined(AV_RB32) +# define AV_RB32(p) AV_RN32(p) +# elif !defined(AV_RN32) && defined(AV_RB32) +# define AV_RN32(p) AV_RB32(p) +# endif + +# if defined(AV_WN32) && !defined(AV_WB32) +# define AV_WB32(p, v) AV_WN32(p, v) +# elif !defined(AV_WN32) && defined(AV_WB32) +# define AV_WN32(p, v) AV_WB32(p, v) +# endif + +# if defined(AV_RN64) && !defined(AV_RB64) +# define AV_RB64(p) AV_RN64(p) +# elif !defined(AV_RN64) && defined(AV_RB64) +# define AV_RN64(p) AV_RB64(p) +# endif + +# if defined(AV_WN64) && !defined(AV_WB64) +# define AV_WB64(p, v) AV_WN64(p, v) +# elif !defined(AV_WN64) && defined(AV_WB64) +# define AV_WN64(p, v) AV_WB64(p, v) +# endif + +#else /* AV_HAVE_BIGENDIAN */ + +# if defined(AV_RN16) && !defined(AV_RL16) +# define AV_RL16(p) AV_RN16(p) +# elif !defined(AV_RN16) && defined(AV_RL16) +# define AV_RN16(p) AV_RL16(p) +# endif + +# if defined(AV_WN16) && !defined(AV_WL16) +# define AV_WL16(p, v) AV_WN16(p, v) +# elif !defined(AV_WN16) && defined(AV_WL16) +# define AV_WN16(p, v) AV_WL16(p, v) +# endif + +# if defined(AV_RN24) && !defined(AV_RL24) +# define AV_RL24(p) AV_RN24(p) +# elif !defined(AV_RN24) && defined(AV_RL24) +# define AV_RN24(p) AV_RL24(p) +# endif + +# if defined(AV_WN24) && !defined(AV_WL24) +# define AV_WL24(p, v) AV_WN24(p, v) +# elif !defined(AV_WN24) && defined(AV_WL24) +# define AV_WN24(p, v) AV_WL24(p, v) +# endif + +# if defined(AV_RN32) && !defined(AV_RL32) +# define AV_RL32(p) AV_RN32(p) +# elif !defined(AV_RN32) && defined(AV_RL32) +# define AV_RN32(p) AV_RL32(p) +# endif + +# if defined(AV_WN32) && !defined(AV_WL32) +# define AV_WL32(p, v) AV_WN32(p, v) +# elif !defined(AV_WN32) && defined(AV_WL32) +# define AV_WN32(p, v) AV_WL32(p, v) +# endif + +# if defined(AV_RN64) && !defined(AV_RL64) +# define AV_RL64(p) AV_RN64(p) +# elif !defined(AV_RN64) && defined(AV_RL64) +# define AV_RN64(p) AV_RL64(p) +# endif + +# if defined(AV_WN64) && !defined(AV_WL64) +# define AV_WL64(p, v) AV_WN64(p, v) +# elif !defined(AV_WN64) && defined(AV_WL64) +# define AV_WN64(p, v) AV_WL64(p, v) +# endif + +#endif /* !AV_HAVE_BIGENDIAN */ + +/* + * Define AV_[RW]N helper macros to simplify definitions not provided + * by per-arch headers. + */ + +#if defined(__GNUC__) && !defined(__TI_COMPILER_VERSION__) + +union unaligned_64 { uint64_t l; } __attribute__((packed)) av_alias; +union unaligned_32 { uint32_t l; } __attribute__((packed)) av_alias; +union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias; + +# define AV_RN(s, p) (((const union unaligned_##s *) (p))->l) +# define AV_WN(s, p, v) ((((union unaligned_##s *) (p))->l) = (v)) + +#elif defined(__DECC) + +# define AV_RN(s, p) (*((const __unaligned uint##s##_t*)(p))) +# define AV_WN(s, p, v) (*((__unaligned uint##s##_t*)(p)) = (v)) + +#elif AV_HAVE_FAST_UNALIGNED + +# define AV_RN(s, p) (((const av_alias##s*)(p))->u##s) +# define AV_WN(s, p, v) (((av_alias##s*)(p))->u##s = (v)) + +#else + +#ifndef AV_RB16 +# define AV_RB16(x) \ + ((((const uint8_t*)(x))[0] << 8) | \ + ((const uint8_t*)(x))[1]) +#endif +#ifndef AV_WB16 +# define AV_WB16(p, d) do { \ + ((uint8_t*)(p))[1] = (d); \ + ((uint8_t*)(p))[0] = (d)>>8; \ + } while(0) +#endif + +#ifndef AV_RL16 +# define AV_RL16(x) \ + ((((const uint8_t*)(x))[1] << 8) | \ + ((const uint8_t*)(x))[0]) +#endif +#ifndef AV_WL16 +# define AV_WL16(p, d) do { \ + ((uint8_t*)(p))[0] = (d); \ + ((uint8_t*)(p))[1] = (d)>>8; \ + } while(0) +#endif + +#ifndef AV_RB32 +# define AV_RB32(x) \ + ((((const uint8_t*)(x))[0] << 24) | \ + (((const uint8_t*)(x))[1] << 16) | \ + (((const uint8_t*)(x))[2] << 8) | \ + ((const uint8_t*)(x))[3]) +#endif +#ifndef AV_WB32 +# define AV_WB32(p, d) do { \ + ((uint8_t*)(p))[3] = (d); \ + ((uint8_t*)(p))[2] = (d)>>8; \ + ((uint8_t*)(p))[1] = (d)>>16; \ + ((uint8_t*)(p))[0] = (d)>>24; \ + } while(0) +#endif + +#ifndef AV_RL32 +# define AV_RL32(x) \ + ((((const uint8_t*)(x))[3] << 24) | \ + (((const uint8_t*)(x))[2] << 16) | \ + (((const uint8_t*)(x))[1] << 8) | \ + ((const uint8_t*)(x))[0]) +#endif +#ifndef AV_WL32 +# define AV_WL32(p, d) do { \ + ((uint8_t*)(p))[0] = (d); \ + ((uint8_t*)(p))[1] = (d)>>8; \ + ((uint8_t*)(p))[2] = (d)>>16; \ + ((uint8_t*)(p))[3] = (d)>>24; \ + } while(0) +#endif + +#ifndef AV_RB64 +# define AV_RB64(x) \ + (((uint64_t)((const uint8_t*)(x))[0] << 56) | \ + ((uint64_t)((const uint8_t*)(x))[1] << 48) | \ + ((uint64_t)((const uint8_t*)(x))[2] << 40) | \ + ((uint64_t)((const uint8_t*)(x))[3] << 32) | \ + ((uint64_t)((const uint8_t*)(x))[4] << 24) | \ + ((uint64_t)((const uint8_t*)(x))[5] << 16) | \ + ((uint64_t)((const uint8_t*)(x))[6] << 8) | \ + (uint64_t)((const uint8_t*)(x))[7]) +#endif +#ifndef AV_WB64 +# define AV_WB64(p, d) do { \ + ((uint8_t*)(p))[7] = (d); \ + ((uint8_t*)(p))[6] = (d)>>8; \ + ((uint8_t*)(p))[5] = (d)>>16; \ + ((uint8_t*)(p))[4] = (d)>>24; \ + ((uint8_t*)(p))[3] = (d)>>32; \ + ((uint8_t*)(p))[2] = (d)>>40; \ + ((uint8_t*)(p))[1] = (d)>>48; \ + ((uint8_t*)(p))[0] = (d)>>56; \ + } while(0) +#endif + +#ifndef AV_RL64 +# define AV_RL64(x) \ + (((uint64_t)((const uint8_t*)(x))[7] << 56) | \ + ((uint64_t)((const uint8_t*)(x))[6] << 48) | \ + ((uint64_t)((const uint8_t*)(x))[5] << 40) | \ + ((uint64_t)((const uint8_t*)(x))[4] << 32) | \ + ((uint64_t)((const uint8_t*)(x))[3] << 24) | \ + ((uint64_t)((const uint8_t*)(x))[2] << 16) | \ + ((uint64_t)((const uint8_t*)(x))[1] << 8) | \ + (uint64_t)((const uint8_t*)(x))[0]) +#endif +#ifndef AV_WL64 +# define AV_WL64(p, d) do { \ + ((uint8_t*)(p))[0] = (d); \ + ((uint8_t*)(p))[1] = (d)>>8; \ + ((uint8_t*)(p))[2] = (d)>>16; \ + ((uint8_t*)(p))[3] = (d)>>24; \ + ((uint8_t*)(p))[4] = (d)>>32; \ + ((uint8_t*)(p))[5] = (d)>>40; \ + ((uint8_t*)(p))[6] = (d)>>48; \ + ((uint8_t*)(p))[7] = (d)>>56; \ + } while(0) +#endif + +#if AV_HAVE_BIGENDIAN +# define AV_RN(s, p) AV_RB##s(p) +# define AV_WN(s, p, v) AV_WB##s(p, v) +#else +# define AV_RN(s, p) AV_RL##s(p) +# define AV_WN(s, p, v) AV_WL##s(p, v) +#endif + +#endif /* HAVE_FAST_UNALIGNED */ + +#ifndef AV_RN16 +# define AV_RN16(p) AV_RN(16, p) +#endif + +#ifndef AV_RN32 +# define AV_RN32(p) AV_RN(32, p) +#endif + +#ifndef AV_RN64 +# define AV_RN64(p) AV_RN(64, p) +#endif + +#ifndef AV_WN16 +# define AV_WN16(p, v) AV_WN(16, p, v) +#endif + +#ifndef AV_WN32 +# define AV_WN32(p, v) AV_WN(32, p, v) +#endif + +#ifndef AV_WN64 +# define AV_WN64(p, v) AV_WN(64, p, v) +#endif + +#if AV_HAVE_BIGENDIAN +# define AV_RB(s, p) AV_RN##s(p) +# define AV_WB(s, p, v) AV_WN##s(p, v) +# define AV_RL(s, p) av_bswap##s(AV_RN##s(p)) +# define AV_WL(s, p, v) AV_WN##s(p, av_bswap##s(v)) +#else +# define AV_RB(s, p) av_bswap##s(AV_RN##s(p)) +# define AV_WB(s, p, v) AV_WN##s(p, av_bswap##s(v)) +# define AV_RL(s, p) AV_RN##s(p) +# define AV_WL(s, p, v) AV_WN##s(p, v) +#endif + +#define AV_RB8(x) (((const uint8_t*)(x))[0]) +#define AV_WB8(p, d) do { ((uint8_t*)(p))[0] = (d); } while(0) + +#define AV_RL8(x) AV_RB8(x) +#define AV_WL8(p, d) AV_WB8(p, d) + +#ifndef AV_RB16 +# define AV_RB16(p) AV_RB(16, p) +#endif +#ifndef AV_WB16 +# define AV_WB16(p, v) AV_WB(16, p, v) +#endif + +#ifndef AV_RL16 +# define AV_RL16(p) AV_RL(16, p) +#endif +#ifndef AV_WL16 +# define AV_WL16(p, v) AV_WL(16, p, v) +#endif + +#ifndef AV_RB32 +# define AV_RB32(p) AV_RB(32, p) +#endif +#ifndef AV_WB32 +# define AV_WB32(p, v) AV_WB(32, p, v) +#endif + +#ifndef AV_RL32 +# define AV_RL32(p) AV_RL(32, p) +#endif +#ifndef AV_WL32 +# define AV_WL32(p, v) AV_WL(32, p, v) +#endif + +#ifndef AV_RB64 +# define AV_RB64(p) AV_RB(64, p) +#endif +#ifndef AV_WB64 +# define AV_WB64(p, v) AV_WB(64, p, v) +#endif + +#ifndef AV_RL64 +# define AV_RL64(p) AV_RL(64, p) +#endif +#ifndef AV_WL64 +# define AV_WL64(p, v) AV_WL(64, p, v) +#endif + +#ifndef AV_RB24 +# define AV_RB24(x) \ + ((((const uint8_t*)(x))[0] << 16) | \ + (((const uint8_t*)(x))[1] << 8) | \ + ((const uint8_t*)(x))[2]) +#endif +#ifndef AV_WB24 +# define AV_WB24(p, d) do { \ + ((uint8_t*)(p))[2] = (d); \ + ((uint8_t*)(p))[1] = (d)>>8; \ + ((uint8_t*)(p))[0] = (d)>>16; \ + } while(0) +#endif + +#ifndef AV_RL24 +# define AV_RL24(x) \ + ((((const uint8_t*)(x))[2] << 16) | \ + (((const uint8_t*)(x))[1] << 8) | \ + ((const uint8_t*)(x))[0]) +#endif +#ifndef AV_WL24 +# define AV_WL24(p, d) do { \ + ((uint8_t*)(p))[0] = (d); \ + ((uint8_t*)(p))[1] = (d)>>8; \ + ((uint8_t*)(p))[2] = (d)>>16; \ + } while(0) +#endif + +/* + * The AV_[RW]NA macros access naturally aligned data + * in a type-safe way. + */ + +#define AV_RNA(s, p) (((const av_alias##s*)(p))->u##s) +#define AV_WNA(s, p, v) (((av_alias##s*)(p))->u##s = (v)) + +#ifndef AV_RN16A +# define AV_RN16A(p) AV_RNA(16, p) +#endif + +#ifndef AV_RN32A +# define AV_RN32A(p) AV_RNA(32, p) +#endif + +#ifndef AV_RN64A +# define AV_RN64A(p) AV_RNA(64, p) +#endif + +#ifndef AV_WN16A +# define AV_WN16A(p, v) AV_WNA(16, p, v) +#endif + +#ifndef AV_WN32A +# define AV_WN32A(p, v) AV_WNA(32, p, v) +#endif + +#ifndef AV_WN64A +# define AV_WN64A(p, v) AV_WNA(64, p, v) +#endif + +/* Parameters for AV_COPY*, AV_SWAP*, AV_ZERO* must be + * naturally aligned. They may be implemented using MMX, + * so emms_c() must be called before using any float code + * afterwards. + */ + +#define AV_COPY(n, d, s) \ + (((av_alias##n*)(d))->u##n = ((const av_alias##n*)(s))->u##n) + +#ifndef AV_COPY16 +# define AV_COPY16(d, s) AV_COPY(16, d, s) +#endif + +#ifndef AV_COPY32 +# define AV_COPY32(d, s) AV_COPY(32, d, s) +#endif + +#ifndef AV_COPY64 +# define AV_COPY64(d, s) AV_COPY(64, d, s) +#endif + +#ifndef AV_COPY128 +# define AV_COPY128(d, s) \ + do { \ + AV_COPY64(d, s); \ + AV_COPY64((char*)(d)+8, (char*)(s)+8); \ + } while(0) +#endif + +#define AV_SWAP(n, a, b) FFSWAP(av_alias##n, *(av_alias##n*)(a), *(av_alias##n*)(b)) + +#ifndef AV_SWAP64 +# define AV_SWAP64(a, b) AV_SWAP(64, a, b) +#endif + +#define AV_ZERO(n, d) (((av_alias##n*)(d))->u##n = 0) + +#ifndef AV_ZERO16 +# define AV_ZERO16(d) AV_ZERO(16, d) +#endif + +#ifndef AV_ZERO32 +# define AV_ZERO32(d) AV_ZERO(32, d) +#endif + +#ifndef AV_ZERO64 +# define AV_ZERO64(d) AV_ZERO(64, d) +#endif + +#ifndef AV_ZERO128 +# define AV_ZERO128(d) \ + do { \ + AV_ZERO64(d); \ + AV_ZERO64((char*)(d)+8); \ + } while(0) +#endif + +#endif /* AVUTIL_INTREADWRITE_H */ diff --git a/ffmpeg 0.7/include/libavutil/lfg.h b/ffmpeg 0.7/include/libavutil/lfg.h new file mode 100644 index 000000000..0e89ea308 --- /dev/null +++ b/ffmpeg 0.7/include/libavutil/lfg.h @@ -0,0 +1,62 @@ +/* + * Lagged Fibonacci PRNG + * Copyright (c) 2008 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_LFG_H +#define AVUTIL_LFG_H + +typedef struct { + unsigned int state[64]; + int index; +} AVLFG; + +void av_lfg_init(AVLFG *c, unsigned int seed); + +/** + * Get the next random unsigned 32-bit number using an ALFG. + * + * Please also consider a simple LCG like state= state*1664525+1013904223, + * it may be good enough and faster for your specific use case. + */ +static inline unsigned int av_lfg_get(AVLFG *c){ + c->state[c->index & 63] = c->state[(c->index-24) & 63] + c->state[(c->index-55) & 63]; + return c->state[c->index++ & 63]; +} + +/** + * Get the next random unsigned 32-bit number using a MLFG. + * + * Please also consider av_lfg_get() above, it is faster. + */ +static inline unsigned int av_mlfg_get(AVLFG *c){ + unsigned int a= c->state[(c->index-55) & 63]; + unsigned int b= c->state[(c->index-24) & 63]; + return c->state[c->index++ & 63] = 2*a*b+a+b; +} + +/** + * Get the next two numbers generated by a Box-Muller Gaussian + * generator using the random numbers issued by lfg. + * + * @param out[2] array where the two generated numbers are placed + */ +void av_bmg_get(AVLFG *lfg, double out[2]); + +#endif /* AVUTIL_LFG_H */ diff --git a/ffmpeg 0.7/include/libavutil/log.h b/ffmpeg 0.7/include/libavutil/log.h new file mode 100644 index 000000000..c87125d2d --- /dev/null +++ b/ffmpeg 0.7/include/libavutil/log.h @@ -0,0 +1,160 @@ +/* + * copyright (c) 2006 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_LOG_H +#define AVUTIL_LOG_H + +#include +#include "avutil.h" + +/** + * Describe the class of an AVClass context structure. That is an + * arbitrary struct of which the first field is a pointer to an + * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.). + */ +typedef struct { + /** + * The name of the class; usually it is the same name as the + * context structure type to which the AVClass is associated. + */ + const char* class_name; + + /** + * A pointer to a function which returns the name of a context + * instance ctx associated with the class. + */ + const char* (*item_name)(void* ctx); + + /** + * a pointer to the first option specified in the class if any or NULL + * + * @see av_set_default_options() + */ + const struct AVOption *option; + + /** + * LIBAVUTIL_VERSION with which this structure was created. + * This is used to allow fields to be added without requiring major + * version bumps everywhere. + */ + + int version; + + /** + * Offset in the structure where log_level_offset is stored. + * 0 means there is no such variable + */ + int log_level_offset_offset; + + /** + * Offset in the structure where a pointer to the parent context for loging is stored. + * for example a decoder that uses eval.c could pass its AVCodecContext to eval as such + * parent context. And a av_log() implementation could then display the parent context + * can be NULL of course + */ + int parent_log_context_offset; +} AVClass; + +/* av_log API */ + +#define AV_LOG_QUIET -8 + +/** + * Something went really wrong and we will crash now. + */ +#define AV_LOG_PANIC 0 + +/** + * Something went wrong and recovery is not possible. + * For example, no header was found for a format which depends + * on headers or an illegal combination of parameters is used. + */ +#define AV_LOG_FATAL 8 + +/** + * Something went wrong and cannot losslessly be recovered. + * However, not all future data is affected. + */ +#define AV_LOG_ERROR 16 + +/** + * Something somehow does not look correct. This may or may not + * lead to problems. An example would be the use of '-vstrict -2'. + */ +#define AV_LOG_WARNING 24 + +#define AV_LOG_INFO 32 +#define AV_LOG_VERBOSE 40 + +/** + * Stuff which is only useful for libav* developers. + */ +#define AV_LOG_DEBUG 48 + +/** + * Send the specified message to the log if the level is less than or equal + * to the current av_log_level. By default, all logging messages are sent to + * stderr. This behavior can be altered by setting a different av_vlog callback + * function. + * + * @param avcl A pointer to an arbitrary struct of which the first field is a + * pointer to an AVClass struct. + * @param level The importance level of the message, lower values signifying + * higher importance. + * @param fmt The format string (printf-compatible) that specifies how + * subsequent arguments are converted to output. + * @see av_vlog + */ +#ifdef __GNUC__ +void av_log(void *avcl, int level, const char *fmt, ...) __attribute__ ((__format__ (__printf__, 3, 4))); +#else +void av_log(void *avcl, int level, const char *fmt, ...); +#endif + +void av_vlog(void *avcl, int level, const char *fmt, va_list); +int av_log_get_level(void); +void av_log_set_level(int); +void av_log_set_callback(void (*)(void*, int, const char*, va_list)); +void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl); +const char* av_default_item_name(void* ctx); + +/** + * av_dlog macros + * Useful to print debug messages that shouldn't get compiled in normally. + */ + +#ifdef DEBUG +# define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__) +#else +# define av_dlog(pctx, ...) do { if (0) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__); } while (0) +#endif + +/** + * Skip repeated messages, this requires the user app to use av_log() instead of + * (f)printf as the 2 would otherwise interfere and lead to + * "Last message repeated x times" messages below (f)printf messages with some + * bad luck. + * Also to receive the last, "last repeated" line if any, the user app must + * call av_log(NULL, AV_LOG_QUIET, ""); at the end + */ +#define AV_LOG_SKIP_REPEATED 1 +void av_log_set_flags(int arg); + +#endif /* AVUTIL_LOG_H */ diff --git a/ffmpeg 0.7/include/libavutil/lzo.h b/ffmpeg 0.7/include/libavutil/lzo.h new file mode 100644 index 000000000..6788054bf --- /dev/null +++ b/ffmpeg 0.7/include/libavutil/lzo.h @@ -0,0 +1,66 @@ +/* + * LZO 1x decompression + * copyright (c) 2006 Reimar Doeffinger + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_LZO_H +#define AVUTIL_LZO_H + +#include + +/** \defgroup errflags Error flags returned by av_lzo1x_decode + * \{ */ +//! end of the input buffer reached before decoding finished +#define AV_LZO_INPUT_DEPLETED 1 +//! decoded data did not fit into output buffer +#define AV_LZO_OUTPUT_FULL 2 +//! a reference to previously decoded data was wrong +#define AV_LZO_INVALID_BACKPTR 4 +//! a non-specific error in the compressed bitstream +#define AV_LZO_ERROR 8 +/** \} */ + +#define AV_LZO_INPUT_PADDING 8 +#define AV_LZO_OUTPUT_PADDING 12 + +/** + * \brief Decodes LZO 1x compressed data. + * \param out output buffer + * \param outlen size of output buffer, number of bytes left are returned here + * \param in input buffer + * \param inlen size of input buffer, number of bytes left are returned here + * \return 0 on success, otherwise a combination of the error flags above + * + * Make sure all buffers are appropriately padded, in must provide + * AV_LZO_INPUT_PADDING, out must provide AV_LZO_OUTPUT_PADDING additional bytes. + */ +int av_lzo1x_decode(void *out, int *outlen, const void *in, int *inlen); + +/** + * \brief deliberately overlapping memcpy implementation + * \param dst destination buffer; must be padded with 12 additional bytes + * \param back how many bytes back we start (the initial size of the overlapping window) + * \param cnt number of bytes to copy, must be >= 0 + * + * cnt > back is valid, this will copy the bytes we just copied, + * thus creating a repeating pattern with a period length of back. + */ +void av_memcpy_backptr(uint8_t *dst, int back, int cnt); + +#endif /* AVUTIL_LZO_H */ diff --git a/ffmpeg 0.7/include/libavutil/mathematics.h b/ffmpeg 0.7/include/libavutil/mathematics.h new file mode 100644 index 000000000..882a51639 --- /dev/null +++ b/ffmpeg 0.7/include/libavutil/mathematics.h @@ -0,0 +1,112 @@ +/* + * copyright (c) 2005 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_MATHEMATICS_H +#define AVUTIL_MATHEMATICS_H + +#include +#include +#include "attributes.h" +#include "rational.h" + +#ifndef M_E +#define M_E 2.7182818284590452354 /* e */ +#endif +#ifndef M_LN2 +#define M_LN2 0.69314718055994530942 /* log_e 2 */ +#endif +#ifndef M_LN10 +#define M_LN10 2.30258509299404568402 /* log_e 10 */ +#endif +#ifndef M_LOG2_10 +#define M_LOG2_10 3.32192809488736234787 /* log_2 10 */ +#endif +#ifndef M_PHI +#define M_PHI 1.61803398874989484820 /* phi / golden ratio */ +#endif +#ifndef M_PI +#define M_PI 3.14159265358979323846 /* pi */ +#endif +#ifndef M_SQRT1_2 +#define M_SQRT1_2 0.70710678118654752440 /* 1/sqrt(2) */ +#endif +#ifndef M_SQRT2 +#define M_SQRT2 1.41421356237309504880 /* sqrt(2) */ +#endif +#ifndef NAN +#define NAN (0.0/0.0) +#endif +#ifndef INFINITY +#define INFINITY (1.0/0.0) +#endif + +enum AVRounding { + AV_ROUND_ZERO = 0, ///< Round toward zero. + AV_ROUND_INF = 1, ///< Round away from zero. + AV_ROUND_DOWN = 2, ///< Round toward -infinity. + AV_ROUND_UP = 3, ///< Round toward +infinity. + AV_ROUND_NEAR_INF = 5, ///< Round to nearest and halfway cases away from zero. +}; + +/** + * Return the greatest common divisor of a and b. + * If both a and b are 0 or either or both are <0 then behavior is + * undefined. + */ +int64_t av_const av_gcd(int64_t a, int64_t b); + +/** + * Rescale a 64-bit integer with rounding to nearest. + * A simple a*b/c isn't possible as it can overflow. + */ +int64_t av_rescale(int64_t a, int64_t b, int64_t c) av_const; + +/** + * Rescale a 64-bit integer with specified rounding. + * A simple a*b/c isn't possible as it can overflow. + */ +int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding) av_const; + +/** + * Rescale a 64-bit integer by 2 rational numbers. + */ +int64_t av_rescale_q(int64_t a, AVRational bq, AVRational cq) av_const; + +/** + * Compare 2 timestamps each in its own timebases. + * The result of the function is undefined if one of the timestamps + * is outside the int64_t range when represented in the others timebase. + * @return -1 if ts_a is before ts_b, 1 if ts_a is after ts_b or 0 if they represent the same position + */ +int av_compare_ts(int64_t ts_a, AVRational tb_a, int64_t ts_b, AVRational tb_b); + +/** + * Compare 2 integers modulo mod. + * That is we compare integers a and b for which only the least + * significant log2(mod) bits are known. + * + * @param mod must be a power of 2 + * @return a negative value if a is smaller than b + * a positive value if a is greater than b + * 0 if a equals b + */ +int64_t av_compare_mod(uint64_t a, uint64_t b, uint64_t mod); + +#endif /* AVUTIL_MATHEMATICS_H */ diff --git a/ffmpeg 0.7/include/libavutil/md5.h b/ffmpeg 0.7/include/libavutil/md5.h new file mode 100644 index 000000000..969202a80 --- /dev/null +++ b/ffmpeg 0.7/include/libavutil/md5.h @@ -0,0 +1,36 @@ +/* + * copyright (c) 2006 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_MD5_H +#define AVUTIL_MD5_H + +#include + +extern const int av_md5_size; + +struct AVMD5; + +void av_md5_init(struct AVMD5 *ctx); +void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, const int len); +void av_md5_final(struct AVMD5 *ctx, uint8_t *dst); +void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len); + +#endif /* AVUTIL_MD5_H */ + diff --git a/ffmpeg 0.7/include/libavutil/mem.h b/ffmpeg 0.7/include/libavutil/mem.h new file mode 100644 index 000000000..7c30e160f --- /dev/null +++ b/ffmpeg 0.7/include/libavutil/mem.h @@ -0,0 +1,135 @@ +/* + * copyright (c) 2006 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * memory handling functions + */ + +#ifndef AVUTIL_MEM_H +#define AVUTIL_MEM_H + +#include "attributes.h" +#include "avutil.h" + +#if defined(__INTEL_COMPILER) && __INTEL_COMPILER < 1110 || defined(__SUNPRO_C) + #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v + #define DECLARE_ASM_CONST(n,t,v) const t __attribute__ ((aligned (n))) v +#elif defined(__TI_COMPILER_VERSION__) + #define DECLARE_ALIGNED(n,t,v) \ + AV_PRAGMA(DATA_ALIGN(v,n)) \ + t __attribute__((aligned(n))) v + #define DECLARE_ASM_CONST(n,t,v) \ + AV_PRAGMA(DATA_ALIGN(v,n)) \ + static const t __attribute__((aligned(n))) v +#elif defined(__GNUC__) + #define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v + #define DECLARE_ASM_CONST(n,t,v) static const t av_used __attribute__ ((aligned (n))) v +#elif defined(_MSC_VER) + #define DECLARE_ALIGNED(n,t,v) __declspec(align(n)) t v + #define DECLARE_ASM_CONST(n,t,v) __declspec(align(n)) static const t v +#else + #define DECLARE_ALIGNED(n,t,v) t v + #define DECLARE_ASM_CONST(n,t,v) static const t v +#endif + +#if AV_GCC_VERSION_AT_LEAST(3,1) + #define av_malloc_attrib __attribute__((__malloc__)) +#else + #define av_malloc_attrib +#endif + +#if AV_GCC_VERSION_AT_LEAST(4,3) + #define av_alloc_size(n) __attribute__((alloc_size(n))) +#else + #define av_alloc_size(n) +#endif + +/** + * Allocate a block of size bytes with alignment suitable for all + * memory accesses (including vectors if available on the CPU). + * @param size Size in bytes for the memory block to be allocated. + * @return Pointer to the allocated block, NULL if the block cannot + * be allocated. + * @see av_mallocz() + */ +void *av_malloc(size_t size) av_malloc_attrib av_alloc_size(1); + +/** + * Allocate or reallocate a block of memory. + * If ptr is NULL and size > 0, allocate a new block. If + * size is zero, free the memory block pointed to by ptr. + * @param size Size in bytes for the memory block to be allocated or + * reallocated. + * @param ptr Pointer to a memory block already allocated with + * av_malloc(z)() or av_realloc() or NULL. + * @return Pointer to a newly reallocated block or NULL if the block + * cannot be reallocated or the function is used to free the memory block. + * @see av_fast_realloc() + */ +void *av_realloc(void *ptr, size_t size) av_alloc_size(2); + +/** + * Free a memory block which has been allocated with av_malloc(z)() or + * av_realloc(). + * @param ptr Pointer to the memory block which should be freed. + * @note ptr = NULL is explicitly allowed. + * @note It is recommended that you use av_freep() instead. + * @see av_freep() + */ +void av_free(void *ptr); + +/** + * Allocate a block of size bytes with alignment suitable for all + * memory accesses (including vectors if available on the CPU) and + * zero all the bytes of the block. + * @param size Size in bytes for the memory block to be allocated. + * @return Pointer to the allocated block, NULL if it cannot be allocated. + * @see av_malloc() + */ +void *av_mallocz(size_t size) av_malloc_attrib av_alloc_size(1); + +/** + * Duplicate the string s. + * @param s string to be duplicated + * @return Pointer to a newly allocated string containing a + * copy of s or NULL if the string cannot be allocated. + */ +char *av_strdup(const char *s) av_malloc_attrib; + +/** + * Free a memory block which has been allocated with av_malloc(z)() or + * av_realloc() and set the pointer pointing to it to NULL. + * @param ptr Pointer to the pointer to the memory block which should + * be freed. + * @see av_free() + */ +void av_freep(void *ptr); + +/** + * Add an element to a dynamic array. + * + * @param tab_ptr Pointer to the array. + * @param nb_ptr Pointer to the number of elements in the array. + * @param elem Element to be added. + */ +void av_dynarray_add(void *tab_ptr, int *nb_ptr, void *elem); + +#endif /* AVUTIL_MEM_H */ diff --git a/ffmpeg 0.7/include/libavutil/opt.h b/ffmpeg 0.7/include/libavutil/opt.h new file mode 100644 index 000000000..b04c7905d --- /dev/null +++ b/ffmpeg 0.7/include/libavutil/opt.h @@ -0,0 +1,179 @@ +/* + * AVOptions + * copyright (c) 2005 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_OPT_H +#define AVUTIL_OPT_H + +/** + * @file + * AVOptions + */ + +#include "rational.h" +#include "avutil.h" + +enum AVOptionType{ + FF_OPT_TYPE_FLAGS, + FF_OPT_TYPE_INT, + FF_OPT_TYPE_INT64, + FF_OPT_TYPE_DOUBLE, + FF_OPT_TYPE_FLOAT, + FF_OPT_TYPE_STRING, + FF_OPT_TYPE_RATIONAL, + FF_OPT_TYPE_BINARY, ///< offset must point to a pointer immediately followed by an int for the length + FF_OPT_TYPE_CONST=128, +}; + +/** + * AVOption + */ +typedef struct AVOption { + const char *name; + + /** + * short English help text + * @todo What about other languages? + */ + const char *help; + + /** + * The offset relative to the context structure where the option + * value is stored. It should be 0 for named constants. + */ + int offset; + enum AVOptionType type; + + /** + * the default value for scalar options + */ + union { + double dbl; + const char *str; + /* TODO those are unused now */ + int64_t i64; + AVRational q; + } default_val; + double min; ///< minimum valid value for the option + double max; ///< maximum valid value for the option + + int flags; +#define AV_OPT_FLAG_ENCODING_PARAM 1 ///< a generic parameter which can be set by the user for muxing or encoding +#define AV_OPT_FLAG_DECODING_PARAM 2 ///< a generic parameter which can be set by the user for demuxing or decoding +#define AV_OPT_FLAG_METADATA 4 ///< some data extracted or inserted into the file like title, comment, ... +#define AV_OPT_FLAG_AUDIO_PARAM 8 +#define AV_OPT_FLAG_VIDEO_PARAM 16 +#define AV_OPT_FLAG_SUBTITLE_PARAM 32 +//FIXME think about enc-audio, ... style flags + + /** + * The logical unit to which the option belongs. Non-constant + * options and corresponding named constants share the same + * unit. May be NULL. + */ + const char *unit; +} AVOption; + +/** + * Look for an option in obj. Look only for the options which + * have the flags set as specified in mask and flags (that is, + * for which it is the case that opt->flags & mask == flags). + * + * @param[in] obj a pointer to a struct whose first element is a + * pointer to an AVClass + * @param[in] name the name of the option to look for + * @param[in] unit the unit of the option to look for, or any if NULL + * @return a pointer to the option found, or NULL if no option + * has been found + */ +const AVOption *av_find_opt(void *obj, const char *name, const char *unit, int mask, int flags); + +/** + * Set the field of obj with the given name to value. + * + * @param[in] obj A struct whose first element is a pointer to an + * AVClass. + * @param[in] name the name of the field to set + * @param[in] val The value to set. If the field is not of a string + * type, then the given string is parsed. + * SI postfixes and some named scalars are supported. + * If the field is of a numeric type, it has to be a numeric or named + * scalar. Behavior with more than one scalar and +- infix operators + * is undefined. + * If the field is of a flags type, it has to be a sequence of numeric + * scalars or named flags separated by '+' or '-'. Prefixing a flag + * with '+' causes it to be set without affecting the other flags; + * similarly, '-' unsets a flag. + * @param[out] o_out if non-NULL put here a pointer to the AVOption + * found + * @param alloc when 1 then the old value will be av_freed() and the + * new av_strduped() + * when 0 then no av_free() nor av_strdup() will be used + * @return 0 if the value has been set, or an AVERROR code in case of + * error: + * AVERROR(ENOENT) if no matching option exists + * AVERROR(ERANGE) if the value is out of range + * AVERROR(EINVAL) if the value is not valid + */ +int av_set_string3(void *obj, const char *name, const char *val, int alloc, const AVOption **o_out); + +const AVOption *av_set_double(void *obj, const char *name, double n); +const AVOption *av_set_q(void *obj, const char *name, AVRational n); +const AVOption *av_set_int(void *obj, const char *name, int64_t n); +double av_get_double(void *obj, const char *name, const AVOption **o_out); +AVRational av_get_q(void *obj, const char *name, const AVOption **o_out); +int64_t av_get_int(void *obj, const char *name, const AVOption **o_out); +const char *av_get_string(void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len); +const AVOption *av_next_option(void *obj, const AVOption *last); + +/** + * Show the obj options. + * + * @param req_flags requested flags for the options to show. Show only the + * options for which it is opt->flags & req_flags. + * @param rej_flags rejected flags for the options to show. Show only the + * options for which it is !(opt->flags & req_flags). + * @param av_log_obj log context to use for showing the options + */ +int av_opt_show2(void *obj, void *av_log_obj, int req_flags, int rej_flags); + +void av_opt_set_defaults(void *s); +void av_opt_set_defaults2(void *s, int mask, int flags); + +/** + * Parse the key/value pairs list in opts. For each key/value pair + * found, stores the value in the field in ctx that is named like the + * key. ctx must be an AVClass context, storing is done using + * AVOptions. + * + * @param key_val_sep a 0-terminated list of characters used to + * separate key from value + * @param pairs_sep a 0-terminated list of characters used to separate + * two pairs from each other + * @return the number of successfully set key/value pairs, or a negative + * value corresponding to an AVERROR code in case of error: + * AVERROR(EINVAL) if opts cannot be parsed, + * the error code issued by av_set_string3() if a key/value pair + * cannot be set + */ +int av_set_options_string(void *ctx, const char *opts, + const char *key_val_sep, const char *pairs_sep); + +#endif /* AVUTIL_OPT_H */ diff --git a/ffmpeg 0.7/include/libavutil/parseutils.h b/ffmpeg 0.7/include/libavutil/parseutils.h new file mode 100644 index 000000000..c3986af20 --- /dev/null +++ b/ffmpeg 0.7/include/libavutil/parseutils.h @@ -0,0 +1,117 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_PARSEUTILS_H +#define AVUTIL_PARSEUTILS_H + +#include "libavutil/rational.h" + +/** + * @file + * misc parsing utilities + */ + +/** + * Parse str and put in width_ptr and height_ptr the detected values. + * + * @param[in,out] width_ptr pointer to the variable which will contain the detected + * width value + * @param[in,out] height_ptr pointer to the variable which will contain the detected + * height value + * @param[in] str the string to parse: it has to be a string in the format + * width x height or a valid video size abbreviation. + * @return >= 0 on success, a negative error code otherwise + */ +int av_parse_video_size(int *width_ptr, int *height_ptr, const char *str); + +/** + * Parse str and store the detected values in *rate. + * + * @param[in,out] rate pointer to the AVRational which will contain the detected + * frame rate + * @param[in] str the string to parse: it has to be a string in the format + * rate_num / rate_den, a float number or a valid video rate abbreviation + * @return >= 0 on success, a negative error code otherwise + */ +int av_parse_video_rate(AVRational *rate, const char *str); + +/** + * Put the RGBA values that correspond to color_string in rgba_color. + * + * @param color_string a string specifying a color. It can be the name of + * a color (case insensitive match) or a [0x|#]RRGGBB[AA] sequence, + * possibly followed by "@" and a string representing the alpha + * component. + * The alpha component may be a string composed by "0x" followed by an + * hexadecimal number or a decimal number between 0.0 and 1.0, which + * represents the opacity value (0x00/0.0 means completely transparent, + * 0xff/1.0 completely opaque). + * If the alpha component is not specified then 0xff is assumed. + * The string "random" will result in a random color. + * @param slen length of the initial part of color_string containing the + * color. It can be set to -1 if color_string is a null terminated string + * containing nothing else than the color. + * @return >= 0 in case of success, a negative value in case of + * failure (for example if color_string cannot be parsed). + */ +int av_parse_color(uint8_t *rgba_color, const char *color_string, int slen, + void *log_ctx); + +/** + * Parses timestr and returns in *time a corresponding number of + * microseconds. + * + * @param timeval puts here the number of microseconds corresponding + * to the string in timestr. If the string represents a duration, it + * is the number of microseconds contained in the time interval. If + * the string is a date, is the number of microseconds since 1st of + * January, 1970 up to the time of the parsed date. If timestr cannot + * be successfully parsed, set *time to INT64_MIN. + + * @param datestr a string representing a date or a duration. + * - If a date the syntax is: + * @code + * [{YYYY-MM-DD|YYYYMMDD}[T|t| ]]{{HH[:MM[:SS[.m...]]]}|{HH[MM[SS[.m...]]]}}[Z] + * now + * @endcode + * If the value is "now" it takes the current time. + * Time is local time unless Z is appended, in which case it is + * interpreted as UTC. + * If the year-month-day part is not specified it takes the current + * year-month-day. + * - If a duration the syntax is: + * @code + * [-]HH[:MM[:SS[.m...]]] + * [-]S+[.m...] + * @endcode + * @param duration flag which tells how to interpret timestr, if not + * zero timestr is interpreted as a duration, otherwise as a date + * @return 0 in case of success, a negative value corresponding to an + * AVERROR code otherwise + */ +int av_parse_time(int64_t *timeval, const char *timestr, int duration); + +/** + * Attempt to find a specific tag in a URL. + * + * syntax: '?tag1=val1&tag2=val2...'. Little URL decoding is done. + * Return 1 if found. + */ +int av_find_info_tag(char *arg, int arg_size, const char *tag1, const char *info); + +#endif /* AVUTIL_PARSEUTILS_H */ diff --git a/ffmpeg 0.7/include/libavutil/pixdesc.h b/ffmpeg 0.7/include/libavutil/pixdesc.h new file mode 100644 index 000000000..727e47f06 --- /dev/null +++ b/ffmpeg 0.7/include/libavutil/pixdesc.h @@ -0,0 +1,166 @@ +/* + * pixel format descriptor + * Copyright (c) 2009 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_PIXDESC_H +#define AVUTIL_PIXDESC_H + +#include + +typedef struct AVComponentDescriptor{ + uint16_t plane :2; ///< which of the 4 planes contains the component + + /** + * Number of elements between 2 horizontally consecutive pixels minus 1. + * Elements are bits for bitstream formats, bytes otherwise. + */ + uint16_t step_minus1 :3; + + /** + * Number of elements before the component of the first pixel plus 1. + * Elements are bits for bitstream formats, bytes otherwise. + */ + uint16_t offset_plus1 :3; + uint16_t shift :3; ///< number of least significant bits that must be shifted away to get the value + uint16_t depth_minus1 :4; ///< number of bits in the component minus 1 +}AVComponentDescriptor; + +/** + * Descriptor that unambiguously describes how the bits of a pixel are + * stored in the up to 4 data planes of an image. It also stores the + * subsampling factors and number of components. + * + * @note This is separate of the colorspace (RGB, YCbCr, YPbPr, JPEG-style YUV + * and all the YUV variants) AVPixFmtDescriptor just stores how values + * are stored not what these values represent. + */ +typedef struct AVPixFmtDescriptor{ + const char *name; + uint8_t nb_components; ///< The number of components each pixel has, (1-4) + + /** + * Amount to shift the luma width right to find the chroma width. + * For YV12 this is 1 for example. + * chroma_width = -((-luma_width) >> log2_chroma_w) + * The note above is needed to ensure rounding up. + * This value only refers to the chroma components. + */ + uint8_t log2_chroma_w; ///< chroma_width = -((-luma_width )>>log2_chroma_w) + + /** + * Amount to shift the luma height right to find the chroma height. + * For YV12 this is 1 for example. + * chroma_height= -((-luma_height) >> log2_chroma_h) + * The note above is needed to ensure rounding up. + * This value only refers to the chroma components. + */ + uint8_t log2_chroma_h; + uint8_t flags; + + /** + * Parameters that describe how pixels are packed. If the format + * has chroma components, they must be stored in comp[1] and + * comp[2]. + */ + AVComponentDescriptor comp[4]; +}AVPixFmtDescriptor; + +#define PIX_FMT_BE 1 ///< Pixel format is big-endian. +#define PIX_FMT_PAL 2 ///< Pixel format has a palette in data[1], values are indexes in this palette. +#define PIX_FMT_BITSTREAM 4 ///< All values of a component are bit-wise packed end to end. +#define PIX_FMT_HWACCEL 8 ///< Pixel format is an HW accelerated format. + +/** + * The array of all the pixel format descriptors. + */ +extern const AVPixFmtDescriptor av_pix_fmt_descriptors[]; + +/** + * Read a line from an image, and write the values of the + * pixel format component c to dst. + * + * @param data the array containing the pointers to the planes of the image + * @param linesize the array containing the linesizes of the image + * @param desc the pixel format descriptor for the image + * @param x the horizontal coordinate of the first pixel to read + * @param y the vertical coordinate of the first pixel to read + * @param w the width of the line to read, that is the number of + * values to write to dst + * @param read_pal_component if not zero and the format is a paletted + * format writes the values corresponding to the palette + * component c in data[1] to dst, rather than the palette indexes in + * data[0]. The behavior is undefined if the format is not paletted. + */ +void av_read_image_line(uint16_t *dst, const uint8_t *data[4], const int linesize[4], + const AVPixFmtDescriptor *desc, int x, int y, int c, int w, int read_pal_component); + +/** + * Write the values from src to the pixel format component c of an + * image line. + * + * @param src array containing the values to write + * @param data the array containing the pointers to the planes of the + * image to write into. It is supposed to be zeroed. + * @param linesize the array containing the linesizes of the image + * @param desc the pixel format descriptor for the image + * @param x the horizontal coordinate of the first pixel to write + * @param y the vertical coordinate of the first pixel to write + * @param w the width of the line to write, that is the number of + * values to write to the image line + */ +void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesize[4], + const AVPixFmtDescriptor *desc, int x, int y, int c, int w); + +/** + * Return the pixel format corresponding to name. + * + * If there is no pixel format with name name, then looks for a + * pixel format with the name corresponding to the native endian + * format of name. + * For example in a little-endian system, first looks for "gray16", + * then for "gray16le". + * + * Finally if no pixel format has been found, returns PIX_FMT_NONE. + */ +enum PixelFormat av_get_pix_fmt(const char *name); + +/** + * Print in buf the string corresponding to the pixel format with + * number pix_fmt, or an header if pix_fmt is negative. + * + * @param buf the buffer where to write the string + * @param buf_size the size of buf + * @param pix_fmt the number of the pixel format to print the + * corresponding info string, or a negative value to print the + * corresponding header. + */ +char *av_get_pix_fmt_string (char *buf, int buf_size, enum PixelFormat pix_fmt); + +/** + * Return the number of bits per pixel used by the pixel format + * described by pixdesc. + * + * The returned number of bits refers to the number of bits actually + * used for storing the pixel information, that is padding bits are + * not counted. + */ +int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc); + +#endif /* AVUTIL_PIXDESC_H */ diff --git a/ffmpeg 0.7/include/libavutil/pixfmt.h b/ffmpeg 0.7/include/libavutil/pixfmt.h new file mode 100644 index 000000000..95972f937 --- /dev/null +++ b/ffmpeg 0.7/include/libavutil/pixfmt.h @@ -0,0 +1,180 @@ +/* + * copyright (c) 2006 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_PIXFMT_H +#define AVUTIL_PIXFMT_H + +/** + * @file + * pixel format definitions + * + * @warning This file has to be considered an internal but installed + * header, so it should not be directly included in your projects. + */ + +#include "libavutil/avconfig.h" + +/** + * Pixel format. Notes: + * + * PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA + * color is put together as: + * (A << 24) | (R << 16) | (G << 8) | B + * This is stored as BGRA on little-endian CPU architectures and ARGB on + * big-endian CPUs. + * + * When the pixel format is palettized RGB (PIX_FMT_PAL8), the palettized + * image data is stored in AVFrame.data[0]. The palette is transported in + * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is + * formatted the same as in PIX_FMT_RGB32 described above (i.e., it is + * also endian-specific). Note also that the individual RGB palette + * components stored in AVFrame.data[1] should be in the range 0..255. + * This is important as many custom PAL8 video codecs that were designed + * to run on the IBM VGA graphics adapter use 6-bit palette components. + * + * For all the 8bit per pixel formats, an RGB32 palette is in data[1] like + * for pal8. This palette is filled in automatically by the function + * allocating the picture. + * + * Note, make sure that all newly added big endian formats have pix_fmt&1==1 + * and that all newly added little endian formats have pix_fmt&1==0 + * this allows simpler detection of big vs little endian. + */ +enum PixelFormat { + PIX_FMT_NONE= -1, + PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) + PIX_FMT_YUYV422, ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr + PIX_FMT_RGB24, ///< packed RGB 8:8:8, 24bpp, RGBRGB... + PIX_FMT_BGR24, ///< packed RGB 8:8:8, 24bpp, BGRBGR... + PIX_FMT_YUV422P, ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) + PIX_FMT_YUV444P, ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples) + PIX_FMT_YUV410P, ///< planar YUV 4:1:0, 9bpp, (1 Cr & Cb sample per 4x4 Y samples) + PIX_FMT_YUV411P, ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) + PIX_FMT_GRAY8, ///< Y , 8bpp + PIX_FMT_MONOWHITE, ///< Y , 1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb + PIX_FMT_MONOBLACK, ///< Y , 1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb + PIX_FMT_PAL8, ///< 8 bit with PIX_FMT_RGB32 palette + PIX_FMT_YUVJ420P, ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range + PIX_FMT_YUVJ422P, ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range + PIX_FMT_YUVJ444P, ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range + PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing + PIX_FMT_XVMC_MPEG2_IDCT, + PIX_FMT_UYVY422, ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1 + PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3 + PIX_FMT_BGR8, ///< packed RGB 3:3:2, 8bpp, (msb)2B 3G 3R(lsb) + PIX_FMT_BGR4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits + PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1B 2G 1R(lsb) + PIX_FMT_RGB8, ///< packed RGB 3:3:2, 8bpp, (msb)2R 3G 3B(lsb) + PIX_FMT_RGB4, ///< packed RGB 1:2:1 bitstream, 4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits + PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1, 8bpp, (msb)1R 2G 1B(lsb) + PIX_FMT_NV12, ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) + PIX_FMT_NV21, ///< as above, but U and V bytes are swapped + + PIX_FMT_ARGB, ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB... + PIX_FMT_RGBA, ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA... + PIX_FMT_ABGR, ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR... + PIX_FMT_BGRA, ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA... + + PIX_FMT_GRAY16BE, ///< Y , 16bpp, big-endian + PIX_FMT_GRAY16LE, ///< Y , 16bpp, little-endian + PIX_FMT_YUV440P, ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples) + PIX_FMT_YUVJ440P, ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range + PIX_FMT_YUVA420P, ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples) + PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers + PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers + PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers + PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers + PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers + PIX_FMT_RGB48BE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian + PIX_FMT_RGB48LE, ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian + + PIX_FMT_RGB565BE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), big-endian + PIX_FMT_RGB565LE, ///< packed RGB 5:6:5, 16bpp, (msb) 5R 6G 5B(lsb), little-endian + PIX_FMT_RGB555BE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0 + PIX_FMT_RGB555LE, ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0 + + PIX_FMT_BGR565BE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), big-endian + PIX_FMT_BGR565LE, ///< packed BGR 5:6:5, 16bpp, (msb) 5B 6G 5R(lsb), little-endian + PIX_FMT_BGR555BE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1 + PIX_FMT_BGR555LE, ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1 + + PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers + PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers + PIX_FMT_VAAPI_VLD, ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers + + PIX_FMT_YUV420P16LE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian + PIX_FMT_YUV420P16BE, ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian + PIX_FMT_YUV422P16LE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian + PIX_FMT_YUV422P16BE, ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian + PIX_FMT_YUV444P16LE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian + PIX_FMT_YUV444P16BE, ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian + PIX_FMT_VDPAU_MPEG4, ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers + PIX_FMT_DXVA2_VLD, ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer + + PIX_FMT_RGB444LE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0 + PIX_FMT_RGB444BE, ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0 + PIX_FMT_BGR444LE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1 + PIX_FMT_BGR444BE, ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1 + PIX_FMT_GRAY8A, ///< 8bit gray, 8bit alpha + PIX_FMT_BGR48BE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian + PIX_FMT_BGR48LE, ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian + + //the following 6 formats are deprecated and should be replaced by PIX_FMT_YUV420P16* with the bpp stored seperately + PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian + PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian + PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian + PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian + PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian + PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian + + PIX_FMT_NB, ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions +}; + +#define PIX_FMT_Y400A PIX_FMT_GRAY8A + +#if AV_HAVE_BIGENDIAN +# define PIX_FMT_NE(be, le) PIX_FMT_##be +#else +# define PIX_FMT_NE(be, le) PIX_FMT_##le +#endif + +#define PIX_FMT_RGB32 PIX_FMT_NE(ARGB, BGRA) +#define PIX_FMT_RGB32_1 PIX_FMT_NE(RGBA, ABGR) +#define PIX_FMT_BGR32 PIX_FMT_NE(ABGR, RGBA) +#define PIX_FMT_BGR32_1 PIX_FMT_NE(BGRA, ARGB) + +#define PIX_FMT_GRAY16 PIX_FMT_NE(GRAY16BE, GRAY16LE) +#define PIX_FMT_RGB48 PIX_FMT_NE(RGB48BE, RGB48LE) +#define PIX_FMT_RGB565 PIX_FMT_NE(RGB565BE, RGB565LE) +#define PIX_FMT_RGB555 PIX_FMT_NE(RGB555BE, RGB555LE) +#define PIX_FMT_RGB444 PIX_FMT_NE(RGB444BE, RGB444LE) +#define PIX_FMT_BGR48 PIX_FMT_NE(BGR48BE, BGR48LE) +#define PIX_FMT_BGR565 PIX_FMT_NE(BGR565BE, BGR565LE) +#define PIX_FMT_BGR555 PIX_FMT_NE(BGR555BE, BGR555LE) +#define PIX_FMT_BGR444 PIX_FMT_NE(BGR444BE, BGR444LE) + +#define PIX_FMT_YUV420P9 PIX_FMT_NE(YUV420P9BE , YUV420P9LE) +#define PIX_FMT_YUV420P10 PIX_FMT_NE(YUV420P10BE, YUV420P10LE) +#define PIX_FMT_YUV422P10 PIX_FMT_NE(YUV422P10BE, YUV422P10LE) +#define PIX_FMT_YUV420P16 PIX_FMT_NE(YUV420P16BE, YUV420P16LE) +#define PIX_FMT_YUV422P16 PIX_FMT_NE(YUV422P16BE, YUV422P16LE) +#define PIX_FMT_YUV444P16 PIX_FMT_NE(YUV444P16BE, YUV444P16LE) + +#endif /* AVUTIL_PIXFMT_H */ diff --git a/ffmpeg 0.7/include/libavutil/random_seed.h b/ffmpeg 0.7/include/libavutil/random_seed.h new file mode 100644 index 000000000..7f7506323 --- /dev/null +++ b/ffmpeg 0.7/include/libavutil/random_seed.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2009 Baptiste Coudurier + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_RANDOM_SEED_H +#define AVUTIL_RANDOM_SEED_H + +#include + +/** + * Get a seed to use in conjunction with random functions. + */ +uint32_t av_get_random_seed(void); + +#endif /* AVUTIL_RANDOM_SEED_H */ diff --git a/ffmpeg 0.7/include/libavutil/rational.h b/ffmpeg 0.7/include/libavutil/rational.h new file mode 100644 index 000000000..789e4aca2 --- /dev/null +++ b/ffmpeg 0.7/include/libavutil/rational.h @@ -0,0 +1,135 @@ +/* + * rational numbers + * Copyright (c) 2003 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +/** + * @file + * rational numbers + * @author Michael Niedermayer + */ + +#ifndef AVUTIL_RATIONAL_H +#define AVUTIL_RATIONAL_H + +#include +#include +#include "attributes.h" + +/** + * rational number numerator/denominator + */ +typedef struct AVRational{ + int num; ///< numerator + int den; ///< denominator +} AVRational; + +/** + * Compare two rationals. + * @param a first rational + * @param b second rational + * @return 0 if a==b, 1 if a>b, -1 if a>63)|1; + else if(b.den && a.den) return 0; + else if(a.num && b.num) return (a.num>>31) - (b.num>>31); + else return INT_MIN; +} + +/** + * Convert rational to double. + * @param a rational to convert + * @return (double) a + */ +static inline double av_q2d(AVRational a){ + return a.num / (double) a.den; +} + +/** + * Reduce a fraction. + * This is useful for framerate calculations. + * @param dst_num destination numerator + * @param dst_den destination denominator + * @param num source numerator + * @param den source denominator + * @param max the maximum allowed for dst_num & dst_den + * @return 1 if exact, 0 otherwise + */ +int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max); + +/** + * Multiply two rationals. + * @param b first rational + * @param c second rational + * @return b*c + */ +AVRational av_mul_q(AVRational b, AVRational c) av_const; + +/** + * Divide one rational by another. + * @param b first rational + * @param c second rational + * @return b/c + */ +AVRational av_div_q(AVRational b, AVRational c) av_const; + +/** + * Add two rationals. + * @param b first rational + * @param c second rational + * @return b+c + */ +AVRational av_add_q(AVRational b, AVRational c) av_const; + +/** + * Subtract one rational from another. + * @param b first rational + * @param c second rational + * @return b-c + */ +AVRational av_sub_q(AVRational b, AVRational c) av_const; + +/** + * Convert a double precision floating point number to a rational. + * inf is expressed as {1,0} or {-1,0} depending on the sign. + * + * @param d double to convert + * @param max the maximum allowed numerator and denominator + * @return (AVRational) d + */ +AVRational av_d2q(double d, int max) av_const; + +/** + * @return 1 if q1 is nearer to q than q2, -1 if q2 is nearer + * than q1, 0 if they have the same distance. + */ +int av_nearer_q(AVRational q, AVRational q1, AVRational q2); + +/** + * Find the nearest value in q_list to q. + * @param q_list an array of rationals terminated by {0, 0} + * @return the index of the nearest value found in the array + */ +int av_find_nearest_q_idx(AVRational q, const AVRational* q_list); + +#endif /* AVUTIL_RATIONAL_H */ diff --git a/ffmpeg 0.7/include/libavutil/samplefmt.h b/ffmpeg 0.7/include/libavutil/samplefmt.h new file mode 100644 index 000000000..9b9c0d49a --- /dev/null +++ b/ffmpeg 0.7/include/libavutil/samplefmt.h @@ -0,0 +1,111 @@ +/* + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_SAMPLEFMT_H +#define AVUTIL_SAMPLEFMT_H + +#include "avutil.h" + +/** + * all in native-endian format + */ +enum AVSampleFormat { + AV_SAMPLE_FMT_NONE = -1, + AV_SAMPLE_FMT_U8, ///< unsigned 8 bits + AV_SAMPLE_FMT_S16, ///< signed 16 bits + AV_SAMPLE_FMT_S32, ///< signed 32 bits + AV_SAMPLE_FMT_FLT, ///< float + AV_SAMPLE_FMT_DBL, ///< double + AV_SAMPLE_FMT_NB ///< Number of sample formats. DO NOT USE if linking dynamically +}; + +/** + * Return the name of sample_fmt, or NULL if sample_fmt is not + * recognized. + */ +const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt); + +/** + * Return a sample format corresponding to name, or AV_SAMPLE_FMT_NONE + * on error. + */ +enum AVSampleFormat av_get_sample_fmt(const char *name); + +/** + * Generate a string corresponding to the sample format with + * sample_fmt, or a header if sample_fmt is negative. + * + * @param buf the buffer where to write the string + * @param buf_size the size of buf + * @param sample_fmt the number of the sample format to print the + * corresponding info string, or a negative value to print the + * corresponding header. + * @return the pointer to the filled buffer or NULL if sample_fmt is + * unknown or in case of other errors + */ +char *av_get_sample_fmt_string(char *buf, int buf_size, enum AVSampleFormat sample_fmt); + +/** + * Return sample format bits per sample. + * + * @param sample_fmt the sample format + * @return number of bits per sample or zero if unknown for the given + * sample format + */ +int av_get_bits_per_sample_fmt(enum AVSampleFormat sample_fmt); + +/** + * Fill channel data pointers and linesizes for samples with sample + * format sample_fmt. + * + * The pointers array is filled with the pointers to the samples data: + * data[c] points to the first sample of channel c. + * data[c] + linesize[0] points to the second sample of channel c + * + * @param pointers array to be filled with the pointer for each plane, may be NULL + * @param linesizes array to be filled with the linesize, may be NULL + * @param buf the pointer to a buffer containing the samples + * @param nb_samples the number of samples in a single channel + * @param planar 1 if the samples layout is planar, 0 if it is packed + * @param nb_channels the number of channels + * @return the total size of the buffer, a negative + * error code in case of failure + */ +int av_samples_fill_arrays(uint8_t *pointers[8], int linesizes[8], + uint8_t *buf, int nb_channels, int nb_samples, + enum AVSampleFormat sample_fmt, int planar, int align); + +/** + * Allocate a samples buffer for nb_samples samples, and + * fill pointers and linesizes accordingly. + * The allocated samples buffer has to be freed by using + * av_freep(&pointers[0]). + * + * @param nb_samples number of samples per channel + * @param planar 1 if the samples layout is planar, 0 if packed, + * @param align the value to use for buffer size alignment + * @return the size in bytes required for the samples buffer, a negative + * error code in case of failure + * @see av_samples_fill_arrays() + */ +int av_samples_alloc(uint8_t *pointers[8], int linesizes[8], + int nb_samples, int nb_channels, + enum AVSampleFormat sample_fmt, int planar, + int align); + +#endif /* AVCORE_SAMPLEFMT_H */ diff --git a/ffmpeg 0.7/include/libavutil/sha.h b/ffmpeg 0.7/include/libavutil/sha.h new file mode 100644 index 000000000..543f5a194 --- /dev/null +++ b/ffmpeg 0.7/include/libavutil/sha.h @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2007 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef AVUTIL_SHA_H +#define AVUTIL_SHA_H + +#include + +extern const int av_sha_size; + +struct AVSHA; + +/** + * Initialize SHA-1 or SHA-2 hashing. + * + * @param context pointer to the function context (of size av_sha_size) + * @param bits number of bits in digest (SHA-1 - 160 bits, SHA-2 224 or 256 bits) + * @return zero if initialization succeeded, -1 otherwise + */ +int av_sha_init(struct AVSHA* context, int bits); + +/** + * Update hash value. + * + * @param context hash function context + * @param data input data to update hash with + * @param len input data length + */ +void av_sha_update(struct AVSHA* context, const uint8_t* data, unsigned int len); + +/** + * Finish hashing and output digest value. + * + * @param context hash function context + * @param digest buffer where output digest value is stored + */ +void av_sha_final(struct AVSHA* context, uint8_t *digest); + +#endif /* AVUTIL_SHA_H */ diff --git a/ffmpeg 0.7/include/libpostproc/postprocess.h b/ffmpeg 0.7/include/libpostproc/postprocess.h new file mode 100644 index 000000000..0713c4795 --- /dev/null +++ b/ffmpeg 0.7/include/libpostproc/postprocess.h @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2001-2003 Michael Niedermayer (michaelni@gmx.at) + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef POSTPROC_POSTPROCESS_H +#define POSTPROC_POSTPROCESS_H + +/** + * @file + * @brief + * external postprocessing API + */ + +#include "libavutil/avutil.h" + +#define LIBPOSTPROC_VERSION_MAJOR 51 +#define LIBPOSTPROC_VERSION_MINOR 2 +#define LIBPOSTPROC_VERSION_MICRO 0 + +#define LIBPOSTPROC_VERSION_INT AV_VERSION_INT(LIBPOSTPROC_VERSION_MAJOR, \ + LIBPOSTPROC_VERSION_MINOR, \ + LIBPOSTPROC_VERSION_MICRO) +#define LIBPOSTPROC_VERSION AV_VERSION(LIBPOSTPROC_VERSION_MAJOR, \ + LIBPOSTPROC_VERSION_MINOR, \ + LIBPOSTPROC_VERSION_MICRO) +#define LIBPOSTPROC_BUILD LIBPOSTPROC_VERSION_INT + +#define LIBPOSTPROC_IDENT "postproc" AV_STRINGIFY(LIBPOSTPROC_VERSION) + +/** + * Return the LIBPOSTPROC_VERSION_INT constant. + */ +unsigned postproc_version(void); + +/** + * Return the libpostproc build-time configuration. + */ +const char *postproc_configuration(void); + +/** + * Return the libpostproc license. + */ +const char *postproc_license(void); + +#define PP_QUALITY_MAX 6 + +#define QP_STORE_T int8_t + +#include + +typedef void pp_context; +typedef void pp_mode; + +#if LIBPOSTPROC_VERSION_INT < (52<<16) +typedef pp_context pp_context_t; +typedef pp_mode pp_mode_t; +extern const char *const pp_help; ///< a simple help text +#else +extern const char pp_help[]; ///< a simple help text +#endif + +void pp_postprocess(const uint8_t * src[3], const int srcStride[3], + uint8_t * dst[3], const int dstStride[3], + int horizontalSize, int verticalSize, + const QP_STORE_T *QP_store, int QP_stride, + pp_mode *mode, pp_context *ppContext, int pict_type); + + +/** + * returns a pp_mode or NULL if an error occurred + * name is the string after "-pp" on the command line + * quality is a number from 0 to PP_QUALITY_MAX + */ +pp_mode *pp_get_mode_by_name_and_quality(const char *name, int quality); +void pp_free_mode(pp_mode *mode); + +pp_context *pp_get_context(int width, int height, int flags); +void pp_free_context(pp_context *ppContext); + +#define PP_CPU_CAPS_MMX 0x80000000 +#define PP_CPU_CAPS_MMX2 0x20000000 +#define PP_CPU_CAPS_3DNOW 0x40000000 +#define PP_CPU_CAPS_ALTIVEC 0x10000000 + +#define PP_FORMAT 0x00000008 +#define PP_FORMAT_420 (0x00000011|PP_FORMAT) +#define PP_FORMAT_422 (0x00000001|PP_FORMAT) +#define PP_FORMAT_411 (0x00000002|PP_FORMAT) +#define PP_FORMAT_444 (0x00000000|PP_FORMAT) + +#define PP_PICT_TYPE_QP2 0x00000010 ///< MPEG2 style QScale + +#endif /* POSTPROC_POSTPROCESS_H */ diff --git a/ffmpeg 0.7/include/libswscale/swscale.h b/ffmpeg 0.7/include/libswscale/swscale.h new file mode 100644 index 000000000..406eec47f --- /dev/null +++ b/ffmpeg 0.7/include/libswscale/swscale.h @@ -0,0 +1,359 @@ +/* + * Copyright (C) 2001-2003 Michael Niedermayer + * + * This file is part of FFmpeg. + * + * FFmpeg is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * FFmpeg is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with FFmpeg; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef SWSCALE_SWSCALE_H +#define SWSCALE_SWSCALE_H + +/** + * @file + * @brief + * external api for the swscale stuff + */ + +#include "libavutil/avutil.h" + +#define LIBSWSCALE_VERSION_MAJOR 0 +#define LIBSWSCALE_VERSION_MINOR 14 +#define LIBSWSCALE_VERSION_MICRO 0 + +#define LIBSWSCALE_VERSION_INT AV_VERSION_INT(LIBSWSCALE_VERSION_MAJOR, \ + LIBSWSCALE_VERSION_MINOR, \ + LIBSWSCALE_VERSION_MICRO) +#define LIBSWSCALE_VERSION AV_VERSION(LIBSWSCALE_VERSION_MAJOR, \ + LIBSWSCALE_VERSION_MINOR, \ + LIBSWSCALE_VERSION_MICRO) +#define LIBSWSCALE_BUILD LIBSWSCALE_VERSION_INT + +#define LIBSWSCALE_IDENT "SwS" AV_STRINGIFY(LIBSWSCALE_VERSION) + +/** + * Those FF_API_* defines are not part of public API. + * They may change, break or disappear at any time. + */ +#ifndef FF_API_SWS_GETCONTEXT +#define FF_API_SWS_GETCONTEXT (LIBSWSCALE_VERSION_MAJOR < 2) +#endif + +/** + * Returns the LIBSWSCALE_VERSION_INT constant. + */ +unsigned swscale_version(void); + +/** + * Returns the libswscale build-time configuration. + */ +const char *swscale_configuration(void); + +/** + * Returns the libswscale license. + */ +const char *swscale_license(void); + +/* values for the flags, the stuff on the command line is different */ +#define SWS_FAST_BILINEAR 1 +#define SWS_BILINEAR 2 +#define SWS_BICUBIC 4 +#define SWS_X 8 +#define SWS_POINT 0x10 +#define SWS_AREA 0x20 +#define SWS_BICUBLIN 0x40 +#define SWS_GAUSS 0x80 +#define SWS_SINC 0x100 +#define SWS_LANCZOS 0x200 +#define SWS_SPLINE 0x400 + +#define SWS_SRC_V_CHR_DROP_MASK 0x30000 +#define SWS_SRC_V_CHR_DROP_SHIFT 16 + +#define SWS_PARAM_DEFAULT 123456 + +#define SWS_PRINT_INFO 0x1000 + +//the following 3 flags are not completely implemented +//internal chrominace subsampling info +#define SWS_FULL_CHR_H_INT 0x2000 +//input subsampling info +#define SWS_FULL_CHR_H_INP 0x4000 +#define SWS_DIRECT_BGR 0x8000 +#define SWS_ACCURATE_RND 0x40000 +#define SWS_BITEXACT 0x80000 + +#define SWS_CPU_CAPS_MMX 0x80000000 +#define SWS_CPU_CAPS_MMX2 0x20000000 +#define SWS_CPU_CAPS_3DNOW 0x40000000 +#define SWS_CPU_CAPS_ALTIVEC 0x10000000 +#define SWS_CPU_CAPS_BFIN 0x01000000 +#define SWS_CPU_CAPS_SSE2 0x02000000 + +#define SWS_MAX_REDUCE_CUTOFF 0.002 + +#define SWS_CS_ITU709 1 +#define SWS_CS_FCC 4 +#define SWS_CS_ITU601 5 +#define SWS_CS_ITU624 5 +#define SWS_CS_SMPTE170M 5 +#define SWS_CS_SMPTE240M 7 +#define SWS_CS_DEFAULT 5 + +/** + * Returns a pointer to yuv<->rgb coefficients for the given colorspace + * suitable for sws_setColorspaceDetails(). + * + * @param colorspace One of the SWS_CS_* macros. If invalid, + * SWS_CS_DEFAULT is used. + */ +const int *sws_getCoefficients(int colorspace); + + +// when used for filters they must have an odd number of elements +// coeffs cannot be shared between vectors +typedef struct { + double *coeff; ///< pointer to the list of coefficients + int length; ///< number of coefficients in the vector +} SwsVector; + +// vectors can be shared +typedef struct { + SwsVector *lumH; + SwsVector *lumV; + SwsVector *chrH; + SwsVector *chrV; +} SwsFilter; + +struct SwsContext; + +/** + * Returns a positive value if pix_fmt is a supported input format, 0 + * otherwise. + */ +int sws_isSupportedInput(enum PixelFormat pix_fmt); + +/** + * Returns a positive value if pix_fmt is a supported output format, 0 + * otherwise. + */ +int sws_isSupportedOutput(enum PixelFormat pix_fmt); + +/** + * Allocates an empty SwsContext. This must be filled and passed to + * sws_init_context(). For filling see AVOptions, options.c and + * sws_setColorspaceDetails(). + */ +struct SwsContext *sws_alloc_context(void); + +/** + * Initializes the swscaler context sws_context. + * + * @return zero or positive value on success, a negative value on + * error + */ +int sws_init_context(struct SwsContext *sws_context, SwsFilter *srcFilter, SwsFilter *dstFilter); + +/** + * Frees the swscaler context swsContext. + * If swsContext is NULL, then does nothing. + */ +void sws_freeContext(struct SwsContext *swsContext); + +#if FF_API_SWS_GETCONTEXT +/** + * Allocates and returns a SwsContext. You need it to perform + * scaling/conversion operations using sws_scale(). + * + * @param srcW the width of the source image + * @param srcH the height of the source image + * @param srcFormat the source image format + * @param dstW the width of the destination image + * @param dstH the height of the destination image + * @param dstFormat the destination image format + * @param flags specify which algorithm and options to use for rescaling + * @return a pointer to an allocated context, or NULL in case of error + * @note this function is to be removed after a saner alternative is + * written + */ +struct SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, + int dstW, int dstH, enum PixelFormat dstFormat, + int flags, SwsFilter *srcFilter, + SwsFilter *dstFilter, const double *param); +#endif + +/** + * Scales the image slice in srcSlice and puts the resulting scaled + * slice in the image in dst. A slice is a sequence of consecutive + * rows in an image. + * + * Slices have to be provided in sequential order, either in + * top-bottom or bottom-top order. If slices are provided in + * non-sequential order the behavior of the function is undefined. + * + * @param context the scaling context previously created with + * sws_getContext() + * @param srcSlice the array containing the pointers to the planes of + * the source slice + * @param srcStride the array containing the strides for each plane of + * the source image + * @param srcSliceY the position in the source image of the slice to + * process, that is the number (counted starting from + * zero) in the image of the first row of the slice + * @param srcSliceH the height of the source slice, that is the number + * of rows in the slice + * @param dst the array containing the pointers to the planes of + * the destination image + * @param dstStride the array containing the strides for each plane of + * the destination image + * @return the height of the output slice + */ +int sws_scale(struct SwsContext *context, const uint8_t* const srcSlice[], const int srcStride[], + int srcSliceY, int srcSliceH, uint8_t* const dst[], const int dstStride[]); + +#if LIBSWSCALE_VERSION_MAJOR < 1 +/** + * @deprecated Use sws_scale() instead. + */ +int sws_scale_ordered(struct SwsContext *context, const uint8_t* const src[], + int srcStride[], int srcSliceY, int srcSliceH, + uint8_t* dst[], int dstStride[]) attribute_deprecated; +#endif + +/** + * @param inv_table the yuv2rgb coefficients, normally ff_yuv2rgb_coeffs[x] + * @param fullRange if 1 then the luma range is 0..255 if 0 it is 16..235 + * @return -1 if not supported + */ +int sws_setColorspaceDetails(struct SwsContext *c, const int inv_table[4], + int srcRange, const int table[4], int dstRange, + int brightness, int contrast, int saturation); + +/** + * @return -1 if not supported + */ +int sws_getColorspaceDetails(struct SwsContext *c, int **inv_table, + int *srcRange, int **table, int *dstRange, + int *brightness, int *contrast, int *saturation); + +/** + * Allocates and returns an uninitialized vector with length coefficients. + */ +SwsVector *sws_allocVec(int length); + +/** + * Returns a normalized Gaussian curve used to filter stuff + * quality=3 is high quality, lower is lower quality. + */ +SwsVector *sws_getGaussianVec(double variance, double quality); + +/** + * Allocates and returns a vector with length coefficients, all + * with the same value c. + */ +SwsVector *sws_getConstVec(double c, int length); + +/** + * Allocates and returns a vector with just one coefficient, with + * value 1.0. + */ +SwsVector *sws_getIdentityVec(void); + +/** + * Scales all the coefficients of a by the scalar value. + */ +void sws_scaleVec(SwsVector *a, double scalar); + +/** + * Scales all the coefficients of a so that their sum equals height. + */ +void sws_normalizeVec(SwsVector *a, double height); +void sws_convVec(SwsVector *a, SwsVector *b); +void sws_addVec(SwsVector *a, SwsVector *b); +void sws_subVec(SwsVector *a, SwsVector *b); +void sws_shiftVec(SwsVector *a, int shift); + +/** + * Allocates and returns a clone of the vector a, that is a vector + * with the same coefficients as a. + */ +SwsVector *sws_cloneVec(SwsVector *a); + +#if LIBSWSCALE_VERSION_MAJOR < 1 +/** + * @deprecated Use sws_printVec2() instead. + */ +attribute_deprecated void sws_printVec(SwsVector *a); +#endif + +/** + * Prints with av_log() a textual representation of the vector a + * if log_level <= av_log_level. + */ +void sws_printVec2(SwsVector *a, AVClass *log_ctx, int log_level); + +void sws_freeVec(SwsVector *a); + +SwsFilter *sws_getDefaultFilter(float lumaGBlur, float chromaGBlur, + float lumaSharpen, float chromaSharpen, + float chromaHShift, float chromaVShift, + int verbose); +void sws_freeFilter(SwsFilter *filter); + +/** + * Checks if context can be reused, otherwise reallocates a new + * one. + * + * If context is NULL, just calls sws_getContext() to get a new + * context. Otherwise, checks if the parameters are the ones already + * saved in context. If that is the case, returns the current + * context. Otherwise, frees context and gets a new context with + * the new parameters. + * + * Be warned that srcFilter and dstFilter are not checked, they + * are assumed to remain the same. + */ +struct SwsContext *sws_getCachedContext(struct SwsContext *context, + int srcW, int srcH, enum PixelFormat srcFormat, + int dstW, int dstH, enum PixelFormat dstFormat, + int flags, SwsFilter *srcFilter, + SwsFilter *dstFilter, const double *param); + +/** + * Converts an 8bit paletted frame into a frame with a color depth of 32-bits. + * + * The output frame will have the same packed format as the palette. + * + * @param src source frame buffer + * @param dst destination frame buffer + * @param num_pixels number of pixels to convert + * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src + */ +void sws_convertPalette8ToPacked32(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette); + +/** + * Converts an 8bit paletted frame into a frame with a color depth of 24 bits. + * + * With the palette format "ABCD", the destination frame ends up with the format "ABC". + * + * @param src source frame buffer + * @param dst destination frame buffer + * @param num_pixels number of pixels to convert + * @param palette array with [256] entries, which must match color arrangement (RGB or BGR) of src + */ +void sws_convertPalette8ToPacked24(const uint8_t *src, uint8_t *dst, long num_pixels, const uint8_t *palette); + + +#endif /* SWSCALE_SWSCALE_H */ diff --git a/ffmpeg 0.7/lib/avcodec-53.dll b/ffmpeg 0.7/lib/avcodec-53.dll new file mode 100644 index 000000000..fce76bb01 Binary files /dev/null and b/ffmpeg 0.7/lib/avcodec-53.dll differ diff --git a/ffmpeg 0.7/lib/avcodec.lib b/ffmpeg 0.7/lib/avcodec.lib new file mode 100644 index 000000000..1e6305e63 Binary files /dev/null and b/ffmpeg 0.7/lib/avcodec.lib differ diff --git a/ffmpeg 0.7/lib/avdevice-53.dll b/ffmpeg 0.7/lib/avdevice-53.dll new file mode 100644 index 000000000..1405b043f Binary files /dev/null and b/ffmpeg 0.7/lib/avdevice-53.dll differ diff --git a/ffmpeg 0.7/lib/avdevice.lib b/ffmpeg 0.7/lib/avdevice.lib new file mode 100644 index 000000000..3e423edb2 Binary files /dev/null and b/ffmpeg 0.7/lib/avdevice.lib differ diff --git a/ffmpeg 0.7/lib/avfilter-2.dll b/ffmpeg 0.7/lib/avfilter-2.dll new file mode 100644 index 000000000..b56253918 Binary files /dev/null and b/ffmpeg 0.7/lib/avfilter-2.dll differ diff --git a/ffmpeg 0.7/lib/avfilter.lib b/ffmpeg 0.7/lib/avfilter.lib new file mode 100644 index 000000000..0c21155e6 Binary files /dev/null and b/ffmpeg 0.7/lib/avfilter.lib differ diff --git a/ffmpeg 0.7/lib/avformat-53.dll b/ffmpeg 0.7/lib/avformat-53.dll new file mode 100644 index 000000000..3984c918e Binary files /dev/null and b/ffmpeg 0.7/lib/avformat-53.dll differ diff --git a/ffmpeg 0.7/lib/avformat.lib b/ffmpeg 0.7/lib/avformat.lib new file mode 100644 index 000000000..618e3a1bb Binary files /dev/null and b/ffmpeg 0.7/lib/avformat.lib differ diff --git a/ffmpeg 0.7/lib/avutil-51.dll b/ffmpeg 0.7/lib/avutil-51.dll new file mode 100644 index 000000000..3c4683905 Binary files /dev/null and b/ffmpeg 0.7/lib/avutil-51.dll differ diff --git a/ffmpeg 0.7/lib/avutil.lib b/ffmpeg 0.7/lib/avutil.lib new file mode 100644 index 000000000..3c753bc73 Binary files /dev/null and b/ffmpeg 0.7/lib/avutil.lib differ diff --git a/ffmpeg 0.7/lib/postproc-51.dll b/ffmpeg 0.7/lib/postproc-51.dll new file mode 100644 index 000000000..4fe064aaa Binary files /dev/null and b/ffmpeg 0.7/lib/postproc-51.dll differ diff --git a/ffmpeg 0.7/lib/postproc.lib b/ffmpeg 0.7/lib/postproc.lib new file mode 100644 index 000000000..a781aad75 Binary files /dev/null and b/ffmpeg 0.7/lib/postproc.lib differ diff --git a/ffmpeg 0.7/lib/swscale-0.dll b/ffmpeg 0.7/lib/swscale-0.dll new file mode 100644 index 000000000..d2cc47410 Binary files /dev/null and b/ffmpeg 0.7/lib/swscale-0.dll differ diff --git a/ffmpeg 0.7/lib/swscale.lib b/ffmpeg 0.7/lib/swscale.lib new file mode 100644 index 000000000..3688e2266 Binary files /dev/null and b/ffmpeg 0.7/lib/swscale.lib differ diff --git a/ffmpeg 0.7/licenses/bzip2.txt b/ffmpeg 0.7/licenses/bzip2.txt new file mode 100644 index 000000000..af3a13040 --- /dev/null +++ b/ffmpeg 0.7/licenses/bzip2.txt @@ -0,0 +1,42 @@ + +-------------------------------------------------------------------------- + +This program, "bzip2", the associated library "libbzip2", and all +documentation, are copyright (C) 1996-2010 Julian R Seward. All +rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product + documentation would be appreciated but is not required. + +3. Altered source versions must be plainly marked as such, and must + not be misrepresented as being the original software. + +4. The name of the author may not be used to endorse or promote + products derived from this software without specific prior written + permission. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS +OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Julian Seward, jseward@bzip.org +bzip2/libbzip2 version 1.0.6 of 6 September 2010 + +-------------------------------------------------------------------------- diff --git a/ffmpeg 0.7/licenses/ffmpeg.txt b/ffmpeg 0.7/licenses/ffmpeg.txt new file mode 100644 index 000000000..818433ecc --- /dev/null +++ b/ffmpeg 0.7/licenses/ffmpeg.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/ffmpeg 0.7/licenses/freetype.txt b/ffmpeg 0.7/licenses/freetype.txt new file mode 100644 index 000000000..b6ee268ef --- /dev/null +++ b/ffmpeg 0.7/licenses/freetype.txt @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/ffmpeg 0.7/licenses/frei0r.txt b/ffmpeg 0.7/licenses/frei0r.txt new file mode 100644 index 000000000..0f3bd3d29 --- /dev/null +++ b/ffmpeg 0.7/licenses/frei0r.txt @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. \ No newline at end of file diff --git a/ffmpeg 0.7/licenses/gsm.txt b/ffmpeg 0.7/licenses/gsm.txt new file mode 100644 index 000000000..8aec8e1a9 --- /dev/null +++ b/ffmpeg 0.7/licenses/gsm.txt @@ -0,0 +1,35 @@ +Copyright 1992, 1993, 1994 by Jutta Degener and Carsten Bormann, +Technische Universitaet Berlin + +Any use of this software is permitted provided that this notice is not +removed and that neither the authors nor the Technische Universitaet Berlin +are deemed to have made any representations as to the suitability of this +software for any purpose nor are held responsible for any defects of +this software. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE. + +As a matter of courtesy, the authors request to be informed about uses +this software has found, about bugs in this software, and about any +improvements that may be of general interest. + +Berlin, 28.11.1994 +Jutta Degener +Carsten Bormann + + oOo + +Since the original terms of 15 years ago maybe do not make our +intentions completely clear given today's refined usage of the legal +terms, we append this additional permission: + + Permission to use, copy, modify, and distribute this software + for any purpose with or without fee is hereby granted, + provided that this notice is not removed and that neither + the authors nor the Technische Universitaet Berlin are + deemed to have made any representations as to the suitability + of this software for any purpose nor are held responsible + for any defects of this software. THERE IS ABSOLUTELY NO + WARRANTY FOR THIS SOFTWARE. + +Berkeley/Bremen, 05.04.2009 +Jutta Degener +Carsten Bormann \ No newline at end of file diff --git a/ffmpeg 0.7/licenses/lame.txt b/ffmpeg 0.7/licenses/lame.txt new file mode 100644 index 000000000..b24021034 --- /dev/null +++ b/ffmpeg 0.7/licenses/lame.txt @@ -0,0 +1,481 @@ + GNU LIBRARY GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the library GPL. It is + numbered 2 because it goes with version 2 of the ordinary GPL.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Library General Public License, applies to some +specially designated Free Software Foundation software, and to any +other libraries whose authors decide to use it. You can use it for +your libraries, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if +you distribute copies of the library, or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link a program with the library, you must provide +complete object files to the recipients so that they can relink them +with the library, after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + Our method of protecting your rights has two steps: (1) copyright +the library, and (2) offer you this license which gives you legal +permission to copy, distribute and/or modify the library. + + Also, for each distributor's protection, we want to make certain +that everyone understands that there is no warranty for this free +library. If the library is modified by someone else and passed on, we +want its recipients to know that what they have is not the original +version, so that any problems introduced by others will not reflect on +the original authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that companies distributing free +software will individually obtain patent licenses, thus in effect +transforming the program into proprietary software. To prevent this, +we have made it clear that any patent must be licensed for everyone's +free use or not licensed at all. + + Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License, which was designed for utility programs. This +license, the GNU Library General Public License, applies to certain +designated libraries. This license is quite different from the ordinary +one; be sure to read it in full, and don't assume that anything in it is +the same as in the ordinary license. + + The reason we have a separate public license for some libraries is that +they blur the distinction we usually make between modifying or adding to a +program and simply using it. Linking a program with a library, without +changing the library, is in some sense simply using the library, and is +analogous to running a utility program or application program. However, in +a textual and legal sense, the linked executable is a combined work, a +derivative of the original library, and the ordinary General Public License +treats it as such. + + Because of this blurred distinction, using the ordinary General +Public License for libraries did not effectively promote software +sharing, because most developers did not use the libraries. We +concluded that weaker conditions might promote sharing better. + + However, unrestricted linking of non-free programs would deprive the +users of those programs of all benefit from the free status of the +libraries themselves. This Library General Public License is intended to +permit developers of non-free programs to use free libraries, while +preserving your freedom as a user of such programs to change the free +libraries that are incorporated in them. (We have not seen how to achieve +this as regards changes in header files, but we have achieved it as regards +changes in the actual functions of the Library.) The hope is that this +will lead to faster development of free libraries. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, while the latter only +works together with the library. + + Note that it is possible for a library to be covered by the ordinary +General Public License rather than by this special one. + + GNU LIBRARY GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library which +contains a notice placed by the copyright holder or other authorized +party saying it may be distributed under the terms of this Library +General Public License (also called "this License"). Each licensee is +addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also compile or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + c) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + d) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the source code distributed need not include anything that is normally +distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Library General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! \ No newline at end of file diff --git a/ffmpeg 0.7/licenses/libvpx.txt b/ffmpeg 0.7/licenses/libvpx.txt new file mode 100644 index 000000000..872c1f141 --- /dev/null +++ b/ffmpeg 0.7/licenses/libvpx.txt @@ -0,0 +1,29 @@ +Copyright (c) 2010, Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + * Neither the name of Google nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/ffmpeg 0.7/licenses/opencore-amr.txt b/ffmpeg 0.7/licenses/opencore-amr.txt new file mode 100644 index 000000000..6c40ca52e --- /dev/null +++ b/ffmpeg 0.7/licenses/opencore-amr.txt @@ -0,0 +1,191 @@ +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and +distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the +copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other +entities that control, are controlled by, or are under common control with +that entity. For the purposes of this definition, "control" means (i) the +power, direct or indirect, to cause the direction or management of such +entity, whether by contract or otherwise, or (ii) ownership of fifty +percent (50%) or more of the outstanding shares, or (iii) beneficial +ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising +permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, +including but not limited to software source code, documentation source, +and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation +or translation of a Source form, including but not limited to compiled +object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, +made available under the License, as indicated by a copyright notice that +is included in or attached to the work (an example is provided in the +Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, +that is based on (or derived from) the Work and for which the editorial +revisions, annotations, elaborations, or other modifications represent, as +a whole, an original work of authorship. For the purposes of this License, +Derivative Works shall not include works that remain separable from, or +merely link (or bind by name) to the interfaces of, the Work and Derivative +Works thereof. + +"Contribution" shall mean any work of authorship, including the original +version of the Work and any modifications or additions to that Work or +Derivative Works thereof, that is intentionally submitted to Licensor for +inclusion in the Work by the copyright owner or by an individual or Legal +Entity authorized to submit on behalf of the copyright owner. For the +purposes of this definition, "submitted" means any form of electronic, +verbal, or written communication sent to the Licensor or its +representatives, including but not limited to communication on electronic +mailing lists, source code control systems, and issue tracking systems that +are managed by, or on behalf of, the Licensor for the purpose of discussing +and improving the Work, but excluding communication that is conspicuously +marked or otherwise designated in writing by the copyright owner as "Not a +Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on +behalf of whom a Contribution has been received by Licensor and +subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this +License, each Contributor hereby grants to You a perpetual, worldwide, +non-exclusive, no-charge, royalty-free, irrevocable copyright license to +reproduce, prepare Derivative Works of, publicly display, publicly perform, +sublicense, and distribute the Work and such Derivative Works in Source or +Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this +License, each Contributor hereby grants to You a perpetual, worldwide, +non-exclusive, no-charge, royalty-free, irrevocable (except as stated in +this section) patent license to make, have made, use, offer to sell, sell, +import, and otherwise transfer the Work, where such license applies only to +those patent claims licensable by such Contributor that are necessarily +infringed by their Contribution(s) alone or by combination of their +Contribution(s) with the Work to which such Contribution(s) was submitted. +If You institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work or a +Contribution incorporated within the Work constitutes direct or +contributory patent infringement, then any patent licenses granted to You +under this License for that Work shall terminate as of the date such +litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or +Derivative Works thereof in any medium, with or without modifications, and +in Source or Object form, provided that You meet the following conditions: + + 1. You must give any other recipients of the Work or Derivative Works a +copy of this License; and + + 2. You must cause any modified files to carry prominent notices stating +that You changed the files; and + + 3. You must retain, in the Source form of any Derivative Works that You +distribute, all copyright, patent, trademark, and attribution notices from +the Source form of the Work, excluding those notices that do not pertain to +any part of the Derivative Works; and + + 4. If the Work includes a "NOTICE" text file as part of its +distribution, then any Derivative Works that You distribute must include a +readable copy of the attribution notices contained within such NOTICE file, +excluding those notices that do not pertain to any part of the Derivative +Works, in at least one of the following places: within a NOTICE text file +distributed as part of the Derivative Works; within the Source form or +documentation, if provided along with the Derivative Works; or, within a +display generated by the Derivative Works, if and wherever such third-party +notices normally appear. The contents of the NOTICE file are for +informational purposes only and do not modify the License. You may add Your +own attribution notices within Derivative Works that You distribute, +alongside or as an addendum to the NOTICE text from the Work, provided that +such additional attribution notices cannot be construed as modifying the +License. + +You may add Your own copyright statement to Your modifications and may +provide additional or different license terms and conditions for use, +reproduction, or distribution of Your modifications, or for any such +Derivative Works as a whole, provided Your use, reproduction, and +distribution of the Work otherwise complies with the conditions stated in +this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any +Contribution intentionally submitted for inclusion in the Work by You to +the Licensor shall be under the terms and conditions of this License, +without any additional terms or conditions. Notwithstanding the above, +nothing herein shall supersede or modify the terms of any separate license +agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade +names, trademarks, service marks, or product names of the Licensor, except +as required for reasonable and customary use in describing the origin of +the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to +in writing, Licensor provides the Work (and each Contributor provides its +Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied, including, without limitation, any +warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or +FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for +determining the appropriateness of using or redistributing the Work and +assume any risks associated with Your exercise of permissions under this +License. + +8. Limitation of Liability. In no event and under no legal theory, whether +in tort (including negligence), contract, or otherwise, unless required by +applicable law (such as deliberate and grossly negligent acts) or agreed to +in writing, shall any Contributor be liable to You for damages, including +any direct, indirect, special, incidental, or consequential damages of any +character arising as a result of this License or out of the use or +inability to use the Work (including but not limited to damages for loss of +goodwill, work stoppage, computer failure or malfunction, or any and all +other commercial damages or losses), even if such Contributor has been +advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the +Work or Derivative Works thereof, You may choose to offer, and charge a fee +for, acceptance of support, warranty, indemnity, or other liability +obligations and/or rights consistent with this License. However, in +accepting such obligations, You may act only on Your own behalf and on Your +sole responsibility, not on behalf of any other Contributor, and only if +You agree to indemnify, defend, and hold each Contributor harmless for any +liability incurred by, or claims asserted against, such Contributor by +reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work + +To apply the Apache License to your work, attach the following boilerplate +notice, with the fields enclosed by brackets "[]" replaced with your own +identifying information. (Don't include the brackets!) The text should be +enclosed in the appropriate comment syntax for the file format. We also +recommend that a file or class name and description of purpose be included +on the same "printed page" as the copyright notice for easier +identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); you may + not use this file except in compliance with the License. You may obtain a + copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable + law or agreed to in writing, software distributed under the License is + distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the specific language + governing permissions and limitations under the License. \ No newline at end of file diff --git a/ffmpeg 0.7/licenses/openjpeg.txt b/ffmpeg 0.7/licenses/openjpeg.txt new file mode 100644 index 000000000..0ad448854 --- /dev/null +++ b/ffmpeg 0.7/licenses/openjpeg.txt @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium + * Copyright (c) 2002-2007, Professor Benoit Macq + * Copyright (c) 2001-2003, David Janssens + * Copyright (c) 2002-2003, Yannick Verschueren + * Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe + * Copyright (c) 2005, Herve Drolon, FreeImage Team + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ \ No newline at end of file diff --git a/ffmpeg 0.7/licenses/rtmp.txt b/ffmpeg 0.7/licenses/rtmp.txt new file mode 100644 index 000000000..7ba5aff47 --- /dev/null +++ b/ffmpeg 0.7/licenses/rtmp.txt @@ -0,0 +1,503 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + diff --git a/ffmpeg 0.7/licenses/schroedinger.txt b/ffmpeg 0.7/licenses/schroedinger.txt new file mode 100644 index 000000000..2b79e5a85 --- /dev/null +++ b/ffmpeg 0.7/licenses/schroedinger.txt @@ -0,0 +1,278 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. \ No newline at end of file diff --git a/ffmpeg 0.7/licenses/speex.txt b/ffmpeg 0.7/licenses/speex.txt new file mode 100644 index 000000000..e7a3ac7ef --- /dev/null +++ b/ffmpeg 0.7/licenses/speex.txt @@ -0,0 +1,35 @@ +Copyright 2002-2008 Xiph.org Foundation +Copyright 2002-2008 Jean-Marc Valin +Copyright 2005-2007 Analog Devices Inc. +Copyright 2005-2008 Commonwealth Scientific and Industrial Research + Organisation (CSIRO) +Copyright 1993, 2002, 2006 David Rowe +Copyright 2003 EpicGames +Copyright 1992-1994 Jutta Degener, Carsten Bormann + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +- Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +- Neither the name of the Xiph.org Foundation nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/ffmpeg 0.7/licenses/theora.txt b/ffmpeg 0.7/licenses/theora.txt new file mode 100644 index 000000000..0914ccab0 --- /dev/null +++ b/ffmpeg 0.7/licenses/theora.txt @@ -0,0 +1,28 @@ +Copyright (C) 2002-2009 Xiph.org Foundation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +- Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +- Neither the name of the Xiph.org Foundation nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/ffmpeg 0.7/licenses/vorbis.txt b/ffmpeg 0.7/licenses/vorbis.txt new file mode 100644 index 000000000..9ce60f84a --- /dev/null +++ b/ffmpeg 0.7/licenses/vorbis.txt @@ -0,0 +1,28 @@ +Copyright (c) 2002-2008 Xiph.org Foundation + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +- Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +- Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution. + +- Neither the name of the Xiph.org Foundation nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/ffmpeg 0.7/licenses/x264.txt b/ffmpeg 0.7/licenses/x264.txt new file mode 100644 index 000000000..1e51ded8a --- /dev/null +++ b/ffmpeg 0.7/licenses/x264.txt @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. \ No newline at end of file diff --git a/ffmpeg 0.7/licenses/xavs.txt b/ffmpeg 0.7/licenses/xavs.txt new file mode 100644 index 000000000..818433ecc --- /dev/null +++ b/ffmpeg 0.7/licenses/xavs.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/ffmpeg 0.7/licenses/xvid.txt b/ffmpeg 0.7/licenses/xvid.txt new file mode 100644 index 000000000..ea9864d07 --- /dev/null +++ b/ffmpeg 0.7/licenses/xvid.txt @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. \ No newline at end of file diff --git a/ffmpeg 0.7/licenses/zlib.txt b/ffmpeg 0.7/licenses/zlib.txt new file mode 100644 index 000000000..eb9dc5823 --- /dev/null +++ b/ffmpeg 0.7/licenses/zlib.txt @@ -0,0 +1,23 @@ + zlib.h -- interface of the 'zlib' general purpose compression library + version 1.2.5, April 19th, 2010 + + Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly + Mark Adler