]> git.sesse.net Git - ffmpeg/blobdiff - doc/ffmpeg-doc.texi
Doc improvement for -target patch by (Michel Bardiaux <mbardiaux at peaktime dot...
[ffmpeg] / doc / ffmpeg-doc.texi
index 0011ca959b64f76d71b8f8d1056dd1639b2c4782..d1b80b342c10a199a015ca7dd229b6161a55a842 100644 (file)
@@ -131,7 +131,7 @@ The generic syntax is:
 
 @example 
 @c man begin SYNOPSIS
-ffmpeg [[options][@option{-i} @var{input_file}]]... @{[options] @var{output_file}@}...
+ffmpeg [[infile options][@option{-i} @var{infile}]]... @{[outfile options] @var{outfile}@}...
 @c man end
 @end example
 @c man begin DESCRIPTION
@@ -173,6 +173,10 @@ overwrite output files
 set the recording time in seconds. @code{hh:mm:ss[.xxx]} syntax is also
 supported.
 
+@item -ss position
+seek to given time position. @code{hh:mm:ss[.xxx]} syntax is also
+supported.
+
 @item -title string       
 set the title
 
@@ -185,9 +189,32 @@ set the copyright
 @item -comment string     
 set the comment
 
-@item -hq                 
+@item -target type
+specify target file type ("vcd", "svcd", "dvd", "pal-vcd", "ntsc-svcd", ... ). All the format
+options (bitrate, codecs, buffer sizes) are automatically set by this
+option. You can just type:
+
+@example
+ffmpeg -i myfile.avi -target vcd /tmp/vcd.mpg
+@end example
+
+Nevertheless you can specify additional options as long as you know they do not compromise the
+standard, as in:
+
+@example
+ffmpeg -i myfile.avi -target vcd -bf 2 /tmp/vcd.mpg
+@end example
+
+@item -hq
 activate high quality settings
 
+@item -itsoffset offset
+set the input time offset in seconds. @code{[-]hh:mm:ss[.xxx]} syntax
+is also supported.  This option affects all the input files that
+follow it.  The offset is added to the input files' timestamps;
+specifying a positive offset means that the corresponding streams are
+delayed by 'offset' seconds.
+
 @end table
 
 @section Video Options
@@ -221,6 +248,18 @@ set bottom crop band size (in pixels)
 set left crop band size (in pixels)
 @item -cropright size
 set right crop band size (in pixels)
+@item -padtop size
+set top pad band size (in pixels)
+@item -padbottom size
+set bottom pad band size (in pixels)
+@item -padleft size
+set left pad band size (in pixels)
+@item -padright size
+set right pad band size (in pixels)
+@item -padcolor (hex color)
+set color of padded bands. The value for pad color is expressed 
+as a six digit hexidecimal number where the first two digits represent red, 
+middle two digits green and last two digits blue. Defaults to 000000 (black)
 @item -vn
 disable video recording
 @item -bt tolerance       
@@ -393,6 +432,12 @@ enable Unlimited Motion Vector (h263+)
 
 @item -deinterlace
 deinterlace pictures
+@item -interlace
+force interlacing support in encoder (only MPEG-2 and MPEG-4). Use this option
+if your input file is interlaced and if you want to keep the interlaced
+format for minimum losses. The alternative is to deinterlace the input
+stream with @option{-deinterlace}, but deinterlacing introduces more
+losses.
 @item -psnr
 calculate PSNR of compressed frames
 @item -vstats
@@ -405,8 +450,6 @@ name and its parameters separated by spaces.
 @section Audio Options
 
 @table @option
-@item -ab bitrate         
-set audio bitrate (in kbit/s)
 @item -ar freq    
 set the audio sampling freq (default = 44100 Hz)
 @item -ab bitrate 
@@ -613,12 +656,14 @@ library:
 @item Raw MJPEG @tab X  @tab  X 
 @item Raw MPEG video @tab X  @tab  X 
 @item Raw PCM8/16 bits, mulaw/Alaw@tab X  @tab  X 
+@item Raw CRI ADX audio @tab X  @tab  X 
 @item SUN AU format @tab X  @tab  X 
+@item NUT @tab X @tab X @tab NUT Open Container Format
 @item Quicktime        @tab X @tab  X 
 @item MPEG4            @tab X @tab  X 
 @tab MPEG4 is a variant of Quicktime
 @item Raw MPEG4 video  @tab  X @tab  X 
-@item DV               @tab  @tab X
+@item DV               @tab  X @tab  X
 @item 4xm              @tab    @tab X
 @tab 4X Technologies format, used in some games
 @item Playstation STR  @tab    @tab X
@@ -628,6 +673,19 @@ library:
 @tab format used in various Interplay computer games
 @item WC3 Movie        @tab    @tab X
 @tab multimedia format used in Origin's Wing Commander III computer game
+@item Sega FILM/CPK    @tab    @tab X
+@tab used in many Sega Saturn console games
+@item Westwood Studios VQA/AUD  @tab    @tab X
+@tab Multimedia formats used in Westwood Studios games
+@item Id Cinematic (.cin) @tab    @tab X
+@tab Used in Quake II
+@item FLIC format      @tab    @tab X
+@tab .fli/.flc files
+@item Sierra VMD       @tab    @tab X
+@tab used in Sierra CD-ROM games
+@item Sierra Online    @tab    @tab X
+@tab .sol files used in Sierra Online games
+@item Matroska         @tab    @tab X
 @end multitable
 
 @code{X} means that the encoding (resp. decoding) is supported.
@@ -646,6 +704,7 @@ following image formats are supported:
 @item .Y.U.V       @tab X @tab X @tab One raw file per component
 @item Animated GIF @tab X @tab X @tab Only uncompressed GIFs are generated
 @item PNG          @tab X @tab X @tab 2 bit and 4 bit/pixel not supported yet
+@item SGI          @tab X @tab X @tab SGI RGB image format
 @end multitable
 
 @code{X} means that the encoding (resp. decoding) is supported.
@@ -664,24 +723,48 @@ following image formats are supported:
 @item WMV8                   @tab  X  @tab  X @tab Not completely working
 @item H263(+)                @tab  X  @tab  X @tab Also known as Real Video 1.0
 @item MJPEG                  @tab  X  @tab  X 
-@item DV                     @tab     @tab  X 
+@item Lossless MJPEG         @tab  X  @tab  X
+@item Apple MJPEG-B          @tab     @tab  X
+@item Sunplus MJPEG          @tab     @tab  X @tab fourcc: SP5X
+@item DV                     @tab  X  @tab  X 
 @item Huff YUV               @tab  X  @tab  X
+@item FFmpeg Video 1         @tab  X  @tab  X @tab Experimental lossless codec (fourcc: FFV1)
+@item FFmpeg Snow            @tab  X  @tab  X @tab Experimental wavelet codec (fourcc: SNOW)
 @item Asus v1                @tab  X  @tab  X @tab fourcc: ASV1
 @item Asus v2                @tab  X  @tab  X @tab fourcc: ASV2
 @item Creative YUV           @tab     @tab  X @tab fourcc: CYUV
 @item H.264                  @tab     @tab  X
-@item Sorenson Video 1       @tab     @tab  X @tab fourcc: SVQ1
+@item Sorenson Video 1       @tab  X  @tab  X @tab fourcc: SVQ1
 @item Sorenson Video 3       @tab     @tab  X @tab fourcc: SVQ3
 @item On2 VP3                @tab     @tab  X @tab still experimental
+@item Theora                 @tab     @tab  X @tab still experimental
 @item Intel Indeo 3          @tab     @tab  X @tab only works on i386 right now
 @item FLV                    @tab  X  @tab  X @tab Flash H263 variant
 @item ATI VCR1               @tab     @tab  X @tab fourcc: VCR1
+@item ATI VCR2               @tab     @tab  X @tab fourcc: VCR2
 @item Cirrus Logic AccuPak   @tab     @tab  X @tab fourcc: CLJR
 @item 4X Video               @tab     @tab  X @tab used in certain computer games
 @item Sony Playstation MDEC  @tab     @tab  X 
 @item Id RoQ                 @tab     @tab  X @tab used in Quake III, Jedi Knight 2, other computer games
 @item Xan/WC3                @tab     @tab  X @tab used in Wing Commander III .MVE files
 @item Interplay Video        @tab     @tab  X @tab used in Interplay .MVE files
+@item Apple Animation        @tab     @tab  X @tab fourcc: 'rle '
+@item Apple Graphics         @tab     @tab  X @tab fourcc: 'smc '
+@item Apple Video            @tab     @tab  X @tab fourcc: rpza
+@item Apple QuickDraw        @tab     @tab  X @tab fourcc: qdrw
+@item Cinepak                @tab     @tab  X
+@item Microsoft RLE          @tab     @tab  X
+@item Microsoft Video-1      @tab     @tab  X
+@item Westwood VQA           @tab     @tab  X
+@item Id Cinematic Video     @tab     @tab  X @tab used in Quake II
+@item Planar RGB             @tab     @tab  X @tab fourcc: 8BPS
+@item FLIC video             @tab     @tab  X
+@item Duck TrueMotion v1     @tab     @tab  X @tab fourcc: DUCK
+@item VMD Video              @tab     @tab  X @tab used in Sierra VMD files
+@item MSZH                   @tab     @tab  X @tab Part of LCL
+@item ZLIB                   @tab  X  @tab  X @tab Part of LCL, encoder experimental
+@item TechSmith Camtasia     @tab     @tab  X @tab fourcc: TSCC
+@item IBM Ultimotion         @tab     @tab  X @tab fourcc: ULTI
 @end multitable
 
 @code{X} means that the encoding (resp. decoding) is supported.
@@ -697,25 +780,41 @@ solutions.
 @item MPEG audio layer 2     @tab  IX  @tab  IX 
 @item MPEG audio layer 1/3   @tab IX   @tab  IX
 @tab MP3 encoding is supported through the external library LAME
-@item AC3                    @tab  IX  @tab  X
+@item AC3                    @tab  IX  @tab  IX
 @tab liba52 is used internally for decoding
 @item Vorbis                 @tab  X   @tab  X
 @tab supported through the external library libvorbis
 @item WMA V1/V2              @tab      @tab X
+@item AAC                    @tab X    @tab X
+@tab supported through the external library libfaac/libfaad
 @item Microsoft ADPCM        @tab X    @tab X
 @item MS IMA ADPCM           @tab X    @tab X
 @item QT IMA ADPCM           @tab      @tab X
 @item 4X IMA ADPCM           @tab      @tab X
+@item G.726  ADPCM           @tab X    @tab X
 @item Duck DK3 IMA ADPCM     @tab      @tab X
 @tab used in some Sega Saturn console games
 @item Duck DK4 IMA ADPCM     @tab      @tab X
 @tab used in some Sega Saturn console games
+@item Westwood Studios IMA ADPCM @tab      @tab X
+@tab used in Westwood Studios games like Command and Conquer
+@item SMJPEG IMA ADPCM       @tab      @tab X
+@tab used in certain Loki game ports
+@item CD-ROM XA ADPCM        @tab      @tab X
+@item CRI ADX ADPCM          @tab X    @tab X
+@tab used in Sega Dreamcast games
+@item Electronic Arts ADPCM  @tab      @tab X
+@tab used in various EA titles
 @item RA144                  @tab      @tab X
 @tab Real 14400 bit/s codec
 @item RA288                  @tab      @tab X
 @tab Real 28800 bit/s codec
+@item RADnet                 @tab X    @tab IX
+@tab Real lowbitrate AC3 codec, liba52 is used for decoding
 @item AMR-NB                 @tab X    @tab X
 @tab supported through an external library
+@item AMR-WB                 @tab X    @tab X
+@tab supported through an external library
 @item DV audio               @tab      @tab X
 @item Id RoQ DPCM            @tab      @tab X
 @tab used in Quake III, Jedi Knight 2, other computer games
@@ -723,6 +822,13 @@ solutions.
 @tab used in various Interplay computer games
 @item Xan DPCM               @tab      @tab X
 @tab used in Origin's Wing Commander IV AVI files
+@item Sierra Online DPCM     @tab      @tab X
+@tab used in Sierra Online game audio files
+@item Apple MACE 3           @tab      @tab X
+@item Apple MACE 6           @tab      @tab X
+@item FLAC                   @tab      @tab X
+@item FFmpeg Sonic           @tab X    @tab X
+@tab Experimental lossy/lossless codec
 @end multitable
 
 @code{X} means that the encoding (resp. decoding) is supported.
@@ -754,7 +860,8 @@ the MinGW development library of SDL 1.2.x
 (@file{SDL-devel-1.2.x-mingw32.tar.gz}) from
 @url{http://www.libsdl.org}. Unpack it in a temporary place, and
 unpack the archive @file{i386-mingw32msvc.tar.gz} in the MinGW tool
-directory.
+directory. Edit the @file{sdl-config} script so that it gives the
+correct SDL directory when invoked.
 
 @item Extract the current version of FFmpeg (the latest release version or the current CVS snapshot whichever is recommended).
  
@@ -766,15 +873,31 @@ directory.
 suffices. If you have problems using SDL, verify that
 @file{sdl-config} can be launched from the MSYS command line.
 
-@item You can install FFmpeg in @file{Program Files/FFmpeg} by typing @file{make install}.
+@item You can install FFmpeg in @file{Program Files/FFmpeg} by typing @file{make install}. Don't forget to copy @file{SDL.dll} at the place you launch 
+@file{ffplay}.
 
 @end itemize
 
-Note: The target @file{make wininstaller} can be used to create a Nullsoft based Windows installer for FFmpeg and FFplay.
+Notes: 
+@itemize
 
-@subsection How to create a single Windows DLL from libavcodec and libavformat
-Read @url{http://ffmpeg.org/win32.html}.
+@item The target @file{make wininstaller} can be used to create a
+Nullsoft based Windows installer for FFmpeg and FFplay. @file{SDL.dll}
+must be copied in the ffmpeg directory in order to build the
+installer.
+
+@item By using @code{./configure --enable-shared} when configuring ffmpeg, 
+you can build @file{avcodec.dll} and @file{avformat.dll}. With
+@code{make install} you install the FFmpeg DLLs and the associated
+headers in @file{Program Files/FFmpeg}. 
+
+@item Visual C++ compatibility: if you used @code{./configure --enable-shared} 
+when configuring FFmpeg, then FFmpeg tries to use the Microsoft Visual
+C++ @code{lib} tool to build @code{avcodec.lib} and
+@code{avformat.lib}. With these libraries, you can link your Visual C++
+code directly with the FFmpeg DLLs.
+
+@end itemize
 
 @subsection Cross compilation for Windows with Linux
 
@@ -838,23 +961,91 @@ You can use libavcodec or libavformat in your commercial program, but
 @emph{any patch you make must be published}. The best way to proceed is
 to send your patches to the ffmpeg mailing list.
 
+@node Coding Rules
 @section Coding Rules
 
-ffmpeg is programmed in ANSI C language. GCC extensions are
-tolerated. Indent size is 4. The TAB character should not be used.
+ffmpeg is programmed in the ISO C90 language with a few additional
+features from ISO C99, namely:
+@itemize @bullet
+@item
+the @samp{inline} keyword;
+@item
+@samp{//} comments;
+@item
+designated struct initializers (@samp{struct s x = @{ .i = 17 @};})
+@item
+compound literals (@samp{x = (struct s) { 17, 23 @};})
+@end itemize
+
+These features are supported by all compilers we care about, so we won't
+accept patches to remove their use unless they absolutely don't 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 don't use any
+additional C99 features or gcc extensions. Watch out especially for:
+@itemize @bullet
+@item
+mixing statements and declarations;
+@item
+@samp{long long} (use @samp{int64_t} instead);
+@item
+@samp{__attribute__} not protected by @samp{#ifdef __GNUC__} or similar;
+@item
+gcc statement expressions (@samp{(x = (@{ int y = 4; y; @})}).
+@end itemize
 
+Indent size is 4. The TAB character should not be used.
 The presentation is the one specified by 'indent -i4 -kr'.
 
 Main priority in ffmpeg is simplicity and small code size (=less
 bugs).
 
-Comments: for functions visible from other modules, use the JavaDoc
-format (see examples in @file{libav/utils.c}) so that a documentation
-can be generated automatically.
+Comments: use the JavaDoc/Doxygen 
+format (see examples below) so that a documentation
+can be generated automatically. All non trivial functions should have a comment
+above it explaining what the function does, even if its just one sentance.
+All Structures and their member variables should be documented too.
+@example
+/**
+ * @file mpeg.c
+ * mpeg codec.
+ * @author ...
+ */
+
+/**
+ * Summary sentance.
+ * more text ...
+ * ...
+ */
+typedef struct Foobar{
+    int var1; /**< var1 description */
+    int var2; ///< var2 description
+    /** var3 description */
+    int var3;
+} Foobar;
+
+/**
+ * Summary sentance.
+ * more text ...
+ * ...
+ * @param my_parameter description of my_parameter
+ * @return return value description
+ */
+int myfunc(int my_parameter)
+...
+@end example
+
+fprintf and printf are forbidden in libavformat and libavcodec, 
+please use av_log() instead.
 
 @section Submitting patches
 
-When you submit your patch, try to send a unified diff (diff '-u'
+First, (@pxref{Coding Rules}) above if you didn't yet.
+
+When you submit your patch, try to send a unified diff (diff '-up'
 option). I cannot read other diffs :-)
 
 Run the regression tests before submitting a patch so that you can
@@ -865,6 +1056,13 @@ encoding which ensures that the patch wont be trashed during
 transmission) to the ffmpeg-devel mailinglist, see 
 @url{http://lists.sourceforge.net/lists/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 isnt c99 compliant
+and has no lrint()')
+
+We reply to all patches submitted and either apply or reject with some
+explanation why, but sometimes we are quite busy so it can take a week or 2
+
 @section Regression tests
 
 Before submitting a patch (or committing with CVS), you should at least
@@ -880,7 +1078,7 @@ The regression test then goes 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.
+Run 'make test' to test all the codecs and formats.
 
 Run 'make fulltest' to test all the codecs, formats and ffserver.