| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| @chapter Bitstream Filters | ||
| @c man begin 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 @code{--list-bsfs}. | ||
|
|
||
| You can disable all the bitstream filters using the configure option | ||
| @code{--disable-bsfs}, and selectively enable any bitstream filter using | ||
| the option @code{--enable-bsf=BSF}, or you can disable a particular | ||
| bitstream filter using the option @code{--disable-bsf=BSF}. | ||
|
|
||
| The option @code{-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. | ||
|
|
||
| @section aac_adtstoasc | ||
|
|
||
| @section chomp | ||
|
|
||
| @section dump_extradata | ||
|
|
||
| @section h264_mp4toannexb | ||
|
|
||
| @section imx_dump_header | ||
|
|
||
| @section 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 | ||
|
|
||
| @example | ||
| ffmpeg -i ../some_mjpeg.avi -vcodec copy frames_%d.jpg | ||
| @end example | ||
|
|
||
| Unfortunately, these chunks are incomplete JPEG images, because | ||
| they lack the DHT segment required for decoding. Quoting from | ||
| @url{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. | ||
|
|
||
| @example | ||
| 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 | ||
| @end example | ||
|
|
||
| @section mjpega_dump_header | ||
|
|
||
| @section movsub | ||
|
|
||
| @section mp3_header_compress | ||
|
|
||
| @section mp3_header_decompress | ||
|
|
||
| @section noise | ||
|
|
||
| @section remove_extradata | ||
|
|
||
| @c man end BITSTREAM FILTERS |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| FFmpeg currently uses a custom build system, this text attempts to document | ||
| some of its obscure features and options. | ||
|
|
||
| Options to make: | ||
| make V=1 <target> | ||
| Build target with verbosity 1, instead of 1, 2 can be used too | ||
|
|
||
|
|
||
| Useful standard make commands: | ||
| make -t <target> | ||
| Touch all files that otherwise would be build, this is useful to reduce | ||
| unneeded rebuilding when changing headers, but note you must force rebuilds | ||
| of files that actually need it by hand then. | ||
|
|
||
| make -j<num> | ||
| rebuild with multiple jobs at the same time. Faster on multi processor systems | ||
|
|
||
| make -k | ||
| continue build in case of errors, this is useful for the regression tests | ||
| sometimes but note it will still not run all reg tests. | ||
|
|
||
|
|
||
| Targets to make: | ||
| fate-list | ||
| Will list all fate/regression test targets | ||
|
|
||
| fate | ||
| Run the fate test suite, note you must have installed it | ||
|
|
||
|
|
||
| Setting up local fate: | ||
| use the following command to get the fate test samples | ||
| rsync -aL rsync://rsync.mplayerhq.hu:/samples/fate-suite/ fate/fate-suite | ||
| pass --samples=<path to the samples> to configure |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| @chapter Demuxers | ||
| @c man begin 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=@var{DEMUXER}", or disable it | ||
| with the option "--disable-demuxer=@var{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. | ||
|
|
||
| @section 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 "%0@var{N}d", which | ||
| specifies the position of the characters representing a sequential | ||
| number in each filename matched by the pattern. If the form | ||
| "%d0@var{N}d" is used, the string representing the number in each | ||
| filename is 0-padded and @var{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 "%0@var{N}d", 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 @file{img-001.bmp}, @file{img-002.bmp}, ..., | ||
| @file{img-010.bmp}, etc.; the pattern "i%%m%%g-%d.jpg" will match a | ||
| sequence of filenames of the form @file{i%m%g-1.jpg}, | ||
| @file{i%m%g-2.jpg}, ..., @file{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 @file{ffmpeg} for creating a | ||
| video from the images in the file sequence @file{img-001.jpeg}, | ||
| @file{img-002.jpeg}, ..., assuming an input framerate of 10 frames per | ||
| second: | ||
| @example | ||
| ffmpeg -r 10 -f image2 -i 'img-%03d.jpeg' out.avi | ||
| @end example | ||
|
|
||
| Note that the pattern must not necessarily contain "%d" or | ||
| "%0@var{N}d", for example to convert a single image file | ||
| @file{img.jpeg} you can employ the command: | ||
| @example | ||
| ffmpeg -f image2 -i img.jpeg img.png | ||
| @end example | ||
|
|
||
| @c man end INPUT DEVICES |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,140 @@ | ||
| @chapter Expression Evaluation | ||
| @c man begin EXPRESSION EVALUATION | ||
|
|
||
| When evaluating an arithemetic expression, FFmpeg uses an internal | ||
| formula evaluator, implemented through the @file{libavutil/eval.h} | ||
| interface. | ||
|
|
||
| An expression may contain unary, binary operators, constants, and | ||
| functions. | ||
|
|
||
| Two expressions @var{expr1} and @var{expr2} can be combined to form | ||
| another expression "@var{expr1};@var{expr2}". | ||
| @var{expr1} and @var{expr2} are evaluated in turn, and the new | ||
| expression evaluates to the value of @var{expr2}. | ||
|
|
||
| The following binary operators are available: @code{+}, @code{-}, | ||
| @code{*}, @code{/}, @code{^}. | ||
|
|
||
| The following unary operators are available: @code{+}, @code{-}. | ||
|
|
||
| The following functions are available: | ||
| @table @option | ||
| @item sinh(x) | ||
| @item cosh(x) | ||
| @item tanh(x) | ||
| @item sin(x) | ||
| @item cos(x) | ||
| @item tan(x) | ||
| @item atan(x) | ||
| @item asin(x) | ||
| @item acos(x) | ||
| @item exp(x) | ||
| @item log(x) | ||
| @item abs(x) | ||
| @item squish(x) | ||
| @item gauss(x) | ||
| @item isnan(x) | ||
| Return 1.0 if @var{x} is NAN, 0.0 otherwise. | ||
|
|
||
| @item mod(x, y) | ||
| @item max(x, y) | ||
| @item min(x, y) | ||
| @item eq(x, y) | ||
| @item gte(x, y) | ||
| @item gt(x, y) | ||
| @item lte(x, y) | ||
| @item lt(x, y) | ||
| @item st(var, expr) | ||
| Allow to store the value of the expression @var{expr} in an internal | ||
| variable. @var{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. | ||
|
|
||
| @item ld(var) | ||
| Allow to load the value of the internal variable with number | ||
| @var{var}, which was previosly stored with st(@var{var}, @var{expr}). | ||
| The function returns the loaded value. | ||
|
|
||
| @item while(cond, expr) | ||
| Evaluate expression @var{expr} while the expression @var{cond} is | ||
| non-zero, and returns the value of the last @var{expr} evaluation, or | ||
| NAN if @var{cond} was always false. | ||
| @end table | ||
|
|
||
| Note that: | ||
|
|
||
| @code{*} works like AND | ||
|
|
||
| @code{+} works like OR | ||
|
|
||
| thus | ||
| @example | ||
| if A then B else C | ||
| @end example | ||
| is equivalent to | ||
| @example | ||
| A*B + not(A)*C | ||
| @end example | ||
|
|
||
| When A evaluates to either 1 or 0, that is the same as | ||
| @example | ||
| A*B + eq(A,0)*C | ||
| @end example | ||
|
|
||
| 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. | ||
| @table @option | ||
| @item y | ||
| -24 / -80 | ||
| @item z | ||
| -21 / -70 | ||
| @item a | ||
| -18 / -60 | ||
| @item f | ||
| -15 / -50 | ||
| @item p | ||
| -12 / -40 | ||
| @item n | ||
| -9 / -30 | ||
| @item u | ||
| -6 / -20 | ||
| @item m | ||
| -3 / -10 | ||
| @item c | ||
| -2 | ||
| @item d | ||
| -1 | ||
| @item h | ||
| 2 | ||
| @item k | ||
| 3 / 10 | ||
| @item K | ||
| 3 / 10 | ||
| @item M | ||
| 6 / 20 | ||
| @item G | ||
| 9 / 30 | ||
| @item T | ||
| 12 / 40 | ||
| @item P | ||
| 15 / 40 | ||
| @item E | ||
| 18 / 50 | ||
| @item Z | ||
| 21 / 60 | ||
| @item Y | ||
| 24 / 70 | ||
| @end table | ||
|
|
||
| @c man end |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,259 @@ | ||
|
|
||
| About Git write access: | ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
|
||
| Before everything else, you should know how to use GIT properly. | ||
| Luckily Git comes with excellent documentation. | ||
|
|
||
| git --help | ||
| man git | ||
|
|
||
| shows you the available subcommands, | ||
|
|
||
| git <command> --help | ||
| man git-<command> | ||
|
|
||
| shows information about the subcommand <command>. | ||
|
|
||
| The most comprehensive manual is the website Git Reference | ||
|
|
||
| http://gitref.org/ | ||
|
|
||
| For more information about the Git project, visit | ||
|
|
||
| http://git-scm.com/ | ||
|
|
||
| Consult these resources whenever you have problems, they are quite exhaustive. | ||
|
|
||
| You do not need a special username or password. | ||
| All you need is to provide a ssh public key to the Git server admin. | ||
|
|
||
| What follows now is a basic introduction to Git and some FFmpeg-specific | ||
| guidelines. Read it at least once, if you are granted commit privileges to the | ||
| FFmpeg project you are expected to be familiar with these rules. | ||
|
|
||
|
|
||
|
|
||
| I. BASICS: | ||
| ========== | ||
|
|
||
| 0. Get GIT: | ||
|
|
||
| You can get git from http://git-scm.com/ | ||
|
|
||
|
|
||
| 1. Cloning the source tree: | ||
|
|
||
| git clone git://git.ffmpeg.org/ffmpeg.git <target> | ||
|
|
||
| This will put the FFmpeg sources into the directory <target>. | ||
|
|
||
| git clone git@git.ffmpeg.org:ffmpeg.git <target> | ||
|
|
||
| This will put the FFmpeg sources into the directory <target> and let | ||
| you push back your changes to the remote repository. | ||
|
|
||
|
|
||
| 2. Updating the source tree to the latest revision: | ||
|
|
||
| git pull (--ff-only) | ||
|
|
||
| pulls in the latest changes from the tracked branch. The tracked branch | ||
| can be remote. By default the master branch tracks the branch master in | ||
| the remote origin. | ||
| Caveat: Since merge commits are forbidden at least for the initial | ||
| months of git --ff-only or --rebase (see below) are recommended. | ||
| --ff-only will fail and not create merge commits if your branch | ||
| has diverged (has a different history) from the tracked branch. | ||
|
|
||
| 2.a Rebasing your local branches: | ||
|
|
||
| git pull --rebase | ||
|
|
||
| fetches the changes from the main repository and replays your local commits | ||
| over it. This is required to keep all your local changes at the top of | ||
| FFmpeg's master tree. The master tree will reject pushes with merge commits. | ||
|
|
||
|
|
||
| 3. Adding/removing files/directories: | ||
|
|
||
| git add [-A] <filename/dirname> | ||
| git rm [-r] <filename/dirname> | ||
|
|
||
| GIT needs to get notified of all changes you make to your working | ||
| directory that makes files appear or disappear. | ||
| Line moves across files are automatically tracked. | ||
|
|
||
|
|
||
| 4. Showing modifications: | ||
|
|
||
| git diff <filename(s)> | ||
|
|
||
| will show all local modifications in your working directory as unified diff. | ||
|
|
||
|
|
||
| 5. Inspecting the changelog: | ||
|
|
||
| git log <filename(s)> | ||
|
|
||
| You may also use the graphical tools like gitview or gitk or the web | ||
| interface available at http://git.ffmpeg.org/ | ||
|
|
||
| 6. Checking source tree status: | ||
|
|
||
| git status | ||
|
|
||
| detects all the changes you made and lists what actions will be taken in case | ||
| of a commit (additions, modifications, deletions, etc.). | ||
|
|
||
|
|
||
| 7. Committing: | ||
|
|
||
| git diff --check | ||
|
|
||
| to double check your changes before committing them to avoid trouble later | ||
| on. All experienced developers do this on each and every commit, no matter | ||
| how small. | ||
| Every one of them has been saved from looking like a fool by this many times. | ||
| It's very easy for stray debug output or cosmetic modifications to slip in, | ||
| please avoid problems through this extra level of scrutiny. | ||
|
|
||
| For cosmetics-only commits you should get (almost) empty output from | ||
|
|
||
| git diff -wb <filename(s)> | ||
|
|
||
| Also check the output of | ||
|
|
||
| git status | ||
|
|
||
| to make sure you don't have untracked files or deletions. | ||
|
|
||
| git add [-i|-p|-A] <filenames/dirnames> | ||
|
|
||
| Make sure you have told git your name and email address, e.g. by running | ||
| git config --global user.name "My Name" | ||
| git config --global user.email my@email.invalid | ||
| (--global to set the global configuration for all your git checkouts). | ||
|
|
||
| Git will select the changes to the files for commit. Optionally you can use | ||
| the interactive or the patch mode to select hunk by hunk what should be | ||
| added to the commit. | ||
|
|
||
| git commit | ||
|
|
||
| Git will commit the selected changes to your current local branch. | ||
|
|
||
| You will be prompted for a log message in an editor, which is either | ||
| set in your personal configuration file through | ||
|
|
||
| git config core.editor | ||
|
|
||
| or set by one of the following environment variables: | ||
| GIT_EDITOR, VISUAL or EDITOR. | ||
|
|
||
| Log messages should be concise but descriptive. Explain why you made a change, | ||
| what you did will be obvious from the changes themselves most of the time. | ||
| Saying just "bug fix" or "10l" is bad. Remember that people of varying skill | ||
| levels look at and educate themselves while reading through your code. Don't | ||
| include filenames in log messages, Git provides that information. | ||
|
|
||
| Possibly make the commit message have a terse, descriptive first line, an | ||
| empty line and then a full description. The first line will be used to name | ||
| the patch by git format-patch. | ||
|
|
||
|
|
||
| 8. Renaming/moving/copying files or contents of files: | ||
|
|
||
| Git automatically tracks such changes, making those normal commits. | ||
|
|
||
| mv/cp path/file otherpath/otherfile | ||
|
|
||
| git add [-A] . | ||
|
|
||
| git commit | ||
|
|
||
| Do not move, rename or copy files of which you are not the maintainer without | ||
| discussing it on the mailing list first! | ||
|
|
||
| 9. Reverting broken commits | ||
|
|
||
| git revert <commit> | ||
|
|
||
| git revert will generate a revert commit. This will not make the faulty | ||
| commit disappear from the history. | ||
|
|
||
| git reset <commit> | ||
|
|
||
| git reset will uncommit the changes till <commit> rewriting the current | ||
| branch history. | ||
|
|
||
| git commit --amend | ||
|
|
||
| allows to amend the last commit details quickly. | ||
|
|
||
| git rebase -i origin/master | ||
|
|
||
| will replay local commits over the main repository allowing to edit, | ||
| merge or remove some of them in the process. | ||
|
|
||
| Note that the reset, commit --amend and rebase rewrite history, so you | ||
| should use them ONLY on your local or topic branches. | ||
|
|
||
| The main repository will reject those changes. | ||
|
|
||
| 10. Preparing a patchset. | ||
|
|
||
| git format-patch <commit> [-o directory] | ||
|
|
||
| will generate a set of patches out of the current branch starting from | ||
| commit. By default the patches are created in the current directory. | ||
|
|
||
| 11. Sending patches for review | ||
|
|
||
| git send-email <commit list|directory> | ||
|
|
||
| will send the patches created by git format-patch or directly generates | ||
| them. All the email fields can be configured in the global/local | ||
| configuration or overridden by command line. | ||
|
|
||
| 12. Pushing changes to remote trees | ||
|
|
||
| git push | ||
|
|
||
| Will push the changes to the default remote (origin). | ||
| Git will prevent you from pushing changes if the local and remote trees are | ||
| out of sync. Refer to 2 and 2.a to sync the local tree. | ||
|
|
||
| git remote add <name> <url> | ||
|
|
||
| Will add additional remote with a name reference, it is useful if you want | ||
| to push your local branch for review on a remote host. | ||
|
|
||
| git push <remote> <refspec> | ||
|
|
||
| Will push the changes to the remote repository. Omitting refspec makes git | ||
| push update all the remote branches matching the local ones. | ||
|
|
||
| 13. Finding a specific svn revision | ||
|
|
||
| Since version 1.7.1 git supports ':/foo' syntax for specifying commits | ||
| based on a regular expression. see man gitrevisions | ||
|
|
||
| git show :/'as revision 23456' | ||
|
|
||
| will show the svn changeset r23456. With older git versions searching in | ||
| the git log output is the easiest option (especially if a pager with | ||
| search capabilities is used). | ||
| This commit can be checked out with | ||
|
|
||
| git checkout -b svn_23456 :/'as revision 23456' | ||
|
|
||
| or for git < 1.7.1 with | ||
|
|
||
| git checkout -b svn_23456 $SHA1 | ||
|
|
||
| where $SHA1 is the commit SHA1 from the 'git log' output. | ||
|
|
||
|
|
||
| Contact the project admins <git at ffmpeg dot org> if you have technical | ||
| problems with the GIT server. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,212 @@ | ||
| @chapter Input Devices | ||
| @c man begin 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=@var{INDEV}", or you can disable a particular | ||
| input device using the option "--disable-indev=@var{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. | ||
|
|
||
| @section 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: | ||
| @example | ||
| hw:@var{CARD}[,@var{DEV}[,@var{SUBDEV}]] | ||
| @end example | ||
|
|
||
| where the @var{DEV} and @var{SUBDEV} components are optional. | ||
|
|
||
| The three arguments (in order: @var{CARD},@var{DEV},@var{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 @file{/proc/asound/cards} and @file{/proc/asound/devices}. | ||
|
|
||
| For example to capture with @file{ffmpeg} from an ALSA device with | ||
| card id 0, you may run the command: | ||
| @example | ||
| ffmpeg -f alsa -i hw:0 alsaout.wav | ||
| @end example | ||
|
|
||
| For more information see: | ||
| @url{http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html} | ||
|
|
||
| @section bktr | ||
|
|
||
| BSD video input device. | ||
|
|
||
| @section dv1394 | ||
|
|
||
| Linux DV 1394 input device. | ||
|
|
||
| @section 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 @var{client_name}:input_@var{N}, where | ||
| @var{client_name} is the name provided by the application, and @var{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 | ||
| @file{jack_connect} and @file{jack_disconnect} programs, or do it | ||
| through a graphical interface, for example with @file{qjackctl}. | ||
|
|
||
| To list the JACK clients and their properties you can invoke the command | ||
| @file{jack_lsp}. | ||
|
|
||
| Follows an example which shows how to capture a JACK readable client | ||
| with @file{ffmpeg}. | ||
| @example | ||
| # 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 | ||
| @end example | ||
|
|
||
| For more information read: | ||
| @url{http://jackaudio.org/} | ||
|
|
||
| @section libdc1394 | ||
|
|
||
| IIDC1394 input device, based on libdc1394 and libraw1394. | ||
|
|
||
| @section 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 | ||
| @file{/dev/dsp}. | ||
|
|
||
| For example to grab from @file{/dev/dsp} using @file{ffmpeg} use the | ||
| command: | ||
| @example | ||
| ffmpeg -f oss -i /dev/dsp /tmp/oss.wav | ||
| @end example | ||
|
|
||
| For more information about OSS see: | ||
| @url{http://manuals.opensound.com/usersguide/dsp.html} | ||
|
|
||
| @section 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 @file{/dev/video@var{N}}, where @var{N} is a number associated to | ||
| the device. | ||
|
|
||
| Video4Linux and Video4Linux2 devices only support a limited set of | ||
| @var{width}x@var{height} sizes and framerates. You can check which are | ||
| supported for example with the command @file{dov4l} for Video4Linux | ||
| devices and the command @file{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. | ||
| @example | ||
| # 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 | ||
| @end example | ||
|
|
||
| @section 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. | ||
|
|
||
| @section x11grab | ||
|
|
||
| X11 video input device. | ||
|
|
||
| This device allows to capture a region of an X11 display. | ||
|
|
||
| The filename passed as input has the syntax: | ||
| @example | ||
| [@var{hostname}]:@var{display_number}.@var{screen_number}[+@var{x_offset},@var{y_offset}] | ||
| @end example | ||
|
|
||
| @var{hostname}:@var{display_number}.@var{screen_number} specifies the | ||
| X11 display name of the screen to grab from. @var{hostname} can be | ||
| ommitted, and defaults to "localhost". The environment variable | ||
| @env{DISPLAY} contains the default display name. | ||
|
|
||
| @var{x_offset} and @var{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 @file{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 @file{:0.0} using @file{ffmpeg}: | ||
| @example | ||
| 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 | ||
| @end example | ||
|
|
||
| @c man end INPUT DEVICES |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| @chapter Metadata | ||
| @c man begin 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: | ||
| @enumerate | ||
|
|
||
| @item | ||
| A file consists of a header and a number of metadata tags divided into sections, | ||
| each on its own line. | ||
|
|
||
| @item | ||
| The header is a ';FFMETADATA' string, followed by a version number (now 1). | ||
|
|
||
| @item | ||
| Metadata tags are of the form 'key=value' | ||
|
|
||
| @item | ||
| Immediately after header follows global metadata | ||
|
|
||
| @item | ||
| After global metadata there may be sections with per-stream/per-chapter | ||
| metadata. | ||
|
|
||
| @item | ||
| 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. | ||
|
|
||
| @item | ||
| 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. | ||
|
|
||
| @item | ||
| Empty lines and lines starting with ';' or '#' are ignored. | ||
|
|
||
| @item | ||
| Metadata keys or values containing special characters ('=', ';', '#', '\' and a | ||
| newline) must be escaped with a backslash '\'. | ||
|
|
||
| @item | ||
| 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'). | ||
| @end enumerate | ||
|
|
||
| A ffmetadata file might look like this: | ||
| @example | ||
| ;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 | ||
| @end example | ||
| @c man end METADATA |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| @chapter Muxers | ||
| @c man begin 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 @code{--list-muxers}. | ||
|
|
||
| You can disable all the muxers with the configure option | ||
| @code{--disable-muxers} and selectively enable / disable single muxers | ||
| with the options @code{--enable-muxer=@var{MUXER}} / | ||
| @code{--disable-muxer=@var{MUXER}}. | ||
|
|
||
| The option @code{-formats} of the ff* tools will display the list of | ||
| enabled muxers. | ||
|
|
||
| A description of some of the currently available muxers follows. | ||
|
|
||
| @section image2 | ||
|
|
||
| Image file muxer. | ||
|
|
||
| This muxer writes video frames to multiple image files specified by a | ||
| pattern. | ||
|
|
||
| The pattern may contain the string "%d" or "%0@var{N}d", which | ||
| specifies the position of the characters representing a numbering in | ||
| the filenames. If the form "%d0@var{N}d" is used, the string | ||
| representing the number in each filename is 0-padded to @var{N} | ||
| digits. The literal character '%' can be specified in the pattern with | ||
| the string "%%". | ||
|
|
||
| If the pattern contains "%d" or "%0@var{N}d", 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 @file{img-001.bmp}, @file{img-002.bmp}, ..., | ||
| @file{img-010.bmp}, etc. | ||
| The pattern "img%%-%d.jpg" will specify a sequence of filenames of the | ||
| form @file{img%-1.jpg}, @file{img%-2.jpg}, ..., @file{img%-10.jpg}, | ||
| etc. | ||
|
|
||
| The following example shows how to use @file{ffmpeg} for creating a | ||
| sequence of files @file{img-001.jpeg}, @file{img-002.jpeg}, ..., | ||
| taking one image every second from the input video: | ||
| @example | ||
| ffmpeg -i in.avi -r 1 -f image2 'img-%03d.jpeg' | ||
| @end example | ||
|
|
||
| Note that with @file{ffmpeg}, if the format is not specified with the | ||
| @code{-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: | ||
| @example | ||
| ffmpeg -i in.avi -r 1 'img-%03d.jpeg' | ||
| @end example | ||
|
|
||
| Note also that the pattern must not necessarily contain "%d" or | ||
| "%0@var{N}d", for example to create a single image file | ||
| @file{img.jpeg} from the input video you can employ the command: | ||
| @example | ||
| ffmpeg -i in.avi -f image2 -vframes 1 img.jpeg | ||
| @end example | ||
|
|
||
| @section mpegts | ||
|
|
||
| MPEG transport stream muxer. | ||
|
|
||
| This muxer implements ISO 13818-1 and part of ETSI EN 300 468. | ||
|
|
||
| The muxer options are: | ||
|
|
||
| @table @option | ||
| @item -mpegts_original_network_id @var{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. | ||
| @item -mpegts_transport_stream_id @var{number} | ||
| Set the transport_stream_id (default 0x0001). This identifies a | ||
| transponder in DVB. | ||
| @item -mpegts_service_id @var{number} | ||
| Set the service_id (default 0x0001) also known as program in DVB. | ||
| @item -mpegts_pmt_start_pid @var{number} | ||
| Set the first PID for PMT (default 0x1000, max 0x1f00). | ||
| @item -mpegts_start_pid @var{number} | ||
| Set the first PID for data packets (default 0x0100, max 0x0f00). | ||
| @end table | ||
|
|
||
| The recognized metadata settings in mpegts muxer are @code{service_provider} | ||
| and @code{service_name}. If they are not set the default for | ||
| @code{service_provider} is "FFmpeg" and the default for | ||
| @code{service_name} is "Service01". | ||
|
|
||
| @example | ||
| 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 | ||
| @end example | ||
|
|
||
| @c man end MUXERS |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| @chapter Output Devices | ||
| @c man begin 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=@var{OUTDEV}", or you can disable a particular | ||
| input device using the option "--disable-outdev=@var{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. | ||
|
|
||
| @section alsa | ||
|
|
||
| ALSA (Advanced Linux Sound Architecture) output device. | ||
|
|
||
| @section oss | ||
|
|
||
| OSS (Open Sound System) output device. | ||
|
|
||
| @c man end OUTPUT DEVICES |