diff options
author | Anssi Hannula <anssi@xbmc.org> | 2011-02-02 01:29:29 +0200 |
---|---|---|
committer | Anssi Hannula <anssi@xbmc.org> | 2011-02-03 00:16:55 +0200 |
commit | 1a6a927ec5a0c305f58fa44bc0d023e007820b64 (patch) | |
tree | 480da2a288b605711c96a7315937c33ccf6c8257 /lib/ffmpeg/doc | |
parent | 4d8e27ceb8c6218f4dd62b381ec786650f594ac9 (diff) |
updated: internal ffmpeg to c3beafa0f1
Update internal FFmpeg to c3beafa0f1 from
git://git.ffmpeg.org/ffmpeg.git.
This update adds a new library, libavcore, which contains common
multimedia utilities. Build scripts are updated to handle it (both
internal and external). FFmpeg is no longer built with libfaad as it
now supports LATM AAC audio natively. The unused build_xbmc.sh script is
removed.
The patchset in ffmpeg/patches has been updated, removals and additions
are documented below.
The following patches have been removed as no longer necessary:
- Ticket #5481 - added support for LATM encapsulated AAC audio streams
within FFmpeg (thanks Paul Kendall).
- re-add libfaad wrapper to ffmpeg for now
- added: ffmpeg spdif demuxer (fixes ac3-in-wav)
- ffmpeg issue2137 patch for MKV (fixes #9014)
- ffmpeg issue2137 patch for AVI (fixes #9014)
- fixed: bitstream mode improperly set. Ticket #10981.
- Add av_popcount() to libavutil/common.h and bump minor version
- added: export DTS profile information in ffmpeg
- Add av_get_profile_name() to get profile names.
- Show profile in avcodec_string().
- libfaac: add recognized profiles array
- dca: add profile names
- h264: add profile names for the existing defines
- dca: consider a stream with XXCh/X96 in ExSS as DTS-HD HRA
- added: metadata support to oggenc with vorbis streams (submitted
upstream Issue #555)
The following patch has been removed as its purpose is unclear and
upstream code has diverged (passthrough works even without it):
- Setup wanted pkt size in spdif muxers header parser
The following patch:
- When PMT is found, we have found mpegts header information, and
av_find_stream_info doesn't need to read more to find streams
has been re-replaced with
- Speed up mpegts av_find_stream_info.
The latter was apparently accidentally reverted in the previous FFmpeg
update.
The following patch has been added to fix a build regression with the
configure flags we use on darwin:
- swscale: fix build with --enable-runtime-cpudetect
--disable-mmx/mmx2/amd3dnow
Diffstat (limited to 'lib/ffmpeg/doc')
24 files changed, 3030 insertions, 238 deletions
diff --git a/lib/ffmpeg/doc/APIchanges b/lib/ffmpeg/doc/APIchanges index 2150225343..aa1221df45 100644 --- a/lib/ffmpeg/doc/APIchanges +++ b/lib/ffmpeg/doc/APIchanges @@ -2,6 +2,7 @@ Never assume the API of libav* to be stable unless at least 1 week has passed si the last major version increase. The last version increases were: libavcodec: ? +libavcore: 2010-07-21 libavdevice: ? libavfilter: 2009-10-18 libavformat: ? @@ -12,6 +13,322 @@ libavutil: 2009-03-08 API changes, most recent first: +2011-01-15 - r26374 - lavfi 1.74.0 - AVFilterBufferRefAudioProps + Rename AVFilterBufferRefAudioProps.samples_nb to nb_samples. + +2011-01-14 - r26330 - lavf 52.93.0 - av_metadata_copy() + Add av_metadata_copy() in avformat.h. + +2011-01-07 - r26262 - lavc 52.107.0 - deprecate reordered_opaque + Deprecate reordered_opaque in favor of pkt_pts/dts. + +2011-01-07 - r26261 - lavc 52.106.0 - pkt_dts + Add pkt_dts to AVFrame, this will in the future allow multithreading decoders + to not mess up dts. + +2011-01-07 - r26260 - lavc 52.105.0 - pkt_pts + Add pkt_pts to AVFrame. + +2011-01-07 - r26259 - lavc 52.104.0 - av_get_profile_name() + Add av_get_profile_name to libavcodec/avcodec.h. + +2010-12-27 - r26108 - lavfi 1.71.0 - AV_PERM_NEG_LINESIZES + Add AV_PERM_NEG_LINESIZES in avfilter.h. + +2010-12-27 - r26104 - lavf 52.91.0 - av_find_best_stream() + Add av_find_best_stream to libavformat/avformat.h. + +2010-12-27 - r26103 - lavf 52.90.0 + Add AVFMT_NOSTREAMS flag for formats with no streams, + like e.g. text metadata. + +2010-12-22 - r26073 - lavu 50.36.0 - file.h + Add functions av_file_map() and av_file_unmap() in file.h. + +2010-12-19 - r26056 - lavu 50.35.0 - error.h + Add "not found" error codes: + AVERROR_DEMUXER_NOT_FOUND + AVERROR_MUXER_NOT_FOUND + AVERROR_DECODER_NOT_FOUND + AVERROR_ENCODER_NOT_FOUND + AVERROR_PROTOCOL_NOT_FOUND + AVERROR_FILTER_NOT_FOUND + AVERROR_BSF_NOT_FOUND + AVERROR_STREAM_NOT_FOUND + +2010-12-09 - r25923 - lavcore 0.16.0 - avcore.h + Move AV_NOPTS_VALUE, AV_TIME_BASE, AV_TIME_BASE_Q symbols from + avcodec.h to avcore.h. + +2010-12-04 - r25886 - lavc 52.98.0 - CODEC_CAP_NEG_LINESIZES + Add CODEC_CAP_NEG_LINESIZES codec capability flag in avcodec.h. + +2010-12-04 - r25879 - lavu 50.34.0 - av_get_pix_fmt_string() + Deprecate avcodec_pix_fmt_string() in favor of + pixdesc.h/av_get_pix_fmt_string(). + +2010-12-04 - r25878 - lavcore 0.15.0 - av_image_alloc() + Add av_image_alloc() to libavcore/imgutils.h. + +2010-12-02 - r25862 - lavfi 1.67.0 - avfilter_graph_create_filter() + Add function avfilter_graph_create_filter() in avfiltergraph.h. + +2010-11-25 - r25826 - lavfi 1.65.0 - avfilter_get_video_buffer_ref_from_arrays() + Add function avfilter_get_video_buffer_ref_from_arrays() in + avfilter.h. + +2010-11-21 - r25787 - lavcore 0.14.0 - audioconvert.h + Add a public audio channel API in audioconvert.h, and deprecate the + corresponding functions in libavcodec: + avcodec_get_channel_name() + avcodec_get_channel_layout() + avcodec_get_channel_layout_string() + avcodec_channel_layout_num_channels() + and the CH_* macros defined in libavcodec/avcodec.h. + +2010-11-21 - r25777 - lavf 52.85.0 - avformat.h + Add av_append_packet(). + +2010-11-21 - r25776 - lavc 52.97.0 - avcodec.h + Add av_grow_packet(). + +2010-11-17 - r25761 - lavcore 0.13.0 - parseutils.h + Add av_parse_color() declared in libavcore/parseutils.h. + +2010-11-13 - r25745 - lavc 52.95.0 - AVCodecContext + Add AVCodecContext.subtitle_header and AVCodecContext.subtitle_header_size + fields. + +2010-11-13 - r25740 - lavfi 1.62.0 - avfiltergraph.h + Make avfiltergraph.h public. + +2010-11-13 - r25737 - lavfi 1.61.0 - avfiltergraph.h + Remove declarations from avfiltergraph.h for the functions: + avfilter_graph_check_validity() + avfilter_graph_config_links() + avfilter_graph_config_formats() + which are now internal. + Use avfilter_graph_config() instead. + +2010-11-08 - r25708 - lavu 50.33.0 - eval.h + Deprecate functions: + av_parse_and_eval_expr(), + av_parse_expr(), + av_eval_expr(), + av_free_expr(), + in favor of the functions: + av_expr_parse_and_eval(), + av_expr_parse(), + av_expr_eval(), + av_expr_free(). + +2010-11-08 - r25707 - lavfi 1.59.0 - avfilter_free() + Rename avfilter_destroy() to avfilter_free(). + This change breaks libavfilter API/ABI. + +2010-11-07 - r25705 - lavfi 1.58.0 - avfiltergraph.h + Remove graphparser.h header, move AVFilterInOut and + avfilter_graph_parse() declarations to libavfilter/avfiltergraph.h. + +2010-11-07 - r25700 - lavfi 1.57.0 - AVFilterInOut + Rename field AVFilterInOut.filter to AVFilterInOut.filter_ctx. + This change breaks libavfilter API. + +2010-11-04 - r25674 - lavfi 1.56.0 - avfilter_graph_free() + Rename avfilter_graph_destroy() to avfilter_graph_free(). + This change breaks libavfilter API/ABI. + +2010-11-04 - r25673 - lavfi 1.55.0 - avfilter_graph_alloc() + Add avfilter_graph_alloc() to libavfilter/avfiltergraph.h. + +2010-11-02 - r25654 - lavcore 0.12.0 - av_get_bits_per_sample_fmt() + Add av_get_bits_per_sample_fmt() to libavcore/samplefmt.h and + deprecate av_get_bits_per_sample_format(). + +2010-11-02 - r25653 - lavcore 0.11.0 - samplefmt.h + Add sample format functions in libavcore/samplefmt.h: + av_get_sample_fmt_name(), + av_get_sample_fmt(), + av_get_sample_fmt_string(), + and deprecate the corresponding libavcodec/audioconvert.h functions: + avcodec_get_sample_fmt_name(), + avcodec_get_sample_fmt(), + avcodec_sample_fmt_string(). + +2010-11-02 - r25652 - lavcore 0.10.0 - samplefmt.h + Define enum AVSampleFormat in libavcore/samplefmt.h, deprecate enum + SampleFormat. + +2010-10-16 - r25502 - lavfi 1.52.0 - avfilter_graph_config() + Add the function avfilter_graph_config() in avfiltergraph.h. + +2010-10-15 - r25493 - lavf 52.83.0 - metadata API + Change demuxers to export metadata in generic format and + muxers to accept generic format. Deprecate the public + conversion API. + +2010-10-10 - r25441 - lavfi 1.49.0 - AVFilterLink.time_base + Add time_base field to AVFilterLink. + +2010-09-27 - r25236 - lavu 50.31.0 - av_set_options_string() + Move av_set_options_string() from libavfilter/parseutils.h to + libavutil/opt.h. + +2010-09-27 - r25227 - lavfi 1.47.0 - AVFilterLink + Make the AVFilterLink fields srcpad and dstpad store the pointers to + the source and destination pads, rather than their indexes. + +2010-09-27 - r25225 - lavu 50.30.0 - av_get_token() + Move av_get_token() from libavfilter/parseutils.h to + libavutil/avstring.h. + +2010-09-26 - r32368 - lsws 0.12.0 - swscale.h + Add the functions sws_alloc_context() and sws_init_context(). + +2010-09-26 - r25210 - lavu 50.29.0 - opt.h + Move libavcodec/opt.h to libavutil/opt.h. + +2010-09-24 - r25174 - lavu 50.28.0 - av_log_set_flags() + Default of av_log() changed due to many problems to the old no repeat + detection. Read the docs of AV_LOG_SKIP_REPEATED in log.h before + enabling it for your app!. + +2010-09-24 - r25167 - lavc 52.90.0 - av_opt_show2() + Deprecate av_opt_show() in favor or av_opt_show2(). + +2010-09-14 - r25120 - lavu 50.27.0 - av_popcount() + Add av_popcount() to libavutil/common.h. + +2010-09-08 - r25076 - lavu 50.26.0 - av_get_cpu_flags() + Add av_get_cpu_flags(). + +2010-09-07 - r25067 - lavcore 0.9.0 - av_image_copy() + Add av_image_copy(). + +2010-09-07 - r25064 - lavcore 0.8.0 - av_image_copy_plane() + Add av_image_copy_plane(). + +2010-09-07 - r25057 - lavcore 0.7.0 - imgutils.h + Adopt hierarchical scheme for the imgutils.h function names, + deprecate the old names. + +2010-09-04 - r25040 - lavu 50.25.0 - AV_CPU_FLAG_* + Deprecate the FF_MM_* flags defined in libavcodec/avcodec.h in favor + of the AV_CPU_FLAG_* flags defined in libavutil/cpu.h. + +2010-08-26 - r24936 - lavc 52.87.0 - avcodec_get_channel_layout() + Add avcodec_get_channel_layout() in audioconvert.h. + +2010-08-20 - r24851 - lavcore 0.6.0 - av_fill_image_max_pixsteps() + Rename av_fill_image_max_pixstep() to av_fill_image_max_pixsteps(). + +2010-08-18 - r24827 - lavcore 0.5.0 - av_fill_image_max_pixstep() + Add av_fill_image_max_pixstep() in imgutils.h. + +2010-08-17 - r24814 - lavu 50.24.0 - AV_NE() + Add the AV_NE macro. + +2010-08-17 - r24811 - lavfi 1.36.0 - audio framework + Implement AVFilterBufferRefAudioProps struct for audio properties, + get_audio_buffer(), filter_samples() functions and related changes. + +2010-08-12 - r24787 - lavcore 0.4.0 - av_get_image_linesize() + Add av_get_image_linesize() in imgutils.h. + +2010-08-11 - r24773 - lavfi 1.34.0 - AVFilterBufferRef + Resize data and linesize arrays in AVFilterBufferRef to 8. + + This change breaks libavfilter API/ABI. + +2010-08-11 - r24768 - lavc 52.85.0 - av_picture_data_copy() + Add av_picture_data_copy in avcodec.h. + +2010-08-11 - r24765 - lavfi 1.33.0 - avfilter_open() + Change avfilter_open() signature: + AVFilterContext *avfilter_open(AVFilter *filter, const char *inst_name) -> + int avfilter_open(AVFilterContext **filter_ctx, AVFilter *filter, const char *inst_name); + + This change breaks libavfilter API/ABI. + +2010-08-11 - r24763 - lavfi 1.32.0 - AVFilterBufferRef + Add a type field to AVFilterBufferRef, and move video specific + properties to AVFilterBufferRefVideoProps. + + This change breaks libavfilter API/ABI. + +2010-08-07 - r24732 - lavfi 1.31.0 - AVFilterLink + Rename AVFilterLink fields: + AVFilterLink.srcpic -> AVFilterLink.src_buf + AVFilterLink.cur_pic -> AVFilterLink.cur_buf + AVFilterLink.outpic -> AVFilterLink.out_buf + +2010-08-07 - r24731 - lavfi 1.30.0 + Rename functions and fields: + avfilter_(un)ref_pic -> avfilter_(un)ref_buffer + avfilter_copy_picref_props -> avfilter_copy_buffer_ref_props + AVFilterBufferRef.pic -> AVFilterBufferRef.buffer + +2010-08-07 - r24730 - lavfi 1.29.0 - AVFilterBufferRef + Rename AVFilterPicRef to AVFilterBufferRef. + +2010-08-07 - r24728 - lavfi 1.28.0 - AVFilterBuffer + Move format field from AVFilterBuffer to AVFilterPicRef. + +2010-08-06 - r24709 - lavcore 0.3.0 - av_check_image_size() + Deprecate avcodec_check_dimensions() in favor of the function + av_check_image_size() defined in libavcore/imgutils.h. + +2010-07-30 - r24592 - lavfi 1.27.0 - AVFilterBuffer + Increase size of the arrays AVFilterBuffer.data and + AVFilterBuffer.linesize from 4 to 8. + + This change breaks libavfilter ABI. + +2010-07-29 - r24583 - lavcore 0.2.0 - imgutils.h + Add functions av_fill_image_linesizes() and + av_fill_image_pointers(), declared in libavcore/imgutils.h. + +2010-07-27 - r24518 - lavcore 0.1.0 - parseutils.h + Deprecate av_parse_video_frame_size() and av_parse_video_frame_rate() + defined in libavcodec in favor of the newly added functions + av_parse_video_size() and av_parse_video_rate() declared in + libavcore/parseutils.h. + +2010-07-23 - r24439 - lavu 50.23.0 - mathematics.h + Add the M_PHI constant definition. + +2010-07-22 - r24424 - lavfi 1.26.0 - media format generalization + Add a type field to AVFilterLink. + + Change the field types: + enum PixelFormat format -> int format in AVFilterBuffer + enum PixelFormat *formats -> int *formats in AVFilterFormats + enum PixelFormat *format -> int format in AVFilterLink + + Change the function signatures: + AVFilterFormats *avfilter_make_format_list(const enum PixelFormat *pix_fmts); -> + AVFilterFormats *avfilter_make_format_list(const int *fmts); + + int avfilter_add_colorspace(AVFilterFormats **avff, enum PixelFormat pix_fmt); -> + int avfilter_add_format (AVFilterFormats **avff, int fmt); + + AVFilterFormats *avfilter_all_colorspaces(void); -> + AVFilterFormats *avfilter_all_formats (enum AVMediaType type); + + This change breaks libavfilter API/ABI. + +2010-07-21 - r24393 - lavcore 0.0.0 + Add libavcore. + +2010-07-17 - r24291 - lavfi 1.25.0 - AVFilterBuffer + Remove w and h fields from AVFilterBuffer. + +2010-07-17 - r24284 - lavfi 1.24.0 - AVFilterBuffer + Rename AVFilterPic to AVFilterBuffer. + +2010-07-17 - r24278 - lavf 52.74.0 - url_fskip() + Make url_fskip() return an int error code instead of void. + 2010-07-11 - r24199 - lavc 52.83.0 Add AVCodecContext.lpc_type and AVCodecContext.lpc_passes fields. Add AVLPCType enum. diff --git a/lib/ffmpeg/doc/bitstream_filters.texi b/lib/ffmpeg/doc/bitstream_filters.texi new file mode 100644 index 0000000000..1ad67cd5ef --- /dev/null +++ b/lib/ffmpeg/doc/bitstream_filters.texi @@ -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 diff --git a/lib/ffmpeg/doc/build_system.txt b/lib/ffmpeg/doc/build_system.txt new file mode 100644 index 0000000000..b22ff8487d --- /dev/null +++ b/lib/ffmpeg/doc/build_system.txt @@ -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 diff --git a/lib/ffmpeg/doc/demuxers.texi b/lib/ffmpeg/doc/demuxers.texi new file mode 100644 index 0000000000..05316ce5cd --- /dev/null +++ b/lib/ffmpeg/doc/demuxers.texi @@ -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 diff --git a/lib/ffmpeg/doc/developer.texi b/lib/ffmpeg/doc/developer.texi index edce7ea63a..b9e246f214 100644 --- a/lib/ffmpeg/doc/developer.texi +++ b/lib/ffmpeg/doc/developer.texi @@ -2,11 +2,12 @@ @settitle Developer Documentation @titlepage -@sp 7 @center @titlefont{Developer Documentation} -@sp 3 @end titlepage +@top + +@contents @chapter Developers Guide @@ -149,9 +150,9 @@ should also be avoided if they don't make the code easier to understand. Also if you have doubts about splitting or not splitting, do not hesitate to ask/discuss it on the developer mailing list. @item - Do not change behavior of the program (renaming options etc) without - first discussing it on the ffmpeg-devel mailing list. Do not remove - functionality from the code. Just improve! + 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. @item @@ -289,8 +290,8 @@ send a reminder by email. Your patch should eventually be dealt with. Did you add a long_name under NULL_IF_CONFIG_SMALL to the AVCodec or AVInputFormat/AVOutputFormat struct? @item - Did you bump the minor version number in @file{avcodec.h} or - @file{avformat.h}? + Did you bump the minor version number (and reset the micro version + number) in @file{avcodec.h} or @file{avformat.h}? @item Did you register it in @file{allcodecs.c} or @file{allformats.c}? @item diff --git a/lib/ffmpeg/doc/eval.texi b/lib/ffmpeg/doc/eval.texi new file mode 100644 index 0000000000..99cd034cdf --- /dev/null +++ b/lib/ffmpeg/doc/eval.texi @@ -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 diff --git a/lib/ffmpeg/doc/faq.texi b/lib/ffmpeg/doc/faq.texi index 3f17738940..100adff312 100644 --- a/lib/ffmpeg/doc/faq.texi +++ b/lib/ffmpeg/doc/faq.texi @@ -2,11 +2,12 @@ @settitle FFmpeg FAQ @titlepage -@sp 7 @center @titlefont{FFmpeg FAQ} -@sp 3 @end titlepage +@top + +@contents @chapter General Questions @@ -20,10 +21,11 @@ request more timely and/or frequent releases unless you are willing to help out creating them. @section I have a problem with an old version of FFmpeg; where should I report it? -Nowhere. Upgrade to the latest release or if there is no recent release upgrade -to Subversion HEAD. You could also try to report it. Maybe you will get lucky and -become the first person in history to get an answer different from "upgrade -to Subversion HEAD". +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 Subversion snapshot. If you +still experience the problem, then you can report it according to the +guidelines in @url{http://ffmpeg.org/bugreports.html}. @section Why doesn't FFmpeg support feature [xyz]? @@ -44,7 +46,7 @@ Likely reasons @itemize @item We are busy and haven't had time yet to read your report or investigate the issue. -@item You didn't follow bugreports.html. +@item You didn't follow @url{http://ffmpeg.org/bugreports.html}. @item You didn't use Subversion HEAD. @item You reported a segmentation fault without gdb output. @item You describe a problem but not how to reproduce it. @@ -195,19 +197,6 @@ quite logical that there is a small reduction of quality. This is not a bug. Use @file{-} as file name. -@section Why does the chrominance data seem to be sampled at a different time from the luminance data on bt8x8 captures on Linux? - -This is a well-known bug in the bt8x8 driver. For 2.4.26 there is a patch at -(@url{http://svn.ffmpeg.org/michael/trunk/patches/bttv-420-2.4.26.patch?view=co}). This may also -apply cleanly to other 2.4-series kernels. - -@section How do I avoid the ugly aliasing artifacts in bt8x8 captures on Linux? - -Pass 'combfilter=1 lumafilter=1' to the bttv driver. Note though that 'combfilter=1' -will cause somewhat too strong filtering. A fix is to apply (@url{http://svn.ffmpeg.org/michael/trunk/patches/bttv-comb-2.4.26.patch?view=co}) -or (@url{http://svn.ffmpeg.org/michael/trunk/patches/bttv-comb-2.6.6.patch?view=co}) -and pass 'combfilter=2'. - @section -f jpeg doesn't work. Try '-f image2 test%d.jpg'. @@ -233,11 +222,11 @@ default. @item needed stuff -acodec libfaac -vcodec mpeg4 width<=320 height<=240 @item working stuff -4mv, title +mv4, title @item non-working stuff B-frames @item example command line -ffmpeg -i input -acodec libfaac -ab 128kb -vcodec mpeg4 -b 1200kb -mbd 2 -flags +4mv -trellis 2 -aic 2 -cmp 2 -subcmp 2 -s 320x180 -metadata title=X output.mp4 +ffmpeg -i input -acodec libfaac -ab 128kb -vcodec mpeg4 -b 1200kb -mbd 2 -flags +mv4 -trellis 2 -aic 2 -cmp 2 -subcmp 2 -s 320x180 -metadata title=X output.mp4 @end table @section How do I encode videos which play on the PSP? @@ -246,11 +235,11 @@ ffmpeg -i input -acodec libfaac -ab 128kb -vcodec mpeg4 -b 1200kb -mbd 2 -flags @item 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 @item working stuff -4mv, title +mv4, title @item non-working stuff B-frames @item example command line -ffmpeg -i input -acodec libfaac -ab 128kb -vcodec mpeg4 -b 1200kb -ar 24000 -mbd 2 -flags +4mv -trellis 2 -aic 2 -cmp 2 -subcmp 2 -s 368x192 -r 30000/1001 -metadata title=X -f psp output.mp4 +ffmpeg -i input -acodec libfaac -ab 128kb -vcodec mpeg4 -b 1200kb -ar 24000 -mbd 2 -flags +mv4 -trellis 2 -aic 2 -cmp 2 -subcmp 2 -s 368x192 -r 30000/1001 -metadata title=X -f psp output.mp4 @item 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 @item working stuff for H.264 @@ -267,7 +256,7 @@ ffmpeg -i input -acodec libfaac -ab 128kb -ac 2 -ar 48000 -vcodec libx264 -level @section Which are good parameters for encoding high quality MPEG-4? -'-mbd rd -flags +4mv+aic -trellis 2 -cmp 2 -subcmp 2 -g 300 -pass 1/2', +'-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'. @section Which are good parameters for encoding high quality MPEG-1/MPEG-2? @@ -460,8 +449,8 @@ See @url{http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html#faq-32.3} @section 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. +You have to implement a URLProtocol, see @file{libavformat/file.c} in +FFmpeg and @file{libmpdemux/demux_lavf.c} in MPlayer sources. @section I get "No compatible shell script interpreter found." in MSys. @@ -471,18 +460,13 @@ The standard MSys bash (2.04) is broken. You need to install 2.05 or later. The standard MSys install doesn't come with pr. You need to get it from the coreutils package. -@section I tried to pass RTP packets into a decoder, but it doesn't work. - -RTP is a container format like any other, you must first depacketize the -codec frames/samples stored in RTP and then feed to the decoder. - @section Where can I find libav* headers for Pascal/Delphi? see @url{http://www.iversenit.dk/dev/ffmpeg-headers/} @section Where is the documentation about ffv1, msmpeg4, asv1, 4xm? -see @url{http://svn.ffmpeg.org/michael/trunk/docs/} +see @url{http://www.ffmpeg.org/~michael/} @section How do I feed H.263-RTP (and other codecs in RTP) to libavcodec? diff --git a/lib/ffmpeg/doc/ffmpeg-doc.texi b/lib/ffmpeg/doc/ffmpeg.texi index 7e3abadbb8..047444ab62 100644 --- a/lib/ffmpeg/doc/ffmpeg-doc.texi +++ b/lib/ffmpeg/doc/ffmpeg.texi @@ -2,11 +2,13 @@ @settitle FFmpeg Documentation @titlepage -@sp 7 @center @titlefont{FFmpeg Documentation} -@sp 3 @end titlepage +@top + +@contents + @chapter Synopsis The generic syntax is: @@ -36,21 +38,26 @@ 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. -* To set the video bitrate of the output file to 64kbit/s: +@itemize +@item +To set the video bitrate of the output file to 64kbit/s: @example ffmpeg -i input.avi -b 64k output.avi @end example -* To force the frame rate of the output file to 24 fps: +@item +To force the frame rate of the output file to 24 fps: @example ffmpeg -i input.avi -r 24 output.avi @end example -* To force the frame rate of the input file (valid for raw formats only) +@item +To force the frame rate of the input file (valid for raw formats only) to 1 fps and the frame rate of the output file to 24 fps: @example ffmpeg -r 1 -i input.m2v -r 24 output.avi @end example +@end itemize The format option may be needed for raw input files. @@ -226,14 +233,13 @@ The following abbreviations are recognized: @item -aspect @var{aspect} Set aspect ratio (4:3, 16:9 or 1.3333, 1.7777). -@item -croptop @var{size} (deprecated - use -vf crop=x:y:width:height instead) -Set top crop band size (in pixels). -@item -cropbottom @var{size} (deprecated - use -vf crop=x:y:width:height instead) -Set bottom crop band size (in pixels). -@item -cropleft @var{size} (deprecated - use -vf crop=x:y:width:height instead) -Set left crop band size (in pixels). -@item -cropright @var{size} (deprecated - use -vf crop=x:y:width:height instead) -Set right crop band size (in pixels). +@item -croptop @var{size} +@item -cropbottom @var{size} +@item -cropleft @var{size} +@item -cropright @var{size} +All the crop options have been removed. Use -vf +crop=width:height:x:y instead. + @item -padtop @var{size} @item -padbottom @var{size} @item -padleft @var{size} @@ -355,8 +361,39 @@ qp offset between P- and B-frames @item -i_qoffset @var{offset} qp offset between P- and I-frames @item -rc_eq @var{equation} -Set rate control equation (@pxref{FFmpeg formula -evaluator}) (default = @code{tex^qComp}). +Set rate control equation (see section "Expression Evaluation") +(default = @code{tex^qComp}). + +When computing the rate control equation expression, besides the +standard functions defined in the section "Expression Evaluation", the +following functions are available: +@table @var +@item bits2qp(bits) +@item qp2bits(qp) +@end table + +and the following constants are available: +@table @var +@item iTex +@item pTex +@item tex +@item mv +@item fCode +@item iCount +@item mcVar +@item var +@item isI +@item isP +@item isB +@item avgQP +@item qComp +@item avgIITex +@item avgPITex +@item avgPPTex +@item avgBPTex +@item avgTex +@end table + @item -rc_override @var{override} rate control override for specific intervals @item -me_method @var{method} @@ -492,10 +529,16 @@ Force video tag/fourcc. @item -qphist Show QP histogram. @item -vbsf @var{bitstream_filter} -Bitstream filters available are "dump_extra", "remove_extra", "noise", "h264_mp4toannexb", "imxdump", "mjpegadump". +Bitstream filters available are "dump_extra", "remove_extra", "noise", "h264_mp4toannexb", "imxdump", "mjpegadump", "mjpeg2jpeg". @example ffmpeg -i h264.mp4 -vcodec copy -vbsf h264_mp4toannexb -an out.h264 @end example +@item -force_key_frames @var{time}[,@var{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. @end table @section Audio Options @@ -504,13 +547,19 @@ ffmpeg -i h264.mp4 -vcodec copy -vbsf h264_mp4toannexb -an out.h264 @item -aframes @var{number} Set the number of audio frames to record. @item -ar @var{freq} -Set the audio sampling frequency (default = 44100 Hz). +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. @item -ab @var{bitrate} Set the audio bitrate in bit/s (default = 64k). @item -aq @var{q} Set the audio quality (codec-specific, VBR). @item -ac @var{channels} -Set the number of audio channels (default = 1). +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. @item -an Disable audio recording. @item -acodec @var{codec} @@ -578,8 +627,29 @@ Set stream mapping from input streams to output streams. Just enumerate the input streams in the order you want them in the output. @var{sync_stream_id} if specified sets the input stream to sync against. -@item -map_meta_data @var{outfile}:@var{infile} -Set meta data information of @var{outfile} from @var{infile}. +@item -map_meta_data @var{outfile}[,@var{metadata}]:@var{infile}[,@var{metadata}] +Set meta data information of @var{outfile} from @var{infile}. Note that those +are file indices (zero-based), not filenames. +Optional @var{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: +@example +ffmpeg -i in.ogg -map_meta_data 0:0,s0 out.mp3 +@end example +@item -map_chapters @var{outfile}:@var{infile} +Copy chapters from @var{infile} to @var{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. @item -debug Print specific debug info. @item -benchmark @@ -607,16 +677,25 @@ Repeatedly loop output for formats that support looping such as animated GIF Thread count. @item -vsync @var{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. + +@table @option +@item 0 +Each frame is passed with its timestamp from the demuxer to the muxer. +@item 1 +Frames will be duplicated and dropped to achieve exactly the requested +constant framerate. +@item 2 +Frames are passed through with their timestamp or dropped so as to +prevent 2 frames from having the same timestamp. +@item -1 +Chooses between 1 and 2 depending on muxer capabilities. This is the +default method. +@end table + +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. + @item -async @var{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. @@ -624,6 +703,8 @@ the parameter is the maximum samples per second by which the audio is changed. without any later correction. @item -copyts Copy timestamps from input to output. +@item -copytb +Copy input stream time base from input to output when stream copying. @item -shortest Finish encoding when the shortest input stream ends. @item -dts_delta_threshold @@ -633,8 +714,10 @@ Set the maximum demux-decode delay. @item -muxpreload @var{seconds} Set the initial demux-decode delay. @item -streamid @var{output-stream-index}:@var{new-value} -Assign a new value to a stream's stream-id field in the next output file. -All stream-id fields are reset to default for each output file. +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: @@ -675,89 +758,8 @@ directories, where @var{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 @code{-vcodec libx264} and use @code{-vpre max}, then it will search for the file @file{libx264-max.ffpreset}. - -@anchor{FFmpeg formula evaluator} -@section FFmpeg formula evaluator - -When evaluating a rate control string, FFmpeg uses an internal formula -evaluator. - -The following binary operators are available: @code{+}, @code{-}, -@code{*}, @code{/}, @code{^}. - -The following unary operators are available: @code{+}, @code{-}, -@code{(...)}. - -The following statements are available: @code{ld}, @code{st}, -@code{while}. - -The following functions are available: -@table @var -@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 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 bits2qp(bits) -@item qp2bits(qp) -@end table - -The following constants are available: -@table @var -@item PI -@item E -@item iTex -@item pTex -@item tex -@item mv -@item fCode -@item iCount -@item mcVar -@item var -@item isI -@item isP -@item isB -@item avgQP -@item qComp -@item avgIITex -@item avgPITex -@item avgPPTex -@item avgBPTex -@item avgTex -@end table - @c man end -@section Protocols - -The file name can be @file{-} to read from standard input or to write -to standard output. - -FFmpeg also handles many protocols specified with an URL syntax. - -Use 'ffmpeg -protocols' to see a list of the supported protocols. - -The protocol @code{http:} is currently used only to communicate with -FFserver (see the FFserver documentation). When FFmpeg will be a -video player it will also be used for streaming :-) - @chapter Tips @c man begin TIPS @@ -827,14 +829,14 @@ standard mixer. FFmpeg can grab the X11 display. @example -ffmpeg -f x11grab -s cif -i :0.0 /tmp/out.mpg +ffmpeg -f x11grab -s cif -r 25 -i :0.0 /tmp/out.mpg @end example 0.0 is display.screen number of your X11 server, same as the DISPLAY environment variable. @example -ffmpeg -f x11grab -s cif -i :0.0+10,20 /tmp/out.mpg +ffmpeg -f x11grab -s cif -r 25 -i :0.0+10,20 /tmp/out.mpg @end example 0.0 is display.screen number of your X11 server, same as the DISPLAY environment @@ -842,11 +844,12 @@ variable. 10 is the x-offset and 20 the y-offset for the grabbing. @section Video and Audio file format conversion -* FFmpeg can use any supported file format and protocol as input: +FFmpeg can use any supported file format and protocol as input: Examples: - -* You can use YUV files as input: +@itemize +@item +You can use YUV files as input: @example ffmpeg -i /tmp/test%d.Y /tmp/out.mpg @@ -863,7 +866,8 @@ raw files, without header. They can be generated by all decent video decoders. You must specify the size of the image with the @option{-s} option if FFmpeg cannot guess it. -* You can input from a raw YUV420P file: +@item +You can input from a raw YUV420P file: @example ffmpeg -i /tmp/test.yuv /tmp/out.avi @@ -873,13 +877,15 @@ test.yuv is a file containing raw YUV planar data. Each frame is composed of the Y plane followed by the U and V planes at half vertical and horizontal resolution. -* You can output to a raw YUV420P file: +@item +You can output to a raw YUV420P file: @example ffmpeg -i mydivx.avi hugefile.yuv @end example -* You can set several input files and output files: +@item +You can set several input files and output files: @example ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg @@ -888,7 +894,8 @@ ffmpeg -i /tmp/a.wav -s 640x480 -i /tmp/a.yuv /tmp/a.mpg Converts the audio file a.wav and the raw YUV video file a.yuv to MPEG file a.mpg. -* You can also do audio and video conversions at the same time: +@item +You can also do audio and video conversions at the same time: @example ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2 @@ -896,7 +903,8 @@ ffmpeg -i /tmp/a.wav -ar 22050 /tmp/a.mp2 Converts a.wav to MPEG audio at 22050 Hz sample rate. -* You can encode to several formats at the same time and define a +@item +You can encode to several formats at the same time and define a mapping from input stream to output streams: @example @@ -907,7 +915,8 @@ Converts a.wav to a.mp2 at 64 kbits and to b.mp2 at 128 kbits. '-map file:index' specifies which input stream is used for each output stream, in the order of the definition of output streams. -* You can transcode decrypted VOBs: +@item +You can transcode decrypted VOBs: @example ffmpeg -i snatch_1.vob -f avi -vcodec mpeg4 -b 800k -g 300 -bf 2 -acodec libmp3lame -ab 128k snatch.avi @@ -924,7 +933,8 @@ to get the desired audio language. NOTE: To see the supported input formats, use @code{ffmpeg -formats}. -* You can extract images from a video, or create a video from many images: +@item +You can extract images from a video, or create a video from many images: For extracting images from a video: @example @@ -949,7 +959,8 @@ composed of three digits padded with zeroes to express the sequence number. It is the same syntax supported by the C printf function, but only formats accepting a normal integer are suitable. -* You can put many streams of the same type in the output: +@item +You can put many streams of the same type in the output: @example ffmpeg -i test1.avi -i test2.avi -vcodec copy -acodec copy -vcodec copy -acodec copy test12.avi -newvideo -newaudio @@ -962,9 +973,19 @@ and the second audio stream found in the input streams list. The @code{-newvideo}, @code{-newaudio} and @code{-newsubtitle} options have to be specified immediately after the name of the output file to which you want to add them. + +@end itemize @c man end EXAMPLES +@include eval.texi +@include demuxers.texi +@include muxers.texi +@include indevs.texi +@include outdevs.texi +@include protocols.texi +@include bitstream_filters.texi @include filters.texi +@include metadata.texi @ignore diff --git a/lib/ffmpeg/doc/ffplay-doc.texi b/lib/ffmpeg/doc/ffplay.texi index 5e8032fb59..e0518b859e 100644 --- a/lib/ffmpeg/doc/ffplay-doc.texi +++ b/lib/ffmpeg/doc/ffplay.texi @@ -2,11 +2,13 @@ @settitle FFplay Documentation @titlepage -@sp 7 @center @titlefont{FFplay Documentation} -@sp 3 @end titlepage +@top + +@contents + @chapter Synopsis @example @@ -153,6 +155,12 @@ Seek to percentage in file corresponding to fraction of width. @c man end +@include eval.texi +@include demuxers.texi +@include muxers.texi +@include indevs.texi +@include outdevs.texi +@include protocols.texi @include filters.texi @ignore diff --git a/lib/ffmpeg/doc/ffprobe-doc.texi b/lib/ffmpeg/doc/ffprobe.texi index a1a11c16fd..de65eee664 100644 --- a/lib/ffmpeg/doc/ffprobe-doc.texi +++ b/lib/ffmpeg/doc/ffprobe.texi @@ -2,11 +2,13 @@ @settitle FFprobe Documentation @titlepage -@sp 7 @center @titlefont{FFprobe Documentation} -@sp 3 @end titlepage +@top + +@contents + @chapter Synopsis The generic syntax is: @@ -50,8 +52,8 @@ keyN=valN @end example 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:''. +and printed in the corresponding "FORMAT" or "STREAM" section, and +are prefixed by the string "TAG:". @c man end @@ -64,9 +66,6 @@ are prefixed by the string ``TAG:''. @table @option -@item -convert_tags -Convert the tag names in the format container to the generic FFmpeg tag names. - @item -f @var{format} Force format to use. @@ -74,8 +73,8 @@ Force format to use. Show the unit of the displayed values. @item -prefix -Show a SI prefixes of the displayed values. -Unless ``-byte_binary_prefix'' option is used all the prefix +Use SI prefixes for the displayed values. +Unless the "-byte_binary_prefix" option is used all the prefixes are decimal. @item -byte_binary_prefix @@ -86,25 +85,37 @@ Use sexagesimal format HH:MM:SS.MICROSECONDS for time values. @item -pretty Prettify the format of the displayed values, it corresponds to the -options ``-unit -prefix -byte_binary_prefix -sexagesimal''. +options "-unit -prefix -byte_binary_prefix -sexagesimal". @item -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''. +name "FORMAT". + +@item -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". @item -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''. +with name "STREAM". @end table @c man end +@include demuxers.texi +@include muxers.texi +@include protocols.texi +@include indevs.texi + @ignore @setfilename ffprobe diff --git a/lib/ffmpeg/doc/ffserver-doc.texi b/lib/ffmpeg/doc/ffserver.texi index 77deb85317..0cab3c8a98 100644 --- a/lib/ffmpeg/doc/ffserver-doc.texi +++ b/lib/ffmpeg/doc/ffserver.texi @@ -2,11 +2,13 @@ @settitle FFserver Documentation @titlepage -@sp 7 @center @titlefont{FFserver Documentation} -@sp 3 @end titlepage +@top + +@contents + @chapter Synopsys The generic syntax is: diff --git a/lib/ffmpeg/doc/fftools-common-opts.texi b/lib/ffmpeg/doc/fftools-common-opts.texi index 618441e045..d72ca5cc00 100644 --- a/lib/ffmpeg/doc/fftools-common-opts.texi +++ b/lib/ffmpeg/doc/fftools-common-opts.texi @@ -84,6 +84,10 @@ Set the logging level used by the library. 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 @env{NO_COLOR}. +can be disabled setting the environment variable +@env{FFMPEG_FORCE_NOCOLOR} or @env{NO_COLOR}, or can be forced setting +the environment variable @env{FFMPEG_FORCE_COLOR}. +The use of the environment variable @env{NO_COLOR} is deprecated and +will be dropped in a following FFmpeg version. @end table diff --git a/lib/ffmpeg/doc/filters.texi b/lib/ffmpeg/doc/filters.texi index cd4364a786..3842886521 100644 --- a/lib/ffmpeg/doc/filters.texi +++ b/lib/ffmpeg/doc/filters.texi @@ -1,3 +1,157 @@ +@chapter Filtergraph description +@c man begin 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". + +@section Filtergraph syntax + +A filtergraph can be represented using a textual representation, which +is recognized by the @code{-vf} and @code{-af} options of the ff* +tools, and by the @code{av_parse_graph()} function defined in +@file{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: +[@var{in_link_1}]...[@var{in_link_N}]@var{filter_name}=@var{arguments}[@var{out_link_1}]...[@var{out_link_M}] + +@var{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 +"=@var{arguments}". + +@var{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 @var{in_link_1} +... @var{in_link_N}, are associated to the filter input pads, +the following labels @var{out_link_1} ... @var{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: +@example +nullsrc, split[L1], [L2]overlay, nullsink +@end example +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: +@example +@var{NAME} ::= sequence of alphanumeric characters and '_' +@var{LINKLABEL} ::= "[" @var{NAME} "]" +@var{LINKLABELS} ::= @var{LINKLABEL} [@var{LINKLABELS}] +@var{FILTER_ARGUMENTS} ::= sequence of chars (eventually quoted) +@var{FILTER} ::= [@var{LINKNAMES}] @var{NAME} ["=" @var{ARGUMENTS}] [@var{LINKNAMES}] +@var{FILTERCHAIN} ::= @var{FILTER} [,@var{FILTERCHAIN}] +@var{FILTERGRAPH} ::= @var{FILTERCHAIN} [;@var{FILTERGRAPH}] +@end example + +@c man end FILTERGRAPH DESCRIPTION + +@chapter Audio Filters +@c man begin 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. + +@section anull + +Pass the audio source unchanged to the output. + +@c man end AUDIO FILTERS + +@chapter Audio Sources +@c man begin AUDIO SOURCES + +Below is a description of the currently available audio sources. + +@section 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 +@var{sample_rate}:@var{channel_layout}. + +@var{sample_rate} specify the sample rate, and defaults to 44100. + +@var{channel_layout} specify the channel layout, and can be either an +integer or a string representing a channel layout. The default value +of @var{channel_layout} is 3, which corresponds to CH_LAYOUT_STEREO. + +Check the channel_layout_map definition in +@file{libavcodec/audioconvert.c} for the mapping between strings and +channel layout values. + +Follow some examples: +@example +# set the sample rate to 48000 Hz and the channel layout to CH_LAYOUT_MONO. +anullsrc=48000:4 + +# same as +anullsrc=48000:mono +@end example + +@c man end AUDIO SOURCES + +@chapter Audio Sinks +@c man begin AUDIO SINKS + +Below is a description of the currently available audio sinks. + +@section 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. + +@c man end AUDIO SINKS + @chapter Video Filters @c man begin VIDEO FILTERS @@ -8,36 +162,205 @@ build. Below is a description of the currently available video filters. +@section 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: +@example +blackframe[=@var{amount}:[@var{threshold}]] +@end example + +@var{amount} is the percentage of the pixels that have to be below the +threshold, and defaults to 98. + +@var{threshold} is the threshold below which a pixel value is +considered black, and defaults to 32. + +@section copy + +Copy the input source unchanged to the output. Mainly useful for +testing purposes. + @section crop -Crop the input video to @var{x}:@var{y}:@var{width}:@var{height}. +Crop the input video to @var{out_w}:@var{out_h}:@var{x}:@var{y}. + +The parameters are expressions containing the following constants: + +@table @option +@item E, PI, PHI +the corresponding mathematical approximated values for e +(euler number), pi (greek PI), PHI (golden ratio) + +@item x, y +the computed values for @var{x} and @var{y}. They are evaluated for +each new frame. + +@item in_w, in_h +the input width and heigth + +@item iw, ih +same as @var{in_w} and @var{in_h} + +@item out_w, out_h +the output (cropped) width and heigth + +@item ow, oh +same as @var{out_w} and @var{out_h} + +@item n +the number of input frame, starting from 0 + +@item pos +the position in the file of the input frame, NAN if unknown + +@item t +timestamp expressed in seconds, NAN if the input timestamp is unknown + +@end table + +The @var{out_w} and @var{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 @var{out_w} is "in_w", and the default value of +@var{out_h} is "in_h". + +The expression for @var{out_w} may depend on the value of @var{out_h}, +and the expression for @var{out_h} may depend on @var{out_w}, but they +cannot depend on @var{x} and @var{y}, as @var{x} and @var{y} are +evaluated after @var{out_w} and @var{out_h}. + +The @var{x} and @var{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 @var{x} is "(in_w-out_w)/2", and the default +value for @var{y} is "(in_h-out_h)/2", which set the cropped area at +the center of the input image. + +The expression for @var{x} may depend on @var{y}, and the expression +for @var{y} may depend on @var{x}. + +Follow some examples: +@example +# 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)" +@end example + +@section 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: @example -./ffmpeg -i in.avi -vf "crop=0:0:0:240" out.avi +cropdetect[=@var{limit}[:@var{round}[:@var{reset}]]] @end example -@var{x} and @var{y} specify the position of the top-left corner of the -output (non-cropped) area. +@table @option -The default value of @var{x} and @var{y} is 0. +@item limit +Threshold, which can be optionally specified from nothing (0) to +everything (255), defaults to 24. + +@item 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. -The @var{width} and @var{height} parameters specify the width and height -of the output (non-cropped) area. +@item 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. -A value of 0 is interpreted as the maximum possible size contained in -the area delimited by the top-left corner at position x:y. +This can be useful when channel logos distort the video area. 0 +indicates never reset and return the largest area encountered during +playback. +@end table + +@section drawbox -For example the parameters: +Draw a colored box on the input image. +It accepts the syntax: @example -"crop=100:100:0:0" +drawbox=@var{x}:@var{y}:@var{width}:@var{height}:@var{color} @end example -will 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. +@table @option -The default value of @var{width} and @var{height} is 0. +@item x, y +Specify the top left corner coordinates of the box. Default to 0. + +@item width, height +Specify the width and height of the box, if 0 they are interpreted as +the input width and height. Default to 0. + +@item 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. +@end table + +Follow some examples: +@example +# 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" +@end example + +@section 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. @section format @@ -45,37 +368,312 @@ 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''. +The filter accepts a list of pixel format names, separated by ":", +for example "yuv420p:monow:rgb24". -The following command: +Some examples follow: +@example +# 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 +@end example + +@anchor{frei0r} +@section 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: @example -./ffmpeg -i in.avi -vf "format=yuv420p" out.avi +@var{filter_name}[@{:|=@}@var{param1}:@var{param2}:...:@var{paramN}] @end example -will convert the input video to the format ``yuv420p''. +@var{filter_name} is the name to the frei0r effect to load. If the +environment variable @env{FREI0R_PATH} is defined, the frei0r effect +is searched in each one of the directories specified by the colon +separated list in @env{FREIOR_PATH}, otherwise in the standard frei0r +paths, which are in this order: @file{HOME/.frei0r-1/lib/}, +@file{/usr/local/lib/frei0r-1/}, @file{/usr/lib/frei0r-1/}. + +@var{param1}, @var{param2}, ... , @var{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 +@var{R}/@var{G}/@var{B}, @var{R}, @var{G}, and @var{B} being float +numbers from 0.0 to 1.0) or by an @code{av_parse_color()} color +description), a position (specified by the syntax @var{X}/@var{Y}, +@var{X} and @var{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: +@example +# 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 +@end example + +For more information see: +@url{http://piksel.org/frei0r} + +@section 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. + +The filter takes two optional parameters, separated by ':': +@var{strength}:@var{radius} + +@var{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. + +@var{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. + +@example +# default parameters +gradfun=1.2:16 + +# omitting radius +gradfun=1.2 +@end example + +@section hflip + +Flip the input video horizontally. + +For example to horizontally flip the video in input with +@file{ffmpeg}: +@example +ffmpeg -i in.avi -vf "hflip" out.avi +@end example + +@section 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: +@var{luma_spatial}:@var{chroma_spatial}:@var{luma_tmp}:@var{chroma_tmp} + +@table @option +@item luma_spatial +a non-negative float number which specifies spatial luma strength, +defaults to 4.0 + +@item chroma_spatial +a non-negative float number which specifies spatial chroma strength, +defaults to 3.0*@var{luma_spatial}/4.0 + +@item luma_tmp +a float number which specifies luma temporal strength, defaults to +6.0*@var{luma_spatial}/4.0 + +@item chroma_tmp +a float number which specifies chroma temporal strength, defaults to +@var{luma_tmp}*@var{chroma_spatial}/@var{luma_spatial} +@end table @section 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''. +The filter accepts a list of pixel format names, separated by ":", +for example "yuv420p:monow:rgb24". + +Some examples follow: +@example +# 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 +@end example + +@section null + +Pass the video source unchanged to the output. + +@section ocv + +Apply video transform using libopencv. + +To enable this filter install libopencv library and headers and +configure FFmpeg with --enable-libopencv. -The following command: +The filter takes the parameters: @var{filter_name}@{:=@}@var{filter_params}. +@var{filter_name} is the name of the libopencv filter to apply. + +@var{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: +@url{http://opencv.willowgarage.com/documentation/c/image_filtering.html} + +Follows the list of supported libopencv filters. + +@anchor{dilate} +@subsection dilate + +Dilate an image by using a specific structuring element. +This filter corresponds to the libopencv function @code{cvDilate}. + +It accepts the parameters: @var{struct_el}:@var{nb_iterations}. + +@var{struct_el} represents a structuring element, and has the syntax: +@var{cols}x@var{rows}+@var{anchor_x}x@var{anchor_y}/@var{shape} + +@var{cols} and @var{rows} represent the number of colums and rows of +the structuring element, @var{anchor_x} and @var{anchor_y} the anchor +point, and @var{shape} the shape for the structuring element, and +can be one of the values "rect", "cross", "ellipse", "custom". + +If the value for @var{shape} is "custom", it must be followed by a +string of the form "=@var{filename}". The file with name +@var{filename} is assumed to represent a binary image, with each +printable character corresponding to a bright pixel. When a custom +@var{shape} is used, @var{cols} and @var{rows} are ignored, the number +or columns and rows of the read file are assumed instead. + +The default value for @var{struct_el} is "3x3+0x0/rect". + +@var{nb_iterations} specifies the number of times the transform is +applied to the image, and defaults to 1. + +Follow some example: @example -./ffmpeg -i in.avi -vf "noformat=yuv420p, vflip" out.avi +# 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 @end example -will make libavfilter use a format different from ``yuv420p'' for the -input to the vflip filter. +@subsection erode -@section null +Erode an image by using a specific structuring element. +This filter corresponds to the libopencv function @code{cvErode}. + +The filter accepts the parameters: @var{struct_el}:@var{nb_iterations}, +with the same meaning and use of those of the dilate filter +(@pxref{dilate}). + +@subsection smooth + +Smooth the input video. + +The filter takes the following parameters: +@var{type}:@var{param1}:@var{param2}:@var{param3}:@var{param4}. + +@var{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". + +@var{param1}, @var{param2}, @var{param3}, and @var{param4} are +parameters whose meanings depend on smooth type. @var{param1} and +@var{param2} accept integer positive values or 0, @var{param3} and +@var{param4} accept float values. + +The default value for @var{param1} is 3, the default value for the +other parameters is 0. -Pass the source unchanged to the output. +These parameters correspond to the parameters assigned to the +libopencv function @code{cvSmooth}. + +@section 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: @var{x}:@var{y}. + +@var{x} is the x coordinate of the overlayed video on the main video, +@var{y} is the y coordinate. The parameters are expressions containing +the following parameters: + +@table @option +@item main_w, main_h +main input width and height + +@item W, H +same as @var{main_w} and @var{main_h} + +@item overlay_w, overlay_h +overlay input width and height + +@item w, h +same as @var{overlay_w} and @var{overlay_h} +@end table + +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 @var{setpts=PTS-STARTPTS} filter to +have them begin in the same zero timestamp, as it does the example for +the @var{movie} filter. + +Follow some examples: +@example +# 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=0:png: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=0:png:logo1.png [logo1]; +movie=0:png: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] +@end example + +You can chain togheter more overlays but the efficiency of such +approach is yet to be tested. @section pad @@ -108,10 +706,19 @@ The default value of @var{x} and @var{y} is 0. 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 @var{color} is ``black''. +The default value of @var{color} is "black". @end table +For example: + +@example +# 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 +# row 0, column 40. +pad=640:480:0:40:violet +@end example + @section pixdesctest Pixel format descriptor test filter, mainly useful for internal @@ -149,6 +756,96 @@ ratio of the input image. The default value of @var{width} and @var{height} is 0. +@section 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: + +@table @option +@item PTS +the presentation timestamp in input + +@item PI +Greek PI + +@item PHI +golden ratio + +@item E +Euler number + +@item N +the count of the input frame, starting from 0. + +@item STARTPTS +the PTS of the first video frame + +@item INTERLACED +tell if the current frame is interlaced + +@item POS +original position in the file of the frame, or undefined if undefined +for the current frame + +@item PREV_INPTS +previous input PTS + +@item PREV_OUTPTS +previous output PTS + +@end table + +Some examples follow: + +@example +# 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))' +@end example + +@section 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. + +@example +# 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 +@end example + @section slicify Pass the images of input video on to next video filter as multiple @@ -164,6 +861,47 @@ 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. +@section 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: + +@table @samp +@item 0 +Rotate by 90 degrees counterclockwise and vertically flip (default), that is: +@example +L.R L.l +. . -> . . +l.r R.r +@end example + +@item 1 +Rotate by 90 degrees clockwise, that is: +@example +L.R l.L +. . -> . . +l.r r.R +@end example + +@item 2 +Rotate by 90 degrees counterclockwise, that is: +@example +L.R R.r +. . -> . . +l.r L.l +@end example + +@item 3 +Rotate by 90 degrees clockwise and vertically flip, that is: +@example +L.R r.R +. . -> . . +l.r l.L +@end example +@end table + @section unsharp Sharpen or blur the input video. @@ -222,6 +960,45 @@ Flip the input video vertically. ./ffmpeg -i in.avi -vf "vflip" out.avi @end example +@section yadif + +Deinterlace the input video ("yadif" means "yet another deinterlacing +filter"). + +It accepts the optional parameters: @var{mode}:@var{parity}. + +@var{mode} specifies the interlacing mode to adopt, accepts one of the +following values: + +@table @option +@item 0 +output 1 frame for each frame +@item 1 +output 1 frame for each field +@item 2 +like 0 but skips spatial interlacing check +@item 3 +like 1 but skips spatial interlacing check +@end table + +Default value is 0. + +@var{parity} specifies the picture field parity assumed for the input +interlaced video, accepts one of the following values: + +@table @option +@item 0 +assume bottom field first +@item 1 +assume top field first +@item -1 +enable automatic detection +@end table + +Default value is -1. +If interlacing is unknown or decoder does not export this information, +top field first will be assumed. + @c man end VIDEO FILTERS @chapter Video Sources @@ -229,17 +1006,131 @@ Flip the input video vertically. Below is a description of the currently available video sources. +@section 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 @file{libavfilter/vsrc_buffer.h}. + +It accepts the following parameters: +@var{width}:@var{height}:@var{pix_fmt_string}:@var{timebase_num}:@var{timebase_den} + +All the parameters need to be explicitely defined. + +Follows the list of the accepted parameters. + +@table @option + +@item width, height +Specify the width and height of the buffered video frames. + +@item 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. + +@item timebase_num, timebase_den +Specify numerator and denomitor of the timebase assumed by the +timestamps of the buffered frames. +@end table + +For example: +@example +buffer=320:240:yuv410p:1:24 +@end example + +will instruct the source to accept video frames with size 320x240 and +with format "yuv410p" and assuming 1/24 as the timestamps timebase. +Since the pixel format with name "yuv410p" corresponds to the number 6 +(check the enum PixelFormat definition in @file{libavutil/pixfmt.h}), +this example corresponds to: +@example +buffer=320:240:6:1:24 +@end example + +@section color + +Provide an uniformly colored input. + +It accepts the following parameters: +@var{color}:@var{frame_size}:@var{frame_rate} + +Follows the description of the accepted parameters. + +@table @option + +@item 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". + +@item frame_size +Specify the size of the sourced video, it may be a string of the form +@var{width}x@var{heigth}, or the name of a size abbreviation. The +default value is "320x240". + +@item 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 +@var{frame_rate_num}/@var{frame_rate_den}, an integer number, a float +number or a valid video frame rate abbreviation. The default value is +"25". + +@end table + +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". + +@example +"color=red@@0.2:qcif:10 [color]; [in][color] overlay [out]" +@end example + @section 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 -@var{width}:@var{height}, where @var{width} and @var{height} specify the size of -the configured source. +@var{width}:@var{height}:@var{timebase}. + +@var{width} and @var{height} specify the size of the configured +source. The default values of @var{width} and @var{height} are +respectively 352 and 288 (corresponding to the CIF size format). + +@var{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". -The default values of @var{width} and @var{height} are respectively 352 -and 288 (corresponding to the CIF size format). +@section 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: +@example +@var{size}:@var{rate}:@var{src_name}[@{=|:@}@var{param1}:@var{param2}:...:@var{paramN}] +@end example + +@var{size} is the size of the video to generate, may be a string of the +form @var{width}x@var{height} or a frame size abbreviation. +@var{rate} is the rate of the video to generate, may be a string of +the form @var{num}/@var{den} or a frame rate abbreviation. +@var{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" (@pxref{frei0r}) in the description of the video +filters. + +Some examples follow: +@example +# 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 +@end example @c man end VIDEO SOURCES diff --git a/lib/ffmpeg/doc/general.texi b/lib/ffmpeg/doc/general.texi index 0154b79654..950159f1b3 100644 --- a/lib/ffmpeg/doc/general.texi +++ b/lib/ffmpeg/doc/general.texi @@ -2,11 +2,12 @@ @settitle General Documentation @titlepage -@sp 7 @center @titlefont{General Documentation} -@sp 3 @end titlepage +@top + +@contents @chapter external libraries @@ -49,6 +50,7 @@ library: @item American Laser Games MM @tab @tab X @tab Multimedia format used in games like Mad Dog McCree. @item 3GPP AMR @tab X @tab X +@item Apple HTTP Live Streaming @tab @tab X @item ASF @tab X @tab X @item AVI @tab X @tab X @item AVISynth @tab @tab X @@ -109,15 +111,20 @@ library: @tab Format used in various Interplay computer games. @item IV8 @tab @tab X @tab A format generated by IndigoVision 8000 video server. -@item IVF (On2) @tab @tab X +@item IVF (On2) @tab X @tab X @tab A format used by libvpx @item LMLM4 @tab @tab X @tab Used by Linux Media Labs MPEG-4 PCI boards +@item LXF @tab @tab X + @tab VR native stream format, used by Leitch/Harris' video servers. @item Matroska @tab X @tab X @item Matroska audio @tab X @tab +@item FFmpeg metadata @tab X @tab X + @tab Metadata in text format. @item MAXIS XA @tab @tab X @tab Used in Sim City 3000; file extension .xa. @item MD Studio @tab @tab X +@item Mobotix .mxg @tab @tab X @item Monkey's Audio @tab @tab X @item Motion Pixels MVI @tab @tab X @item MOV/QuickTime/MP4 @tab X @tab X @@ -156,7 +163,7 @@ library: @item QCP @tab @tab X @item raw ADTS (AAC) @tab X @tab X @item raw AC-3 @tab X @tab X -@item raw Chinese AVS video @tab @tab X +@item raw Chinese AVS video @tab X @tab X @item raw CRI ADX @tab X @tab X @item raw Dirac @tab X @tab X @item raw DNxHD @tab X @tab X @@ -209,10 +216,12 @@ library: @item RL2 @tab @tab X @tab Audio and video format used in some games by Entertainment Software Partners. @item RPL/ARMovie @tab @tab X +@item Lego Mindstorms RSO @tab X @tab X @item RTMP @tab X @tab X @tab Output is performed by publishing stream to RTMP server -@item RTP @tab @tab X +@item RTP @tab X @tab X @item RTSP @tab X @tab X +@item SAP @tab X @tab X @item SDP @tab @tab X @item Sega FILM/CPK @tab @tab X @tab Used in many Sega Saturn console games. @@ -228,6 +237,7 @@ library: @item Sony Wave64 (W64) @tab @tab X @item SoX native format @tab X @tab X @item SUN AU format @tab X @tab X +@item Text files @tab @tab X @item THP @tab @tab X @tab Used on the Nintendo GameCube. @item Tiertex Limited SEQ @tab @tab X @@ -237,6 +247,7 @@ library: @item WAV @tab X @tab X @item WavPack @tab @tab X @item WebM @tab X @tab X +@item Windows Televison (WTV) @tab @tab X @item Wing Commander III movie @tab @tab X @tab Multimedia format used in Origin's Wing Commander III computer game. @item Westwood Studios audio @tab @tab X @@ -312,10 +323,13 @@ following image formats are supported: @item 8088flex TMV @tab @tab X @item 8SVX exponential @tab @tab X @item 8SVX fibonacci @tab @tab X +@item A64 multicolor @tab X @tab + @tab Creates video suitable to be played on a commodore 64 (multicolor mode). @item American Laser Games MM @tab @tab X @tab Used in games like Mad Dog McCree. @item AMV Video @tab @tab X @tab Used in Chinese MP3 players. +@item ANSI/ASCII art @tab @tab X @item Apple MJPEG-B @tab @tab X @item Apple QuickDraw @tab @tab X @tab fourcc: qdrw @@ -347,8 +361,8 @@ following image formats are supported: @tab fourcc: CSCD @item CD+G @tab @tab X @tab Video codec for CD+G karaoke disks -@item Chinese AVS video @tab @tab X - @tab AVS1-P2, JiZhun profile +@item Chinese AVS video @tab E @tab X + @tab AVS1-P2, JiZhun profile, encoding through external library libxavs @item Delphine Software International CIN video @tab @tab X @tab Codec used in Delphine Software International games. @item Cinepak @tab @tab X @@ -411,6 +425,7 @@ following image formats are supported: @tab Codec used in Worms games. @item Kega Game Video (KGV1) @tab @tab X @tab Kega emulator screen capture codec. +@item Lagarith @tab @tab X @item LCL (LossLess Codec Library) MSZH @tab @tab X @item LCL (LossLess Codec Library) ZLIB @tab E @tab E @item LOCO @tab @tab X @@ -429,7 +444,7 @@ following image formats are supported: @item MPEG-2 video @tab X @tab X @item MPEG-4 part 2 @tab X @tab X @ libxvidcore can be used alternatively for encoding. -@item MPEG-4 part 2 Microsoft variant version 1 @tab X @tab X +@item MPEG-4 part 2 Microsoft variant version 1 @tab @tab X @item MPEG-4 part 2 Microsoft variant version 2 @tab X @tab X @item MPEG-4 part 2 Microsoft variant version 3 @tab X @tab X @item Nintendo Gamecube THP video @tab @tab X @@ -454,6 +469,7 @@ following image formats are supported: @tab fourcc: 'smc ' @item QuickTime video (RPZA) @tab @tab X @tab fourcc: rpza +@item R10K AJA Kona 10-bit RGB Codec @tab @tab X @item R210 Quicktime Uncompressed RGB 10-bit @tab @tab X @item Raw Video @tab X @tab X @item RealVideo 1.0 @tab X @tab X @@ -529,6 +545,7 @@ following image formats are supported: @item ADPCM Electronic Arts R2 @tab @tab X @item ADPCM Electronic Arts R3 @tab @tab X @item ADPCM Electronic Arts XAS @tab @tab X +@item ADPCM G.722 @tab X @tab X @item ADPCM G.726 @tab X @tab X @item ADPCM IMA AMV @tab @tab X @tab Used in AMV files @@ -562,8 +579,7 @@ following image formats are supported: @item ADPCM Yamaha @tab X @tab X @item AMR-NB @tab E @tab X @tab encoding supported through external library libopencore-amrnb -@item AMR-WB @tab @tab E - @tab decoding supported through external library libopencore-amrwb +@item AMR-WB @tab @tab X @item Apple lossless audio @tab X @tab X @tab QuickTime fourcc 'alac' @item Atrac 1 @tab @tab X @@ -588,7 +604,6 @@ following image formats are supported: @item DV audio @tab @tab X @item Enhanced AC-3 @tab @tab X @item FLAC (Free Lossless Audio Codec) @tab X @tab IX -@item G.729 @tab @tab X @item GSM @tab E @tab X @tab encoding supported through external library libgsm @item GSM Microsoft variant @tab E @tab X @@ -677,10 +692,11 @@ performance on systems without hardware floating point support). @multitable @columnfractions .4 .1 .1 .1 .1 @item Name @tab Muxing @tab Demuxing @tab Encoding @tab Decoding -@item SSA/ASS @tab X @tab X +@item SSA/ASS @tab X @tab X @tab X @tab X @item DVB @tab X @tab X @tab X @tab X @item DVD @tab X @tab X @tab X @tab X @item PGS @tab @tab @tab @tab X +@item SubRip (SRT) @tab X @tab X @tab @tab X @item XSUB @tab @tab @tab X @tab X @end multitable @@ -786,7 +802,8 @@ bash ./configure MacOS X on PowerPC or ARM (iPhone) requires a preprocessor from @url{http://github.com/yuvi/gas-preprocessor} to build the optimized -assembler functions. +assembler functions. Just download the Perl script and put it somewhere +in your PATH, FFmpeg's configure will pick it up automatically. @section Windows @@ -966,15 +983,27 @@ 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. @file{c:\msys\usr\local\bin}). This is not a typo, the LIB files are -installed in the @file{bin} directory. And instead of adding @file{libxx.a} -files, you should add @file{avcodec.lib}, @file{avformat.lib}, and -@file{avutil.lib}. There should be no need for @file{libmingwex.a}, +installed in the @file{bin} directory. And instead of adding the static +libraries (@file{libxxx.a} files) you should add the MSVC import libraries +(@file{avcodec.lib}, @file{avformat.lib}, @file{avcore.lib}, and +@file{avutil.lib}). Note that you should not use the GCC import +libraries (@file{libxxx.dll.a} files), as these will give you undefined +reference errors. There should be no need for @file{libmingwex.a}, @file{libgcc.a}, and @file{wsock32.lib}, nor any other external library statically linked into the DLLs. The @file{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. @file{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: +@example +extern __declspec(dllimport) const AVPixFmtDescriptor av_pix_fmt_descriptors[]; +@end example + @subsection Cross compilation for Windows with Linux You must use the MinGW cross compilation tools available at @@ -1031,7 +1060,7 @@ These library packages are only available from Cygwin Ports (@url{http://sourceware.org/cygwinports/}) : @example -yasm, libSDL-devel, libdirac-devel, libfaac-devel, libfaad-devel, libgsm-devel, +yasm, libSDL-devel, libdirac-devel, libfaac-devel, libgsm-devel, libmp3lame-devel, libschroedinger1.0-devel, speex-devel, libtheora-devel, libxvidcore-devel @end example diff --git a/lib/ffmpeg/doc/git-howto.txt b/lib/ffmpeg/doc/git-howto.txt new file mode 100644 index 0000000000..519c8970ef --- /dev/null +++ b/lib/ffmpeg/doc/git-howto.txt @@ -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. diff --git a/lib/ffmpeg/doc/indevs.texi b/lib/ffmpeg/doc/indevs.texi new file mode 100644 index 0000000000..8e862ff6bc --- /dev/null +++ b/lib/ffmpeg/doc/indevs.texi @@ -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 diff --git a/lib/ffmpeg/doc/libavfilter.texi b/lib/ffmpeg/doc/libavfilter.texi index 8745928d40..f0b448259a 100644 --- a/lib/ffmpeg/doc/libavfilter.texi +++ b/lib/ffmpeg/doc/libavfilter.texi @@ -2,11 +2,12 @@ @settitle Libavfilter Documentation @titlepage -@sp 7 @center @titlefont{Libavfilter Documentation} -@sp 3 @end titlepage +@top + +@contents @chapter Introduction diff --git a/lib/ffmpeg/doc/metadata.texi b/lib/ffmpeg/doc/metadata.texi new file mode 100644 index 0000000000..2a285757cc --- /dev/null +++ b/lib/ffmpeg/doc/metadata.texi @@ -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 diff --git a/lib/ffmpeg/doc/muxers.texi b/lib/ffmpeg/doc/muxers.texi new file mode 100644 index 0000000000..d98abefda3 --- /dev/null +++ b/lib/ffmpeg/doc/muxers.texi @@ -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 diff --git a/lib/ffmpeg/doc/optimization.txt b/lib/ffmpeg/doc/optimization.txt index 5469adc836..5d51235983 100644 --- a/lib/ffmpeg/doc/optimization.txt +++ b/lib/ffmpeg/doc/optimization.txt @@ -157,15 +157,68 @@ Use asm loops like: __asm__( "1: .... ... - "jump_instruciton .... + "jump_instruction .... Do not use C loops: do{ __asm__( ... }while() -Use __asm__() instead of intrinsics. The latter requires a good optimizing compiler -which gcc is not. +For x86, mark registers that are clobbered in your asm. This means both +general x86 registers (e.g. eax) as well as XMM registers. This last one is +particularly important on Win64, where xmm6-15 are callee-save, and not +restoring their contents leads to undefined results. In external asm (e.g. +yasm), you do this by using: +cglobal functon_name, num_args, num_regs, num_xmm_regs +In inline asm, you specify clobbered registers at the end of your asm: +__asm__(".." ::: "%eax"). +If gcc is not set to support sse (-msse) it will not accept xmm registers +in the clobber list. For that we use two macros to declare the clobbers. +XMM_CLOBBERS should be used when there are other clobbers, for example: +__asm__(".." ::: XMM_CLOBBERS("xmm0",) "eax"); +and XMM_CLOBBERS_ONLY should be used when the only clobbers are xmm registers: +__asm__(".." :: XMM_CLOBBERS_ONLY("xmm0")); + +Do not expect a compiler to maintain values in your registers between separate +(inline) asm code blocks. It is not required to. For example, this is bad: +__asm__("movdqa %0, %%xmm7" : src); +/* do something */ +__asm__("movdqa %%xmm7, %1" : dst); +- first of all, you're assuming that the compiler will not use xmm7 in + between the two asm blocks. It probably won't when you test it, but it's + a poor assumption that will break at some point for some --cpu compiler flag +- secondly, you didn't mark xmm7 as clobbered. If you did, the compiler would + have restored the original value of xmm7 after the first asm block, thus + rendering the combination of the two blocks of code invalid +Code that depends on data in registries being untouched, should be written as +a single __asm__() statement. Ideally, a single function contains only one +__asm__() block. + +Use external asm (nasm/yasm) or inline asm (__asm__()), do not use intrinsics. +The latter requires a good optimizing compiler which gcc is not. + +Inline asm vs. external asm +--------------------------- +Both inline asm (__asm__("..") in a .c file, handled by a compiler such as gcc) +and external asm (.s or .asm files, handled by an assembler such as yasm/nasm) +are accepted in FFmpeg. Which one to use differs per specific case. + +- if your code is intended to be inlined in a C function, inline asm is always + better, because external asm cannot be inlined +- if your code calls external functions, yasm is always better +- if your code takes huge and complex structs as function arguments (e.g. + MpegEncContext; note that this is not ideal and is discouraged if there + are alternatives), then inline asm is always better, because predicting + member offsets in complex structs is almost impossible. It's safest to let + the compiler take care of that +- in many cases, both can be used and it just depends on the preference of the + person writing the asm. For new asm, the choice is up to you. For existing + asm, you'll likely want to maintain whatever form it is currently in unless + there is a good reason to change it. +- if, for some reason, you believe that a particular chunk of existing external + asm could be improved upon further if written in inline asm (or the other + way around), then please make the move from external asm <-> inline asm a + separate patch before your patches that actually improve the asm. Links: diff --git a/lib/ffmpeg/doc/outdevs.texi b/lib/ffmpeg/doc/outdevs.texi new file mode 100644 index 0000000000..3c0acee984 --- /dev/null +++ b/lib/ffmpeg/doc/outdevs.texi @@ -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 diff --git a/lib/ffmpeg/doc/protocols.texi b/lib/ffmpeg/doc/protocols.texi new file mode 100644 index 0000000000..29f5c90d81 --- /dev/null +++ b/lib/ffmpeg/doc/protocols.texi @@ -0,0 +1,447 @@ +@chapter Protocols +@c man begin 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=@var{PROTOCOL}", or you can disable a +particular protocol using the option +"--disable-protocol=@var{PROTOCOL}". + +The option "-protocols" of the ff* tools will display the list of +supported protocols. + +A description of the currently available protocols follows. + +@section 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: +@example +concat:@var{URL1}|@var{URL2}|...|@var{URLN} +@end example + +where @var{URL1}, @var{URL2}, ..., @var{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 @file{split1.mpeg}, +@file{split2.mpeg}, @file{split3.mpeg} with @file{ffplay} use the +command: +@example +ffplay concat:split1.mpeg\|split2.mpeg\|split3.mpeg +@end example + +Note that you may need to escape the character "|" which is special for +many shells. + +@section file + +File access protocol. + +Allow to read from or read to a file. + +For example to read from a file @file{input.mpeg} with @file{ffmpeg} +use the command: +@example +ffmpeg -i file:input.mpeg output.mpeg +@end example + +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". + +@section gopher + +Gopher protocol. + +@section http + +HTTP (Hyper Text Transfer Protocol). + +@section mmst + +MMS (Microsoft Media Server) protocol over TCP. + +@section mmsh + +MMS (Microsoft Media Server) protocol over HTTP. + +The required syntax is: +@example +mmsh://@var{server}[:@var{port}][/@var{app}][/@var{playpath}] +@end example + +@section 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. +@example +# 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: +@end example + +Note that some formats (typically MOV) require the output protocol to +be seekable, so they will fail with the MD5 output protocol. + +@section pipe + +UNIX pipe access protocol. + +Allow to read and write from UNIX pipes. + +The accepted syntax is: +@example +pipe:[@var{number}] +@end example + +@var{number} is the number corresponding to the file descriptor of the +pipe (e.g. 0 for stdin, 1 for stdout, 2 for stderr). If @var{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 @file{ffmpeg}: +@example +cat test.wav | ffmpeg -i pipe:0 +# ...this is the same as... +cat test.wav | ffmpeg -i pipe: +@end example + +For writing to stdout with @file{ffmpeg}: +@example +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 +@end example + +Note that some formats (typically MOV), require the output protocol to +be seekable, so they will fail with the pipe output protocol. + +@section 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: +@example +rtmp://@var{server}[:@var{port}][/@var{app}][/@var{playpath}] +@end example + +The accepted parameters are: +@table @option + +@item server +The address of the RTMP server. + +@item port +The number of the TCP port to use (by default is 1935). + +@item 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. @file{/ondemand/}, @file{/flash/live/}, etc.). + +@item playpath +It is the path or name of the resource to play with reference to the +application specified in @var{app}, may be prefixed by "mp4:". + +@end table + +For example to read with @file{ffplay} a multimedia resource named +"sample" from the application "vod" from an RTMP server "myserver": +@example +ffplay rtmp://myserver/vod/sample +@end example + +@section 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: +@example +@var{rtmp_proto}://@var{server}[:@var{port}][/@var{app}][/@var{playpath}] @var{options} +@end example + +where @var{rtmp_proto} is one of the strings "rtmp", "rtmpt", "rtmpe", +"rtmps", "rtmpte", "rtmpts" corresponding to each RTMP variant, and +@var{server}, @var{port}, @var{app} and @var{playpath} have the same +meaning as specified for the RTMP native protocol. +@var{options} contains a list of space-separated options of the form +@var{key}=@var{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 +@file{ffmpeg}: +@example +ffmpeg -re -i myfile -f flv rtmp://myserver/live/mystream +@end example + +To play the same stream using @file{ffplay}: +@example +ffplay "rtmp://myserver/live/mystream live=1" +@end example + +@section rtp + +Real-Time Protocol. + +@section 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, @url{http://github.com/revmischa/rtsp-server}). + +The required syntax for a RTSP url is: +@example +rtsp://@var{hostname}[:@var{port}]/@var{path}[?@var{options}] +@end example + +@var{options} is a @code{&}-separated list. The following options +are supported: + +@table @option + +@item udp +Use UDP as lower transport protocol. + +@item tcp +Use TCP (interleaving within the RTSP control channel) as lower +transport protocol. + +@item multicast +Use UDP multicast as lower transport protocol. + +@item http +Use HTTP tunneling as lower transport protocol, which is useful for +passing proxies. + +@item filter_src +Accept packets only from negotiated peer address and port. +@end table + +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 @code{tcp} and @code{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 +@code{max_delay} field of AVFormatContext. + +When watching multi-bitrate Real-RTSP streams with @file{ffplay}, the +streams to display can be chosen with @code{-vst} @var{n} and +@code{-ast} @var{n} for video and audio respectively, and can be switched +on the fly by pressing @code{v} and @code{a}. + +Example command lines: + +To watch a stream over UDP, with a max reordering delay of 0.5 seconds: + +@example +ffplay -max_delay 500000 rtsp://server/video.mp4?udp +@end example + +To watch a stream tunneled over HTTP: + +@example +ffplay rtsp://server/video.mp4?http +@end example + +To send a stream in realtime to a RTSP server, for others to watch: + +@example +ffmpeg -re -i @var{input} -f rtsp -muxdelay 0.1 rtsp://server/live.sdp +@end example + +@section 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. + +@subsection Muxer + +The syntax for a SAP url given to the muxer is: +@example +sap://@var{destination}[:@var{port}][?@var{options}] +@end example + +The RTP packets are sent to @var{destination} on port @var{port}, +or to port 5004 if no port is specified. +@var{options} is a @code{&}-separated list. The following options +are supported: + +@table @option + +@item announce_addr=@var{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 @var{destination} is an IPv6 address. + +@item announce_port=@var{port} +Specify the port to send the announcements on, defaults to +9875 if not specified. + +@item ttl=@var{ttl} +Specify the time to live value for the announcements and RTP packets, +defaults to 255. + +@item same_port=@var{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. +@end table + +Example command lines follow. + +To broadcast a stream on the local subnet, for watching in VLC: + +@example +ffmpeg -re -i @var{input} -f sap sap://224.0.0.255?same_port=1 +@end example + +Similarly, for watching in ffplay: + +@example +ffmpeg -re -i @var{input} -f sap sap://224.0.0.255 +@end example + +And for watching in ffplay, over IPv6: + +@example +ffmpeg -re -i @var{input} -f sap sap://[ff0e::1:2:3:4] +@end example + +@subsection Demuxer + +The syntax for a SAP url given to the demuxer is: +@example +sap://[@var{address}][:@var{port}] +@end example + +@var{address} is the multicast address to listen for announcements on, +if omitted, the default 224.2.127.254 (sap.mcast.net) is used. @var{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: + +@example +ffplay sap:// +@end example + +To play back the first stream announced on one the default IPv6 SAP multicast address: + +@example +ffplay sap://[ff0e::2:7ffe] +@end example + +@section tcp + +Trasmission Control Protocol. + +@section udp + +User Datagram Protocol. + +The required syntax for a UDP url is: +@example +udp://@var{hostname}:@var{port}[?@var{options}] +@end example + +@var{options} contains a list of &-seperated options of the form @var{key}=@var{val}. +Follow the list of supported options. + +@table @option + +@item buffer_size=@var{size} +set the UDP buffer size in bytes + +@item localport=@var{port} +override the local UDP port to bind with + +@item pkt_size=@var{size} +set the size in bytes of UDP packets + +@item reuse=@var{1|0} +explicitly allow or disallow reusing UDP sockets + +@item ttl=@var{ttl} +set the time to live value (for multicast only) + +@item connect=@var{1|0} +Initialize the UDP socket with @code{connect()}. In this case, the +destination address can't be changed with udp_set_remote_url later. +If the destination address isn't known at the start, this option can +be specified in 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. +@end table + +Some usage examples of the udp protocol with @file{ffmpeg} follow. + +To stream over UDP to a remote endpoint: +@example +ffmpeg -i @var{input} -f @var{format} udp://@var{hostname}:@var{port} +@end example + +To stream in mpegts format over UDP using 188 sized UDP packets, using a large input buffer: +@example +ffmpeg -i @var{input} -f mpegts udp://@var{hostname}:@var{port}?pkt_size=188&buffer_size=65535 +@end example + +To receive over UDP from a remote endpoint: +@example +ffmpeg -i udp://[@var{multicast-address}]:@var{port} +@end example + +@c man end PROTOCOLS diff --git a/lib/ffmpeg/doc/t2h.init b/lib/ffmpeg/doc/t2h.init new file mode 100644 index 0000000000..cd38a3ec9e --- /dev/null +++ b/lib/ffmpeg/doc/t2h.init @@ -0,0 +1,24 @@ +# no horiz rules between sections +$end_section = \&FFMPEG_end_section; +sub FFMPEG_end_section($$) +{ +} + +$print_page_foot = \&FFMPEG_print_page_foot; +sub FFMPEG_print_page_foot($$) +{ + my $fh = shift; + print $fh "$SMALL_RULE\n"; + T2H_DEFAULT_print_page_foot($fh); +} + +# no navigation elements +$SECTION_NAVIGATION = 0; +# the same for texi2html 5.0 +$HEADERS = 0; + +# TOC and Chapter headings link +$TOC_LINKS = 1; + +# print the TOC where @contents is used +$INLINE_CONTENTS = 1; diff --git a/lib/ffmpeg/doc/texi2pod.pl b/lib/ffmpeg/doc/texi2pod.pl index fd3f02059d..aa3273ec1a 100755 --- a/lib/ffmpeg/doc/texi2pod.pl +++ b/lib/ffmpeg/doc/texi2pod.pl @@ -346,6 +346,7 @@ sub postprocess # @* is also impossible in .pod; we discard it and any newline that # follows it. Similarly, our macro @gol must be discarded. + s/\@anchor{(?:[^\}]*)\}//g; s/\(?\@xref\{(?:[^\}]*)\}(?:[^.<]|(?:<[^<>]*>))*\.\)?//g; s/\s+\(\@pxref\{(?:[^\}]*)\}\)//g; s/;\s+\@pxref\{(?:[^\}]*)\}//g; |