Compare commits

..

664 Commits

Author SHA1 Message Date
Michael Niedermayer
60eebbbf22 Update for 2.5.11
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-02-01 20:44:56 +01:00
Michael Niedermayer
5eca7ba16b MAINTAINERS: remove unmaintained releases
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-31 00:45:17 +01:00
Michael Niedermayer
69e191f854 avcodec/jpeg2000dec: More completely check cdef
Fixes out of array access
Fixes: j2k-poc.bin

Found-by: Lucas Leong <wmliang.tw@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0aada30510d809bccfd539a90ea37b61188f2cb4)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-31 00:24:52 +01:00
Michael Niedermayer
3fa6ecca76 avutil/opt: check for and handle errors in av_opt_set_dict2()
Previously errors could result in random entries to be lost.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f3ace85d8869c3dddd2d28d064002d0d912e3624)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-31 00:24:52 +01:00
Paul B Mahol
d7c0287fbd avcodec/flacenc: fix calculation of bits required in case of custom sample rate
Sample rate of 11025 takes 16 bits but previous code would pick only 8.
Fixes assertion failure.

Reviewed-by: Rostislav Pehlivanov <atomnuker@gmail.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit 3e7d6849120d61bb354376d52786c26f20e20835)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-31 00:24:52 +01:00
Michael Niedermayer
7bcf142c02 avformat: Document urls a bit
Spell-checked-by: Moritz Barsnick <barsnick@gmx.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3130556c0eb09f3da3c9de6473a97937a4648d62)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-31 00:24:52 +01:00
Michael Niedermayer
0251cd6cf3 avformat/libquvi: Set default demuxer and protocol limitations
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 15cc98a0f38ac45444d177186cfbf28e14bd5f1f)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-31 00:24:52 +01:00
Michael Niedermayer
dde76f2d04 avformat/concat: Check protocol prefix
Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 8e32d014322eada1812af268d7ea9d53169d279c)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-31 00:24:52 +01:00
Michael Niedermayer
e46999ccf4 doc/demuxers: Document enable_drefs and use_absolute_path
Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 9a8034b8bc1d1cd7a8889dc385d41744be47b159)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-31 00:24:52 +01:00
Michael Niedermayer
58ea532cad avcodec/mjpegdec: Check for end for both bytes in unescaping
Fixes assertion failure
Fixes: c40c779601b77dc6e19aaea0b04b9751/signal_sigabrt_7ffff6ae7cb7_5769_b94f6ec70caecb2d3d76b4771b109ac1.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 509c9e74e548139285f30ed8dcc9baf1d64359fa)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-31 00:24:52 +01:00
Michael Niedermayer
0ec1ffcb4d avcodec/mpegvideo_enc: Check for integer overflow in ff_mpv_reallocate_putbitbuffer()
Fixes assertion failure
Fixes: 6568d187979ce17878b6fe5fbbb89142/signal_sigabrt_7ffff6ae7cb7_7176_564bbc6741bdcf907f5c4e685c9a77a2.mpg

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b65efbc0f4195421c15d2a6c228d331eec5b31c3)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-31 00:24:51 +01:00
Michael Niedermayer
2df2c0aab0 avformat/avformat: Replace some references to filenames by urls
Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 41e07390e04cf369d84f0cc7ff5858c273290770)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-31 00:24:51 +01:00
Michael Niedermayer
65bb07d4be avcodec/wmaenc: Check ff_wma_init() for failure
Fixes null pointer dereference
Fixes: c4faf8280ba366bf00a79d425f2910a8/signal_sigsegv_1f96477_5177_1448ba7e4125faceb966f44ceb69abfa.qcp
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 19e456d48c90a1e3ceeb9e6241383384cc73dfdf)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-31 00:24:51 +01:00
Michael Niedermayer
3fc75e79cf avcodec/mpeg12enc: Move high resolution thread check to before initializing threads
Cleaner solution is welcome!

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a53fbda9dc92273054a103db7539d2bb6e9632b2)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-31 00:24:51 +01:00
Michael Niedermayer
30463a0c99 avformat/avio: Limit url option parsing to the documented cases
This feature is not know much or used much AFAIK, and it might be helpfull in
exploits.
No specific case is known where it can be used in an exploit though
subsequent commits depend on this commit though

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 984d58a3440d513f66344b5332f6b589c0a6bbc6)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-31 00:24:51 +01:00
Michael Niedermayer
7ee0b1937a avcodec/ass_split: Fix null pointer dereference in ff_ass_style_get()
Fixes: 55d71971da50365d542ed14b65565fe1/signal_sigsegv_4765a4_8499_f146af090a94f591d6254515c7700ef5.mkv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 158f0545d81b2aca1c936490f80d13988616910e)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-31 00:24:51 +01:00
Derek Buitenhuis
dd957b56e6 mov: Add an option to toggle dref opening
This feature is mostly only used by NLE software, and is
both of dubious value being enabled by default, and a
possible security risk.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 712d962a6a29b1099cd872cfb07867175a93ac4c)

Conflicts:

	libavformat/isom.h
	libavformat/mov.c
	libavformat/version.h

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>

Conflicts:

	libavformat/mov.c
2016-01-31 00:24:51 +01:00
Michael Niedermayer
9f30eafd0f avcodec/gif: Fix lzw buffer size
Fixes out of array access
Fixes: aaa479088e6fb40b04837b3119f47b04/asan_heap-oob_e38c68_8576_9d653078b2470700e2834636f12ff557.tga

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 03d83ba34b2070878909eae18dfac0f519503777)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-31 00:24:51 +01:00
Michael Niedermayer
22e20a1d83 avcodec/put_bits: Assert buf_ptr in flush_put_bits()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3ef5de0f19774e2c3dd9b08ba2e8ab7241a4862a)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-31 00:24:51 +01:00
Michael Niedermayer
dee25a5fa5 avcodec/tiff: Check subsample & rps values more completely
Fixes out of array access
Fixes: 83aedfb29af669c4d6e10f1bfad974d2/asan_heap-oob_1ab42fe_4984_9f6ec14462f8d8a00ea24b320572a963.tif

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 89f464e9c229006e16f6bb5403c5529fdd0a9edd)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-31 00:24:51 +01:00
Michael Niedermayer
0f956cde93 swscale/swscale: Add some sanity checks for srcSlice* parameters
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 321e85e1769ca1fc1567025ae264760790ee7fc9)

Conflicts:

	libswscale/swscale.c

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-31 00:24:51 +01:00
Michael Niedermayer
9631209eea swscale/x86/rgb2rgb_template: Fix planar2x() for short width
Fixes: 451b3e0cf956c0bd2f27ed753ac24050/asan_heap-oob_2873c01_3231_7ed10a9464d15f0d57277f5917c566a8.AVI

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c8a9aaab2695e0f9921db946a3b9f14bea880167)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-31 00:24:51 +01:00
Michael Niedermayer
93c675d6a6 swscale/swscale_unscaled: Fix odd height inputs for bayer_to_yv12_wrapper()
Fixes: 372d2df1f04b49e25f109f07f90b1505/asan_heap-oob_2835d2e_8501_99e0114d7ba3a6db885d0b4684d200c1.cine
Fixes out of array read

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 757248ea3cd917a7755cb15f817a9b1f15578718)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-31 00:24:51 +01:00
Michael Niedermayer
262192a48b swscale/swscale_unscaled: Fix odd height inputs for bayer_to_rgb24_wrapper()
Fixes: 372d2df1f04b49e25f109f07f90b1505/asan_heap-oob_2835d2e_8501_99e0114d7ba3a6db885d0b4684d200c1.cine
Fixes out of array read

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ad3b6fa7d83db7de951ed891649af93a47e74be5)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-31 00:24:51 +01:00
Michael Niedermayer
b515a23f76 avcodec/aacenc: Check both channels for finiteness
Fixes null pointer dereference
Fixes: 10412fc52ecc6eab40ed67f82ca7b372/signal_sigsegv_2618c99_2129_f808373959e46afb165593332799ffbc.aif

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 057549a9ccc9fd32df71678e6abe69e10668186a)

Conflicts:

	libavcodec/aacenc.c
2016-01-31 00:24:51 +01:00
Michael Niedermayer
d1fc87529f swscale/swscale-test: Fix slice height in random reference data creation.
Found-by: Pedro Arthur <bygrandao@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-31 00:24:37 +01:00
Andreas Cadhalpun
873a0dfa26 dca: fix misaligned access in avpriv_dca_convert_bitstream
src and dst are only 8-bit-aligned, so accessing them as uint16_t causes
SIGBUS crashes on architectures like sparc.

This fixes ubsan runtime error: load of misaligned address for type
'const uint16_t', which requires 2 byte alignment

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 44ac13eed49593f4f8efdb72ab0d5b48e05aa305)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-01-28 01:50:35 +01:00
Andreas Cadhalpun
f2fd5b9eb2 brstm: fix missing closing brace
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 1cb2331eca0dbde1bc63bc715a0e98771dda8b80)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-01-28 01:50:35 +01:00
Andreas Cadhalpun
cdedd71a7e brstm: also allocate b->table in read_packet
This fixes NULL pointer dereferencing if the codec is forced to
adpcm_thp even though a different one was detected.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit bcf4ee26a0a1ed349ec7489925540401002b87cc)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-01-28 01:50:34 +01:00
Andreas Cadhalpun
a90a7594a8 brstm: make sure an ADPC chunk was read for adpcm_thp
This fixes NULL pointer dereferencing.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit d7d37c479fa71639650751648275615e979beb33)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-01-28 01:50:33 +01:00
Andreas Cadhalpun
641a010157 vorbisdec: reject rangebits 0 with non-0 partitions
This causes non-unique elements in floor_setup->data.t1.list, which
makes the stream undecodable according to the specification.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit e7a7b3135a4e5ba4bd2e144444d95a7563f53e9b)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-01-28 01:50:33 +01:00
Andreas Cadhalpun
b6fb6ccda4 vorbisdec: reject channel mapping with less than two channels
It causes the angle channel number to equal the magnitude channel
number, which makes the stream undecodable according to the
specification.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit b4b13848dec5420fa5dd9e1a7d4dfae5de1932d5)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-01-28 01:50:33 +01:00
Andreas Cadhalpun
3b535bbf88 ffmdec: reset packet_end in case of failure
This fixes segmentation faults caused by passing a packet_ptr of NULL to
memcpy.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 40eb2531b279abe008012c5c2c292552d3e62449)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-01-28 01:50:33 +01:00
Paul B Mahol
bf44699314 avformat/ipmovie: put video decoding_map_size into packet and use it in decoder
The size of decoding map can differ from one calculated
internally, producing artifacts while decoding video.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit c293ef258cbb2c058e23651a26edf46e3bc05050)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-01-28 01:50:33 +01:00
Clément Bœsch
1a65265131 avcodec/samidec: make sure to properly restore parsing context after a tag
(cherry picked from commit 70082a1e533deed6688938232e6e66abbd62b0fa)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2016-01-28 01:50:32 +01:00
James Almer
7e297b4bc6 avcodec/wavpackenc: print channel count in av_log call
Fixes a warning with -Wformat-extra-args
(cherry picked from commit 17e7fdf61a04f52c499e2d06eab2cf2d22343aa9)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 17:54:00 +01:00
Michael Niedermayer
fba2fdaea3 Update for 2.5.10
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 17:49:08 +01:00
James Almer
6456043ff7 configure: bump copyright year to 2016
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 78129978f02f27d76ecaf2cd1a7bf7a47253fdab)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 17:39:05 +01:00
Michael Niedermayer
83913c6e7e avformat/hls: Even stricter URL checks
This fixes a null pointer dereference at least

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit cfda1bea4c18ec1edbc11ecc465f788b02851488)

Conflicts:

	libavformat/hls.c
2016-01-15 17:39:05 +01:00
Michael Niedermayer
8d5060192c avformat/hls: More strict url checks
No case is known where these are needed

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 6ba42b6482c725a59eb468391544dc0c75b8c6f0)

Conflicts:

	libavformat/hls.c

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>

Conflicts:

	libavformat/hls.c
2016-01-15 17:39:05 +01:00
Michael Niedermayer
4089af67ab swscale/utils: Detect and skip unneeded sws_setColorspaceDetails() calls
This avoids running various table inits unnecessarily

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit cc538e9dbd14b61d1ac8c9fa687d83289673fe90)

Conflicts:

	libswscale/utils.c
2016-01-15 17:39:05 +01:00
Michael Niedermayer
dc6a9162a2 swscale/yuv2rgb: Increase YUV2RGB table headroom
This makes SWS more robust
Fixes: 07650a772d98aa63b0fed6370dc89037/asan_heap-oob_27ddeaf_2657_2c81ff264dee5d9712cb3251fb9c3bbb.264
Fixes: out of array read

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 8f3a9a8c278acf886f70a1d743bc07b6f9c7b51a)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 17:39:04 +01:00
Michael Niedermayer
9c67c52acc swscale/yuv2rgb: Factor YUVRGB_TABLE_LUMA_HEADROOM out
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5e5f82a28737fba4402259617500911cc37e3674)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 17:39:04 +01:00
Maxim Andreev
e183075dc1 avformat/hls: forbid all protocols except http(s) & file
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7145e80b4f78cff5ed5fee04d4c4d53daaa0e077)

Conflicts:

	libavformat/hls.c
2016-01-15 17:39:04 +01:00
Michael Niedermayer
a7dea6f2cd avformat/aviobuf: Fix end check in put_str16()
Fixes out of array read
Fixes: 03c406ec9530e594a074ce2979f8a1f0/asan_heap-oob_7dec26_4664_37c52495b2870a2eaac65f53958e76c1.flac

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 115fb6d03ef6310732b42258d8c3cd1839cfb74b)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 17:39:04 +01:00
Michael Niedermayer
8419971a42 avformat/asfenc: Check pts
Fixes integer overflow
Fixes: 0063df8be3aaa30dd6d76f59c8f818c8/signal_sigsegv_7b7b59_3634_bf418b6822bbfa68734411d96b667be3.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7c0b84d89911b2035161f5ef51aafbfcc84aa9e2)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 17:39:04 +01:00
Michael Niedermayer
1c99807cb7 avcodec/mpeg4video: Check time_incr
Fixes assertion failure
Fixes out of memory access

Fixes: test_casex.ivf

Found-by: Tyson Smith <twsmith@mozilla.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7c97946d6131b31340954a3f603b6bf92590a9a5)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 17:39:04 +01:00
Michael Niedermayer
4865d66b76 avcodec/wavpackenc: Check the number of channels
They are stored in a byte, thus more than 255 is not possible

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 59c915a403af32c4ff5126625b0cc7e38f4beff9)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 17:39:04 +01:00
Michael Niedermayer
71b640230e avcodec/wavpackenc: Headers are per channel
Fixes: 1b8b83a53bfa751f01b1daa65a4758db/signal_sigabrt_7ffff6ae7cb7_7488_403f71d1a2565b598d01b6cb110fac8f.aiff
Fixes: assertion failure

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 26757b0279b4b93c6066c2151d4d3dbd2ec266bf)

Conflicts:

	libavcodec/wavpackenc.c

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 17:39:04 +01:00
Michael Niedermayer
1d02458c06 avcodec/dvdec: Fix "left shift of negative value -254"
Fixes: dvdec_left_shift.avi

Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 93ac72a98dff592ffc174cfb36a8975dfbf145ae)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 17:39:04 +01:00
Michael Niedermayer
e2285e7cc8 avcodec/mjpegdec: Fix negative shift
Fixes: mjpeg_left_shift.avi

Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d86d7b2486cd5c31db8e820d8a89554abf19567e)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 17:39:04 +01:00
Michael Niedermayer
4c6b48a08e avcodec/mss2: Check for repeat overflow
Fixes: mss2_left_shift.wmv

Found-by: Piotr Bandurski <ami_stuff@o2.pl>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit e273dade78943e22b71d0ddb67cd0d737fc26edf)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 17:39:04 +01:00
Michael Niedermayer
7974642cfd avformat: Add integer fps from 31 to 60 to get_std_framerate()
Fixes Ticket 5106

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2039b3e7511ef183dae206575114e15b6d99c134)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 17:39:04 +01:00
Michael Niedermayer
2111d51619 avcodec/mpegvideo_enc: Clip bits_per_raw_sample within valid range
Fixes out of array read
Fixes: test_case-mdc.264 (b47be15a120979f5a1a945c938cbef33)

Found-by: Tyson Smith <twsmith@mozilla.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 13f266b50cc7554028d22480b7e4383968e64a63)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 17:39:04 +01:00
Thomas Mundt
53025e8681 avfilter/vf_scale: set proper out frame color range
Prevents that following scalers in the filter chain will do unintentional color range conversions.
Fixes Ticket #5096

Signed-off-by: Thomas Mundt <loudmax@yahoo.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 73ce8162f3499cf0e86d1d80dea53324bd62bcb3)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 17:39:04 +01:00
Michael Niedermayer
1b3dffc0c7 avcodec/motion_est: Fix mv_penalty table size
Fixes out of array read

Found-by: Tyson Smith <twsmith@mozilla.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5b4da8a38a5ed211df9504c85ce401c30af86b97)

Conflicts:

	libavcodec/motion_est.h
2016-01-15 17:39:04 +01:00
Michael Niedermayer
d472b83abc avcodec/h264_slice: Fix integer overflow in implicit weight computation
Fixes mozilla bug 1230423

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7cc01c25727a96eaaa0c177234b626e47c8ea491)

Conflicts:

	libavcodec/h264_slice.c

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 17:39:04 +01:00
Michael Niedermayer
c3abdd0f44 swscale/utils: Use normal bilinear scaler if fast cannot be used due to tiny dimensions
Fixes Ticket4960

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 1edf129cbc897447a289ca8b045853df5df1bab3)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 17:39:04 +01:00
Michael Niedermayer
1363d0759d avcodec/put_bits: Always check buffer end before writing
This causes a overall slowdown of 0.1 % (tested with mpeg4 single thread encoding of matrixbench at QP=3)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit cccb0ffccc3723acc7aab3a859b24743596dd9c0)

Conflicts:

	libavcodec/put_bits.h
2016-01-15 17:39:04 +01:00
Andreas Cadhalpun
f48392197d mjpegdec: extend check for incompatible values of s->rgb and s->ls
This can happen if s->ls changes from 0 to 1, but picture allocation is
skipped due to s->interlaced.

In that case ff_jpegls_decode_picture could be called even though the
s->picture_ptr frame has the wrong pixel format and thus a wrong
linesize, which results in a too small zero buffer being allocated.

This fixes an out-of-bounds read in ls_decode_line.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 7ea2db6eafa0a8a9497aab20be2cfc8742a59072)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 17:39:04 +01:00
Michael Niedermayer
c1521dd418 swscale/utils: Fix intermediate format for cascaded alpha downscaling
Fixes Ticket4926

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b83d8be6bff7d645469a623aee0b380541da15cf)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 17:39:04 +01:00
Michael Niedermayer
a5b4b80775 avcodec/h264_refs: Fix long_idx check
Fixes out of array read
Fixes mozilla bug 1233606

Found-by: Tyson Smith
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b92b4775a0d07cacfdd2b4be6511f3cb362c977b)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 17:39:04 +01:00
Michael Niedermayer
75e4949ec1 avfilter/vf_mpdecimate: Add missing emms_c()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 997de2e8107cc4256e50611463d609b18fe9619f)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 17:39:04 +01:00
Michael Niedermayer
07b9632531 avformat/mxfenc: Do not crash if there is no packet in the first stream
Fixes: Ticket4914

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b51e7554e74cbf007a1cab83c7bed3ad9fa2793a)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 17:39:04 +01:00
Rainer Hochecker
50aacb334a avformat/utils: estimate_timings_from_pts - increase retry counter, fixes invalid duration for ts files with hevc codec
Fixes a mpegts file with hevc that fails estimating duration. Increasing number of
retries fixes the issue.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2d8c2f1a28073d451c7db31291c333cb15ca3d0b)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 17:39:04 +01:00
Michael Niedermayer
65e7ad746f avformat/matroskaenc: Check codecdelay before use
Fixes CID1238790

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit e6971db12b8ae49712b77378fa8141de4904082b)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 17:39:04 +01:00
Michael Niedermayer
5d865cb375 avutil/mathematics: Fix division by 0
Fixes: CID1341571

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit bc8b1e694cc395fdf5e2917377ef11263c937d85)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2016-01-15 17:39:04 +01:00
James Almer
4bcbeaa337 x86/float_dsp: zero extend offset from ff_scalarproduct_float_sse
Reviewed-by: Christophe Gisquet <christophe.gisquet@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit dc79824deb6ac0ce236589c618744b33629201cd)
2016-01-08 14:03:10 -03:00
Michael Niedermayer
8cd0e23be8 avcodec/mpeg4videodec: also for empty partitioned slices
Fixes assertion failure
Fixes: id_acf3e47f864e1ee4c7b86c0653e0ff31e5bde56e.m4v

Found-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 70f13abb4f9a376ddc0d2c566739bc3c6a0c47e7)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-20 15:43:21 +01:00
Andreas Cadhalpun
eca27eeea9 nuv: sanitize negative fps rate
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit f6830cf5ba03fdcfcd81a0358eb32d4081a2fcce)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-20 15:40:25 +01:00
Andreas Cadhalpun
06edade7ee rawdec: only exempt BIT0 with need_copy from buffer sanity check
Otherwise the too small buffer is directly used in the frame, causing
segmentation faults, when trying to use the frame.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 699e68371ec7e381e5cc48e3d96e29c669261af7)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-20 15:40:21 +01:00
Andreas Cadhalpun
94711d3719 mlvdec: check that index_entries exist
This fixes NULL pointer dereferencing.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 9fcfe4a3cdf9a5af0c37758b178965b7b99582d4)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-20 15:40:17 +01:00
Andreas Cadhalpun
2db78f83ba nutdec: reject negative value_len in read_sm_data
If it is negative, it can cause the byte position to move backwards in
avio_skip, which in turn makes sm_size negative and thus size larger
than the size of the packet buffer, causing invalid writes in avio_read.

Also fix potential overflow of avio_tell(bc) + value_len.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit ce10f572c12b0d172c72d31d8c979afce602bf0c)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-20 15:40:13 +01:00
Andreas Cadhalpun
882391f975 xwddec: prevent overflow of lsize * avctx->height
This is used to check if the input buffer is large enough, so if this
overflows it can cause a false negative leading to a segmentation fault
in bytestream2_get_bufferu.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 9d38f06d05efbb9d6196c27668eb943e934943ae)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-20 15:40:09 +01:00
Andreas Cadhalpun
0f1e398874 nutdec: only copy the header if it exists
Fixes ubsan runtime error: null pointer passed as argument 2, which is
declared to never be null

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 9f82506c79874edd7b09707ab63d9e72078de8f9)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-20 15:40:05 +01:00
Andreas Cadhalpun
79d75f1554 exr: fix out of bounds read in get_code
This macro unconditionally used out[-1], which causes an out of bounds
read, if out is the very beginning of the buffer.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 90b99a81071d10e6b5efe86a4602d54d4f45bbcb)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-20 15:40:01 +01:00
Andreas Cadhalpun
105be66545 on2avc: limit number of bits to 30 in get_egolomb
More don't fit into the integer output.

Also use get_bits_long, since get_bits only supports reading up to 25
bits, while get_bits_long supports the full integer range.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 4d5c3b02e9d2c9a630ca433fabca43285879e0b8)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-20 15:39:57 +01:00
Andreas Cadhalpun
46e7a63b6e sonic: make sure num_taps * channels is not larger than frame_size
If that is the case, the loop setting predictor_state in
sonic_decode_frame causes out of bounds reads of int_samples, which has
only frame_size number of elements.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 9637c2531f7eb040ad1c3cb46cb40a63dfc77b80)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-20 15:39:20 +01:00
Andreas Cadhalpun
31d6900161 opus_silk: fix typo causing overflow in silk_stabilize_lsf
Due to this typo max_center can be too large, causing nlsf to be set to
too large values, which in turn can cause nlsf[i - 1] + min_delta[i] to
overflow to a negative value, which is not allowed for nlsf and can
cause an out of bounds read in silk_lsf2lpc.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit f61d44b74aaae1d306d8a0d38b7b3d4292c89ced)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-20 15:39:16 +01:00
Andreas Cadhalpun
5478e7bbc1 ffm: reject invalid codec_id and codec_type
A negative codec_id cannot be handled by the found_decoder API of
AVStream->info: if the codec_id is not recognized, found_decoder is set
to -codec_id, which has to be '<0' according to the API documentation.

This can cause NULL pointer dereferencing in try_decode_frame.

Also make sure the codec_type matches the expected one for codec_id.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit ecf63b7cc24b9fd3e6d604313325dd1ada4db662)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-20 15:39:11 +01:00
Andreas Cadhalpun
26b74a7213 aaccoder: prevent crash of anmr coder
If minq is negative, the range of sf_idx can be larger than
SCALE_MAX_DIFF allows, causing assertion failures later in
encode_scale_factors.

Reviewed-by: Claudio Freire <klaussfreire@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 7a4652dd5da0502ff21c183b5ca7d76b1cfd6c51)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-20 15:38:32 +01:00
Andreas Cadhalpun
cc77012329 ffmdec: reject zero-sized chunks
If size is zero, avio_get_str fails, leaving the buffer uninitialized.
This causes invalid reads in av_set_options_string.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit a611375db532c3d5363d97b10fadd0211811a4fd)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-12-20 15:38:27 +01:00
Michael Niedermayer
dbc3797779 swscale/x86/rgb2rgb_template: Fallback to mmx in interleaveBytes() if the alignment is insufficient for SSE*
This also as a sideeffect fixes the non aligned case

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a066ff89bcbae6033c2ffda9271cad84f6c1b807)
2015-12-15 11:19:39 +01:00
Michael Niedermayer
f8b83cfa1c swscale/x86/rgb2rgb_template: Do not crash on misaligend stride
Fixes Ticket5013

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 80bfce35ccd11458e97f68f417fc094c5347070c)
2015-12-15 11:19:36 +01:00
Andreas Cadhalpun
d52b5f85f2 mjpegdec: consider chroma subsampling in size check
If the chroma components are subsampled, smaller buffers are allocated
for them. In that case the maximal block_offset for the chroma
components is not as large as for the luma component.

This fixes out of bounds writes causing segmentation faults or memory
corruption.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 5adb5d9d894aa495e7bf9557b4c78350cbfc9d32)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-07 01:34:15 +01:00
Michael Niedermayer
ffe40ef9b4 Update Changelog
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:31:14 +01:00
Michael Niedermayer
f0ae57aca4 avcodec/hevc: Check max ctb addresses for WPP
Fixes out of array read
Fixes: 2f95ddd996db8a6281d2e18c184595a7/asan_heap-oob_192fe91_3330_58e4441181e30a66c19f743dcb392347.bit

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit dad354f38ddc9bfc834bc21358a1d0ad41532ca0)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>

Conflicts:

	libavcodec/hevc.c

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:16:35 +01:00
Michael Niedermayer
4a91e424da avcodec/vp3: ensure header is parsed successfully before tables
Fixes assertion failure
Fixes: 266ee543812e934f7b4a72923a2701d4/signal_sigabrt_7ffff6ae7cc9_7322_85218d61759d461bdf7387180e8000c9.ogg

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 26379d4fddc17cac853ef297ff327b58c44edbad)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:08:26 +01:00
Michael Niedermayer
f217aca5ba avcodec/jpeg2000dec: Check bpno in decode_cblk()
Fixes: undefined shift
Fixes: c409ef86f892335a0a164b5871174d5a/asan_heap-oob_1dff564_2159_162b7234616deab02b544410455eb07b.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a85b02dcf70f62a6a433a607143f1f78fa5648bb)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:08:26 +01:00
Michael Niedermayer
e4f90cbd0d avcodec/pgssubdec: Fix left shift of 255 by 24 places cannot be represented in type int
Fixes: b293a6479bb4b5286cff24d356bfd955/asan_generic_225c3c9_7819_cc526b657450c6cdef1371b526499626.mkv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4f2419888ba49245761f4ab343679c38e7880cfe)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:08:26 +01:00
Michael Niedermayer
5b41c96146 swscale/utils: Fix for runtime error: left shift of negative value -1
Fixes: c106b36fa36db8ff8f3ed0c82be7bea2/asan_heap-oob_32699f0_6321_467b9a1d7e03d7cfd310b7e65dc53bcc.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 325b59368dae3c3f2f5cc39873002b4cf133ccbc)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:08:26 +01:00
Michael Niedermayer
5c0be549ef avcodec/hevc: Fix integer overflow of entry_point_offset
Fixes out of array read
Fixes: d41d8cd98f00b204e9800998ecf8427e/signal_sigsegv_321165b_7641_077dfcd8cbc80b1c0b470c8554cd6ffb.bit

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 214085852491448631dcecb008b5d172c11b8892)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:08:26 +01:00
Michael Niedermayer
9ce8308ee3 avcodec/dirac_parser: Check that there is a previous PU before accessing it
Fixes out of array read
Fixes: 99d142c47e6ba3510a74b872a1a2ae72/asan_heap-oob_11b36f4_3811_0f5c69e7609a88a580135678de1df844.dxa

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a08681f1e614152184615e2bcd71c3d63835f810)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:08:26 +01:00
Michael Niedermayer
87dbcf7cd2 avcodec/dirac_parser: Add basic validity checks for next_pu_offset and prev_pu_offset
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c7d6ec947c053699950af90f695413a5640b3872)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:08:26 +01:00
Michael Niedermayer
752a6591b2 avcodec/dirac_parser: Fix potential overflows in pointer checks
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 79798f7c57b098c78e0bbc6becd64b9888b013d1)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:08:26 +01:00
Michael Niedermayer
38c1ab17ea avcodec/wmaprodec: Check bits per sample to be within the range not causing integer overflows
Fixes: 549d5aab1480d10f2a775ed90b0342f1/signal_sigabrt_7ffff6ae7cc9_5643_96bbb0cfe3e28be1dadfce1075016345.wma

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 66e05f6ff5e5c105bdd7bf3a49234ddac1b592c5)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:08:26 +01:00
Michael Niedermayer
4b77e0a33e avcodec/wmaprodec: Fix overflow of cutoff
Fixes: 129ca3e28d73af7b1e24a9d4118e7a2d/signal_sigabrt_7ffff6ae7cc9_836_762b310fc3ef6087bd7771e5d8e90b9b.asf

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0c56f8303e676556ea09bfac73d881c6c9057259)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:08:26 +01:00
Michael Niedermayer
c108dfc6cc avformat/smacker: fix integer overflow with pts_inc
Fixes: ce19e41f0ef1e52a23edc488faecdb58/asan_heap-oob_2504e97_4202_ffa0df1baed14022b9bfd4f8ac23d0cb.smk

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7ed47e97297fd5ef473d0cc93f0455adbadaac83)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:08:26 +01:00
Michael Niedermayer
f41c1d3bfe avcodec/vp3: Fix "runtime error: left shift of negative value"
Fixes: 5c6129154b356b80bcab86f9e3ee5d29/signal_sigabrt_7ffff6ae7cc9_7322_d26ac6d7cb6567db1b8be0159b387d0b.ogg

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 18268f761bffb37552f59f87542fef3d5c80618c)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:08:26 +01:00
Timo Teräs
cfd1bc5810 mpegencts: Fix overflow in cbr mode period calculations
ts->mux_rate is int (signed 32-bit) type. The period calculations
will start to overflow when mux_rate > 5mbps. This fixes overflows
by converting first to 64-bit type.

Fixes #5044.

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 64f7db554ee83846f207e82a08946a6a5a6acfe2)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:08:26 +01:00
Michael Niedermayer
c8ca4b3275 avutil/timecode: Fix fps check
The fps variable is explicitly set to -1 in case of some errors, the check must
thus be signed or the code setting it needs to use 0 as error code
the type of the field could be changed as well but its in an installed header

Fixes: integer overflow
Fixes: 9982cc157b1ea90429435640a989122f/asan_generic_3ad004a_3799_22cf198d9cd09928e2d9ad250474fa58.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b46dcd5209a77254345ae098b83a872634c5591b)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:08:26 +01:00
Michael Niedermayer
238c7c8276 avutil/mathematics: return INT64_MIN (=AV_NOPTS_VALUE) from av_rescale_rnd() for overflows
Fixes integer overflow
Fixes: mozilla bug 1229167

Found-by: Tyson Smith
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f03c2ceec174877e03bb302f5971fbe9ffbe4856)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:08:26 +01:00
Michael Niedermayer
eff24a1f13 avcodec/apedec: Check length in long_filter_high_3800()
Fixes out of array read
Fixes: 0a7ff0c1d93da9cef28a315ec91b692a/asan_heap-oob_4a52e5_3604_9c56dbb20e308f4faeef7b35f688521a.ape

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit cd7524fdd13dc8d0cf22e2cfd8300a245542b13a)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:08:26 +01:00
Michael Niedermayer
9b28bbb10c avcodec/vp3: always set pix_fmt in theora_decode_header()
Fixes assertion failure
Fixes: d0bb0662da342ec65f8f2a081222e6b9/signal_sigabrt_7ffff6ae7cc9_5471_82964f0a9ac2f4d3d59390c15473f6f7.ogg

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a814f1d364ba912adf61adef158168c5f7604e93)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:08:25 +01:00
Michael Niedermayer
73870147f8 avcodec/mpeg4videodec: Check available data before reading custom matrix
Fixes: out of array read
Fixes: 76c515fc3779d1b838667c61ea13ce92/asan_heap-oob_1fc0d07_8913_794a4629a264ebdb25b58d3a94ed1785.bit

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 891dc8f87536ac2ec695c70d081345224524ad99)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:08:25 +01:00
Michael Niedermayer
582a6035bc avutil/mathematics: Do not treat INT64_MIN as positive in av_rescale_rnd
The code expects actual positive numbers and gives completely wrong
results if INT64_MIN is treated as positive
Instead clip it into the valid range that is add 1 and treat it as
negative

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 25e37f5ea92d4201976a59ae306ce848d257a7e6)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:08:25 +01:00
Michael Niedermayer
60369668ca avutil/integer: Fix av_mod_i() with negative dividend
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3a9cb18855d29c96a5d9d2f5ad30448cae3a2ddf)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:08:25 +01:00
Michael Niedermayer
439452a851 avformat/dump: Fix integer overflow in av_dump_format()
Fixes part of mozilla bug 1229167

Found-by: Tyson Smith
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 8e7f4520226d2d9ad6a58ad6c32d1455a8b244b2)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:08:25 +01:00
Michael Niedermayer
e5d162ae9b avcodec/utils: Clear dimensions in ff_get_buffer() on failure
Fixes out of array access
Fixes: 482d8f2fd17c9f532b586458a33f267c/asan_heap-oob_4a52b6_7417_1d08d477736d66cdadd833d146bb8bae.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit abee0a1c60612e8638640a8a3738fffb65e16dbf)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:08:25 +01:00
Michael Niedermayer
6e28d0d047 avcodec/utils: Use 64bit for aspect ratio calculation in avcodec_string()
Fixes integer overflow
Fixes: 3a45b2ae02f2cf12b7bd99543cdcdae5/asan_heap-oob_1dff502_8022_899f75e1e81046ebd7b6c2394a1419f4.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4f03bebc79f76df3a3e5bb9e1bc32baabfb7797c)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-06 02:08:25 +01:00
Michael Niedermayer
2b9e849c37 avcodec/vp3: Clear context on reinitialization failure
Fixes null pointer dereference
Fixes: 1536b9b096a8f95b742bae9d3d761cc6/signal_sigsegv_294aaed_2039_8d1797aeb823ea43858d0fa45c9eb899.ogv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 6105b7219a90438deae71b0dc5a034c71ee30fc0)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-05 23:48:52 +01:00
Michael Niedermayer
d8c0546ecd avcodec/hevc: allocate entries unconditionally
Fixes out of array access
Fixes: 08664a2a7921ef48172f26495c7455be/asan_heap-oob_23036c6_3301_523388ef84285a0270caf67a43247b59.bit

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d85aa76115214183e7e3b7d65e950da61474959a)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>

Conflicts:

	libavcodec/hevc.c
2015-12-05 23:48:52 +01:00
Michael Niedermayer
f9d6d02fd1 avcodec/hevc_cabac: Fix multiple integer overflows
Fixes: 04ec80eefa77aecd7a49a442cc02baea/asan_heap-oob_19544fa_3303_1905796cd9d8e15f86d664332caabc00.bit

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d5028f61e44b7607b6a547f218f7d85217490a5b)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-05 23:48:52 +01:00
Michael Niedermayer
6bc2f5cc0b avcodec/jpeg2000dwt: Check ndeclevels before calling dwt_encode*()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit feb3f39614b88c113211a98dda1bc2fe5c3c6957)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-05 23:48:52 +01:00
Michael Niedermayer
551e18aa92 avcodec/jpeg2000dwt: Check ndeclevels before calling dwt_decode*()
Fixes out of array access
Fixes: 01859c9a9ac6cd60a008274123275574/asan_heap-oob_1dff571_8250_50d3d1611e294c3519fd1fa82198b69b.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 75422280fbcdfbe9dc56bde5525b4d8b280f1bc5)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-05 23:48:52 +01:00
Michael Niedermayer
c6b81e252e avcodec/hevc: Check entry_point_offsets
Fixes out of array read
Fixes: 007c4a36608ebdf27ee260ad60a81184/asan_heap-oob_32076b4_2243_116b1cb29d91cc4974d6680e3d10bd91.bit

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ef9f7bbfa47317f9d46bf46982a394d2be78503c)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-05 23:48:52 +01:00
Michael Niedermayer
d3de02d9d4 avcodec/cabac: Check initial cabac decoder state
Fixes integer overflows
Fixes: 1430e9c43fae47a24c179c7c54f94918/signal_sigsegv_421427_2340_591e9810c7b09efe501ad84638c9e9f8.264

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Found-by: xiedingbao (Ticket4727)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 8000d484b83aafa752d84fbdbfb352ffe0dc64f8)

Conflicts:

	libavcodec/cabac.h

Conflicts:

	libavcodec/h264_cabac.c
	libavcodec/h264_slice.c
2015-12-05 23:48:52 +01:00
Michael Niedermayer
cc80478463 avcodec/cabac_functions: Fix "left shift of negative value -31767"
Fixes: 1430e9c43fae47a24c179c7c54f94918/signal_sigsegv_421427_2340_591e9810c7b09efe501ad84638c9e9f8.264

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Found-by: xiedingbao (Ticket4727)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a1f6b05f5228979dab0e149deca7a30d22e98af5)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-12-05 23:48:52 +01:00
Michael Niedermayer
fa3df7ae41 avcodec/ffv1dec: Clear quant_table_count if its invalid
Fixes deallocation of corrupted pointer
Fixes: 343dfbe142a38b521ed069dc4ea7c03b/signal_sigsegv_421427_4074_ffb11959610278cd40dbc153464aa254.avi
No releases affected

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit e04126072e984f8db5db9da9303c89ae01f7d6bb)

Fixes ticket #5052.
2015-12-02 12:02:51 +01:00
Michael Niedermayer
b622d6f6f6 avcodec/ffv1dec: Print an error if the quant table count is invalid
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a8b254e436dce2f5c8c6459108dab4b02cc6b79b)
2015-12-02 12:00:22 +01:00
Andrey Utkin
dc5bec14ab doc/filters/drawtext: fix centering example
Signed-off-by: Andrey Utkin <andrey.od.utkin@gmail.com>
Signed-off-by: Lou Logan <lou@lrcd.com>
(cherry picked from commit 648b26acc5e25ab40c43fddc54b50e9f0b13ebd8)
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2015-12-01 17:33:12 -08:00
Michael Niedermayer
5c2f083abb Update for 2.5.9
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 18:02:42 +01:00
Michael Niedermayer
9ba0cb7c27 avcodec/h264_slice: Limit max_contexts when slice_context_count is initialized
Fixes out of array access
Fixes: 1430e9c43fae47a24c179c7c54f94918/signal_sigsegv_421427_2049_f2192b6829ab6e0eefcb035329c03c60.264

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4ea4d2f438c9a7eba37980c9a87be4b34943e4d5)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:33 +01:00
Michael Niedermayer
608f928c74 avcodec/vp8: Do not use num_coeff_partitions in thread/buffer setup
The variable is not a constant and can lead to race conditions

Fixes: repro.webm (not reproducable with FFmpeg alone)

Found-by: Dale Curtis <dalecurtis@google.com>
Tested-by: Dale Curtis <dalecurtis@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit dabea74d0e82ea80cd344f630497cafcb3ef872c)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:33 +01:00
Martin Storsjö
795908eff4 rtmpcrypt: Do the xtea decryption in little endian mode
The XTEA algorithm operates on 32 bit numbers, not on byte sequences.
The XTEA implementation in libavutil is written assuming big endian
numbers, while the rtmpe signature encryption assumes little endian.

This fixes rtmpe communication with rtmpe servers that use signature
type 8 (XTEA), e.g. crunchyroll.

CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit e7728319b92dbb4fb949155e33de7ff5358ddff3)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:33 +01:00
Michael Niedermayer
eb2f0a4465 avformat/matroskadec: Check subtitle stream before dereferencing
Unrecognized streams are not allocated
Fixes: flicker-1.color1.vp91447030769.08.webm

Found-by: Chris Cunningham <chcunningham@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a5034b324cad4c29d47ef285a30b0705e6eb0384)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:33 +01:00
Michael Niedermayer
fddf95da95 avformat/utils: Do not init parser if probing is unfinished
Fixes assertion failure
Fixes: 136f8b8d47af7892306625e597dee655/signal_sigabrt_7ffff6ae7cc9_8941_ab11bea57c84796418f481f873dc31ba.dvr_ms

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 1ef336e912a7a3a13a9933825a56c421f891e44b)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:33 +01:00
Michael Niedermayer
cd7598fb1b avcodec/jpeg2000dec: Fix potential integer overflow with tile dimensions
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 65d3359fb366ea265a8468d76a111cb7352f0b55)

Conflicts:

	libavcodec/jpeg2000dec.c
2015-11-26 16:58:33 +01:00
Michael Niedermayer
13434d5f9f avcodec/jpeg2000dec: Check SIZ dimensions to be within the supported range
Fixes potential integer overflows
Fixes: 03e0abe721b1174856d41a1eb5d6a896/signal_sigabrt_7ffff6ae7cc9_3813_e71bf3541abed3ccba031cd5ba0269a4.avi

This fix is choosen to be simple to backport, better solution
for master is planed

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 6ef819c40bcc2175edba7ce9e20c3036c01b36b9)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:33 +01:00
Michael Niedermayer
58fa73a4d0 avcodec/jpeg2000: Check comp coords to be within the supported size
Fixes assertion failure
Fixes: 03e0abe721b1174856d41a1eb5d6a896/signal_sigabrt_7ffff6ae7cc9_3813_e71bf3541abed3ccba031cd5ba0269a4.avi

This fix is choosen to be simple to backport, better solution
for master is planed

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a1a8cbcb35ef2759a66b4f0875785e4b3f277057)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:33 +01:00
Michael Niedermayer
7468cb847c avcodec/jpeg2000: Use av_image_check_size() in ff_jpeg2000_init_component()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 016fd413f9168816924f21c0c1ffb578f7226221)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:33 +01:00
Michael Niedermayer
be280f3e8b avcodec/wmaprodec: Check for overread in decode_packet()
Fixes assertion failure
Fixes: 0256e92df2df7e933b43a2c70e4c8040/signal_sigabrt_7ffff6ae7cc9_1358_999ac18684788221490757582ce9af84.wma

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7ad698e24e6b9dde57c4e01c145bcddfe9d6e4a3)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:33 +01:00
Michael Niedermayer
2b0cda395f avcodec/smacker: Check that the data size is a multiple of a sample vector
Fixes out of array access
Fixes: ce19e41f0ef1e52a23edc488faecdb58/asan_heap-oob_2504e97_4202_ffa0df1baed14022b9bfd4f8ac23d0cb.smk

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4a9af07a49295e014b059c1ab624c40345af5892)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:33 +01:00
Michael Niedermayer
6816644f34 avcodec/takdec: Skip last p2 sample (which is unused)
Fixes out of array read
Fixes: cb3f38b08b4541523974667c7d1eee9e/asan_heap-oob_2659e18_9838_021fd5cd635bf76cede6398cd9ecbcdd.tak

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 08b520636e96ba6888b669b9b3f4c414631ea1d2)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:33 +01:00
Michael Niedermayer
ac7cc433ad avcodec/dxtory: Fix input size check in dxtory_decode_v1_410()
Fixes potential out of array read

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 76b6f4b7d91901929177cc61d9810dcca0bb40c1)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:33 +01:00
Michael Niedermayer
f43b6a094c avcodec/dxtory: Fix input size check in dxtory_decode_v1_420()
Fixes out of array read
Fixes: c50c4aa6cefda71b19a31ea12302980c/asan_heap-oob_12be5fd_7011_33ebd015a74976215934add72b9c8352.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 9caa9414ccf2dcf8aee2695377dee830a5024c82)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:33 +01:00
Michael Niedermayer
44d82a8fa1 avcodec/error_resilience: avoid accessing previous or next frames tables beyond height
The height of tables can be rounded up for MBAFF but this does not imply that is also true
for the previous frames

Fixes out of array reads
Fixes: c106b36fa36db8ff8f3ed0c82be7bea2/asan_heap-oob_32699f0_6321_467b9a1d7e03d7cfd310b7e65dc53bcc.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a105f52855d08e4ab1ed7306da8e32fc90d6d647)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:33 +01:00
Michael Niedermayer
19c931fe66 avcodec/dpx: Move need_align to act per line
Fixes out of array read
Fixes: 61cf123c081ee2bb774d307c75bdb99e/asan_heap-oob_1224f76_5546_bee833ffae73f752b489b9eeaac52db7.dpx

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c8aaae8e0f1519bc99bd717ea3067c9cfdb68def)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:33 +01:00
Michael Niedermayer
93ff48fd2e avcodec/flashsv: Check size before updating it
Fixes out of array read
Fixes: 3c857d4d90365731524716e6d051e43a/signal_sigsegv_7f4f59bcc29e_1386_20abd2c8e655cb9c75b24368e65fe3b1.flv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 17705f5d4f57c15f9b9bb9cfcbbb4621fed2fc70)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:33 +01:00
Michael Niedermayer
ffaea7a790 avcodec/ivi: Check image dimensions
Fixes integer overflow
Fixes: 1e32c6c591d940337c20b197ec1c4d3d/asan_heap-oob_4a52e5_8946_0bb0d9e863def56005e49f1d89bdc94d.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit df91aa034b82b77a3c4e01791f4a2b2ff6c82066)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:33 +01:00
Michael Niedermayer
72ac69bd05 avcodec/utils: Better check for channels in av_get_audio_frame_duration()
Fixes integer overflow
Fixes: 0c2625f236ced104d402b4a03c0d65c7/asan_generic_274e1ce_5990_9314e7a67c26aecf011b178ade9f217c.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4e16ad2868a1819de6680fc355a8eb20164adaea)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:33 +01:00
Michael Niedermayer
be4b41b6cb avcodec/jpeg2000dec: Check for duplicate SIZ marker
Fixes: 0231a17345734228011c6f35a64e4594/asan_heap-oob_1d92a72_3218_1213809a9e3affec77e4c191fdfdc0a9.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 44a7f17d0b20e6f8d836b2957e3e357b639f19a2)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:33 +01:00
Michael Niedermayer
9e755b9b99 avcodec/jpeg2000dec: Clip all tile coordinates
Fixes out of array access
Fixes: b877a6b788a25c70e8b1d014f8628549/asan_heap-oob_1da2c3f_2324_5a1b329b0b3c4bb6b1d775660ac56717.r3d

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 43492ff3ab68a343c1264801baa1d5a02de10167)

Conflicts:

	libavcodec/jpeg2000dec.c
2015-11-26 16:58:33 +01:00
Michael Niedermayer
5bb599d0c0 avcodec/microdvddec: Check for string end in 'P' case
Fixes out of array read
Fixes: a9502b60f4cecc19475382aee255f73c/asan_heap-oob_1e87fba_2548_a8ad47f6dde36644fe9cdc444d4632d0.sub

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c719cd6cf79ec21d974b81ba874580f4b8e9eb90)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:33 +01:00
Michael Niedermayer
1497b0bb93 avcodec/dirac_parser: Fix undefined memcpy() use
Fixes: 9d375e415486edd1a0c826f2307d89a4/asan_generic_4a5159_1577_faa333e83dacdd9e4dd322380aeed537.iss

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit daefd8ab2f2aeb90cd53cb75445faffdc7a3cc79)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:33 +01:00
Michael Niedermayer
fd7bb09e8a avformat/xmv: Discard remainder of packet on error
Fixes infinite loop
Fixes: 9c48ae2680c5f23bca3d20ff0f325fd8/asan_generic_4c254d_1374_993f1e5967dd6f844b8d72f978ce2a6c.pss

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 79c4a338e4b2bf0bc6f81c9f455994f673a92f78)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:33 +01:00
Michael Niedermayer
46cece74c3 avformat/xmv: factor return check out of if/else
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 9b6fac11da470274d4b93d46ef66527aa1824179)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:33 +01:00
Michael Niedermayer
312895a6d7 libavutil/channel_layout: Check strtol*() for failure
Fixes assertion failure
Fixes: 4f5814bb15d2dda6fc18ef9791b13816/signal_sigabrt_7ffff6ae7cc9_65_7209d160d168b76f311be6cd64a548eb.wv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c9bfd6a8c35a2102e730aca12f6e09d1627f76b3)

Conflicts:

	libavutil/channel_layout.c
2015-11-26 16:58:33 +01:00
Michael Niedermayer
86018daa41 avcodec/ffv1dec: Check for 0 quant tables
Fixes assertion failure
Fixes: 07ec1fc3c1cbf2d3edcd7d9b52ca156c/asan_heap-oob_13624c5_491_ecd4720a03e697ba750b235690656c8f.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5745cf799a4389bc5d14f2b4daf32fe4631c50bc)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:33 +01:00
Michael Niedermayer
aed64448d6 avcodec/mjpegdec: Reinitialize IDCT on BPP changes
Fixes misaligned access
Fixes: dc9262a469f6f315f74c087a7b3a7f35/signal_sigsegv_2e95bcd_9_9c0f9f4a9ba82aa9b3ab2b91ce4d5277.jpg

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit cc35f6f4768ffe57cc4fcfa56ecb89aee409e3d5)

Conflicts:

	libavcodec/mjpegdec.c
2015-11-26 16:58:33 +01:00
Michael Niedermayer
f2b161319d avcodec/mjpegdec: Check index in ljpeg_decode_yuv_scan() before using it
Fixes: 04715144ba237443010554be0d05343f/asan_heap-oob_1eafc76_1737_c685b48041a563461839e4e7ab97abb8.jpg
Fixes out of array access

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d24888ef19ba38b787b11d1ee091a3d94920c76a)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:33 +01:00
Tobias Rapp
3ce0dcfaab avutil/file_open: avoid file handle inheritance on Windows
Avoids inheritance of file handles on Windows systems similar to the
O_CLOEXEC/FD_CLOEXEC flag on Linux.

Fixes file lock issues in Windows applications when a child process
is started with handle inheritance enabled (standard input/output
redirection) while a FFmpeg transcoding is running in the parent
process.

Links relevant to the subject:

https://msdn.microsoft.com/en-us/library/w7sa2b22.aspx

Describes the _wsopen() function and the O_NOINHERIT flag. File handles
opened by _wsopen() are inheritable by default.

https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425%28v=vs.85%29.aspx

Describes handle inheritance when creating new processes. Handle
inheritance must be enabled (bInheritHandles = TRUE) e.g. when you want
to pass handles for stdin/stdout via lpStartupInfo.

Signed-off-by: Tobias Rapp <t.rapp@noa-audio.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 474665346616e446ecd1407002fdf5f88201bf72)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:32 +01:00
Kieran Kunhya
cde478f526 opusdec: Don't run vector_fmul_scalar on zero length arrays
Fixes crashes on fuzzed files
Fixes Ticket4969 part2

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b3e5f15b95f04a35821f63f6fd89ddd60f666a59)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:32 +01:00
Michael Niedermayer
31a5bde1bf avcodec/ffv1: Initialize vlc_state on allocation
This ensures that they are always set to valid values
Fixes Ticket4939

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a878dfa4f57d068eb69fb6614f7a4a20f769ee7b)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:32 +01:00
Michael Niedermayer
20a21bce34 avcodec/ffv1dec: update progress in case of broken pointer chains
Fixes deadlock
Fixes Ticket4932

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5063a18f5635008b2a45ada1f8c1e21e20450029)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:32 +01:00
Michael Niedermayer
46c7b1169f avcodec/ffv1dec: Clear slice coordinates if they are invalid or slice header decoding fails for other reasons
Fixes Ticket4931

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4c2d4e8700cd3db59bc11ab196c0002215cf601f)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:32 +01:00
Andrey Utkin
630ef09766 avformat/httpauth: Add space after commas in HTTP/RTSP auth header
This fixes access to Grandstream cameras, which return 401 to ffmpeg
otherwise.
VLC sends Authorization: header with spaces between parameters, and it
is known to work with Grandstream devices and broad range of other HTTP
and RTSP servers, so author considers switching to such behaviour safe.
Just for record - RFC 2617 (HTTP Auth) does not specify the need in
spaces, so this is not a bug of FFmpeg.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit fdb32838723effb4560a345013387ea37b85ff20)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:32 +01:00
Michael Niedermayer
2205fcd3de avcodec/x86/sbrdsp: Fix using uninitialized upper 32bit of noise
Fixes crash
Fixes: flicker-1.scout3d21443372922.28.m4a

Found-by: Dale Curtis <dalecurtis@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 1b82b934a166e60f64e966eaa97512ba9dcb615b)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:32 +01:00
Michael Niedermayer
8bfe8b422a avcodec/ffv1dec: Fix off by 1 error in quant_table_count check
Fixes: invalid_read.nut
Found-by: Paul B Mahol <onemda@gmail.com>

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2d221d9e069e6269cb41f3678f2734800171d87b)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:32 +01:00
Michael Niedermayer
54bc183897 avcodec/ffv1dec: Explicitly check read_quant_table() return value
Forwards the error code, avoids potential integer overflow

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 10bbf6cf622f8a954c6cc694ca07c24f989c99af)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:32 +01:00
Michael Niedermayer
9c0fb2548f avcodec/rangecoder: Check e
Fixes hang.nut

Found-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b2955b6c5aed11026ec5c7164462899a10cdb937)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:32 +01:00
Simon Thelen
89b7e5cb2a lavf/webvttenc: Require webvtt file to contain exactly one WebVTT stream.
Not requiring this can end up producing hilariously broken files
together with -c:s copy (e.g. a webvtt file containing binary subtitle data).

Signed-off-by: Simon Thelen <ffmpeg-dev@c-14.de>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b84232694ef0c6897e82b52326c9ea4027c69ec4)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:32 +01:00
Michael Niedermayer
93fc958f22 avcodec/mjpegdec: Fix decoding RGBA RCT LJPEG
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 055e56e9f76da3298f1b59bf5ea46f570e844600)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:32 +01:00
Ganesh Ajjanagadde
24e9640c04 avfilter/af_asyncts: use llabs for int64_t
long may not be 64 bit on all platforms; so labs on int64_t is unsafe.
This fixes a warning reported in:
http://fate.ffmpeg.org/log.cgi?time=20150905071512&log=compile&slot=i386-darwin-clang-polly-3.7

Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d74123d03eb1047b844bc39fbde26f199c72cbcb)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:32 +01:00
Michael Niedermayer
7353f529c2 avcodec/g2meet: Also clear tile dimensions on header_fail
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit fb0466699575724923aeddc4490302180dfdf4af)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:32 +01:00
Michael Niedermayer
9f825fa96e avcodec/g2meet: Fix potential overflow in tile dimensions check
Fixes CID1322351

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 71ec8e1ed6cf4947e204e3e4b5929a44c054f5fb)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:32 +01:00
Michael Niedermayer
86f0534b48 avcodec/svq1dec: Check init_get_bits8() for failure
Fixes: CID1322313

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a51d4246d8ac96acee735e7e5dedb9d9ef27a594)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:32 +01:00
Michael Niedermayer
7528e36774 avcodec/tta: Check init_get_bits8() for failure
Fixes: CID1322319

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f1593e4ca564cdb7f3194a9eee1dea16df41142d)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:32 +01:00
Michael Niedermayer
2c08fc9b28 swresample/swresample: Fix integer overflow in seed calculation
Fixes CID1322333

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 32f53958b8f6ed4c3c2a7447c1e47d012796fae2)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:32 +01:00
Michael Niedermayer
4531c0dc8f avformat/mov: Fix integer overflow in FFABS
Fixes: unknown_unknown_19e_414_cov_764838672_bellhamlam.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 053e80f6eaf8d87521fe58ea96886b6ee0bbe59d)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:32 +01:00
Michael Niedermayer
8ebeefecf7 avutil/common: Add FFNABS()
This macro avoids the undefined corner case with the *_MIN values

Previous version Reviewed-by: Ganesh Ajjanagadde <gajjanag@mit.edu>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d6cd614dac579850076ae312c29c4188f8659e46)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:32 +01:00
Michael Niedermayer
b2d7e55584 avutil/common: Document FFABS() corner case
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 733511fb53fedd3adaaeabc5db9d0b29e71ea1d3)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:32 +01:00
Michael Niedermayer
9bbe777f8f avformat/dump: Fix integer overflow in aspect ratio calculation
Fixes: unknown_unknown_19e_414_cov_764838672_bellhamlam.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit d1bdaf3fb2c45020f72a378bb64eab1bf136581c)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:32 +01:00
Michael Niedermayer
93f5d0c536 avcodec/truemotion1: Check for even width
Fixes out of array access
Fixes: 87196d8bbc633629fc9dd851fce73e70/asan_heap-oob_26f6853_862_cov_585961513_sonic3dblast_intro-partial.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 63fb5a6aefb4223334001fd2c0d82a5e22e3b528)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:32 +01:00
Michael Niedermayer
ffa2f97e01 avcodec/mpeg12dec: Set dimensions in mpeg1_decode_sequence() only in absence of errors
Fixes assertion failure
Fixes: 56dcafde14a8397161bb61a16c511179/signal_sigabrt_7ffff6ac8cc9_686_cov_1897408623_microsoft_new_way_to_shove_mpeg2_in_asf.dvr_ms

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b54e03c9dc2a05324c08b503bfe7535c49c0f281)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:32 +01:00
Michael Niedermayer
377d68f9f4 avcodec/libopusenc: Fix infinite loop on flushing after 0 input
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 6701c92fa4269872856c70c3170a9b3291b46247)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:32 +01:00
Michael Niedermayer
221abc1ef6 avformat/hevc: Check num_long_term_ref_pics_sps to avoid potentially long loops
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ee155c18a2c50b339ba5f6f223fbb6dc343fd471)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:32 +01:00
Arthur Grant
df27f8d5fd avformat/hevc: Fix parsing errors
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 781efd07415cdf6f676cca5b22147e5d6be0a4c4)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:32 +01:00
Michael Niedermayer
00ae76c3d0 ffmpeg: Use correct codec_id for av_parser_change() check
No testcase known

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 45f3d4e63e7807ff3d281f269625ed83f11e4cdc)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:32 +01:00
Michael Niedermayer
58e424cdee ffmpeg: Check av_parser_change() for failure
No testcase known

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ac0ba6f233698f02ebb75b03242e94333dbe13d4)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:31 +01:00
Michael Niedermayer
5ab1f18853 ffmpeg: Check for RAWVIDEO and do not relay only on AVFMT_RAWPICTURE
The null muxer has AVFMT_RAWPICTURE set but can be fed with non-raw material

related to Ticket4778

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit c8890941d63df786bb7a8cab92677416499bb7c3)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:31 +01:00
Michael Niedermayer
60e398f280 ffmpeg: check avpicture_fill() return value
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 15ff3f3fdfc788c0e4e584badd7ec300abfbd716)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:31 +01:00
Michael Niedermayer
905853cd40 avformat/mux: Update sidedata in ff_write_chained()
Fixes Ticket4777

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit db91e0edb63afc682ae709f73e3732a4c832944d)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:31 +01:00
Michael Niedermayer
e11f85a4a5 avcodec/flashsvenc: Correct max dimension in error message
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b1f59bb6606721ef5eeade4ada541630d51510fe)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:31 +01:00
Michael Niedermayer
0bdf0cfa00 avcodec/svq1enc: Check dimensions
Fixes assertion failure

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 88fe45e0fe379d7ea86c8ac1e1e8cf2c3f62389f)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:31 +01:00
Michael Niedermayer
27ffd266fc avcodec/dcaenc: clear bitstream end
This avoids leaving uninitialized bits in the output

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit e322b7061f873e8fd33b9e518caa19b87616a528)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:31 +01:00
Emanuel Czirai
3d1cbf388d libavcodec/aacdec_template: Use init_get_bits8() in aac_decode_frame()
related to ticket4749

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7ab1c57a64b629455805d7fa74a8a20c689fc1f6)

Conflicts:

	libavcodec/aacdec_template.c
(cherry picked from commit dabb6dd98af52a22a922bca4a9196acf68b084dd)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-11-26 16:58:31 +01:00
Andreas Cadhalpun
cc0e35c441 mxfdec: check edit_rate also for physical_track
Previously only the edit_rate of material_track was checked.
If it's negative, it causes assertion failures in av_rescale_rnd.

Reviewed-by: Tim Nicholson <nichot20-at-yahoo.com@ffmpeg.org>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 047bf82c181c1220b3087b37f28445f8b87a7a23)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:56 +01:00
Andreas Cadhalpun
d52df5cffa mpegvideo: clear overread in clear_context
Otherwise the h263p decoder can try to copy overread bytes, even though
buffer is NULL.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 6a69a175e7b5c5393528ed0f5753e41573fa0df2)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:56 +01:00
Andreas Cadhalpun
b6a4abc770 dvdsubdec: validate offset2 similar to offset1
If it is negative, it causes segmentation faults in decode_rle.

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit f621749d1181987b3f815c6766ea66d6c5d55198)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:56 +01:00
Michael Niedermayer
8beb5d17f1 avcodec/takdec: Use memove, avoid undefined memcpy() use
Fixes: e214333cbd94c91228e624ff39329ce6/asan_generic_4a5159_6412_96cda2530e80607210ab41ccae3d456d.tak

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7cea3430a56fb0ff6ef60f08620fd3875e7bfeb6)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:56 +01:00
Andreas Cadhalpun
4636eb8968 jvdec: avoid unsigned overflow in comparison
The return type of strlen is size_t, i.e. unsigned, so if pd->buf_size
is 3, the right side overflows leading to a wrong result of the
comparison and subsequently a heap buffer overflow.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit db374790c75fa4ef947abcb5019fcf21d0b2de85)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:56 +01:00
Michael Niedermayer
54133b7aeb avcodec/mpeg12dec: Do not call show_bits() with invalid bits
Fixes assertion failure
Fixes: 63e50545709a6440d3d59f6426d58db9/signal_sigabrt_7ffff6ae7cc9_8189_3272a3010fd98ddf947c662bbde1ac13.ts

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 973c3dba27d0b1a88c70f6661b6a90d2f2e50665)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:56 +01:00
Andreas Cadhalpun
0cf02e015b riffdec: prevent negative bit rate
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 189420cb561929e05f5cc4224cdca83740a24a32)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:56 +01:00
Michael Niedermayer
4202e9d972 Merge commit 'd80811c94e068085aab797f9ba35790529126f85'
* commit 'd80811c94e068085aab797f9ba35790529126f85':
  riff: Use the correct logging context

Conflicts:
	libavformat/asfdec_o.c
	libavformat/avidec.c
	libavformat/dxa.c
	libavformat/matroskadec.c
	libavformat/mov.c
	libavformat/riff.h
	libavformat/riffdec.c
	libavformat/wavdec.c
	libavformat/wtvdec.c
	libavformat/xwma.c

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit ba77fb61f741d9ab3bd12935527556055b2ffb2e)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:56 +01:00
Andreas Cadhalpun
6c36f0b57c imc: use correct position for flcoeffs2 calculation
flcoeffs2[pos] should be the log2 of flcoeffs1[pos].
flcoeffs1[0] can be 0 here, thus flcoeffs2[pos] gets set to -inf,
causing problems further down.

This seems to have been copied from imc_decode_level_coefficients in
commit 4eb4bb3 without updating the position.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 75fd5ce4c1c0b2d96d71c74b650cefaaef519d27)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:56 +01:00
Andreas Cadhalpun
10bf3c2559 wavpack: limit extra_bits to 32 and use get_bits_long
More than 32 bits can't be stored in an integer and get_bits should not
be used with more than 25 bits.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit d0eff8857ceff2601f85037c930cbe61a88b611e)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:56 +01:00
Andreas Cadhalpun
87781f952b wavpack: use get_bits_long to read up to 32 bits
get_bits should not be used for more than 25 bits.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit f9883a669c3df05a5c453428e080298c6511a17e)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:56 +01:00
Andreas Cadhalpun
85ef06c666 nutdec: check maxpos in read_sm_data before returning success
Otherwise sm_size can be larger than size, which results in a negative
packet size.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 6b9fdf7f4f07926557048070cc2af3cfd0e3fe50)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:56 +01:00
Andreas Cadhalpun
d4aeaa2173 s302m: fix arithmetic exception
If nb_samples is zero, the bit_rate calculation results in a division by
zero.

Since ff_get_buffer fails if frame->nb_samples is zero, this can be
fixed by moving the bit_rate calculation after that function call.

That also makes it possible to reuse the already calculated
frame->nb_samples value.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 04dfbc9441beed93984568c1547f1ed588122627)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:55 +01:00
Michael Niedermayer
761bd6df06 avcodec/s302m: Only set the sample rate when some data is output
This way ffplay chooses the mp2 stream for Ticket3890

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 802cca5905abe1fe8392e85a812462b959889aaa)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:55 +01:00
Ronald S. Bultje
1548223d29 vp9: add support for resolution changes in inter frames.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e8b4f6d6befc5062db74916ea8a4d830e83022a8)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:55 +01:00
Andreas Cadhalpun
cd76447d3d alsdec: limit avctx->bits_per_raw_sample to 32
avctx->bits_per_raw_sample is used in get_sbits_long, which only
supports up to 32 bits.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4c2b88678b436f59132386d9be2fc143e3ee480d)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:55 +01:00
wm4
22dbde85e7 vp9: avoid infinite loop with broken files
With a certain fuzzed file, the parser will always return 0 consumed
bytes, which makes calling code call the parser infinitely. Return the
full packet size on error instead. (Here it would be nice if parsers
could return errors at all.)

Additionally, _if_ there's some data left, return that too, which might
help with somewhat broken but still somehow playable files.

Fixes ticket #4242.

Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 09b4ad15681be197fff8c57ce7c988a4718d6e03)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-11-26 01:37:52 +01:00
Ronald S. Bultje
11579f7e4e videodsp: don't overread edges in vfix3 emu_edge.
Fixes trac ticket 3226. Also see Andreas' analysis in
https://bugs.debian.org/801745, which was very helpful.
(cherry picked from commit 52f84d82bdf1851ecfcc412c1719e5f6f3396209)
2015-10-25 01:17:03 +02:00
Michael Niedermayer
8b158bf62c avcodec/h264_mp4toannexb_bsf: Reorder operations in nal_size check
Fixes Ticket4778

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2bb54b82b5094fd906aa28c0443be08c95662a31)
2015-10-09 21:58:11 +02:00
Michael Niedermayer
1024bcab62 avformat/oggenc: Check segments_count for headers too
Fixes infinite loop and segfault in ogg_buffer_data()
Fixes Ticket4806

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 81a8701eb52d2b6469ae16ef442ce425388141b7)
2015-10-09 21:58:00 +02:00
Michael Niedermayer
66b6ab355d avformat/avidec: Workaround broken initial frame
Fixes Ticket4851

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3e2ef00394b8079e93835d47c993868229f07502)
2015-10-09 21:57:24 +02:00
Hendrik Leppkes
7b6fced6b4 hevc: properly handle no_rasl_output_flag when removing pictures from the DPB
Fixes ticket #4185.

Reviewed-By: Mickael Raulet <Mickael.Raulet@insa-rennes.fr>
Signed-off-by: Hendrik Leppkes <h.leppkes@gmail.com>
(cherry picked from commit 0118158efa8e45761f9f65a3bb74f33907bd2aec)
2015-10-09 21:57:05 +02:00
Ronald S. Bultje
cac62c8ad9 hevc: fix wpp threading deadlock.
Fixes ticket 4258.
(cherry picked from commit 74e4948235bc8f8946eeca20525258bbf383f75d)
2015-10-09 21:56:52 +02:00
Michael Niedermayer
3b7d4d8bd6 avcodec/ffv1: seperate slice_count from max_slice_count
Fix segfault with too large slice_count
Fixes Ticket4879

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit aa6c43f3fdec8a7518534b9dab20c9eb4be11568)

Conflicts:
	libavcodec/ffv1enc.c
	libavcodec/ffv1.c
2015-10-09 21:56:33 +02:00
Przemysław Sobala
eb681e1fac lavf/img2dec: Fix memory leak
Fixes #4886

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 01dd7e025c246d9001f1a30f4a5d8fa2936d1a5e)
2015-10-09 21:56:15 +02:00
wm4
9177bcc06c avcodec/mp3: fix skipping zeros
Commits 43bc5cf9 and c5371f77 add code for skipping initial zeros in mp3
packets. This code forgot to report to the user that data was skipped at
all.

Since audio codecs allow partial packet decoding, the user application
has to rely on the return value. It will remove the data reported as
consumed by the decoder, and feed it to the decoder again. This resulted
in the mp3 frame after the zero region to be decoded over and over
again, until the zero region was finally skipped by the application.

Fix this by including the amount of skipped bytes to the number of
consumed bytes returned by the decode call.

Fixes trac ticket #4890.
(cherry picked from commit cb1da9fb8d71bb611a7b0028914c97afc3f5711d)
2015-10-09 21:56:00 +02:00
Clément Bœsch
f2c07de0a5 avformat/srtdec: make sure we probe a number
Fixes regression since 7218352e0228028dfa009a3799ec93fd041065f1: WebVTT
files were matching the SRT probing.
(cherry picked from commit 40d9d6de90c3652f4c468ab14976c7faf5e40c07)
2015-10-09 21:55:47 +02:00
Clément Bœsch
2e575c1e8d avformat/srtdec: more lenient first line probing
Fixes Ticket #4898
(cherry picked from commit 7218352e0228028dfa009a3799ec93fd041065f1)
2015-10-09 21:55:34 +02:00
James Almer
628479b096 doc: mention libavcodec can decode Opus natively
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit fd9ac48dc8aebcbd601af34336234d5102b36e21)
2015-09-20 23:27:45 -03:00
Michael Niedermayer
af098adca3 MAINTAINERS: Remove myself as leader
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f2c58931e629343f7d68258cc2b2d62c5f501ba5)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-31 18:35:31 +02:00
wm4
1eb646ec9f rawdec: fix mjpeg probing buffer size check
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4c6beaed9210f01290e5a5a4e377f93f145172cc)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-30 19:27:45 +02:00
wm4
c809cf1c5b rawdec: fix mjpeg probing
There can be other headers than "Content-Type:" (in this case, a
"Content-Length:" header was following), so checking for a trailing
newline is wrong.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit bf51fcd304d5594a4d8eed2bedf0ef0f68fa65f8)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-30 19:27:45 +02:00
Andreas Cadhalpun
5e833d958c Changelog update
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-07-30 18:54:25 +02:00
Andreas Cadhalpun
ffcfab882b snow: remove an obsolete av_assert2
It asserts that the frame linesize is larger than 37, but it can be
smaller and decoding such frames works.

Before commit cc884a35 src_stride > 7*MB_SIZE was necessary, because the
blocks were interleaved in the tmp buffer and the last block was added
with an offset of 6*MB_SIZE.
It was changed for src_stride <= 7*MB_SIZE to write the blocks
sequentially, hence the larger tmp_step.
After that the assert was only necessary to make sure that the buffer
remained large enough.
Since commit bd2b6b33 s->scratchbuf is used as tmp buffer.
As part of commit 86e107a7 the minimal scratchbuf size was increased to
256*7*MB_SIZE, which is enough for any src_stride <= 7*MB_SIZE.

Also add a comment explaining the tmp_step calculation.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 3526a120f92929cb0a4009e403ee2f141030c487)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-07-30 18:53:34 +02:00
Andreas Cadhalpun
d8c82ed321 huffyuvdec: validate image size
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 9a345802edf7f430b3335f486aecdd8552f8367b)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-07-30 18:53:29 +02:00
Andreas Cadhalpun
983dc64772 vc1dec: use get_bits_long and limit the read bits to 32
get_bits should not be used with more than 25 bits.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 1f1e0a2971b2a01f275bb5088c2e36166514be64)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-07-30 18:53:24 +02:00
Andreas Cadhalpun
98aedbf9fe mpegaudiodec: copy AVFloatDSPContext from first context to all contexts
This fixes a segfault when decoding multi-channel MP3onMP4 files.

This is similar to commit cb72230d for MPADSPContext.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 151dbe4579601a81662b4b366d0e10df3c00027a)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-07-30 18:53:19 +02:00
Andreas Cadhalpun
18189ebab3 libshine: fix support for shine 3.0
shine_encode_buffer expects written to be an int pointer, while the
previous shine_encode_frame expected it to be a long pointer.

Thus encoding with libshine currently always fails with
"internal buffer too small", because a negative return value of
shine_encode_buffer is interpreted as a very large long value.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit e48a9ac9af5f6e652735aa44a86420b5e7258895)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-07-30 18:53:15 +02:00
Andreas Cadhalpun
74a88a509c avidec: check for valid bit_rate range
If bit_rate is negative, it can trigger an av_assert2 in av_rescale_rnd.

Since av_rescale returns int64_t, but st->codec_bit_rate is int, it can
also overflow into a negative value.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0eec40b713eee84e2aec8af35ccce059817cad2a)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-07-30 18:53:10 +02:00
Paul B Mahol
ff68bf7a1b avformat/nut: support WavPack
Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit 64815d1f0c782a632447806e40d9c7ee71f31b92)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-07-30 18:53:05 +02:00
Michael Niedermayer
ef905b1b27 avcodec/diracdec: Check slices malloc and propagate error code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a4d3cf10b2ece441ae25849a66b1c11d838f9381)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
2015-07-30 18:52:58 +02:00
Michael Niedermayer
ad03cef420 Update for 2.5.8
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-28 03:23:43 +02:00
Michael Niedermayer
be369f6e40 avcodec/vp8: Check buffer size in vp8_decode_frame_header()
avoids null pointer dereference
Fixes: signal_sigsegv_d5de40_964_vp80-00-comprehensive-010.ivf with memlimit of 1048576

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 599d746e07319dc792ed2e511b666fe482f1ff88)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-28 02:42:16 +02:00
Michael Niedermayer
1166d9245a avcodec/vp8: Fix null pointer dereference in ff_vp8_decode_free()
Fixes: signal_sigsegv_d5de23_967_vp80_00_comprehensive_010.ivf with memlimit 524288

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a84f0e8d8f293df3c535f9b893730a835bed6520)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-28 02:42:16 +02:00
Michael Niedermayer
c72c1b8716 avcodec/diracdec: Check for hpel_base allocation failure
Fixes null pointer dereference
Fixes: signal_sigsegv_b02a96_280_RL_420p_ffdirac.drc with memlimit of 67108864

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 1c5b712c0a643a039d6f34269b4102de313a050a)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-28 02:42:16 +02:00
Michael Niedermayer
8696762b9a avcodec/rv34: Clear pointers in ff_rv34_decode_init_thread_copy()
Avoids leaving stale pointers
Fixes: signal_sigabrt_7ffff70eccc9_819_sabtriple.rm with memlimit 536870912

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 3197c0aa87a3b7190e17d49e6fbc7b554e4b3f0a)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-28 02:42:16 +02:00
Michael Niedermayer
384f6801a2 avfilter/af_aresample: Check ff_all_* for allocation failures
Fixes: signal_sigabrt_7ffff70eccc9_498_divx502.avi with memlimit 1572864

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2ea8a480832acad3095783bcb11d5f290bec56cf)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-28 02:42:16 +02:00
Michael Niedermayer
b7c8d072ea avcodec/pthread_frame: clear priv_data, avoid stale pointer in error case
Fixes: b4b47bc2b3fb7ca710bfffe5aa969e37_signal_sigabrt_7ffff70eccc9_744_nc_sample2.avi with memlimit of 4194304

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f1a38264f20382731cf2cc75fdd98f4c9a84a626)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-28 02:42:16 +02:00
Michael Niedermayer
46236b0bae swscale/utils: Clear pix buffers
Fixes use of uninitialized memory
Fixes: a96874b9466b6edc660a519c7ad47977_signal_sigsegv_7ffff713351a_744_nc_sample.avi with memlimit 2147483648

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a5d44d5c220e12ca0cb7a4eceb0f74759cb13111)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-28 02:42:16 +02:00
Zhang Rui
d819a2c986 avutil/fifo: Fix the case where func() returns less bytes than requested in av_fifo_generic_write()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit fcbea93cf8777bbef2a393d26942b5d3c70a448d)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-28 02:42:16 +02:00
Michael Niedermayer
3953c497e2 avformat/mov: Fix deallocation when MOVStreamContext failed to allocate
Fixes: 260813283176b57b3c9974fe284eebc3_signal_sigsegv_7ffff713351a_991_xtrem_e2_m64q15_a32sxx.3gp with memlimit of 262144

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 15629129dde771446a005282ee33c4ea1199e696)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-28 02:42:16 +02:00
Michael Niedermayer
40f5222e9c ffmpeg: Fix crash with ost->last_frame allocation failure
Fixes: 1013dbde2c360d939cc2dfc33e4f275c_signal_sigsegv_a0500f_45_320vp3.nsv with memlimit of 536870912

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit fd4c87fa3becaf8a6c480db915daf51e297b76c5)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-28 02:42:16 +02:00
Michael Niedermayer
3e167497c7 ffmpeg: Fix cleanup with ost = NULL
Fixes: 09e670595acbdafb226974b08dab66e3_signal_sigabrt_7ffff70eccc9_991_xtrem_e2_m64q15_a32sxx.3gp with memlimit of 1048576

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 503ec7139f887bf8ed8d57da07ce93c4e88447a6)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-28 02:42:16 +02:00
Michael Niedermayer
95d8912bfd avcodec/pthread_frame: check avctx on deallocation
Fixes null pointer dereferences
Fixes: af1a5a33e67e479f439239097bd0d4fd_signal_sigsegv_7ffff713351a_152_Dolby_Rain_Logo.pmp with memlimit of 8388608

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 5d346feafa817c4fbc30f7ed0b93b2dad6cef15b)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-28 02:42:16 +02:00
Michael Niedermayer
1cb19f4f08 avcodec/sanm: Reset sizes in destroy_buffers()
Fixes crash in 1288a2fe8e9ae6b00ca40e089d08ca65_signal_sigsegv_7ffff71426a7_354_accident.san with allocation limit 65536

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 39bbdebb1ed8eb9c9b0cd6db85afde6ba89d86e4)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-28 02:42:16 +02:00
Michael Niedermayer
3489693051 avcodec/alac: Clear pointers in allocate_buffers()
Fixes: 06a4edb39ad8a9883175f9bd428334a2_signal_sigsegv_7ffff713351a_706_mov__alac__ALAC_6ch.mov

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit f7068bf277a37479aecde2832208d820682b35e6)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-28 02:42:16 +02:00
Anton Khirnov
abe503329d bytestream2: set the reader to the end when reading more than available
This prevents possible infinite loops with the calling code along the
lines of while (bytestream2_get_bytes_left()) { ... }, where the reader
does not advance.

CC: libav-stable@libav.org
(cherry picked from commit 86eee85daddb682fa072c2e2657c90a514b855e3)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-28 02:42:16 +02:00
Michael Niedermayer
80e091853d avcodec/utils: use a minimum 32pixel width in avcodec_align_dimensions2() for H.264
Fixes Assertion failure
Found-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7ef6656b1e5bfbc7499013d3b38b093b6b2f31ec)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2015-07-28 02:42:16 +02:00
Michael Niedermayer
d137bb92b2 avcodec/mpegvideo: Clear pointers in ff_mpv_common_init()
This ensures that no stale pointers leak through on any path

Fixes: signal_sigsegv_c3097a_991_xtrem_e2_m64q15_a32sxx.3gp

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b160fc290cf49b516c5b6ee0730fd9da7fc623b1)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:42:15 +02:00
Chris Watkins
4f4ff23ccb oggparsedirac: check return value of init_get_bits
If init_get_bits fails the GetBitContext is invalid and must not be
used. Check the return value in dirac_header and propogate the error.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4f5c2e651a95b950f6a3fb36f2342cbc32515f17)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:42:15 +02:00
Andreas Cadhalpun
dcfd83fb8e wmalosslessdec: reset frame->nb_samples on packet loss
Otherwise a frame with non-zero nb_samples but without any data can be
returned.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 42e7a5b3c704985c2c18970cc94a837b413df9d9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:42:15 +02:00
Andreas Cadhalpun
29a97823ba wmalosslessdec: avoid reading 0 bits with get_bits
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit f9020d514e9ed5043496a710b36daba1ab182e97)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:42:15 +02:00
Michael Niedermayer
e9deb55810 avcodec/rawenc: Use ff_alloc_packet() instead of ff_alloc_packet2()
the later is not optimal when the buffer size is well known at allocation time

This avoids a memcpy()
Overall 2.5% speedup with a random 1920x1080 video

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 47496eb97cff8130991313d1b7292613620d8592)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:42:15 +02:00
Michael Niedermayer
dec0316c0f avcodec/aacsbr: Assert that bs_num_env is positive
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2e13a45b1a9a69456631e582bbb06954d169eb55)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:42:15 +02:00
Michael Niedermayer
1b15487e90 avcodec/aacsbr: check that the element type matches before applying SBR
Fixes out of array access
Fixes: signal_sigsegv_3670fc0_2818_cov_2307326154_moon.mux

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 79a98294da6cd85f8c86b34764c5e0c43b09eea3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:42:15 +02:00
Michael Niedermayer
58070590b1 avcodec/h264_slice: Use w/h from the AVFrame instead of mb_w/h
Fixes out of array access
Fixes: asan_heap-oob_4d5bb0_682_cov_3124593265_Fraunhofer__a_driving_force_in_innovation__small.mp4

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 330863c9f19a23c500ba7901a23f1cc377b353bb)

Conflicts:

	libavcodec/h264_slice.c
2015-07-28 02:42:15 +02:00
James Zern
68650eda95 vp9/update_prob: prevent out of bounds table read
the max value of the lookup in expanded form is:
(((1 << 7) - 1) << 1) - 65 + 1 + 64 = 254

add one entry of padding to inv_map_table[] to prevent out of bounds
access with non-conforming / fuzzed bitstreams

Signed-off-by: James Zern <jzern@google.com>
Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e91f860ea74e11e9178500fe8794c47f57dbf48c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:42:15 +02:00
Michael Niedermayer
c7cb598bdd avfilter/vf_transpose: Fix rounding error
Fixes out of array access
Fixes: asan_heap-oob_7f875d_3482_cov_1818465256_ssudec.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0083c16605aa5997534e87e68f97ef85a8c3b7b8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:42:15 +02:00
Michael Niedermayer
6a71e748b3 avcodec/pngdec: Check values before updating context in decode_fctl_chunk()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b54ac8403bfea4e7fab0799ccfe728ba76959a38)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:42:15 +02:00
Michael Niedermayer
0628dfd994 avcodec/pngdec: Require a IHDR chunk before fctl
This is required by the APNG spec

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a1736926e9ae51706b537776722e816a4d1f6b36)

Conflicts:

	libavcodec/pngdec.c
2015-07-28 02:42:15 +02:00
Michael Niedermayer
d661cfad02 avcodec/pngdec: Only allow one IHDR chunk
Multiple IHDR chunks are forbidden in PNG
Fixes inconsistency and out of array accesses

Fixes: asan_heap-oob_4d5c5a_1738_cov_2638287726_c-m2-8f2b481b7fd9bd745e620b7c01a18df2.png

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 47f4e2d8960ca756ca153ab8e3e93d80449b8c91)

Conflicts:

	libavcodec/pngdec.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:42:15 +02:00
Andreas Cadhalpun
755c3222e2 wmavoice: limit wmavoice_decode_packet return value to packet size
Claiming to have decoded more bytes than the packet size is wrong.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 2a4700a4f03280fa8ba4fc0f8a9987bb550f0d1e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:42:15 +02:00
Michael Niedermayer
bf44ab5181 swscale/swscale_unscaled: Fix rounding difference with RGBA output between little and big endian
Fixes fate/dds-rgb16 on big endian

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f6ab967eae497733f6adc12b30075980fd6eea98)

Conflicts:

	tests/ref/fate/dds-rgb16
2015-07-28 02:42:15 +02:00
Michael Niedermayer
98d916300a ffmpeg: Do not use the data/size of a bitstream filter after failure
Found-by: Rodger Combs
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8f0f678f090d9939b0014ba85641e2cb83d39cb8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:42:15 +02:00
James Almer
1fc2a1f336 swscale/x86/rgb2rgb_template: fix signedness of v in shuffle_bytes_2103_{mmx,mmxext}
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit e22edbfd413242dda720dc5191fc00a51c24d74c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:42:15 +02:00
James Almer
3528822f96 swscale/x86/rgb2rgb_template: add missing xmm clobbers
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 910eeab48026060b5f7780b2560445c069eb4d6b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:42:14 +02:00
Sebastien Zwickert
8f06795533 vda: unlock the pixel buffer base address.
The pixel buffer base address is never unlocked this causes
a bug with some pixel format types that are produced natively
by the hardware decoder: the first buffer was always used.
Unlock the pixel buffer base address fixes the issue.
(cherry picked from commit c06fdacc3dc706e70d953917fea845532d3703ca)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:42:14 +02:00
Michael Niedermayer
7085f68c14 swscale/rgb2rgb_template: Fix signedness of v in shuffle_bytes_2103_c()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7604358018229f345dfdf88b16c8930a67984435)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:42:14 +02:00
Michael Niedermayer
17b7262b4f swscale/rgb2rgb_template: Implement shuffle_bytes_0321_c and fix shuffle_bytes_2103_c on BE
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit abb833c5681b84d7025c083e2191140eaa30dca7)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:42:14 +02:00
Michael Niedermayer
f9dbe8ab2a swscale/rgb2rgb_template: Disable shuffle_bytes_2103_c on big endian
The function is specific to little endian

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4df3cf90bf7a54793e90304bd1b6c7599673f36a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:42:14 +02:00
Michael Niedermayer
7ff8f9a604 swr: Remember previously set int_sample_format from user
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d4325b2fea9e2f4f4a17d0b929f12425e9c39964)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:42:14 +02:00
Andreas Cadhalpun
a5bc5dd49a matroskadec: check audio sample rate
And default to 8000 if it is invalid.

An invalid sample rate can trigger av_assert2 in av_rescale_rnd.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 5b76c82fd7a5f4f36bb901b8c43d7f7319599599)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:42:14 +02:00
Andreas Cadhalpun
5464da8905 matroskadec: validate audio channels and bitdepth
In the TTA extradata re-construction the values are written with
avio_wl16 and if they don't fit into uint16_t, this triggers an
av_assert2 in avio_w8.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 92e79a2f7bf2f8bb0cb2d1a3e4d76737557071c4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:42:14 +02:00
Michael Niedermayer
fc0df14de1 avcodec/dpxenc: implement write16/32 as functions
Fixes undefined behavior and segfault

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8edc17b639c4ac47913c467107ffb43c67c64890)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:42:14 +02:00
Andreas Cadhalpun
dd141a50cc postproc: fix unaligned access
QP_store is only 8-bit-aligned, so accessing it as uint32_t causes
SIGBUS crashes on sparc.
The AV_RN32/AV_WN32 macros only do unaligned access in the
HAVE_FAST_UNALIGNED case.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 590743101dc934043f34013f1c9bb9fb261355b0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:42:14 +02:00
Michael Niedermayer
568c1b8166 ffmpeg: Free last_frame instead of just unref
Fixes Ticket4611

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d1050d9950610aa2b27878b67bb2b902dd717e7c)

Conflicts:

	ffmpeg.c
2015-07-28 02:42:14 +02:00
wm4
3903a60d4b avio: fix potential crashes when combining ffio_ensure_seekback + crc
Calling ffio_ensure_seekback() if ffio_init_checksum() has been called
on the same context can lead to out of bounds memory accesses and
crashes. The reason is that ffio_ensure_seekback() does not update
checksum_ptr after reallocating the buffer, resulting in a dangling
pointer.

This effectively fixes potential crashes when opening mp3 files.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit dc87758775e2ce8be84e4fe598e12416e83d2845)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:42:14 +02:00
Andreas Cadhalpun
58a0dc1bdf h264: er: Copy from the previous reference only if compatible
Also use the frame pixel format instead of the one from the codec
context, which is more robust.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit fdc64a104410f5fcc7f35b62287b0ae502b7061a)

Conflicts:

	libavcodec/h264_slice.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:57 +02:00
Andreas Cadhalpun
da13957525 sonic: set avctx->channels in sonic_decode_init
Otherwise it can be 0 in sonic_decode_frame, causing SIGFPE crashes.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 58995f647b5fa2e1efa33ae4f8b8a76a81ec99df)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:57 +02:00
Andreas Cadhalpun
27d50fb2d5 vp8: change mv_{min,max}.{x,y} type to int
If one of the dimensions is larger than 8176, s->mb_width or
s->mb_height is larger than 511, leading to an int16_t overflow of
s->mv_max.{x,y}. This then causes av_clip to be called with amin > amax.

Changing the type to int avoids the overflow and has no negative
effect, because s->mv_max is only used in clamp_mv for clipping.
Since mv_max.{x,y} is positive and mv_min.{x,y} negative, av_clip can't
increase the absolute value. The input to av_clip is an int16_t, and
thus the output fits into int16_t as well.

For additional safety, s->mv_{min,max}.{x,y} are clipped to int16_t range
before use.

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 6fdbaa2b7fb56623ab2163f861952bc1408c39b3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:56 +02:00
Andreas Cadhalpun
e4e3b14bba vp9: change type of tile_size from unsigned to int64_t
Otherwise the check 'tile_size < size' treats a negative size as
unsigned, causing the check to pass. This subsequently leads to
segmentation faults.

This was originally fixed as part of Libav commit 72ca83, so the
original author is one of the following developers:
        Anton Khirnov <anton@khirnov.net>
        Diego Biurrun <diego@biurrun.de>
        Luca Barbato <lu_zero@gentoo.org>
        Martin Storsjö <martin@martin.st>

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit b18eac7ff22332c9344769af15f7b245dd13cc64)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:56 +02:00
Andreas Cadhalpun
b4d265e2dc arm: only enable setend on ARMv6
Without this check it causes SIGILL crashes on ARMv5.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 5bf84a584e9ce681b439a5747671e2809a019c83)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:56 +02:00
Andreas Cadhalpun
a1879d347e libopenjpegdec: check existence of image component data
libopenjpeg can return images with components without data.

This fixes segmentation faults.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 3ef5702926c495232ffe685303ba8661bdff1149)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:56 +02:00
Andreas Cadhalpun
7a12379463 mov: abort on EOF in ff_mov_read_chan
Otherwise the loop can take a lot of time if num_descr is very large.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit a5718863da99b54b6c853d45c84871c4a96a57c0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:56 +02:00
Michael Niedermayer
7d03a9156d ffmpeg_opt: Check for localtime() failure
Found-by: Daemon404
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8e91d9652ea5048d9014e7636e12c6ed4732d7b7)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:56 +02:00
Deliang Fu
bda906a195 avformat: Fix bug in parse_rps for HEVC.
Make the logic in libavformat/hevc.c parse_rps align with libavcodec/hevc_ps.c ff_hevc_decode_short_term_rps

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6e1f8780c833ef55815111d4771b95ff78567cdb)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:56 +02:00
Andreas Cadhalpun
3c99f8b4ad takdec: ensure chan2 is a valid channel index
If chan2 is not smaller than the number of channels, it can cause
segmentation faults due to dereferencing a NULL pointer.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 05c57ba2f42324da2fdc93d83d65bb68dd637613)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:56 +02:00
Michael Niedermayer
f5a73058b0 avcodec/h264_slice: Use AVFrame diemensions for grayscale handling
The AVFrame values are closer to the AVFrame bitmap changed instead of
the AVCodecContext values, so this should be more robust

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit aef0e0f009802f1a5e21eb6465498632071e4475)

Conflicts:

	libavcodec/h264_slice.c
2015-07-28 02:33:56 +02:00
Michael Niedermayer
a2a545d8db avdevice/lavfi: do not rescale AV_NOPTS_VALUE in lavfi_read_packet()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 913685f55208efd78bfc34d82b261bd449e69774)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:56 +02:00
Simon Thelen
fb22fc0c46 libavutil/channel_layout: Correctly return layout when channel specification ends with a trailing 'c'.
Return layout when FF_API_GET_CHANNEL_LAYOUT_COMPAT is set even if the
layout itself is not in the deprecated style.

Signed-off-by: Simon Thelen <ffmpeg-dev@c-14.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 83307a32eb0c9f0843f655c44bb65e3e999153f8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:56 +02:00
Michael Niedermayer
062f63e46c avcodec/jpeg2000dec: Check that coords match before applying ICT
This avoid potential out of array accesses

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 12ba1b2b4d5592c0e27b0fcc83db929e8d6a8eee)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:56 +02:00
Michael Niedermayer
057d6e1cd6 avformat/ffmdec: Check ffio_set_buf_size() return value
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit dc55477a64cefebf8dcc611f026be71382814ae2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:56 +02:00
Michael Niedermayer
cdd594e24b avcodec/adpcm: Check for overreads
See: vlc ticket 14649
Reported-by: carl
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3c803ed9cb23e5a8d76b6c31d8a8c71cac27e769)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:56 +02:00
Michael Niedermayer
5ebae729b9 avcodec/alsdec: Check for overread
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c2657633187e325a439e3297fd9ccd0522ab2e39)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:56 +02:00
Michael Niedermayer
177014a494 avcodec/atrac3plusdec: consume only as many bytes as available
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6b6ae7c3ead5dee786a4aea929820076a7c82da4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:56 +02:00
Nedeljko Babic
3dd5c6a4ba libavutil/softfloat: Fix av_normalize1_sf bias.
av_normalize1_sf doesn't properly address border case when mantis is
exactly -0x40000000.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7131aba916d1f562bdaf6a81319f1421ce175b1e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:56 +02:00
Michael Niedermayer
de943a3460 swresample/swresample: Cleanup on init failure.
This avoids leaks if the user doest call swr_close() after a failed init

Found-by: James Almer <jamrial@gmail.com>
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c3f87f7545d42520921bc448b9fbd7324c574e49)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:56 +02:00
Michael Niedermayer
1728aa3442 Revert "avformat/rtpenc: check av_packet_get_side_data() return, fix null ptr dereference"
This was simply wrong

Found-by: Martin Storsjö
This reverts commit 5d8e4f6da03c0342157e6ac7fab1a8ac3a87a8b0.
(cherry picked from commit 3e34b7498f14c04baadde1700a6f73a7e9e86fa6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:56 +02:00
Michael Niedermayer
f569422d66 avformat/mxfenc: Accept MXF D-10 with 49.999840 Mbit/sec
This is the maximum rate possible based on the frame size limit of MXF D-10

Previous version reviewed by tim nicholson <nichot20@yahoo.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d7a762553c6f6c422adb6632354bcc4ff577b701)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:56 +02:00
Ganesh Ajjanagadde
3dc303a051 swresample/dither: check memory allocation
check memory allocation in swri_get_dither()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 196b885a5f0aa3ca022c1fa99509f47341239784)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:56 +02:00
Andreas Cadhalpun
42c54f8f4d libopenjpegenc: add NULL check for img before accessing it
If opj_image_create fails to allocate an image it returns NULL, which
causes a segmentation fault at 'img->x0 = 0'.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 1577526b47439f33a999339efdec5d624b70e1da)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:56 +02:00
Michael Niedermayer
fd989ff9ca swresample: Check the return value of resampler->init()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 02915602d9313aa4b108342a3081244b9d2422bf)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:56 +02:00
Luca Barbato
6b2163caab h264: Make sure reinit failures mark the context as not initialized
(cherry picked from commit 0181ae9af2de1526464d23209b82e6674d362f5d)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:56 +02:00
Michael Niedermayer
a61759596d ffmpeg_opt: Set the video VBV parameters only for the video stream from -target
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2ce6e419113f8276f417a9a8b50122c5467d9bc5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:56 +02:00
Michael Niedermayer
8d98fbef16 avcodec/bitstream: Assert that there is enough space left in avpriv_copy_bits()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 291ad5cc9cf815eb110b062487980fab2d107936)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:56 +02:00
Michael Niedermayer
4ac8b94a73 avcodec/put_bits: Assert that there is enough space left in skip_put_bytes()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8f5ffed183e099128a732a00976f69fdc641d093)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:56 +02:00
Michael Niedermayer
e83d998634 avcodec/mpegvideo_enc: Update the buffer size as more slices are merged
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 561d3a57aaa95c7e8e65e96b36dd069100603650)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:56 +02:00
Michael Niedermayer
962ad32891 avcodec/put_bits: Update size_in_bits in set_put_bits_buffer_size()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e4c2ec879b1121c02279cd60a54643da0d249e40)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:55 +02:00
Rodger Combs
9e1a818a2d avformat/wavdec: Increase dts packet threshold to fix more misdetections
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 40a3e1e9c54997e4dfc7802b5a758b68ceb64982)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:55 +02:00
Michael Niedermayer
f1a4af4dc2 avformat/wavdec: Increase probe_packets limit
Fixes DTS detection of b2429e5ba9.dts

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9f5769437aaab30a359cde254f39d9a28b1ce657)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-07-28 02:33:55 +02:00
Michael Niedermayer
51a624bb80 avformat/swfdec: Do not error out on pixel format changes
Instead print an error and continue

Fixes Ticket4702

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6a1204a1a46674084b1e6b92562f81aaab7aac69)
2015-07-08 12:44:44 +02:00
Michael Niedermayer
e9502ee26a avfilter/x86/vf_hqdn3d: Fix register types
Fixes Ticket4301

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 52fc3e372f8ed4de5735abed1f7f7569fe37b023)
2015-06-19 11:11:41 +02:00
Michael Niedermayer
11f597ed84 avcodec/mjpegenc_common: Use ff_mpv_reallocate_putbitbuffer()
Fixes assertion failure
Fixes Ticket4396

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c50904fd7899e37516324e711b3b8edfe7214da8)
2015-06-19 11:11:26 +02:00
Michael Niedermayer
2e210e19b1 avcodec/mpegvideo: Factor ff_mpv_reallocate_putbitbuffer() out
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 00f3bb2ef2bb25fc41b7a905376f00d104f70185)
2015-06-19 11:11:18 +02:00
Michael Niedermayer
d4c7a1ecb8 avformat/mov: Mark avio context of decompressed atoms as seekable
Fixes Ticket4329

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8ce564ea280b61d21eebf8a2fd741f792ce81638)
2015-06-19 11:10:58 +02:00
Michael Niedermayer
2d55d3483b avcodec/hevc_ps: Only discard overread VPS if a previous is available
Fixes Ticket4621

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 57078e4d255a06246fef27846073f5ffb312b5dc)
2015-06-19 11:10:43 +02:00
Michael Niedermayer
e29f68cf9e avcodec/x86/h264_weight: handle weight1=128
Fix ticket4596

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e1009665759d4a3938dd2dd07b7e84d8bc9c5290)
2015-06-19 11:10:30 +02:00
Paul B Mahol
f621ae6a6d avcodec/exr: fix crash caused by merge
Various header informations need to be reset when decoding next frame.
Regression since: 95582b5c

Fixes ticket #4597.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit a03b69478b7f1c0c31e53acb0cf392917c0f967a)
2015-06-19 11:10:13 +02:00
Andreas Cadhalpun
21d0ae829f nutdec: abort if EOF is reached in decode_info_header/read_sm_data
These loops can take a lot of time if count is very large.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit bb23a15df507440deb0dcf25099d321d0f73dc28)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-23 00:57:08 +02:00
Andreas Cadhalpun
af27254eb3 nutdec: stop skipping bytes at EOF
This can unnecessarily waste a lot of time.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit fa7dec8cb00d2d0dd96ff9863ccda38428610a21)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-23 00:56:38 +02:00
Andreas Cadhalpun
ffb4362bf0 nutdec: fix infinite resync loops
nut->last_syncpoint_pos doesn't necessarily change between resync
attempts, so find_any_startcode can return the same startcode again.

Thus remember where the last resync happened and don't try to resync
before that.

This can't be done locally in nut_read_packet, because this wouldn't
prevent infinite resync loops, where after the resync a packet is
returned and while reading a following packet the resync happens again.

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
(cherry picked from commit 37e679881d364b6da817d829d35869d657218ab3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-23 00:55:57 +02:00
Michael Niedermayer
3ea101b234 avformat/nutdec: Check X in 2nd branch of index reading
Prevents read of uninitialized variable

Based on patch by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ebb0ca3d70465ab6d369a66b2ef43bb059705db8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-23 00:52:44 +02:00
Michael Niedermayer
3c7ea2c46e Update for 2.5.7
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 21:42:38 +02:00
Michael Niedermayer
682ccd4167 avformat/nutdec: Fix recovery when immedeately after seeking a failure happens
Found-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b3496b4a33e806b7afdcbbf6f468b0332b676d7c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
e7e1832cfd avformat/nutdec: Return error on EOF from get_str()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6bbb2f8f4da67af374d62403742482cc5962aa21)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Andreas Cadhalpun
23e88c81d6 nutdec: fix memleaks on error in nut_read_header
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 361702660d2c37a63b7d6381d39e1e1de8405260)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Martin Storsjö
6b7c621839 rtsp: Make sure we don't write too many transport entries into a fixed-size array
(cherry picked from commit b90adb0aba073f9c1b4abca852119947393ced4c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Andrey Utkin
3d65a272da rtpenc_jpeg: handle case of picture dimensions not dividing by 8
This fixes the calculation of the number of needed blocks to make
sure that ALL pixels are represented by the result.

Reviewed-by: Thomas Volkert <silvo@gmx.net>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7f64a7503b19b39f1251e4380987034c569bebf5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
458ba000a5 avformat/mp3dec: Check for avcodec_alloc_context3() failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b851bc20c6931c084710e69f7eec30d8c1bdb68e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
64c82912a7 avformat/mp3dec: properly allocate dummy AVCodecContext
Fixes (harmless) use of uninitialized variable

Found-by: jamrial
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6ad42b3e15478284321dd285acaf189a16590854)

Conflicts:

	libavformat/mp3dec.c
2015-05-21 20:43:39 +02:00
Nicolas George
1aaf9613a8 lavd/xcbgrab: fix comparison with screen size.
Signed-off-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7971fa9ce0ead8d2e8a79dbe422e91dcef8222ba)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
8b95fc6d8d avcodec/golomb: get_ur_golomb_jpegls: Fix reading huge k values
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c720b9ce9850710e74a103d9626869e397a89faa)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
10b77a3471 avformat/mov: Fix parsing short loci
Fixes Ticket4557

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 50393bce31a5618f5125aaaf97bb69886fc4261d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
7e3d413f12 avformat/mov: Print reason of loci parsing failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9e4f0cfc8ff4ab635ea12bdbd8d85d8bb1ba25f9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
1bf416dfc3 avcodec/hevc: Fix typo in num_entry_point_offsets check
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3051e7fa712dfe2136f19b7157211453895f2a3c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
d3c9d87eea avcodec/libtheoraenc: Check for av_malloc failure
Fixes CID1257799

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c64b2d480b4a35d4face9928b4265a0fda3f3dd9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
228f7c7eed avcodec/dcadec: Check active_bands
Fixes CID1297594 part2

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fc624ec9ba7e5c4e8d905ac10f605a43d123f95a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
ba82b23a1d avcodec/dcadec: Check scale table index
Fixes CID1297594 part 1

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0f3e6959bfa67d12cd5a173b86eb15abd7d9e4d5)

Conflicts:

	libavcodec/dcadec.c
2015-05-21 20:43:39 +02:00
Michael Niedermayer
665b343f92 avcodec/sonic: More completely check sample_rate_index and channels
Fixes CID1271783

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ade8a46154cb45c88b1cb5c616eaa6320c941187)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
43f9ec7113 avcodec/sonic: check memory allocations
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c131a9fead5bf63215b6e1172b3c5c183cf90b85)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
8d02ba5b7b avcodec/smvjpegdec: check avcodec_decode_video2() return code
Fixes CID1271810

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cdd25f9a3df3905543a5546cf6076d2eaf895736)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
cb0cc44f3a avcodec/shorten: More complete pred_order check
Fixes CID1239055

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 294469416d8193a28710d802bb0c46e5fa09fad7)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
71689e7863 avcodec/shorten: Check skip_bytes()
Fixes CID1210526

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d201becfc0d89c6a5dfe44e96f1044fbc2aadb70)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
d2fbf8b569 avcodec/shorten: Fix code depending on signed overflow behavior
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2d15588124ab1d4c0612cab66f02a716f1509211)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
c14359f24d avcodec/proresdec2: Reset slice_count on deallocation
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c4c6aea397f62421bf8ef0449b2b465a53e4ab4d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
9fb1c02f30 ffmpeg_opt: Fix -timestamp parsing
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 107e4da47644fe615ea821d6a19682d73789aca7)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
4a49f1e764 avcodec/dcadec: Check subsubframes
Fixes: CID1239152

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a9bf628bfdad142763880a3d1ccb6058040dda57)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
474bfd5438 avcodec/dcadec: Check nchans
Fixes CID1239110

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a6a45774d045007f8262cd7c614804390e53122e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
wm4
02c1074f18 hevc: make avcodec_decode_video2() fail if get_format() fails
Personally, I need the decoder to back out if get_format() returns no
usable pixel format. This didn't work because the error code was not
propagated down the call chain. This in turn happened because the
variable declaration removed in this patch shadowed the variable, whose
value is returned at the end of the function. Consequently, failures of
decode_nal_unit() were ignored in this place.

Reviewed-by:  Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cc5e4bb48476a89cc8ce0c41bc2bd2e8fda9b37c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
db00ecbc96 avcodec/cavsdec: Use ff_set_dimensions()
Fixes CID1239111 part2

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f6b8b966076fcd358f734c6d00ed642edc02b4cd)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:39 +02:00
Michael Niedermayer
ebdbb13108 avcodec/cavsdec: Check esc_code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 139e1c8009df7729a53eaaae7036ca01071aced5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
cdc4727766 avcodec/on2avc: Check run more carefully
Fixes CID1239106

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 22f15f5735389e992ec9aed43b0680e75746b3a1)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
4858ee1d9c avcodec/mpeg4audio: add some padding/alignment to MAX_PCE_SIZE
This avoids potential accesses over the end

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 93cfa7d1692c25cff045f99ba1af2c9e5772c45e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Rainer Hochecker
63d484c342 swr: fix alignment issue caused by 8ch sse functions
Fix crash when doing 8 ch conversion from apps compiled with MSVS
Thanks to Ronald for giving this hint:
https://ffmpeg.org/pipermail/ffmpeg-devel/2015-May/173049.html

Reviewed-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit adb7372f7495927a226edf9b8e1d0ac9453985ea)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
4c6224b1cd avcodec/mjpegdec: fix len computation in ff_mjpeg_decode_dqt()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 81cf9108563510dee24f73b2c5d94a7bd07ff747)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
bf2254bffd avcodec/jpeg2000dec: fix boolean operator
Fixes CID1271791 #7-6

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f8f155a18ac454e7ff3312e0e0c3a70eb4359143)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
2cab5f4ad0 avcodec/hevc_ps: Explicitly check num_tile_* for negative values
This fixes nothing but maybe helps coverity which does not see that this is failing later

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 65e5032955cb5022f0f39160aa3839f0799456bd)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
1ed8a10487 avcodec/hevc_ps: Check vps_num_hrd_parameters
Fix CID1239052 part2

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b195aa5d529040f43ab3acf0079cecbeb111bd57)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
502684348b avcodec/hevc_ps: More completely check vps_num_layer_sets
Fixes CID1239052  part1

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 16c95b107365cdbfcde1945370b59fc7e17e0309)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
58f310f496 avcodec/hevc: Check num_entry_point_offsets
Fixes CID1239099 part 2

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1c6ae98d4a9ff9ea607df87908393eda4ebdf4e8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
0230a8efc6 avcodec/hevc: Check offset_len
Fixes CID1239099 part 1

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3e9d5e16ad9799f6b6faae4f21120d23146b84c9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Nick Lewycky
ef5fa5099b libswscale/x86/hscale_fast_bilinear_simd.c: Include BX in the clobber list on x86_64, because it isn't implicitly included when PIC is on.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 48e9f68384a2af257b9ca7633bf14f0c2748edc6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
885f501f7a avcodec/hevc_sei: Check num_sps_ids_minus1 value
Fixes CID1271794

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 93b0ee21a2f534f6d3b812686f3acde110e94f18)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
00223d461b avcodec/vqavideo: Check chunk size
Fixes CID1239154

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8a62b80ce6c8e87e7937f9a5d68f83882c1c8da2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Andreas Cadhalpun
7d45230d81 aacdec: don't return frames without data
Since commit 676a395a aac->frame->data is not necessarily allocated at
the end of aac_decode_frame_int if avctx->channels is 0.

In this case a bogus frame without any data, but non-zero nb_samples is
returned.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ec38a1ba404b8cb8d71ccee2b8dcd6f3fcbde273)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
254e3af60f avformat/hevc: Check num_negative_pics and num_positive_pics
Fixes CID1238994

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b62b3292d8e25d3240e462c1b1cd8ac69195c46b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
05c2801413 avformat/hevc: Check cpb_cnt_minus1
Fixes CID1239014

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2cddc0b19a20dd061dbf199bf88005b37c540d2f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
b7a3a3a8d2 avformat/matroskadec: Cleanup error handling for bz2 & zlib
Fixes CID703652

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 171af59d58fc67d82dce8ff7ed11fa671108baa5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
2012a226d2 avformat/nutdec: Fix use of uinitialized value
Fixes CID1041175

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 56abf35151c635caa3eb04bbb90454bae5463a09)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
b8e0b6c702 avformat/rtpenc_jpeg: Check remaining buffer size for SOS
Fixes CID1238818

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 81198a68370e88f7d02f16de58db36713c2a50b6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
1973b6ac5c avformat/rtpdec_xiph: Check upper bound on len in xiph_handle_packet()
Larger packets are not supported and would cause problems later

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit aa5169935e160551fb1c290d1397da2f04325817)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
9c10c0fdcd tools/graph2dot: use larger data types than int for array/string sizes
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit acf4925f444636a828534ab47d0f86c21a7a9b4e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Andreas Cadhalpun
596b9d6ed8 id3v2: catch avio_read errors in check_tag
Since len is an unsigned int, the comparison is currently treated as
unsigned and thus ignores all errors from avio_read.

Thus cast len to int, which is unproblematic, because at that point len
is between 0 and 4.

This fixes 'Conditional jump or move depends on uninitialised value'
valgrind warnings in is_tag.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0382c94f13b4b20456b7259e90b170dc020419b8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
699357dd4e avformat/matroskaenc: Check ff_vorbiscomment_length in put_flac_codecpriv()
Its currently guaranteed to be smaller but its safer to check anyway

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 66f26b3e8ec075298e7ba329a55893d085bafe96)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
ff0f0b1e83 avformat/oggenc: Check ff_vorbiscomment_length in ogg_write_vorbiscomment()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0db5b2b9f8a96298eeba7988d43c4eb44220fab3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
cb1ecf08b2 avformat/flacenc: Check length in flac_write_block_comment()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 40a7700b82aec0036622f8673ce64e070a520891)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
e3d9bf1151 avformat/subtitles: Use size_t for len
string length could theoretically be larger than int

Reviewed-by: Clément Bœsch <u@pkh.me>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a633928d47057426a9c328da594407d1c7da8a5c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
b2d31dcf04 avformat/url: Use size_t for len from strlen()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 95efc651294b3cf3e5ec4b3ed36e79d7261545ff)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
a9f003b8ac avutil/avstring: Use size_t in av_strlcatf()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ae4eea8be45a0b212fd57ceaac1f11089ab81d98)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
4d3450d62f avformat/vorbiscomment: Check entry length in ff_vorbiscomment_write()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit eca38864a6ce5053e463b8d3fc22b22bc9a49578)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:38 +02:00
Michael Niedermayer
466575c0e0 avutil/dict: Use size_t for appending strings
the string length is not constrained to INT_MAX

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4c128ea1629116fc4936edc5f96bbd18f3ef1647)

Conflicts:

	libavutil/dict.c
2015-05-21 20:43:38 +02:00
Michael Niedermayer
dc8f42e037 libavutil/mem: use size_t for the length in av_strdup()
the string length is not constrained to INT_MAX

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4950bd4ebedbb6289734234bb2a719820f565c41)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:37 +02:00
Andreas Cadhalpun
bb523c1b86 aacsbr: break infinite loop in sbr_hf_calc_npatches
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 584cc1ade10a3297ef9c107ef3a2081c04024156)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:37 +02:00
Andreas Cadhalpun
b8568c546e diracdec: check that block length is valid
In init_planes p->xblen and p->yblen are set to:
            p->xblen = s->plane[0].xblen >> s->chroma_x_shift;
            p->yblen = s->plane[0].yblen >> s->chroma_y_shift;

These are later used as block_w and block_h arguments of
s->vdsp.emulated_edge_mc. If one of them is 0 it triggers an av_assert2
in emulated_edge_mc:
    av_assert2(start_x < end_x && block_w > 0);
    av_assert2(start_y < end_y && block_h > 0);

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 75fc81c8318505aa7946e05a9bee08d47241fc66)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:37 +02:00
Andreas Cadhalpun
7d58774360 diracdec: check if reference could not be allocated
s->ref_pics[i] is later used as ref argument of interpolate_refplane,
where it is dereferenced.

If it is NULL, it causes a segmentation fault.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d93181ef3eacdb862d93448f31c97765a523d1db)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:37 +02:00
Andreas Cadhalpun
448d6488b1 diracdec: avoid overflow of bytes*8 in decode_lowdelay
If bytes is large enough, bytes*8 can overflow and become negative.

In that case 'bufsize -= bytes*8' causes bufsize to increase instead of
decrease.

This leads to a segmentation fault.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9e66b39aa87eb653a6e5d15f70b792ccbf719de7)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:37 +02:00
Andreas Cadhalpun
e67181a351 diracdec: prevent overflow in data_unit_size check
buf_idx + data_unit_size can overflow, causing the '> buf_size' check to
wrongly fail.

This causes a segmentation fault.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 984f50deb2d48f6844d65e10991b996a6d29e87c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:37 +02:00
Andreas Cadhalpun
84db3e6648 avidec: avoid infinite loop due to negative ast->sample_size
If max in clean_index is set to a negative ast->sample_size, the
following loop never ends:
        while (max < 1024)
            max += max;

Thus set ast->sample_size to 0 if it would otherwise be negative.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ca234639ac49a0dc073ac1f10977979acdb94f97)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:37 +02:00
Michael Niedermayer
d8bfa4bb94 avformat/matroskadec: Use tracks[k]->stream instead of s->streams[k]
The later is not correct

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5d309d309108684f742bbf5fc2393f1c519cda72)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:37 +02:00
Andreas Cadhalpun
39115c01f0 matroskadec: check s->streams[k] before using it
This fixes a segmentation fault.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e54540655f229d06667dc7fa7005f2a20e101e80)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:37 +02:00
Michael Niedermayer
e337d5f1b1 avcodec/ffv1dec: Check chroma shift parameters
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d43cd6b08ed555c303478e3133717fbb2236be6e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:37 +02:00
Andreas Cadhalpun
454f63181a matroskadec: use uint64_t instead of int for index_scale
index_scale is set to matroska->time_scale of type uint64_t.

When index_scale is int, the assignment can overflow and e.g. result
in index_scale = 0. This causes a floating point exception due to the
division by index_scale.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit eb9fb508b0e09d85d234fe694333b2005e1d7a7e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:37 +02:00
Andreas Cadhalpun
9b12e4c1e3 pngdec: don't use AV_PIX_FMT_MONOBLACK for apng
AV_PIX_FMT_MONOBLACK has the AV_PIX_FMT_FLAG_BITSTREAM flag, i.e.
linesize can be smaller than width.

Since x_offset is only check against the width, this can lead to
x_offset * bpp >= image_linesize.

In this case ptr could be set to a position outside the image_buf in
png_handle_row, leading to memory corruption and thus crashes.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 372aa0777aaacf726de7cd7dd0e6797026a124ee)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:37 +02:00
Andreas Cadhalpun
b04f6dfd3c pngdec: return correct error code from decode_frame_common
During the loop ret can get changed. Since it is not set on all failure
paths, decode_frame_common can return 0 even though an error occurred.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8f760be4d312bb6e78f80d39b9d0062253332e08)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:37 +02:00
Andreas Cadhalpun
c3653e2265 pngdec: check s->last_picture.f->data[0] before using it
This check was removed in commit 08aec6f6, but
s->last_picture.f->data[0] is still used in handle_p_frame_apng
unconditionally.

This fixes a segmentation fault.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 287dbb0771d558b336e377d0594e26c0a6291755)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:37 +02:00
Michael Niedermayer
4d6d159069 avcodec/wavpack: Check L/R values before use to avoid harmless integer overflow and undefined behavior in fate
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 042260cde4ecf716438c5fc92d15ad5f037ee2e1)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:37 +02:00
Luca Barbato
77059eedb5 xcbgrab: Validate the capture area
And notify why the capture is impossible.

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit e8c4db0d4d07738fed716b1d2f20c85aac944641)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:37 +02:00
Luca Barbato
31601db12a xcbgrab: Do not assume the non shm image data is always available
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 82a10225f817b2612fdd2b23af9d4f0a3408df3b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:37 +02:00
Michael Niedermayer
69f122abd9 avfilter/lavfutils: disable frame threads when decoding a single image
The image decoding code does expect the image to be decoded immedeatly

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d2184bf3b65354e44c177e226a6c59c5d6fdbad4)

Conflicts:

	libavfilter/lavfutils.c
2015-05-21 20:43:37 +02:00
Andreas Cadhalpun
8016800a64 nutdec: fix illegal count check in decode_main_header
The existing check has two problems:
 1) i + count can overflow, so that the check '< 256' returns true.
 2) In the (i == 'N') case occurs a j-- so that the loop runs once more.

This can trigger the assertion 'nut->header_len[0] == 0' or cause
segmentation faults or infinite hangs.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7c24ca1bda2d4df1dc9b2b982941be532d60da21)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:37 +02:00
Andreas Cadhalpun
4158d55b9a nutdec: check chapter creation in decode_info_header
This fixes a segmentation fault when accessing the metadata.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3ff1af2b0db7132d5717be6395227a94c8abab07)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:37 +02:00
Andreas Cadhalpun
b8627a63d8 nutdec: check for negative frame rate in decode_info_header
A negative frame rate triggers an av_assert2 in av_rescale_rnd.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6621105877ce0d65724a8ab60b3a50160adbe65d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:37 +02:00
Michael Niedermayer
260f6b4418 ffmpeg: remove incorrect network deinit
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e2877bdf3862325c2982c3237d9bf28f1bbf793f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:37 +02:00
Andreas Cadhalpun
c946f2cc83 apedec: prevent out of array writes in decode_array_0000
s->decoded_buffer is allocated with a min_size of:
    2 * FFALIGN(blockstodecode, 8) * sizeof(*s->decoded_buffer)

Then it is assigned to s->decoded[0] (and s->decoded_buffer + FFALIGN(blockstodecode, 8)
to s->decoded[1]) and passed as out buffer to decode_array_0000.

In this function 64 elements of the out buffer are written
unconditionally and outside the array if blockstodecode is too small.

This causes memory corruption, leading to segmentation faults or other
crashes.

Thus change decode_array_0000 to write at most blockstodecode elements
of the out buffer.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 699341d647f7af785fb8ceed67604467b0b9ab12)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:37 +02:00
Maneesh Gupta
1e6352578a OpenCL: Avoid potential buffer overflow in cmdutils_opencl.c
The opt_opencl_bench function copied the device name using strcpy without checking if the source string was larger.
This patch fixes this by replacing the strcpy with av_strlcpy, with the string copy size capped to the destination buffer size.

Signed-off-by: Maneesh Gupta <maneesh.gupta@amd.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cf234552b83a9503ff96572de2658b921b8842eb)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:37 +02:00
Andreas Cadhalpun
d269eb2c11 apedec: set s->samples only when init_frame_decoder succeeded
Otherwise range_start_decoding is not necessarily run and thus
ctx->rc.range still 0 in range_dec_normalize leading to an infinite
loop.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 464c49155ce7ffc88ed39eb2511e7a75565c24be)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:37 +02:00
Rong Yan
cb63a8c646 swscale/ppc/swscale_altivec.c: POWER LE support in yuv2planeX_8() delete macro GET_VF() it was wrong
GCC tool had a bug of PPC intrinsic interpret, which has been fixed in GCC 4.9.1. This bug lead to
errors in two of our previous patches. We found this when we update our GCC tools to 4.9.1 and by
reading the related info on GCC website. We fix our previous error in two separate commits

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 603c839398f89d3ef15c47530470fbb0051632c0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:37 +02:00
James Zern
2f85f511ff libvpxenc: only set noise reduction w/vp8
this quiets a warning:
Failed to set VP8E_SET_NOISE_SENSITIVITY codec control: Unspecified
internal error

Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Zern <jzern@google.com>
(cherry picked from commit 238ec505e263e7d0363798a05c1c28f494a6300a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:37 +02:00
Michael Niedermayer
3afb2653bd tests/fate-run: do not attempt to parse tiny_psnrs output if it failed
This avoids confusing syntax errors with awk later

Likely fixes awk errors at:
http://buildd.debian-ports.org/status/fetch.php?pkg=ffmpeg&arch=sparc64&ver=7%3A2.6.2-1&stamp=1428928967

Reviewed-by: Timothy Gu <timothygu99@gmail.com>
Thanks-to: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> for the link
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c0d847e457c1ef72843a63853f1135d52b74131e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:37 +02:00
Andreas Cadhalpun
4c01572a94 alac: reject rice_limit 0 if compression is used
If rice_limit is 0, k can be 0 in decode_scalar, which calls show_bits(gb, k).

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4b657a1b1eedcf38bcf36e89a2f4be6f76b5ce09)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:37 +02:00
Andreas Cadhalpun
216ef1200a alsdec: only adapt order for positive max_order
For max_order = 0 the clipping range is invalid. (amin = 2, amax = 1)

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 58d605ee9b3277289278dc40e022311f8e083833)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:37 +02:00
Vittorio Giovara
b8f5996071 lavf: Reset global flag on deinit
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 32da94fa7f73ac749e0a1e2f20499fad2f6f57fe)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:37 +02:00
Andreas Cadhalpun
004064912f bink: check vst->index_entries before using it
This fixes a NULL pointer dereference if vst->duration is 0.

The problem was introduced in commit 0588acaf.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 86d00ede4f9acb02690a0615490173648e1d933c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:36 +02:00
Andreas Cadhalpun
5ae8df8d37 mpeg4videodec: only allow a positive length
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b3408ae4c64cb674b1d5f0f30171759113ce722a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:36 +02:00
Andreas Cadhalpun
af70697836 alsdec: check sample pointer range in revert_channel_correlation
Also change the type of begin, end and smp to ptrdiff_t to make the
comparison well-defined.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Reviewed-by: Thilo Borgmann <thilo.borgmann@mail.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit afc7748d1f6abc4b3b1cc957b0fa6941837db3d0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-05-21 20:43:36 +02:00
Carl Eugen Hoyos
836a66eeb0 lavfi/fade: Do not overread input buffer.
(cherry picked from commit ab3ff19f08b7a83e320c39ab066f289c242b8030)
2015-05-17 12:46:35 +02:00
Clément Bœsch
346c4f0ad0 tests: drop bc dependency
We already have a dependency on awk and bc is sometimes not found in the
base system.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit a982c5d74fbc7ff5bd2f2f73af61ae48e9b1bcc6)
Signed-off-by: Timothy Gu <timothygu99@gmail.com>

Conflicts:
	doc/platform.texi
2015-05-13 17:11:04 -07:00
Timothy Gu
a2ad7fdb3a fate: Include branch information in the payload header
The server is properly equiped not to choke on that now.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7ad27f1221562b037178d1fb605510ba349f04cc)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-21 22:36:39 +02:00
Michael Niedermayer
5fd5b8ef79 avformat/utils: Ensure that AVFMT_FLAG_CUSTOM_IO is set before use
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ba631b791435c395361e2026fc7419b341e57813)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-21 01:08:16 +02:00
Michael Niedermayer
3f629c83b4 avformat/img2dec: do not rewind custom io buffers
Fixes double free with some applications

Fixes vlc ticket14121
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e6e8cc8ce9c2a398fbb51254a5067f4bd3c4fa8a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-21 00:12:17 +02:00
Andreas Cadhalpun
faac8e4331 alsdec: validate time diff index
If begin is smaller than t, the subtraction 'begin -= t' wraps around,
because begin is unsigned. The same applies for end < t.

This causes segmentation faults.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit faf9fe2c224ea81a98afd53e2f0be0a2e13aeca9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-19 01:27:04 +02:00
Michael Niedermayer
5be683d687 avcodec/alsdec: Use av_mallocz_array() for chan_data to ensure the arrays never contain random data
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7e104647a3556fc61a139483cee1cb7dfa2dc5bd)

Conflicts:

	libavcodec/alsdec.c
2015-04-18 20:58:17 +02:00
Andreas Cadhalpun
96c1421627 alsdec: ensure channel reordering is reversible
If the same idx is used for more than one i, at least one entry in
sconf->chan_pos remains uninitialized.

This can cause segmentation faults.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ef16501aebed43e34a3721336e8bee732eca2877)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-18 19:39:48 +02:00
Michael Niedermayer
8a59dbbc68 Update or 2.5.6
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-17 15:57:45 +02:00
Michael Niedermayer
0683ef4b50 avcodec/atrac3plusdsp: fix on stack alignment
Fixes fate failure on ARM
(cherry picked from commit 38f67260684aec8a02d87ab4056b1a1fbf964c03)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-17 15:20:30 +02:00
Andreas Cadhalpun
b420354a8b ac3: validate end in ff_ac3_bit_alloc_calc_mask
This fixes an invalid read if end is 0:
     band_end   = ff_ac3_bin_to_band_tab[end-1] + 1;

Depending on what is before the array, this can cause stack smashing,
when band_end becomes too large.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit bc4fee7f2a51635fa3c0f61d1e5164da1efeded3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-17 15:20:30 +02:00
Andreas Cadhalpun
1d0f9c92c5 aacpsy: avoid psy_band->threshold becoming NaN
If band->thr is 0.0f, the division is undefined, making norm_fac not a
number or infinity, which causes psy_band->threshold to become NaN.

This is passed on to other variables until it finally reaches
sce->sf_idx and is converted to an integer (-2147483648).

This causes a segmentation fault when it is used as array index.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Reviewed-by: Claudio Freire <klaussfreire@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e224aa41917454e7b5c23d9f2541425743ce595a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-17 15:20:30 +02:00
Andreas Cadhalpun
d846d3e88e aasc: return correct buffer size from aasc_decode_frame
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0be54ad280cf114c02306b7063147e8379f8ed1e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-17 15:20:30 +02:00
Andreas Cadhalpun
621f1a2e63 aacdec: consistently use avctx for logging in decode_eld_specific_config
ac may be NULL and then accessing ac->avctx results in a segmentation fault.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5b75689b987e4c4dd4f34d5c8be389547e9cc701)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-17 15:20:30 +02:00
Andreas Cadhalpun
9a241d95ef msrledec: use signed pixel_ptr in msrle_decode_pal4
This fixes segmentation faults, when pic->linesize[0] is negative.
In that case 'line * pic->linesize[0] + pixel_ptr' is treated as
unsigned and wraps around.

This reverts commit 7d78a964.
The problem was introduced in commit f7e1367f, which should obsolete
that commit.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ae6fd7300b4e9f81d3b5ba201096ffe7cccf26fb)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-17 15:20:30 +02:00
Michael Niedermayer
41b15817ce swresample/swresample-test: Randomly wipe out channel counts
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ff50b1b13be965c93a9a7169edb62631a928e308)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-17 15:20:29 +02:00
Michael Niedermayer
07ea57c5bb swresample: Check channel layouts and channels against each other and print human readable error messages
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3c77bb5f23b2e149495c814759beab7eedeede6c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-17 15:20:29 +02:00
Michael Niedermayer
84fedd3be7 swresample: Allow reinitialization without ever setting channel layouts
(cherry picked from commit 80a28c7509a11114e1aea5b208d56c6646d69c07)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-17 15:20:29 +02:00
Michael Niedermayer
74fb9df48b swresample: Allow reinitialization without ever setting channel counts
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d7b9cb2f7a51351586791e65fa22e6536ee58c9f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-17 15:20:29 +02:00
Michael Niedermayer
8c0fd44317 avcodec/h264: Do not fail with randomly truncated VUIs
Fixes Ticket4445

Tested-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit bc48c88918f767e0dffcd138ae8e5c3052e8a92f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-17 15:20:29 +02:00
Michael Niedermayer
6f02d93c0f avcodec/h264_ps: Move truncation check from VUI to SPS
This more completely checks for truncation

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 32e06c485be94a4967bff87022cbb065d3cbfd0d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-17 15:20:29 +02:00
Michael Niedermayer
9333ee7c0d avcodec/h264: Be more tolerant to changing pps id between slices
Fixes Ticket4446

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 98d0c4236c7542c87f012228d3bc88aea67bddc2)

Conflicts:

	libavcodec/h264.c
(cherry picked from commit 0cd0fa9d0baabd2dc0442ed8b53ba65282733b61)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-17 15:20:29 +02:00
Michael Niedermayer
3e30424961 avcodec/aacdec: Fix storing state before PCE decode
Fixes Ticket4460

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e88b3852aefaa39b2170ef185ad03dda18732821)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-17 15:20:29 +02:00
Michael Niedermayer
fe2df122b4 avcodec/h264: reset the counts in the correct context
Fixes null pointer dereference

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8f8d632220100bfde26587b27da73901b05cb774)
2015-04-17 15:20:29 +02:00
Michael Niedermayer
f96fdb46b7 avcodec/h264_slice: Dont reset mb_aff_frame per slice
Fixes null pointer dereference
Fixes Ticket4440

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 386601286fed2dff5e1955bc21a0256f6f35ab19)

Conflicts:

	libavcodec/h264_slice.c
(cherry picked from commit ce6d38e9ed0842870f3cd5414937bb6d1f2417d9)
2015-04-17 15:20:29 +02:00
Michael Niedermayer
7fa861dfe0 avcodec/h264: finish previous slices before switching to single thread mode
Fixes null pointer dereference
Fixes Ticket4438

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c4b2017ba66e1623da9f527704c61c86a6e74844)

Conflicts:

	libavcodec/h264.c
(cherry picked from commit 09cc7aee3f4d1bd1d7107d38520f782c62c14036)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-17 15:20:29 +02:00
Michael Niedermayer
48f616ceee avcodec/h264: Fix race between slices where one overwrites data from the next
Fixes non deterministic crash in ticket4408/fuzz2.264
Likely fixes other samples as well

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 43b434210e597d484aef57c4139c3126d22b7e2b)

Conflicts:

	libavcodec/h264.h
	libavcodec/h264_slice.c
(cherry picked from commit dbbc42858e87cdd04e6c3b7694f8b394d4bfcdc6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-17 15:20:29 +02:00
Michael Niedermayer
8968de6c61 avformat/utils: avoid discarded streams in av_find_default_stream_index()
Fixes Ticket2010

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ff6841c6bb2d35f8d461419e45d59be7542d03fe)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-17 15:20:29 +02:00
Michael Niedermayer
043cb40bec ffmpeg: Fix extradata allocation
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4d02dfbde475d249916eb19c360e890059aa6aa5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-17 15:20:29 +02:00
Michael Niedermayer
76b289bcf2 avcodec/h264_refs: Do not set reference to things which dont exist
Fixes deadlock
Fixes Ticket4428
Fixes Ticket4429

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 429de043202286a2b5bcc082cc02de860b734db2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-17 15:20:29 +02:00
Michael Niedermayer
52ba406b94 avcodec/h264: Fail for invalid mixed IDR / non IDR frames in slice threading mode
Fixes Ticket4408

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fc58d5c43b4c7396fc69081eb0dfe5b6a21cb10d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-17 15:20:29 +02:00
Rainer Hochecker
071eb56a6a h264: avoid unnecessary calls to get_format
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2197b4018920e5cd7ac465de007b675565687b23)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-17 15:20:29 +02:00
Michael Niedermayer
2f67222780 avutil/pca: Check for av_malloc* failures
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit dadc43eee4d9036aa532665a04720238cc15e922)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-17 15:20:29 +02:00
Michael Niedermayer
a376ef4a17 avcodec/msrledec: restructure msrle_decode_pal4() based on the line number instead of the pixel pointer
Fixes out of array access
Fixes: da14e86d8462be6493eab16bc2d40f88/asan_heap-oob_204cfd2_528_cov_340150052_COMPRESS.BMP

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f7e1367f58263593e6cee3c282f7277d7ee9d553)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-04-17 15:20:29 +02:00
James Almer
43fdd89a3f doc: add aarch64 cpuflags to fftools documentation
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 9fc45681e0c4736e4475966a70402d22c76a2965)
2015-04-11 16:23:52 -03:00
James Almer
60f2f332a3 doc: add missing arm cpuflags to fftools documentation
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 666ec9bd097201eaacb9c04da526cb2710cb9cab)
2015-04-11 16:23:50 -03:00
James Almer
7e05c70bb0 doc: add missing x86 cpuflags to fftools documentation
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 410c93cfd5ab509d8c9f907f88ae09a87fb743e6)
2015-04-11 16:23:47 -03:00
James Almer
b46840475e avutil/cpu: add missing check for mmxext to av_force_cpu_flags
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 1f5d1eed78fad63f1c80a3766d3dc2421b99104d)
2015-03-28 22:10:50 -03:00
Michael Niedermayer
d0599a3516 avcodec/hevc_ps: Check cropping parameters more correctly
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 06c70d45373dedc600f28e345685b130b60203c1)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 23:59:50 +01:00
Anton Khirnov
742d7e9a6e hevc: make the crop sizes unsigned
(cherry picked from commit c929659bdd7d2d5848ea52e685a3164c7b901bb0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 23:59:50 +01:00
James Almer
eb6f2a183a Update Changelog 2015-03-21 15:07:35 -03:00
Ronald S. Bultje
1e86b7108e vp9: make above buffer pointer 32-byte aligned.
Fixes ticket #4383

Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 1fd1f58bd6a58f2067a8d6b4919e1a0f34eb1f22)
2015-03-21 14:27:52 -03:00
Michael Niedermayer
4be1cc7b1d Update for 2.5.5
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 02:35:00 +01:00
Michael Niedermayer
61dbd3f3d0 avcodec/dnxhddec: Check that the frame is interlaced before using cur_field
Fixes Ticket4227

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2c660e34cf3c2b77cd2bef6f292920334dfd9192)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:53 +01:00
Michael Niedermayer
38d6ff31b7 avformat/mov: Disallow ".." in dref unless use_absolute_path is set
as this kind of allows to circumvent it to some extend.
We also could add a separate parameter or value to choose this

Found-by: ramiro
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1e4d0498df6621143da1a550006ddc3526ad51cb)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:53 +01:00
Michael Niedermayer
b0cd6fb590 avformat/mov: Check for string truncation in mov_open_dref()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8003816e1619e77d8de051883264aa090e0d78cc)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:53 +01:00
Michael Niedermayer
50fd06ea32 avformat/mov: Use sizeof(filename) instead of a literal number
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 21a53dd08dce7cc5b3fdf9c4826b4b74d8300ea0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:53 +01:00
Christophe Gisquet
808d5444c4 eac3dec: fix scaling
This is the remaining error, the output on the SPX samples,
respectively csi_miami_stereo_128_spx.eac3 and
csi_miami_5.1_256_spx.eac3, goes from:
stddev:    8.71 PSNR: 77.52 MAXDIFF:  235
stddev:24270.51 PSNR: 22.17 MAXDIFF:47166
to:
stddev:    0.12 PSNR:114.12 MAXDIFF:    1
stddev:    0.12 PSNR:114.73 MAXDIFF:    1

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0c3339f4bd7aceebfd74deb437ba2e5c04ef3d0e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:53 +01:00
Christophe Gisquet
6915dd49c7 ac3_fixed: fix computation of spx_noise_blend
It was set to 1 instead of sqrt(3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c4bf3833f4663fd484441907f73c5bc4700021a4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:53 +01:00
Christophe Gisquet
c657b08fd7 ac3_fixed: fix out-of-bound read
Should also improve decoding, but actually doesn't...

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b0834400608b3980c06bf6d2cf747116e60d10c7)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Andreas Cadhalpun
6d14bea8b5 ac3dec_fixed: always use the USE_FIXED=1 variant of the AC3DecodeContext
The AC3DecodeContext has a float (USE_FIXED=0) and an integer
(USE_FIXED=1) variant, both of which can be present in the same binary.
This is not only very confusing, but it also breaks horribly, when one
variant is used by code expecting the other.

This currently happens, because eac3dec.c is only compiled for the float
variant, but also used from ac3dec_fixed.c, which uses the integer
variant.

The result is memory corruption, leading to crashes.

So compile eac3dec.c once for each variant and adapt it, so that it
works with the integer variant.

A loss of precission and scaling bug has been fixed by the committer
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7b05b5093ea67a3397b0c37cf398bab471e1ce2b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Michael Niedermayer
749cd89ca9 avcodec/012v: redesign main loop
Fixes out of array accesses
Fixes: ffmpeg_012v_crash.ts

Found-by: Thomas Lindroth <thomas.lindroth@gmail.com>
Reviewed-by: Thomas Lindroth <thomas.lindroth@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 48df30d36c3ca360c407d84f96749888d1fbe853)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Michael Niedermayer
2b408d257f avcodec/012v: Check dimensions more completely
Fixes division by 0

Found-by: Thomas Lindroth <thomas.lindroth@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d3b25383daffac154846daeb4e4fb46569e728db)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Andreas Cadhalpun
8d853dc341 asfenc: fix leaking asf->index_ptr on error
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2c8cff2be4a044c66e4904efa156dafd0d332d25)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Andreas Cadhalpun
86960b1101 roqvideoenc: set enc->avctx in roq_encode_init
So far it is only set in roq_encode_frame, but it is used in
roq_encode_end to free the coded_frame. This currently segfaults if
roq_encode_frame is not called between roq_encode_init and
roq_encode_end.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cf82c426fadf90105e1fb9d5ecd267cc3aa2b288)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Michael Niedermayer
94354e368d avcodec/options_table: remove extradata_size from the AVOptions table
allowing access to the size but not the extradata itself is not useful
and could lead to potential problems if writing happens through this field

Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Reviewed-by: Lukasz Marek <lukasz.m.luki2@gmail.com>
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1f4088b28540080ce1d42345c5614be3e1a6a197)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Andreas Cadhalpun
93a0682b1d ffmdec: limit the backward seek to the last resync position
If resyncing leads to the same position as previously, it will again
lead to a resync attempt, resulting in an infinite loop.

Thus don't seek back beyond the last syncpoint.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6b8263b03ab3d16d70525ae1893cb106be7852f1)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Andreas Cadhalpun
0e16c3843a ffmdec: make sure the time base is valid
A negative time base can trigger assertions.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4c91d81be23ffacfa3897b2bcfa77445bb0c2f89)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Andreas Cadhalpun
819955f0c6 ffmdec: fix infinite loop at EOF
If EOF is reached, while skipping bytes, avio_tell(pb) won't change
anymore, resulting in an infinite loop.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6fa98822eba501a4898fdec5b75acd3026201005)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Andreas Cadhalpun
b36bda3c82 ffmdec: initialize f_cprv, f_stvi and f_stau
They are used in a switch statement, but it is not guaranteed that the
COMM case (where they are set to 0) is reached before the other cases.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 66879ee125944b0efde673d9fbebbe9489853e59)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Andreas Cadhalpun
25b8d52fdd avformat/rm: limit packet size
The chunk size is limited to 0xFFFF (written by avio_wb16), so make
sure that the packet size is not too large.

Such large frames need to be split into slices smaller than 64 kB, but
that is currently supported neither by the rv10/rv20 encoders nor the rm
muxer.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>

See Ticket244

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 08728f400b8367dc8c983036cb2eff3a2891322b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Andreas Cadhalpun
1a2aaa7497 avcodec/webp: validate the distance prefix code
According to the WebP Lossless Bitstream Specification the highest
allowed value for a prefix code is 39.

If prefix_code is too large, the calculated extra_bits has an invalid
value and triggers an assertion in get_bits.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5de2dab12b951b2fe121eb18503accfc91cd1565)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Andreas Cadhalpun
f18fc45d18 avcodec/rv10: check size of s->mb_width * s->mb_height
If it doesn't fit into 12 bits it triggers an assertion.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2578a546183da09d49d5bba8ab5e982dece1dede)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Federico Tomassetti
2684ff3573 eamad: check for out of bounds read
Bug-Id: CID 1257500
CC: libav-stable@libav.org

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 061c489895d29049a88dc6118e4b639a273b31d6)

Conflicts:

	libavcodec/eamad.c
2015-03-21 01:52:52 +01:00
Federico Tomassetti
ea0f616a57 mdec: check for out of bounds read
Bug-Id: CID 1257501
CC: libav-stable@libav.org

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 2c63081b48d98f3a0d0bed7b0ec3c0347b99144c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Martin Storsjö
51b911e948 configure: Move the .object_arch check to the right place
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit b77e335e441040a40fc6156b8e4a134745d10233)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Martin Storsjö
bb508ddb8b arm: Suppress tags about used cpu arch and extensions
When all the codepaths using manually set .arch/.fpu code is
behind runtime detection, the elf attributes should be suppressed.

This allows tools to know that the final built binary doesn't
strictly require these extensions.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit dcae2e32f7d8a1ca5fb8c1e4aa81313be854dd73)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Vittorio Giovara
9246eb1ec5 aic: Fix decoding files with odd dimensions
Normally the aic decoder finds the proper slice combination (multiple of
some number less than 32) but in case of odd width, it resorts to the
default values, which were actually swapped.
The number of slices is modified to account for such odd width cases.

CC: libav-stable@libav.org
(cherry picked from commit e878ec0d47cd6228c367b2f3128b76d7523f7255)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Michael Niedermayer
c5b2ef3bdf avcodec/tiff: move bpp check to after "end:"
This ensures that all current and future code-pathes get bpp checked

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d5e9fc782150d4596c72440a0aa02b7f4f1254b1)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Andreas Cadhalpun
07df052d8d doc: avoid the incorrect phrase 'allow to'
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 10fd7ff814f2a35b5b49a9c3b0d426ead6c7e83f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Martin Storsjö
9bb7e2bd90 mxfdec: Fix the error handling for when strftime fails
The str variable is a char ** here.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 6448f15af02f2c3cf0df8cb8237957e426041f2d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Michael Niedermayer
90fa2460c0 avcodec/opusdec: Fix delayed sample value
Fixes out of array access
Fixes: ffmpeg_opus_crash1.ogg

This solution is likely not optimal in terms of error concealment but
its simple and fixes the out of array access.

Found-by: Thomas Lindroth <thomas.lindroth@gmail.com>
Tested-by: Thomas Lindroth <thomas.lindroth@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6c583e9048fe9db2ed4d7bbc75f4f1d76e82761a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Michael Niedermayer
50f5037947 avcodec/opusdec: Clear out pointers per packet
This is safer than to assume that all error pathes cleared them and
nothing will use uncleared pointers.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1ae092587fc196da5098dea346d7ece81ec35153)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Michael Niedermayer
21533730fc avcodec/utils: Align YUV411 by as much as the other YUV variants
Fixes out of array accesses
Fixes: ffmpeg_mjpeg_crash2.avi

Found-by: Thomas Lindroth <thomas.lindroth@gmail.com>
Tested-by: Thomas Lindroth <thomas.lindroth@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e3201c38d53d2b8b24d0bc95d726b2cb1752dc12)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Ronald S. Bultje
032476f830 vp9: fix segmentation map retention with threading enabled.
Fixes ticket 4359.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit efff3854f05d171f5ad3e4f4206533b255a6d267)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Andreas Cadhalpun
57c7922331 webp: ensure that each transform is only used once
According to the WebP Lossless Bitstream Specification
"each transform is allowed to be used only once".

If a transform is more than once this can lead to memory
corruption.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c089e720c1b753790c746a13053636d7facf6bf0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:52 +01:00
Stefano Sabatini
73dd8f0a24 doc/protocols/tcp: fix units of listen_timeout option value, from microseconds to milliseconds
s->listen_timeout is passed to ff_listen_bind(), which accepts a timeout
value expressed in milliseconds.

The unit was incorrectly set in 1b4da43ce02452843a1e9bb976da1a39e18a945c.
(cherry picked from commit 6db20926c32ea297418f1f819585007c6b7b6160)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Steve Lhomme
55637b2e5e fix VP9 packet decoder returning 0 instead of the used data size
See https://trac.videolan.org/vlc/ticket/14022#comment:6

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4851db80a4f80ddade1d50d2ec741375c763f001)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Andreas Cadhalpun
e6bc1fe10c avformat/flvenc: check that the codec_tag fits in the available bits
flags is later written with avio_w8 and if it doesn't fit in one byte it
triggers an av_assert2.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e8565d21c276ab9ac5ce785549420321fbd0b093)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Andreas Cadhalpun
e6b18f5700 avcodec/utils: use correct printf specifier in ff_set_sar
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 732c3ebffaff5005367d7f947fa903f3b6e92f68)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
3791436eb5 avutil/imgutils: correctly check for negative SAR components
These could trigger assert failures previously

Found-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5705dc527687fd84d94c934169b6bd753459744f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
61147f58ab swscale/utils: clear formatConvBuffer on allocation
Fixes use of uninitialized memory
Fixes: asan_heap-oob_35ca682_1474_cov_3230122439_aletrek_tga_16bit.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 007498fc1a639ecee2cda1892cbcff66c7c8c951)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Andreas Cadhalpun
29e435ca33 avformat/bit: only accept the g729 codec and 1 channel
Other codecs/channel numbers are not supported by this muxer.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d0b8640f75ff7569c98d6fdb03d83451104e088c)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Andreas Cadhalpun
0540d5c5fc avformat/bit: check that pkt->size is 10 in write_packet
Ohter packet sizes are not supported by this muxer.

This avoids a null pointer dereference of pkt->data.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit eeda2c3de8a8484d9e7d1e47ac836bec850b31fc)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Andreas Cadhalpun
7f97231d97 avformat/adxdec: check avctx->channels for invalid values
This avoids a null pointer dereference of pkt->data.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7faa40af982960608b117e20fec999b48011e5e0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Andreas Cadhalpun
4005a71def avformat/adxdec: set avctx->channels in adx_read_header
It is used in adx_read_packet, which currently depends on the decoder/parser setting this value between reading the file header and demuxing the first packet.

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 64ea4a0598e7ca61b95cf6c93fd409151a448001)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Dyami Caliri
429347afa7 Fix buffer_size argument to init_put_bits() in multiple encoders.
Several encoders were multiplying the buffer size by 8, in order to get
a bit size. However, the buffer_size argument is for the byte size of
the buffer. We had experienced crashes encoding prores (Anatoliy) at
size 4096x4096.
(cherry picked from commit 50833c9f7b4e1922197a8955669f8ab3589c8cef)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
James Cowgill
a81b6a662a mips/acelp_filters: fix incorrect register constraint
Change register constraint on the v variable from = to +. This was causing GCC
to think that the v variable was never read and therefore not initialize it.

This fixes about 20 fate failures on mips64el.

Signed-off-by: James Cowgill <james410@cowgill.org.uk>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b9de1303a6414174ab2f3bccefa801bfabcf0f88)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
6168fe32f1 avcodec/hevc_ps: Sanity checks for some log2_* values
log2 values which imply numeric overflow are not supported

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 205b2ba3d677330e023aac2f4bd3f624039256b9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
711374b626 avcodec/zmbv: Check len before reading in decode_frame()
Fixes out of array read
Fixes: asan_heap-oob_4d4eb0_3994_cov_3169972261_zmbv_15bit.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1f5c7781e63d6519192ada59c1e36bcecc92791d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
9a63a36dc6 avcodec/h264: Only reinit quant tables if a new PPS is allowed
Fixes null pointer dereference
Fixes: signal_sigsegv_3042097_3007_cov_1741463594_non_monotone_timestamps1.mkv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c23a0e77dd492d6c794f89dbff3a438c95745e70)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
db1a99a209 avcodec/snowdec: Fix ref value check
Fixes integer overflow and out of array read.
Fixes: signal_sigsegv_24169e6_3445_cov_3778346427_snow_chroma_bug.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8f4cbf940212079a34753c7f4d6c6b5a43586d30)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
fe8c81a0f3 swscale/utils: More carefully merge and clear coefficients outside the input
Fixes out of array read
Fixes: asan_heap-oob_35ca682_1474_cov_3230122439_aletrek_tga_16bit.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1895d414aaacece3b57d7bf19502305e9a064fae)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
728051d9b1 avcodec/a64multienc: Assert that the Packet size does not grow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 29bbc1be488ea4fc591d3e0ef12f0fc7c8812afb)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
99d58a0da4 avcodec/a64multienc: simplify frame handling code
This also fixes a memleak

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4da351ff0cff460db2110cf22f2e3eded8733a58)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Andreas Cadhalpun
9783f9fb98 avcodec/a64multienc: fix use of uninitialized values in to_meta_with_crop
Averaging over 2 pixels doesn't work correctly for the last pixel, because the
rest of the buffer is not initialized.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 87513d654546a99f8ddb045ca4fa5d33778a617e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Andreas Cadhalpun
2ed0a77b7b avcodec/a64multienc: initialize mc_meta_charset to zero
This fixes the use of uninitialized values in avpriv_do_elbg.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ab759f8f4a3f7178361e32ab719e6bc49d8afecb)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
804e1e1610 avcodec/a64multienc: don't set incorrect packet size
This fixes invalid reads of the packet buffer in av_dup_packet

Based on patch by Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d96142e9af92ded84f2580620c571ab96c4bb657)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Andreas Cadhalpun
99d2d1404c avcodec/a64multienc: use av_frame_ref instead of copying the frame
This fixes freeing the frame buffer twice on cleanup leading to a crash.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 39e4ed7c1d8d840be47f6d604704d47a59a9ae5d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
cb1c9294f3 avcodec/x86/mlpdsp_init: Simplify mlp_filter_channel_x86()
Based on patch by Francisco Blas Izquierdo Riera
Commit message partly taken from carl

fixes a compilation
error in mlpdsp_init.c with -fstack-check and some gcc compilers (I
reproduced the issue with gcc 4.7.3) by simplifying the code.

See also https://bugs.gentoo.org/show_bug.cgi?id=471756

$ make libavcodec/x86/mlpdsp_init.o
libavcodec/x86/mlpdsp_init.c: In function ‘mlp_filter_channel_x86’:
libavcodec/x86/mlpdsp_init.c:142:5: error: can’t find a register in
class ‘GENERAL_REGS’ while reloading ‘asm’
libavcodec/x86/mlpdsp_init.c:142:5: error: ‘asm’ operand has impossible
constraints

4551 -> 4509 dezicycles

Reviewed-by: Ramiro Polla <ramiro.polla@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 03f39fbb2a558153a3c464edec1378d637a755fe)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Anton Khirnov
84341627d7 h264: initialize H264Context.avctx in init_thread_copy
This prevents using a wrong (first thread's) AVCodecContext if decoding
a frame in the first pass over all threads fails.
(cherry picked from commit a06b0b1295c51d100101e0ca0434e199ad6de6b5)

Conflicts:

	libavcodec/h264.c

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
4f694182e0 avformat/omadec: Use 64bit for ret to avoid overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0f55bc29d41585d110b126cb4ed4b395fd46d7ac)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
a2cfb784fb avformat/vqf: Use 64bit for ret to avoid overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cb08687180683a755d0fe9d425280d0e4d1e6db2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
6faf18acbd avformat/wtvdec: Use 64bit for ret to avoid overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d44e0d8b930732a4a247b4884d75cf62b4ad3664)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
96807933d8 avformat/mvdec: Use 64bit for ret to avoid overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 26c0cc154e06cb0064b3a3da49447ac44d82444f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:51 +01:00
Michael Niedermayer
4ef32aa2a6 avformat/apngdec: Use 64bit for ret to avoid overflow
Missed this hunk in first commit

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 80a851aa5ef2c848449f741365968c8f0ccf4531)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:50 +01:00
Michael Niedermayer
727730e279 avformat/gxf: Use 64bit for res to avoid overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 12987f89007ee82b9d3a6090085dfaef8461ab8b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:50 +01:00
Michael Niedermayer
5a829ee69e avformat/idcin: Use 64bit for ret to avoid overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d1923d15a3544cbb94563a59e7169291db76b312)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:50 +01:00
Michael Niedermayer
7fe22c3fe6 avformat/apngdec: Use 64bit ret to avoid overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0e3d6e17dea758fdb7d0adfc57f7655551ab32b3)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:50 +01:00
Michael Niedermayer
c7565b143c avformat/asfdec: Use 64bit ret to avoid overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d4936d28a11fac6c9c4b4df9625185f93b086986)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:50 +01:00
Rodger Combs
303ecfc373 wtvdec: fix integer overflow resulting in errors with large files
This fixes a regression in 9fbc613f0df1628e7e78bca791fa8833846f8210

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 62e95757d5749e578b2abd407e3009d15a85adb0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-03-21 01:52:50 +01:00
Carl Eugen Hoyos
1456ed2dd5 lavf: Do not list mov-only codecs in riff.c.
Instead check for all mov code-points when demuxing avi
and print a warning if a video codec is found like this.
Fixes ticket #4307.
(cherry picked from commit 2e0b5f5c90a4bc1440703ba5e8bf7139ff42f367)

Conflicts:
	libavformat/riff.c
2015-03-13 09:15:18 +01:00
Michael Niedermayer
79c9d9b134 Revert "avutil/opencl: is_compiled flag not being cleared in av_opencl_uninit"
Fixed build with opencl enabled
Found-by:  WJ Liu

This reverts commit 0f2359b86926ed33da4bd64ca76d84d03d5ad380.

(cherry picked from commit ebd59d271c24601e08c3569681b129cd27bf4070)
2015-03-09 14:32:13 -03:00
Srikanth G
d0aa3d13fa avutil/opencl: is_compiled flag not being cleared in av_opencl_uninit
When OpenCL kernels are compiled, is_compiled flag is being set for each
kernel. But, in opencl uninit, this flag is not being cleared.
This causes an error when an OpenCL kernel is tried on different OpenCL
devices on same platform.

Here is the patch with a fix

Reviewed-by; Wei Gao <highgod0401@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>

(cherry picked from commit 0f2359b86926ed33da4bd64ca76d84d03d5ad380)
2015-03-06 15:51:20 -03:00
Clément Bœsch
e5cc73e0a5 avcodec/gif: fix off by one in column offsetting finding
(cherry picked from commit f9240ec01abb097263fe578d2b6fb076bb7b9263)
2015-02-16 17:59:48 +01:00
Clément Bœsch
3429714f3d avfilter/dctdnoiz: fix slice_h computation
ceilf() can only work if the reminder of the division is not 0.

This fixes memory errors with for instance:
  ffmpeg -f lavfi -i testsrc=s=800x500 -threads 3 -vf dctdnoiz -frames:v 1 -f null -

(cherry picked from commit eb7efaa9244720c5f2051d76d76faeec864eca7a)
2015-02-12 20:21:56 +01:00
James Almer
ee902d3d2d x86/lossless_audiodsp: fix compilation with --disable-yasm
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 383fddeec65f4cebcb197eae702dfefdc6192eb0)

Found-by: jamrial
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 20:04:09 +01:00
James Almer
9bc62da980 avutil/opencl: don't include config.h
It's not an installed header.

Tested-by: Thilo Borgmann <thilo.borgmann@mail.de>
Tested-by: Wei Gao <highgod0401@gmail.com>
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 3aaff803489af21011b8cf03847e17b29643c922)
2015-02-12 15:43:47 -03:00
James Almer
2a6d16ba5f x86/swr: add missing alignment check to pack_6ch functions
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 5f14f9e9849579b3418aebfde8a162d9c172d0ea)
2015-02-12 15:43:43 -03:00
Michael Niedermayer
c7e967a7cb Update for 2.5.4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:44:24 +01:00
Michael Niedermayer
5262c88bb0 avformat/rtmpproto: Use av_freep() to avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:11:55 +01:00
Michael Niedermayer
bd78b9416d avformat/riffdec: Use av_freep() to avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:11:54 +01:00
Michael Niedermayer
48ae72e501 avformat/os_support: Use av_freep() to avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:11:54 +01:00
Michael Niedermayer
0f671dfeac avcodec/arm/videodsp_armv5te: Fix linking failure with "g++ -shared -D__STDC_CONSTANT_MACROS -o test.so ... libavcodec.a"
Tested-by: Andreas Haupt
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit cab6302534962331753fb69c674df86a458b098d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
345962121d avcodec/mjpegdec: Skip blocks which are outside the visible area
Fixes out of array accesses
Fixes: ffmpeg_mjpeg_crash.avi

Found-by: Thomas Lindroth <thomas.lindroth@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 08509c8f86626815a3e9e68d600d1aacbb8df4bf)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
0cbf53bdf5 avcodec/h264_slice: assert that reinit does not occur after the first slice
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2fd9ce92af43e6dcbc8ed7c26c00b052de48ccad)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
b20409c690 avcodec/h264_slice: ignore SAR changes in slices after the first
Fixes race condition and null pointer dereference
Fixes: signal_sigsegv_1472ac3_468_cov_2915641226_CABACI3_Sony_B.jsv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 38d5241b7f36c1571a88517a0650caade16dd5f4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
7997ec54c9 avcodec/h264_slice: Check picture structure before setting the related fields
This might fix a hypothetical race condition

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f111831ed61103f9fa8fdda41473a23da016bdaa)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
e805826903 avcodec/h264_slice: Do not change frame_num after the first slice
Fixes potential race condition
Fixes: signal_sigsegv_1472ac3_468_cov_2915641226_CABACI3_Sony_B.jsv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f906982c9411f3062e3ce68013309b37c213c4dd)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
137a000377 avutil/opt: Fix type used to access AV_OPT_TYPE_SAMPLE_FMT
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1750b45cdf7498d0a05bea29cafcb26aa576d595)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
78c314e39e avutil/opt: Fix types used to access AV_OPT_TYPE_PIXEL_FMT
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a0640e63463e6428b80422c89e1bfc96147ecfc6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
756d85dc14 avcodec/h264: Be more strict on rejecting pps/sps changes
Fixes race condition
Fixes: signal_sigsegv_1472ac3_468_cov_2915641226_CABACI3_Sony_B.jsv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6fafc62b0bd0e206deb77a7aabbf3a370ad80789)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
eeab3e1b20 avcodec/h264: Be more strict on rejecting pps_id changes
Fixes race condition
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 31cc9c04ca386dce289864021982da62190982ab)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
a75787a71a avcodec/h264_ps: More completely check the bit depths
Fixes out of array read
Fixes: asan_static-oob_30328b6_719_cov_3325483287_H264_artifacts_motion.h264

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 69aa79365c1e8e1cb597d33e77bf1062c2ef47d4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
09425294c9 Revert "avcodec/x86/lossless_audiodsp: Make scalarproduct_and_madd_int16 prototypes more similar"
This reverts commit 3b4ffba3af968ae702e3a44f6b5f53445efc7363.

Unbreaks the SSSE3 code on mingw32

Conflicts:

	libavcodec/x86/lossless_audiodsp.asm

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a6c2c8fe3f076d14c0170b4d1965a0dea0393b8d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
3572eaaf02 avcodec/x86/lossless_audiodsp: Move order&8 fallback into C code
This is simpler and more robust, and fixes mismatching XMM save restore
mismatches

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f1214763af1abf5d7f49b98f88c06e13b98932a6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
25da8d84a4 avcodec/x86/lossless_audiodsp: Make scalarproduct_and_madd_int16 prototypes more similar
This is needed as the mmx code is used as fallback from the ssse3 code

Suggested-by: jamrial
Tested-by: wm4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3b4ffba3af968ae702e3a44f6b5f53445efc7363)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
0f642909d8 avformat/thp: Check av_get_packet() for failure not only for partial output
Fixes null pointer dereference
Fixes: signal_sigsegv_db2c1f_3108_cov_163322880_pikmin2_opening1_partial.thp

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f2579dbb4b31e6ae731e7f5555680528ef3020ab)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
6252e9141b swscale/utils: Limit filter shifting so as not to read from prior the array
Fixes out of array read
Fixes: asan_heap-oob_1fb2f9b_3780_cov_3984375136_usf.mkv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 692b22626ec9a9585f667c124a186b1a9796e432)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
c65a731b6f avcodec/mpegvideo_motion: Fix gmc chroma dimensions
Fixes integer overflow and out of array read
Fixes: asan_heap-oob_1fb2f9b_3780_cov_3984375136_usf.mkv

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fd52d2d3d1ee41822a9801dffd41c0e1a2db32a8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
58096b70fa avcodec/mjpegdec: Check number of components for JPEG-LS
Fixes out of array accesses
Fixes: asan_heap-oob_1c1a4ea_1242_cov_2274415971_TESTcmyk.jpg

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fabbfaa095660982cc0bc63242c459561fa37037)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
0ae93844d0 avcodec/mjpegdec: Check escape sequence validity
Fixes assertion failure
Fixes: asan_heap-oob_1c1a4ea_1242_cov_2274415971_TESTcmyk.jpg

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit afa92907f3c6a0c3bdad766ec8d938ee17ee1c9e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
657dc91b44 avformat/mpc8: Use uint64_t in *_get_v() to avoid undefined behavior
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 05e161952954acf247e0fd1fdef00559675c4d4d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
wm4
352d17086f avformat/mpc8: fix broken pointer math
This could overflow and crash at least on 32 bit systems.

Reviewed-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b737a2c52857b214be246ff615c6293730033cfa)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
wm4
193440f566 avformat/mpc8: fix hang with fuzzed file
This can lead to an endless loop by seeking back a few bytes after each
attempted chunk read. Assuming negative sizes are always invalid, this
is easy to fix. Other code in this demuxer treats negative sizes as
invalid as well.

Fixes ticket #4262.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 56cc024220886927350cfc26ee695062ca7ecaf4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
wm4
563e542b31 avformat/tta: fix crash with corrupted files
av_add_index_entry() can fail, for example because the parameters are
invalid, or because memory allocation fails. Check this; it can actually
happen with corrupted files.

The second hunk is just for robustness. Just in case functions like
ff_reduce_index() remove entries. (Not sure if this can actually
happen.)

Fixes ticket #4294.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6a0cd529a35190d9374b0b26504e71857cd67b83)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Rong Yan
b0b6d8de7e avcodec/ppc/idctdsp.c: POWER LE support in idct_add_altivec()
also add GET_TMP2() macro

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fc35df893175cedd65c14a4f7ebab6f33aeae4a6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
2f5c5767d1 avcodec/mpegvideo_enc: Fix number suffixes in rc_buffer_size calculation
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4531e2c489d279bfc90d54ca26ed898c5b265a7f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
979a54ed18 avcodec/h264_cabac: use int instead of long for mbb_xy
The mb address fits in int

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 592ba6ec106206f97133c9345313010c76361e12)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
d11bca8043 avformat/omadec: fix number suffix
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f1f7f5903ab49b84789af5341492afbaba808a70)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:36 +01:00
Michael Niedermayer
a3ef410b9c avformat/smacker: Fix number suffix
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 465f3705b1ef832fd6904750d018f81f9044f3ab)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:35 +01:00
Michael Niedermayer
260e5c6dbe avformat/matroskadec: Fix number suffixes
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit fc3cdb00d084222a107e61e7168903bf3d3d0b47)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:35 +01:00
Michael Niedermayer
bac6554c74 avcodec/dxtory: Use LL instead of L number suffix
This is probably unneeded and normal int would be fine, but its
safer to use LL and this isnt speed relevant

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b4ad2853c50d055e9ba8c29f2e1c83b292f29d7a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:35 +01:00
Michael Niedermayer
1e366c15ed swresample/dither: Cleanup number suffixes
The <<31 case needs LL

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c77cc2c1766666cdb5f14daee0f75e397bf7a194)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:35 +01:00
Michael Niedermayer
675fb3a8af avformat/utils: Fix number suffixes in tb_unreliable()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4b15bba2aec93776bfdc69a1bca42a4795a7d191)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:35 +01:00
Michael Niedermayer
25fc0faccb doc/APIchanges: fill in more missing hash values and dates
all values before 2.5 seem to be filled in now

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8c8ee17e8d2800144116ec52f26a435a06b49420)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:35 +01:00
Michael Niedermayer
164083434e doc/APIchanges: fill in and correct some values
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0d64982828aee5f3495a71050e4930fa2898ca15)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:35 +01:00
Michael Niedermayer
8026606497 doc/APIchanges: Add av_find_best_pix_fmt_of_2() and av_get_pix_fmt_loss()
also add deprecation note for avcodec_get_pix_fmt_loss(), avcodec_find_best_pix_fmt_of_2()

Found-by: wm4
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f7a1c5e4d2294a8970ede7f6deb2fe0a64e202a5)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:35 +01:00
Michael Niedermayer
6ac8ac0109 doc/APIchanges: Fill in some more missing hash values
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit bbdd940f36662d4b6156464b1bda5131fc382465)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:35 +01:00
Michael Niedermayer
f07e2ff697 swscale/input: fix rgba64 alpha non native
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f30798584fd9709e83644f831107fdc9e26b1311)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:35 +01:00
Michael Niedermayer
b62b3e1a25 swscale/input: Fix alpha of YA16 input
Fixes Ticket4278

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 95d04690aa4f43f6b61640713a11a9649cbf85e9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:35 +01:00
Andreas Cadhalpun
a45b8af839 libavcodec/ppc/mpegvideoencdsp.c: fix stack smashing in pix_norm1_altivec() and pix_sum_altivec()
The vec_ste calls were mistakenly changed to vec_vsx_st in c5ca76a, which
caused stack smashing.

Changing them back fixes crashes on ppc64el, when configured with
--toolchain=hardened.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 840c3c05316a59c70a7470ed27aaa9c2f3ba410a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:35 +01:00
Michael Niedermayer
a443b48ccf avformat/rmdec: Check for overflow in ff_rm_read_mdpr_codecdata()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 03abf55f252945c70f4a79eaf4d609cee4d98710)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:35 +01:00
Michael Niedermayer
a45402d4c0 avformat/mpeg: do not count PES packets inside PES packets during probing
Fixes: misdetection of test2.mp3

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e15b29bb18bee8b65fab5a3c873540e01fd20afe)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:35 +01:00
Vittorio Giovara
0bdc64e8b9 hevc: always clip luma_log2_weight_denom
Its value shall be between 0 and 7 according to the specifications.

Bug-Id: CID 1257502
2015-02-12 17:10:35 +01:00
Martin Storsjö
5fbf63ea39 rtpdec_h263_rfc2190: Clear the stored bits if discarding buffered data
If we throw away the buffered incomplete frame, make sure to also
throw away the buffered bits of an incomplete byte at the same
time.

(cherry picked from commit df07c07b3de0a5e8890078944de1eb5cb8372ef8)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:35 +01:00
Vittorio Giovara
4d74bb24e3 aacenc: correctly check returned value
(cherry picked from commit 971099ff5a85377579eb5b8d3620e283957f097e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:35 +01:00
Vittorio Giovara
7f8d0cf93a swscale: check memory allocations
Bug-Id: CID 1257779
(cherry picked from commit 1dd797e3c9f179f957316a0becbec048b42df8aa)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:35 +01:00
Vittorio Giovara
28fba55306 opt: check memory allocation
Bug-Id: CID 1257771
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:35 +01:00
wm4
7caee17204 avformat/utils: check for malloc failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a66893ac949864352b36b39e48c4cd72bbd81e54)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:35 +01:00
Michael Niedermayer
edec2a4da3 avcodec/flac_parser: fix handling EOF if no headers are found
Fixes assertion failure
Fixes Ticket4269

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c4d85fc23c100f7a27d9bad710eb153214868e27)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:35 +01:00
Michael Niedermayer
65074a5dae avfilter/vf_framepack: Check and update frame_rate
The frame_rate update was missing leaving the output frame rate
wrong.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a46a23d30fea9c8a5570e07ec4d9c9b4eaa6eb4f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:35 +01:00
Michael Niedermayer
e3b6144e0c avdevice: Use av_format_get_control_message_cb()
This is required as the location of this field could change and is
specified in libavformat not avdevice

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ba97cf2c4562b60fbef89103b61516891e31845e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:35 +01:00
Vittorio Giovara
8acbba0ec3 vp8: improve memory allocation checks
Check memory earlier, check one more allocation and clean up on error.

CC: libav-stable@libav.org
Bug-Id: CID 1257773
(cherry picked from commit 014b6b416fec89777cb9cff61bcf7896eaf7cf39)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:35 +01:00
Andreas Cadhalpun
9e9cde6afa configure: enable vsx together with altivec for ppc64el
The altivec optimizations on little endian ppc64 don't work without vsx.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6108485cf70f04dbf4708bd84ce749da871fa3f1)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:35 +01:00
Michael Niedermayer
4f8814964c avcodec/hevc: Fix handling of skipped_bytes() reallocation failures
Fixes CID1260704

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e172f5e53ae4dbbcdcf81c9a3b962dc9f5a8a98d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:35 +01:00
wm4
8a6770a214 qpeg: avoid pointless invalid memcpy()
If refdata was NULL, the memcpy() ended up copying the same memory
block onto itself, which is not only pointless, but also undefined
behavior.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 921706691a87c3ea5f5b92afd9b423e5f8c6e9d9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-02-12 17:10:35 +01:00
Carl Eugen Hoyos
763e6ecf83 lavc/aarch64: Do not use the neon horizontal chroma loop filter for H.264 4:2:2.
(cherry picked from commit 4faea46bd906b3897018736208123aa36c3f45d5)
2015-02-03 23:08:15 +01:00
Andreas Cadhalpun
07d508e4f5 doc/examples: fix lib math dep for decoding_encoding
It uses at least sin().

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f97f2a3527eac2cf60ba86206d1bae9a970a7e71)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-10 05:03:04 +01:00
Michael Niedermayer
b089b58250 avformat/movenc: workaround bug in "PathScale EKOPath(tm) Compiler Suite Version 4.0.12.1"
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7824dc5150c0ea44ffa7cd4d57803f9a9697e7d7)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-10 05:01:20 +01:00
Michael Niedermayer
a7dd37169c Update for 2.5.3
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:37:34 +01:00
wm4
3032291b3a vp9: fix parser return values in error case
The parser must always set the out_size and out_data pointers. The API
seems to require it, and the common code in parser.c also relies on it.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit b88e80589bd11ef935a5e9dab53d4edb00de16e4)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
Michael Niedermayer
f9bbc26e69 ffmpeg: Clear error message array at init.
This avoids printing uninitialized bytes if no error message is set

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6d1a2efb8ac399a003ea7d3b6f8c641d192567ee)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
wm4
b895e29941 avcodec/dvdsubdec: fix accessing dangling pointers
dvdsub_decode() can call append_to_cached_buf() 2 times, the second time
with ctx->buf as argument. If the second append_to_cached_buf() reallocs
ctx->buf, the argument will be a pointer to the previous, freed block.
This can cause invalid reads at least with some fuzzed files - and
possibly with valid files.

Since packets can apparently not be larger than 64K (even if packets are
combined), just use a fixed size buffer. It will be allocated as part of
the DVDSubContext, and although some memory is "wasted", it's relatively
minimal by modern standards and should be acceptable.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 816577716bc6170bccfea3b9e865618b69a4b426)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
wm4
3d71024f8a avcodec/dvdsubdec: error on bitmaps with size 0
Attemtping to decode them could lead to invalid writes with some fuzzed
samples.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit bcaa9099b3648b47060e1724a97dc98b63c83702)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
James Almer
b834dc14da configure: bump year
Happy new year!
(cherry picked from commit b8db25a3338b67186837c49580fe538d63dd73c7)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
Michael Niedermayer
d0041dc8c4 avformat/mov: Fix mixed declaration and statement warning
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit db27f50e0658e91758e8a17fdcf390e6bc93c1d2)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
Michael Niedermayer
b3c082412c cmdutils: Use 64bit for file size/offset related variable in cmdutils_read_file()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 369b4cd4120bf67aa5187b6bc72574970a24ca22)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
Michael Niedermayer
918ed73b70 avformat/utils: Clear pointer in ff_alloc_extradata() to avoid leaving a stale pointer in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit bbfca8e84b0e69abba523d665536c0135fc1c00e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
Michael Niedermayer
2791eba1d7 avformat/matroskadec: Use av_freep() to avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6e70e4aca50696040cc9256ec96e5c31d9641432)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
Michael Niedermayer
0d3a07852c avformat/mov: use av_freep() to avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 383c6a3a07b71981bd32d083496f5a4935f620f9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
Paul B Mahol
c7a2ac6b6b lavfi: check av_strdup() return value
Signed-off-by: Paul B Mahol <onemda@gmail.com>
(cherry picked from commit 145a84717b62e086cdb5f26649ad9f1b51ef38d0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
Dale Curtis
0ce35b8ce8 mov: Fix negative size calculation in mov_read_default().
The previous code assumed if an atom was marked with a 64-bit
size extension, it actually had that data available. The new
code verfies there's enough data in the atom for this to be
done.

Failure to verify causes total_size > atom.size which will
result in negative size calculations later on.

Found-by: Paul Mehta <paul@paulmehta.com>
Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3ebd76a9c57558e284e94da367dd23b435e6a6d0)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
Michael Niedermayer
25312a427b avformat/mov: fix integer overflow in mov_read_udta_string()
Found-by: Paul Mehta <paul@paulmehta.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3859868c75313e318ebc5d0d33baada62d45dd75)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
Dale Curtis
9143ab0e5a mov: Fix overflow and error handling in read_tfra().
Under abnormal conditions the item_count may exceed the max
allocation size on 32-bit systems, this causes the allocated
size to overflow and become too small for the given count.

Additionally, if av_reallocp() fails its allocation, the
fragment_index_count is not correctly decremented.

Ensuring further havoc may be wrought, the error code for
read_tfra() is not checked upon return.

Found-by: Paul Mehta <paul@paulmehta.com>

positive return code and use of _array functions by commiter

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit db42d93a61be26873be6115c57f5921b4dfdec14)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
Dale Curtis
022bfd3dd4 mov: Avoid overflow with mov_metadata_raw()
The code previously added 1 to len without checking its size,
resulting in an overflow which can corrupt value[-1] -- which
may be used to store unaligned ptr information for certain
allocators.

Found-by: Paul Mehta <paul@paulmehta.com>
Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
2015-01-09 17:19:10 +01:00
wm4
e0a12b3dc3 avcodec/dvdsubdec: fix out of bounds accesses
The code blindly trusted buffer offsets read from the file in the RLE
decoder. Explicitly check the offset. Also error out on other RLE
decoding errors.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c9151de7c42553bb145be608df8513c1287f1f24)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
Michael Niedermayer
252ba4a925 avfilter/vf_sab: fix filtering tiny images
Fixes out of array reads

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9bff052b51f27f6cce04e8d7d8b405c710d7ad67)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
Michael Niedermayer
5bb31e856d avformat/flvdec: Increase string array size
Fixes parsing httphostheader of Scarlatti\,\ Pieter-Jan\ Belder\ -\ Sonata\ K113\ in\ A\ major\ -\ Alle.flv

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit eb767a276bfdb9a0493bdb0b38203638230b7ccb)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
Michael Niedermayer
eac0451e47 avformat/flvdec: do not inject dts=0 metadata packets which failed to be parsed into a new data stream
Such data streams (which then contain no other packets except the faulty one)
confuse some user applications, like VLC
Works around vlcticket 12389

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 322f0f5960a743cac47252d90a0f1ea7a025feff)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:10 +01:00
Michael Niedermayer
68c6347089 avformat/cdxl: Fix integer overflow of image_size
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3eb5cbe0c50d0a0bbe10bcabbd6b16d73d93c128)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:09 +01:00
Michael Niedermayer
bcd7f35717 avformat/segment: Use av_freep() avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 68fa549230af35179df2a2af2bdb84ee6c825bed)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2015-01-09 17:19:09 +01:00
Martin Storsjö
93cbdcd4d3 libavformat: Build hevc.o when building the RTP muxer
The RTP muxer enables the actual codepaths within sdp.c,
which depend on hevc.o since e5cfc8fd.

This fixes builds with --disable-everything --enable-muxer=rtp.

Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit fccfc22d1f304aef42a0b960e4c1d55ce67107f5)
2015-01-09 00:50:31 -03:00
Michael Niedermayer
959ab06c68 Changelog: update for 2.5.2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-23 04:28:09 +01:00
Michael Niedermayer
46db3121c6 update for 2.5.2
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:41:27 +01:00
Michael Niedermayer
c96c755320 Makefile: add dependencies which require ffversion.h
Without this ffversion.h could sometimes be built too late

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4ae87554f3c8bc54db572873f5049427a7e6cb31)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:56 +01:00
Michael Niedermayer
9f8cdd520b Add FFMPEG_VERSION into the binary libs
This simplifies identifying from which revision a binary of a lib came from

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 649c158e8c94ac0cff7f03e97d6ea8bbf71b7f02)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:56 +01:00
Anton Khirnov
f5631d23e0 mmvideo: check frame dimensions
The frame size must be set by the caller and each dimension must be a
multiple of 2.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
See: 8b0e96e1f21b761ca15dbb470cd619a1ebf86c3e
These should be redundant, but are backported for saftey anyway
2014-12-22 03:17:56 +01:00
Anton Khirnov
50f4543c6b jvdec: check frame dimensions
The frame size must be set by the caller and each dimension must be a
multiple of 8.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
See: 105654e376a736d243aef4a1d121abebce912e6b
These should be redundant, but are backported for saftey anyway
2014-12-22 03:17:56 +01:00
Michael Niedermayer
1344e91f33 avcodec/indeo3: ensure offsets are non negative
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 368642361f3a589d7b0c23ea327d988edb434e3f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:55 +01:00
Michael Niedermayer
f13e6ec7a6 avcodec/h264: Check *log2_weight_denom
Fixes undefined behavior
Fixes: signal_sigsegv_14768d2_2248_cov_3629497219_h264_h264___pi_20070614T182942.h264
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 61296d41e2de3b41304339e4631dd44c2e15f805)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:55 +01:00
Michael Niedermayer
bf2c9e1ad4 avcodec/hevc_ps: Check diff_cu_qp_delta_depth
Fixes undefined behavior
Fixes: asan_static-oob_17aa046_582_cov_1577759978_DBLK_G_VIXS_1.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3281fa892599d71b4dc298a426af8296419cd90e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:55 +01:00
Michael Niedermayer
0663aab1d9 avcodec/h264: Clear delayed_pic on deallocation
Fixes use of freed memory

Fixes: case5_av_frame_copy_props.mp4
Found-by: Michal Zalewski <lcamtuf@coredump.cx>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e8714f6f93d1a32f4e4655209960afcf4c185214)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:55 +01:00
Michael Niedermayer
e911f125fc avcodec/hevc: clear filter_slice_edges() on allocation
This avoids use of uninitialized memory
Fixes: asan_static-oob_17aa046_582_cov_212287884_DBLK_G_VIXS_1.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8aa8d12554868c32436750f881954193087219c8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:55 +01:00
Michael Niedermayer
5aead5ee05 avcodec/dcadec: Check that the added xch channel isnt already there
Fixes null pointer dereference
Fixes: signal_sigsegv_369609d_623_cov_2008234281_ES_6.1_16bit.dts
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7d593495e42e92693cc8f3ce9b42cf3edcea377a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:55 +01:00
Michael Niedermayer
3a5b749d7c avcodec/indeo3: use signed variables to avoid underflow
Fixes out of array read
Fixes: signal_sigsegv_1b0a4da_1865_cov_2167818389_computer_anger.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3305acdc92fa37869f160a11a87741c8a0de0454)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:55 +01:00
Michael Niedermayer
4b4d0b0290 avcodec/h264: make the first field of H264Context an AVClass
Fixes use of freed memory
Fixes: asan_heap-uaf_3660f67_757_cov_1257014655_Hi422FR1_SONY_A.jsv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit f3b5b139ad853b6f69c6a0b036815a60e7b3f261)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:55 +01:00
Michael Niedermayer
c9b25252cb swscale: increase yuv2rgb table headroom
Fixes out of array access
Fixes: case2_bad_read_yuv2rgbx32.mp4
Found-by: Michal Zalewski <lcamtuf@coredump.cx>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2a983ff7fe076ae93926eb33cfb44ca49183dacc)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:55 +01:00
Michael Niedermayer
4400385d5f avformat/mov: fix integer overflow of size
Fixes: case1_call_stack_overflow.mp4
Found-by: Michal Zalewski <lcamtuf@coredump.cx>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit be9ce6e10a8d53b8bc346c9337d75a5a30631a2a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:55 +01:00
Michael Niedermayer
d85e25fe0b avformat/mov: check atom nesting depth
Fixes call stack overflow
Fixes: case1_call_stack_overflow.mp4
Found-by: Michal Zalewski <lcamtuf@coredump.cx>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit caa7a3914f499f74b3ee346f26d598ebdc0ec210)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:55 +01:00
Michael Niedermayer
3d1972d182 avcodec/utvideodec: Fix handling of slice_height=0
Fixes out of array accesses
Fixes: asan_heap-oob_25bcd7e_3783_cov_3553517262_utvideo_rgba_median.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3881606240953b9275a247a1c98a567f3c44890f)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:55 +01:00
Michael Niedermayer
71b1abe638 avcodec/xface: Add asserts to limit nb_words from becoming too large
Approved-by: Stefano Sabatini <stefasab@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 211200e0c0efa48b2815ce93fda10dab43526d1b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:55 +01:00
Michael Niedermayer
991ef3a67e avcodec/xface: correct the XFACE_MAX_* values
Fixes out of array access

Fixes: asan_stack-oob_32c12e5_2536_cov_2442316831_lena.xface
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 93a5a16f136d095d23610f57bdad10ba88120fba)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:55 +01:00
Michael Niedermayer
b850b01533 avcodec/vmdvideo: Check len before using it in method 3
Fixes out of array access
Fixes: asan_heap-oob_4d23ba_91_cov_3853393937_128.vmd

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 3030fb7e0d41836f8add6399e9a7c7b740b48bfd)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:55 +01:00
Michael Niedermayer
23a17b4a3d avformat/flvdec: Use av_freep() avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 91ea466551c148bd897706a1b6a168e783761a06)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:55 +01:00
Michael Niedermayer
3a8ad4b878 avformat/hdsenc: Use av_freep() avoid leaving stale pointers in memory
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 16d763fa45b95783c6770edc559769d9a83d6a10)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:55 +01:00
Michael Niedermayer
b85a939633 configure: create the tests directory like the doc directory
This fixes an issue where the tests directory is not created for out of tree
builds before its needed

Tested-by: Dave Yeo <daveryeo@telus.net>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit e631872f13b6be0583603d45a11e53319754bc8d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-22 03:17:55 +01:00
Clément Bœsch
7e130ca5b4 avformat/rsd: make tag_buf string larger
av_get_codec_tag_string() uses more that 1 char for unprintable characters.

(cherry picked from commit edbbb11488e1fce9b9703535936d2e1731e2e318)
2014-12-19 18:01:31 -03:00
Clément Bœsch
f295f9488a avformat/apngdec: make tag_buf string larger
av_get_codec_tag_string() uses more that 1 char for unprintable characters.

(cherry picked from commit d60fb4f7946272d2ef39703762b54c5f3a1b5789)
2014-12-19 18:00:40 -03:00
Michael Niedermayer
2c01dd2ea5 Update Changelog for 2.5.1
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-15 23:52:03 +01:00
Michael Niedermayer
5e26152ee4 Update for FFmpeg 2.5.1
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-15 15:30:31 +01:00
wm4
135c733125 lavu/frame: fix malloc error path in av_frame_copy_props()
The error path frees all side data, but forgets to reset the side data
count. This can blow up later in av_frame_unref() and free_side_data().

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a400edbb6d00c0211de38e4f1b4f593681db91d8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-15 05:32:36 +01:00
Michael Niedermayer
3b3a3c3d44 avformat/utils: Do not update programs streams from program-less streams in update_wrap_reference()
Fixes Ticket3686

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a29524bf2e197dd8d582445de0fe17f03b79f79d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-14 20:58:33 +01:00
Michael Niedermayer
13244abcd3 avformat/aviobuf: Check that avio_seek() target is non negative
Fixes out of array access

Suggested-by: Andrew Scherkus <scherkus@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ed86dbd05d61363dc1c0d33f3267e2177c985fdd)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-14 17:42:16 +01:00
Rob Sykes
9783d5bfda swresample/soxr_resample: fix error handling
Fixes CID1257659

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4b6f2253741f3023928e61ae5105ccd4b1c515fb)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-13 22:20:16 +01:00
Michael Niedermayer
0e4efad93c avformat/flvdec: fix potential use of uninitialized variables
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 0fadbd3623cf9132832f48810c0edb93aa63f51b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-10 13:42:29 +01:00
Michael Niedermayer
0103bc67fd avformat/crypto: fix key vs iv typo
Fixes Ticket 4167

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 2d0117f816b92510546caf26414961ee6088f961)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-09 20:08:03 +01:00
Moritz Barsnick
d5af3fb1c5 configure: use use_pkg_config() instead of check_pkg_config() for libsmbclient
This ensures that the CFLAGS and LDFLAGS are actually applied.
Fixes an incorrect change introduced with the clean-up in commit
cfcaf6b38e39ed6e788abb1a5a44f23660dce2f6.

Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 754f4957d7a7e5be0df0e9de1d31aebeecdc4476)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-09 01:04:32 +01:00
Rong Yan
6ec5a199ea avcodec/ppc/vp3dsp_altivec: POWER LE support to vp3_idct_add_altivec()
add GET_VDST16() macro

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9bd8f2cc32c2616c2bc010dd50f542ce6a85162b)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-08 15:30:03 +01:00
wm4
f7b5366657 avformat/matroskadec: fix handling of recursive SeekHead elements
When matroska_execute_seekhead() is called, it goes through the list of
seekhead entries and attempts to read elements not read yet. When doing
this, the parser can find further SeekHead elements, and will extend the
matroska->seekhead list. This can lead to a (practically) infinite loop
with certain broken files. (Maybe it can happen even with valid files.
The demuxer doesn't seem to check correctly whether an element has
already been read.)

Fix this by ignoring elements that were added to the seekhead field
during executing seekhead entries.

This does not fix the possible situation when multiple SeekHead elements
after the file header (i.e. occur after the "before_pos" file position)
point to the same elements. These elements will probably be parsed
multiple times, likely leading to bugs.

Fixes ticket #4162.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 6551acab6877addae815decd02aeca33ba4990c8)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-07 23:04:23 +01:00
Piotr Fusik
542332e523 doc/examples/filtering_video: fix frame rate
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit c99e5191ab846d4897dfc565ba446ec960e04aa9)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-05 17:36:19 +01:00
Michael Niedermayer
aa24dd487f avcodec/mpegaudiodec_template: only allocate fdsp when its used
Fixes memleak

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a7ebd0b011f9576c843a86bd6a1828ecaa6faf3a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-05 05:16:14 +01:00
Michael Niedermayer
3bcd1daad7 doc/examples/transcoding: check encoder before using it
Fixes null pointer exception

Found-by: stoupeace
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit bde27e1e617dfeb3c026f530f48a77f5ed8aa2ea)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-04 19:08:32 +01:00
Michael Niedermayer
91f88eab32 MAINTAINERS: add 2.5
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit a4f21a8dd9d8b327334d706a96c0cb5c41bd82b6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-04 14:48:20 +01:00
Rong Yan
aac467ae17 avcodec/ppc/vp8dsp_altivec.c: POWER LE support put_vp8_epel_h_altivec_core() put_vp8_epel_v_altivec_core() put_vp8_pixels16_altivec() add marcos GET_PIXHL() GET_OUTER() LOAD_HL()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d23e8832486f0a37c7ad708b504b723bcfa2f71d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-04 14:48:19 +01:00
Rong Yan
968e733b2e avcodec/ppc/vc1dsp_altivec: add POWER LE support to vc1_inv_trans_8x4_altivec()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 36cd2bcbc343c299241dc7275cb85cbc3fc6b8ad)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-04 12:09:38 +01:00
Timothy Gu
192d46e6d1 Update RELEASE_NOTES
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-04 06:06:18 +01:00
Timothy Gu
bb8614cb7b Changelog/RELEASE_NOTES: Add APNG decoder
Signed-off-by: Timothy Gu <timothygu99@gmail.com>
2014-12-04 06:06:07 +01:00
Michael Niedermayer
d9bdf7d9ae Changelog: release is 2.5 not "next"
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-04 02:16:55 +01:00
Michael Niedermayer
a588e1e560 avcodec/aacdec: reduce noisiness of missing channel elements
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5fe026f2bda68a129d70b9609c4902917db9ca2e)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-04 01:58:32 +01:00
Carl Eugen Hoyos
36e7385d0e Fix standalone compilation of the iec61883 input device.
(cherry picked from commit 963aa1daf88066d43c7495803b870800c5faaa4d)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-04 01:58:28 +01:00
Michael Niedermayer
5108323aa9 Update for 2.5
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
2014-12-04 00:47:17 +01:00
4952 changed files with 116933 additions and 428970 deletions

66
.gitignore vendored
View File

@ -1,6 +1,5 @@
*.a *.a
*.o *.o
*.o.*
*.d *.d
*.def *.def
*.dll *.dll
@ -18,9 +17,9 @@
*.so.* *.so.*
*.swp *.swp
*.ver *.ver
*-example
*-test
*_g *_g
\#*
.\#*
/.config /.config
/.version /.version
/ffmpeg /ffmpeg
@ -29,7 +28,62 @@
/ffserver /ffserver
/config.* /config.*
/coverage.info /coverage.info
/avversion.h /doc/*.1
/doc/*.3
/doc/*.html
/doc/*.pod
/doc/config.texi
/doc/avoptions_codec.texi
/doc/avoptions_format.texi
/doc/doxy/html/
/doc/examples/avio_reading
/doc/examples/decoding_encoding
/doc/examples/demuxing_decoding
/doc/examples/extract_mvs
/doc/examples/filter_audio
/doc/examples/filtering_audio
/doc/examples/filtering_video
/doc/examples/metadata
/doc/examples/muxing
/doc/examples/pc-uninstalled
/doc/examples/remuxing
/doc/examples/resampling_audio
/doc/examples/scaling_video
/doc/examples/transcode_aac
/doc/examples/transcoding
/doc/fate.txt
/doc/print_options
/lcov/ /lcov/
/src /libavcodec/*_tablegen
/mapfile /libavcodec/*_tables.c
/libavcodec/*_tables.h
/libavutil/avconfig.h
/libavutil/ffversion.h
/tests/audiogen
/tests/base64
/tests/data/
/tests/pixfmts.mak
/tests/rotozoom
/tests/test_copy.ffmeta
/tests/tiny_psnr
/tests/tiny_ssim
/tests/videogen
/tests/vsynth1/
/tools/aviocat
/tools/ffbisect
/tools/bisect.need
/tools/crypto_bench
/tools/cws2fws
/tools/fourcc2pixfmt
/tools/ffescape
/tools/ffeval
/tools/ffhash
/tools/graph2dot
/tools/ismindex
/tools/pktdumper
/tools/probetest
/tools/qt-faststart
/tools/trasher
/tools/seek_print
/tools/uncoded_frame
/tools/zmqsend

View File

@ -1,26 +0,0 @@
language: c
sudo: false
os:
- linux
- osx
addons:
apt:
packages:
- yasm
- diffutils
compiler:
- clang
- gcc
cache:
directories:
- ffmpeg-samples
before_install:
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew update --all; fi
install:
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then brew install yasm; fi
script:
- mkdir -p ffmpeg-samples
- ./configure --samples=ffmpeg-samples --cc=$CC
- make -j 8
- make fate-rsync
- make check -j 8

753
Changelog
View File

@ -1,241 +1,536 @@
Entries are sorted chronologically from oldest to youngest within each release, Entries are sorted chronologically from oldest to youngest within each release,
releases are sorted from youngest to oldest. releases are sorted from youngest to oldest.
version <next>: version 2.5.11
- libopenmpt demuxer - MAINTAINERS: remove unmaintained releases
- tee protocol - avcodec/jpeg2000dec: More completely check cdef
- Changed metadata print option to accept general urls - avutil/opt: check for and handle errors in av_opt_set_dict2()
- Alias muxer for Ogg Video (.ogv) - avcodec/flacenc: fix calculation of bits required in case of custom sample rate
- VP8 in Ogg muxing - avformat: Document urls a bit
- curves filter doesn't automatically insert points at x=0 and x=1 anymore - avformat/libquvi: Set default demuxer and protocol limitations
- 16-bit support in curves filter - avformat/concat: Check protocol prefix
- 16-bit support in selectivecolor filter - doc/demuxers: Document enable_drefs and use_absolute_path
- OpenH264 decoder wrapper - avcodec/mjpegdec: Check for end for both bytes in unescaping
- MediaCodec hwaccel - avcodec/mpegvideo_enc: Check for integer overflow in ff_mpv_reallocate_putbitbuffer()
- avformat/avformat: Replace some references to filenames by urls
- avcodec/wmaenc: Check ff_wma_init() for failure
- avcodec/mpeg12enc: Move high resolution thread check to before initializing threads
- avformat/avio: Limit url option parsing to the documented cases
- avcodec/ass_split: Fix null pointer dereference in ff_ass_style_get()
- mov: Add an option to toggle dref opening
- avcodec/gif: Fix lzw buffer size
- avcodec/put_bits: Assert buf_ptr in flush_put_bits()
- avcodec/tiff: Check subsample & rps values more completely
- swscale/swscale: Add some sanity checks for srcSlice* parameters
- swscale/x86/rgb2rgb_template: Fix planar2x() for short width
- swscale/swscale_unscaled: Fix odd height inputs for bayer_to_yv12_wrapper()
- swscale/swscale_unscaled: Fix odd height inputs for bayer_to_rgb24_wrapper()
- avcodec/aacenc: Check both channels for finiteness
- swscale/swscale-test: Fix slice height in random reference data creation.
- dca: fix misaligned access in avpriv_dca_convert_bitstream
- brstm: fix missing closing brace
- brstm: also allocate b->table in read_packet
- brstm: make sure an ADPC chunk was read for adpcm_thp
- vorbisdec: reject rangebits 0 with non-0 partitions
- vorbisdec: reject channel mapping with less than two channels
- ffmdec: reset packet_end in case of failure
- avformat/ipmovie: put video decoding_map_size into packet and use it in decoder
- avcodec/samidec: make sure to properly restore parsing context after a tag
version 2.5.10
- configure: bump copyright year to 2016
- avformat/hls: Even stricter URL checks
- avformat/hls: More strict url checks
- swscale/utils: Detect and skip unneeded sws_setColorspaceDetails() calls
- swscale/yuv2rgb: Increase YUV2RGB table headroom
- swscale/yuv2rgb: Factor YUVRGB_TABLE_LUMA_HEADROOM out
- avformat/hls: forbid all protocols except http(s) & file
- avformat/aviobuf: Fix end check in put_str16()
- avformat/asfenc: Check pts
- avcodec/mpeg4video: Check time_incr
- avcodec/wavpackenc: Check the number of channels
- avcodec/wavpackenc: Headers are per channel
- avcodec/dvdec: Fix "left shift of negative value -254"
- avcodec/mjpegdec: Fix negative shift
- avcodec/mss2: Check for repeat overflow
- avformat: Add integer fps from 31 to 60 to get_std_framerate()
- avcodec/mpegvideo_enc: Clip bits_per_raw_sample within valid range
- avfilter/vf_scale: set proper out frame color range
- avcodec/motion_est: Fix mv_penalty table size
- avcodec/h264_slice: Fix integer overflow in implicit weight computation
- swscale/utils: Use normal bilinear scaler if fast cannot be used due to tiny dimensions
- avcodec/put_bits: Always check buffer end before writing
- mjpegdec: extend check for incompatible values of s->rgb and s->ls
- swscale/utils: Fix intermediate format for cascaded alpha downscaling
- avcodec/h264_refs: Fix long_idx check
- avfilter/vf_mpdecimate: Add missing emms_c()
- avformat/mxfenc: Do not crash if there is no packet in the first stream
- avformat/utils: estimate_timings_from_pts - increase retry counter, fixes invalid duration for ts files with hevc codec
- avformat/matroskaenc: Check codecdelay before use
- avutil/mathematics: Fix division by 0
- x86/float_dsp: zero extend offset from ff_scalarproduct_float_sse
- avcodec/mpeg4videodec: also for empty partitioned slices
- nuv: sanitize negative fps rate
- rawdec: only exempt BIT0 with need_copy from buffer sanity check
- mlvdec: check that index_entries exist
- nutdec: reject negative value_len in read_sm_data
- xwddec: prevent overflow of lsize * avctx->height
- nutdec: only copy the header if it exists
- exr: fix out of bounds read in get_code
- on2avc: limit number of bits to 30 in get_egolomb
- sonic: make sure num_taps * channels is not larger than frame_size
- opus_silk: fix typo causing overflow in silk_stabilize_lsf
- ffm: reject invalid codec_id and codec_type
- aaccoder: prevent crash of anmr coder
- ffmdec: reject zero-sized chunks
- swscale/x86/rgb2rgb_template: Fallback to mmx in interleaveBytes() if the alignment is insufficient for SSE*
- swscale/x86/rgb2rgb_template: Do not crash on misaligend stride
version 3.1: version 2.5.9
- DXVA2-accelerated HEVC Main10 decoding - avcodec/hevc: Check max ctb addresses for WPP
- fieldhint filter - avcodec/vp3: ensure header is parsed successfully before tables
- loop video filter and aloop audio filter - avcodec/jpeg2000dec: Check bpno in decode_cblk()
- Bob Weaver deinterlacing filter - avcodec/pgssubdec: Fix left shift of 255 by 24 places cannot be represented in type int
- firequalizer filter - swscale/utils: Fix for runtime error: left shift of negative value -1
- datascope filter - avcodec/hevc: Fix integer overflow of entry_point_offset
- bench and abench filters - avcodec/dirac_parser: Check that there is a previous PU before accessing it
- ciescope filter - avcodec/dirac_parser: Add basic validity checks for next_pu_offset and prev_pu_offset
- protocol blacklisting API - avcodec/dirac_parser: Fix potential overflows in pointer checks
- MediaCodec H264 decoding - avcodec/wmaprodec: Check bits per sample to be within the range not causing integer overflows
- VC-2 HQ RTP payload format (draft v1) depacketizer and packetizer - avcodec/wmaprodec: Fix overflow of cutoff
- VP9 RTP payload format (draft v2) packetizer - avformat/smacker: fix integer overflow with pts_inc
- AudioToolbox audio decoders - avcodec/vp3: Fix "runtime error: left shift of negative value"
- AudioToolbox audio encoders - mpegencts: Fix overflow in cbr mode period calculations
- coreimage filter (GPU based image filtering on OSX) - avutil/timecode: Fix fps check
- libdcadec removed - avutil/mathematics: return INT64_MIN (=AV_NOPTS_VALUE) from av_rescale_rnd() for overflows
- bitstream filter for extracting DTS core - avcodec/apedec: Check length in long_filter_high_3800()
- ADPCM IMA DAT4 decoder - avcodec/vp3: always set pix_fmt in theora_decode_header()
- musx demuxer - avcodec/mpeg4videodec: Check available data before reading custom matrix
- aix demuxer - avutil/mathematics: Do not treat INT64_MIN as positive in av_rescale_rnd
- remap filter - avutil/integer: Fix av_mod_i() with negative dividend
- hash and framehash muxers - avformat/dump: Fix integer overflow in av_dump_format()
- colorspace filter - avcodec/utils: Clear dimensions in ff_get_buffer() on failure
- hdcd filter - avcodec/utils: Use 64bit for aspect ratio calculation in avcodec_string()
- readvitc filter - avcodec/vp3: Clear context on reinitialization failure
- VAAPI-accelerated format conversion and scaling - avcodec/hevc: allocate entries unconditionally
- libnpp/CUDA-accelerated format conversion and scaling - avcodec/hevc_cabac: Fix multiple integer overflows
- Duck TrueMotion 2.0 Real Time decoder - avcodec/jpeg2000dwt: Check ndeclevels before calling dwt_encode*()
- Wideband Single-bit Data (WSD) demuxer - avcodec/jpeg2000dwt: Check ndeclevels before calling dwt_decode*()
- VAAPI-accelerated H.264/HEVC/MJPEG encoding - avcodec/hevc: Check entry_point_offsets
- DTS Express (LBR) decoder - avcodec/cabac: Check initial cabac decoder state
- Generic OpenMAX IL encoder with support for Raspberry Pi - avcodec/cabac_functions: Fix "left shift of negative value -31767"
- IFF ANIM demuxer & decoder - avcodec/ffv1dec: Clear quant_table_count if its invalid
- Direct Stream Transfer (DST) decoder - avcodec/ffv1dec: Print an error if the quant table count is invalid
- loudnorm filter - doc/filters/drawtext: fix centering example
- MTAF demuxer and decoder - avcodec/h264_slice: Limit max_contexts when slice_context_count is initialized
- MagicYUV decoder - avcodec/vp8: Do not use num_coeff_partitions in thread/buffer setup
- OpenExr improvements (tile data and B44/B44A support) - rtmpcrypt: Do the xtea decryption in little endian mode
- BitJazz SheerVideo decoder - avformat/matroskadec: Check subtitle stream before dereferencing
- CUDA CUVID H264/HEVC decoder - avformat/utils: Do not init parser if probing is unfinished
- 10-bit depth support in native utvideo decoder - avcodec/jpeg2000dec: Fix potential integer overflow with tile dimensions
- libutvideo wrapper removed - avcodec/jpeg2000dec: Check SIZ dimensions to be within the supported range
- YUY2 Lossless Codec decoder - avcodec/jpeg2000: Check comp coords to be within the supported size
- VideoToolbox H.264 encoder - avcodec/jpeg2000: Use av_image_check_size() in ff_jpeg2000_init_component()
- avcodec/wmaprodec: Check for overread in decode_packet()
- avcodec/smacker: Check that the data size is a multiple of a sample vector
- avcodec/takdec: Skip last p2 sample (which is unused)
- avcodec/dxtory: Fix input size check in dxtory_decode_v1_410()
- avcodec/dxtory: Fix input size check in dxtory_decode_v1_420()
- avcodec/error_resilience: avoid accessing previous or next frames tables beyond height
- avcodec/dpx: Move need_align to act per line
- avcodec/flashsv: Check size before updating it
- avcodec/ivi: Check image dimensions
- avcodec/utils: Better check for channels in av_get_audio_frame_duration()
- avcodec/jpeg2000dec: Check for duplicate SIZ marker
- avcodec/jpeg2000dec: Clip all tile coordinates
- avcodec/microdvddec: Check for string end in 'P' case
- avcodec/dirac_parser: Fix undefined memcpy() use
- avformat/xmv: Discard remainder of packet on error
- avformat/xmv: factor return check out of if/else
- libavutil/channel_layout: Check strtol*() for failure
- avcodec/ffv1dec: Check for 0 quant tables
- avcodec/mjpegdec: Reinitialize IDCT on BPP changes
- avcodec/mjpegdec: Check index in ljpeg_decode_yuv_scan() before using it
- avutil/file_open: avoid file handle inheritance on Windows
- opusdec: Don't run vector_fmul_scalar on zero length arrays
- avcodec/ffv1: Initialize vlc_state on allocation
- avcodec/ffv1dec: update progress in case of broken pointer chains
- avcodec/ffv1dec: Clear slice coordinates if they are invalid or slice header decoding fails for other reasons
- avformat/httpauth: Add space after commas in HTTP/RTSP auth header
- avcodec/x86/sbrdsp: Fix using uninitialized upper 32bit of noise
- avcodec/ffv1dec: Fix off by 1 error in quant_table_count check
- avcodec/ffv1dec: Explicitly check read_quant_table() return value
- avcodec/rangecoder: Check e
- lavf/webvttenc: Require webvtt file to contain exactly one WebVTT stream.
- avcodec/mjpegdec: Fix decoding RGBA RCT LJPEG
- avfilter/af_asyncts: use llabs for int64_t
- avcodec/g2meet: Also clear tile dimensions on header_fail
- avcodec/g2meet: Fix potential overflow in tile dimensions check
- avcodec/svq1dec: Check init_get_bits8() for failure
- avcodec/tta: Check init_get_bits8() for failure
- swresample/swresample: Fix integer overflow in seed calculation
- avformat/mov: Fix integer overflow in FFABS
- avutil/common: Add FFNABS()
- avutil/common: Document FFABS() corner case
- avformat/dump: Fix integer overflow in aspect ratio calculation
- avcodec/truemotion1: Check for even width
- avcodec/mpeg12dec: Set dimensions in mpeg1_decode_sequence() only in absence of errors
- avcodec/libopusenc: Fix infinite loop on flushing after 0 input
- avformat/hevc: Check num_long_term_ref_pics_sps to avoid potentially long loops
- avformat/hevc: Fix parsing errors
- ffmpeg: Use correct codec_id for av_parser_change() check
- ffmpeg: Check av_parser_change() for failure
- ffmpeg: Check for RAWVIDEO and do not relay only on AVFMT_RAWPICTURE
- ffmpeg: check avpicture_fill() return value
- avformat/mux: Update sidedata in ff_write_chained()
- avcodec/flashsvenc: Correct max dimension in error message
- avcodec/svq1enc: Check dimensions
- avcodec/dcaenc: clear bitstream end
- libavcodec/aacdec_template: Use init_get_bits8() in aac_decode_frame()
- mxfdec: check edit_rate also for physical_track
- mpegvideo: clear overread in clear_context
- dvdsubdec: validate offset2 similar to offset1
- avcodec/takdec: Use memove, avoid undefined memcpy() use
- jvdec: avoid unsigned overflow in comparison
- avcodec/mpeg12dec: Do not call show_bits() with invalid bits
- riffdec: prevent negative bit rate
- Merge commit 'd80811c94e068085aab797f9ba35790529126f85'
- imc: use correct position for flcoeffs2 calculation
- wavpack: limit extra_bits to 32 and use get_bits_long
- wavpack: use get_bits_long to read up to 32 bits
- nutdec: check maxpos in read_sm_data before returning success
- s302m: fix arithmetic exception
- avcodec/s302m: Only set the sample rate when some data is output
- vp9: add support for resolution changes in inter frames.
- alsdec: limit avctx->bits_per_raw_sample to 32
- vp9: avoid infinite loop with broken files
- videodsp: don't overread edges in vfix3 emu_edge.
- avcodec/h264_mp4toannexb_bsf: Reorder operations in nal_size check
- avformat/oggenc: Check segments_count for headers too
- avformat/avidec: Workaround broken initial frame
- hevc: properly handle no_rasl_output_flag when removing pictures from the DPB
- hevc: fix wpp threading deadlock.
- avcodec/ffv1: separate slice_count from max_slice_count
- lavf/img2dec: Fix memory leak
- avcodec/mp3: fix skipping zeros
- avformat/srtdec: make sure we probe a number
- avformat/srtdec: more lenient first line probing
- doc: mention libavcodec can decode Opus natively
- MAINTAINERS: Remove myself as leader
version 3.0: version 2.5.8
- Common Encryption (CENC) MP4 encoding and decoding support - snow: remove an obsolete av_assert2
- DXV decoding - huffyuvdec: validate image size
- extrastereo filter - vc1dec: use get_bits_long and limit the read bits to 32
- ocr filter - mpegaudiodec: copy AVFloatDSPContext from first context to all contexts
- alimiter filter - libshine: fix support for shine 3.0
- stereowiden filter - avidec: check for valid bit_rate range
- stereotools filter - avformat/nut: support WavPack
- rubberband filter - avcodec/diracdec: Check slices malloc and propagate error code
- tremolo filter - avcodec/vp8: Check buffer size in vp8_decode_frame_header()
- agate filter - avcodec/vp8: Fix null pointer dereference in ff_vp8_decode_free()
- chromakey filter - avcodec/diracdec: Check for hpel_base allocation failure
- maskedmerge filter - avcodec/rv34: Clear pointers in ff_rv34_decode_init_thread_copy()
- Screenpresso SPV1 decoding - avfilter/af_aresample: Check ff_all_* for allocation failures
- chromaprint fingerprinting muxer - avcodec/pthread_frame: clear priv_data, avoid stale pointer in error case
- ffplay dynamic volume control - swscale/utils: Clear pix buffers
- displace filter - avutil/fifo: Fix the case where func() returns less bytes than requested in av_fifo_generic_write()
- selectivecolor filter - avformat/mov: Fix deallocation when MOVStreamContext failed to allocate
- extensive native AAC encoder improvements and removal of experimental flag - ffmpeg: Fix crash with ost->last_frame allocation failure
- ADPCM PSX decoder - ffmpeg: Fix cleanup with ost = NULL
- 3dostr, dcstr, fsb, genh, vag, xvag, ads, msf, svag & vpk demuxer - avcodec/pthread_frame: check avctx on deallocation
- zscale filter - avcodec/sanm: Reset sizes in destroy_buffers()
- wve demuxer - avcodec/alac: Clear pointers in allocate_buffers()
- zero-copy Intel QSV transcoding in ffmpeg - bytestream2: set the reader to the end when reading more than available
- shuffleframes filter - avcodec/utils: use a minimum 32pixel width in avcodec_align_dimensions2() for H.264
- SDX2 DPCM decoder - avcodec/mpegvideo: Clear pointers in ff_mpv_common_init()
- vibrato filter - oggparsedirac: check return value of init_get_bits
- innoHeim/Rsupport Screen Capture Codec decoder - wmalosslessdec: reset frame->nb_samples on packet loss
- ADPCM AICA decoder - wmalosslessdec: avoid reading 0 bits with get_bits
- Interplay ACM demuxer and audio decoder - avcodec/rawenc: Use ff_alloc_packet() instead of ff_alloc_packet2()
- XMA1 & XMA2 decoder - avcodec/aacsbr: Assert that bs_num_env is positive
- realtime filter - avcodec/aacsbr: check that the element type matches before applying SBR
- anoisesrc audio filter source - avcodec/h264_slice: Use w/h from the AVFrame instead of mb_w/h
- IVR demuxer - vp9/update_prob: prevent out of bounds table read
- compensationdelay filter - avfilter/vf_transpose: Fix rounding error
- acompressor filter - avcodec/pngdec: Check values before updating context in decode_fctl_chunk()
- support encoding 16-bit RLE SGI images - avcodec/pngdec: Require a IHDR chunk before fctl
- apulsator filter - avcodec/pngdec: Only allow one IHDR chunk
- sidechaingate audio filter - wmavoice: limit wmavoice_decode_packet return value to packet size
- mipsdspr1 option has been renamed to mipsdsp - swscale/swscale_unscaled: Fix rounding difference with RGBA output between little and big endian
- aemphasis filter - ffmpeg: Do not use the data/size of a bitstream filter after failure
- mips32r5 option has been removed - swscale/x86/rgb2rgb_template: fix signedness of v in shuffle_bytes_2103_{mmx,mmxext}
- mips64r6 option has been removed - swscale/x86/rgb2rgb_template: add missing xmm clobbers
- DXVA2-accelerated VP9 decoding - vda: unlock the pixel buffer base address.
- SOFAlizer: virtual binaural acoustics filter - swscale/rgb2rgb_template: Fix signedness of v in shuffle_bytes_2103_c()
- VAAPI VP9 hwaccel - swscale/rgb2rgb_template: Implement shuffle_bytes_0321_c and fix shuffle_bytes_2103_c on BE
- audio high-order multiband parametric equalizer - swscale/rgb2rgb_template: Disable shuffle_bytes_2103_c on big endian
- automatic bitstream filtering - swr: Remember previously set int_sample_format from user
- showspectrumpic filter - matroskadec: check audio sample rate
- libstagefright support removed - matroskadec: validate audio channels and bitdepth
- spectrumsynth filter - avcodec/dpxenc: implement write16/32 as functions
- ahistogram filter - postproc: fix unaligned access
- only seek with the right mouse button in ffplay - ffmpeg: Free last_frame instead of just unref
- toggle full screen when double-clicking with the left mouse button in ffplay - avio: fix potential crashes when combining ffio_ensure_seekback + crc
- afftfilt filter - h264: er: Copy from the previous reference only if compatible
- convolution filter - sonic: set avctx->channels in sonic_decode_init
- libquvi support removed - vp8: change mv_{min,max}.{x,y} type to int
- support for dvaudio in wav and avi - vp9: change type of tile_size from unsigned to int64_t
- libaacplus and libvo-aacenc support removed - arm: only enable setend on ARMv6
- Cineform HD decoder - libopenjpegdec: check existence of image component data
- new DCA decoder with full support for DTS-HD extensions - mov: abort on EOF in ff_mov_read_chan
- significant performance improvements in Windows Television (WTV) demuxer - ffmpeg_opt: Check for localtime() failure
- nnedi deinterlacer - avformat: Fix bug in parse_rps for HEVC.
- streamselect video and astreamselect audio filter - takdec: ensure chan2 is a valid channel index
- swaprect filter - avcodec/h264_slice: Use AVFrame diemensions for grayscale handling
- metadata video and ametadata audio filter - avdevice/lavfi: do not rescale AV_NOPTS_VALUE in lavfi_read_packet()
- SMPTE VC-2 HQ profile support for the Dirac decoder - libavutil/channel_layout: Correctly return layout when channel specification ends with a trailing 'c'.
- SMPTE VC-2 native encoder supporting the HQ profile - avcodec/jpeg2000dec: Check that coords match before applying ICT
- avformat/ffmdec: Check ffio_set_buf_size() return value
- avcodec/adpcm: Check for overreads
- avcodec/alsdec: Check for overread
- avcodec/atrac3plusdec: consume only as many bytes as available
- libavutil/softfloat: Fix av_normalize1_sf bias.
- swresample/swresample: Cleanup on init failure.
- Revert "avformat/rtpenc: check av_packet_get_side_data() return, fix null ptr dereference"
- avformat/mxfenc: Accept MXF D-10 with 49.999840 Mbit/sec
- swresample/dither: check memory allocation
- libopenjpegenc: add NULL check for img before accessing it
- swresample: Check the return value of resampler->init()
- h264: Make sure reinit failures mark the context as not initialized
- ffmpeg_opt: Set the video VBV parameters only for the video stream from -target
- avcodec/bitstream: Assert that there is enough space left in avpriv_copy_bits()
- avcodec/put_bits: Assert that there is enough space left in skip_put_bytes()
- avcodec/mpegvideo_enc: Update the buffer size as more slices are merged
- avcodec/put_bits: Update size_in_bits in set_put_bits_buffer_size()
- avformat/wavdec: Increase dts packet threshold to fix more misdetections
- avformat/wavdec: Increase probe_packets limit
- avformat/swfdec: Do not error out on pixel format changes
- avfilter/x86/vf_hqdn3d: Fix register types
- avcodec/mjpegenc_common: Use ff_mpv_reallocate_putbitbuffer()
- avcodec/mpegvideo: Factor ff_mpv_reallocate_putbitbuffer() out
- avformat/mov: Mark avio context of decompressed atoms as seekable
- avcodec/hevc_ps: Only discard overread VPS if a previous is available
- avcodec/x86/h264_weight: handle weight1=128
- avcodec/exr: fix crash caused by merge
version 2.8: version 2.5.7
- colorkey video filter - avformat/nutdec: Fix recovery when immedeately after seeking a failure happens
- BFSTM/BCSTM demuxer - nutdec: fix memleaks on error in nut_read_header
- little-endian ADPCM_THP decoder - rtpenc_jpeg: handle case of picture dimensions not dividing by 8
- Hap decoder and encoder - avformat/mov: Fix parsing short loci
- DirectDraw Surface image/texture decoder - avcodec/shorten: Fix code depending on signed overflow behavior
- ssim filter - avcodec/proresdec2: Reset slice_count on deallocation
- optional new ASF demuxer - ffmpeg_opt: Fix -timestamp parsing
- showvolume filter - hevc: make avcodec_decode_video2() fail if get_format() fails
- Many improvements to the JPEG 2000 decoder - avcodec/mpeg4audio: add some padding/alignment to MAX_PCE_SIZE
- Go2Meeting decoding support - swr: fix alignment issue caused by 8ch sse functions
- adrawgraph audio and drawgraph video filter - libswscale/x86/hscale_fast_bilinear_simd.c: Include BX in the clobber list on x86_64, because it isn't implicitly included when PIC is on.
- removegrain video filter - aacdec: don't return frames without data
- Intel QSV-accelerated MPEG-2 video and HEVC encoding - avformat/matroskadec: Cleanup error handling for bz2 & zlib
- Intel QSV-accelerated MPEG-2 video and HEVC decoding - avformat/nutdec: Fix use of uinitialized value
- Intel QSV-accelerated VC-1 video decoding - tools/graph2dot: use larger data types than int for array/string sizes
- libkvazaar HEVC encoder - id3v2: catch avio_read errors in check_tag
- erosion, dilation, deflate and inflate video filters - aacsbr: break infinite loop in sbr_hf_calc_npatches
- Dynamic Audio Normalizer as dynaudnorm filter - diracdec: avoid overflow of bytes*8 in decode_lowdelay
- Reverse video and areverse audio filter - diracdec: prevent overflow in data_unit_size check
- Random filter - avidec: avoid infinite loop due to negative ast->sample_size
- deband filter - pngdec: don't use AV_PIX_FMT_MONOBLACK for apng
- AAC fixed-point decoding - avcodec/wavpack: Check L/R values before use to avoid harmless integer overflow and undefined behavior in fate
- sidechaincompress audio filter - xcbgrab: Validate the capture area
- bitstream filter for converting HEVC from MP4 to Annex B - xcbgrab: Do not assume the non shm image data is always available
- acrossfade audio filter - avfilter/lavfutils: disable frame threads when decoding a single image
- allyuv and allrgb video sources - nutdec: fix illegal count check in decode_main_header
- atadenoise video filter - ffmpeg: remove incorrect network deinit
- OS X VideoToolbox support - OpenCL: Avoid potential buffer overflow in cmdutils_opencl.c
- aphasemeter filter - apedec: set s->samples only when init_frame_decoder succeeded
- showfreqs filter - swscale/ppc/swscale_altivec.c: POWER LE support in yuv2planeX_8() delete macro GET_VF()
- vectorscope filter - libvpxenc: only set noise reduction w/vp8
- waveform filter - tests/fate-run: do not attempt to parse tiny_psnrs output if it failed
- hstack and vstack filter - alac: reject rice_limit 0 if compression is used
- Support DNx100 (1440x1080@8) - alsdec: only adapt order for positive max_order
- VAAPI hevc hwaccel - alsdec: check sample pointer range in revert_channel_correlation
- VDPAU hevc hwaccel - tests: drop bc dependency
- framerate filter - fate: Include branch information in the payload header
- Switched default encoders for webm to VP9 and Opus
- Removed experimental flag from the JPEG 2000 encoder
version 2.7: version 2.5.6
- FFT video filter - avcodec/atrac3plusdsp: fix on stack alignment
- TDSC decoder - ac3: validate end in ff_ac3_bit_alloc_calc_mask
- DTS lossless extension (XLL) decoding (not lossless, disabled by default) - aacpsy: avoid psy_band->threshold becoming NaN
- showwavespic filter - aasc: return correct buffer size from aasc_decode_frame
- DTS decoding through libdcadec - msrledec: use signed pixel_ptr in msrle_decode_pal4
- Drop support for nvenc API before 5.0 - swresample: Allow reinitialization without ever setting channel layouts (cherry picked from commit 80a28c7509a11114e1aea5b208d56c6646d69c07)
- nvenc HEVC encoder - swresample: Allow reinitialization without ever setting channel counts
- Detelecine filter - avcodec/h264: Do not fail with randomly truncated VUIs
- Intel QSV-accelerated H.264 encoding - avcodec/h264_ps: Move truncation check from VUI to SPS
- MMAL-accelerated H.264 decoding - avcodec/h264: Be more tolerant to changing pps id between slices
- basic APNG encoder and muxer with default extension "apng" - avcodec/aacdec: Fix storing state before PCE decode
- unpack DivX-style packed B-frames in MPEG-4 bitstream filter - avcodec/h264: reset the counts in the correct context
- WebM Live Chunk Muxer - avcodec/h264_slice: Do not reset mb_aff_frame per slice
- nvenc level and tier options - avcodec/h264: finish previous slices before switching to single thread mode
- chorus filter - avcodec/h264: Fix race between slices where one overwrites data from the next
- Canopus HQ/HQA decoder - avcodec/h264_refs: Do not set reference to things which do not exist
- Automatically rotate videos based on metadata in ffmpeg - avcodec/h264: Fail for invalid mixed IDR / non IDR frames in slice threading mode
- improved Quickdraw compatibility - h264: avoid unnecessary calls to get_format
- VP9 high bit-depth and extended colorspaces decoding support - avcodec/msrledec: restructure msrle_decode_pal4() based on the line number instead of the pixel pointer
- WebPAnimEncoder API when available for encoding and muxing WebP
- Direct3D11-accelerated decoding
- Support Secure Transport
- Multipart JPEG demuxer
version 2.6: version 2.5.5:
- nvenc encoder - vp9: make above buffer pointer 32-byte aligned.
- 10bit spp filter - avcodec/dnxhddec: Check that the frame is interlaced before using cur_field
- colorlevels filter - avformat/mov: Disallow ".." in dref unless use_absolute_path is set
- RIFX format for *.wav files - avformat/mov: Check for string truncation in mov_open_dref()
- RTP/mpegts muxer - avformat/mov: Use sizeof(filename) instead of a literal number
- non continuous cache protocol support - eac3dec: fix scaling
- tblend filter - ac3_fixed: fix computation of spx_noise_blend
- cropdetect support for non 8bpp, absolute (if limit >= 1) and relative (if limit < 1.0) threshold - ac3_fixed: fix out-of-bound read
- Camellia symmetric block cipher - ac3dec_fixed: always use the USE_FIXED=1 variant of the AC3DecodeContext
- OpenH264 encoder wrapper - avcodec/012v: redesign main loop
- VOC seeking support - avcodec/012v: Check dimensions more completely
- Closed caption Decoder - asfenc: fix leaking asf->index_ptr on error
- fspp, uspp, pp7 MPlayer postprocessing filters ported to native filters - avcodec/options_table: remove extradata_size from the AVOptions table
- showpalette filter - ffmdec: limit the backward seek to the last resync position
- Twofish symmetric block cipher - ffmdec: make sure the time base is valid
- Support DNx100 (960x720@8) - ffmdec: fix infinite loop at EOF
- eq2 filter ported from libmpcodecs as eq filter - ffmdec: initialize f_cprv, f_stvi and f_stau
- removed libmpcodecs - avformat/rm: limit packet size
- Changed default DNxHD colour range in QuickTime .mov derivatives to mpeg range - avcodec/webp: validate the distance prefix code
- ported softpulldown filter from libmpcodecs as repeatfields filter - avcodec/rv10: check size of s->mb_width * s->mb_height
- dcshift filter - eamad: check for out of bounds read
- RTP depacketizer for loss tolerant payload format for MP3 audio (RFC 5219) - mdec: check for out of bounds read
- RTP depacketizer for AC3 payload format (RFC 4184) - arm: Suppress tags about used cpu arch and extensions
- palettegen and paletteuse filters - aic: Fix decoding files with odd dimensions
- VP9 RTP payload format (draft 0) experimental depacketizer - avcodec/tiff: move bpp check to after "end:"
- RTP depacketizer for DV (RFC 6469) - mxfdec: Fix the error handling for when strftime fails
- DXVA2-accelerated HEVC decoding - avcodec/opusdec: Fix delayed sample value
- AAC ELD 480 decoding - avcodec/opusdec: Clear out pointers per packet
- Intel QSV-accelerated H.264 decoding - avcodec/utils: Align YUV411 by as much as the other YUV variants
- DSS SP decoder and DSS demuxer - vp9: fix segmentation map retention with threading enabled.
- Fix stsd atom corruption in DNxHD QuickTimes - webp: ensure that each transform is only used once
- Canopus HQX decoder - doc/protocols/tcp: fix units of listen_timeout option value, from microseconds to milliseconds
- RTP depacketization of T.140 text (RFC 4103) - fix VP9 packet decoder returning 0 instead of the used data size
- Port MIPS optimizations to 64-bit - avformat/flvenc: check that the codec_tag fits in the available bits
- avcodec/utils: use correct printf specifier in ff_set_sar
- avutil/imgutils: correctly check for negative SAR components
- swscale/utils: clear formatConvBuffer on allocation
- avformat/bit: only accept the g729 codec and 1 channel
- avformat/bit: check that pkt->size is 10 in write_packet
- avformat/adxdec: check avctx->channels for invalid values
- avformat/adxdec: set avctx->channels in adx_read_header
- Fix buffer_size argument to init_put_bits() in multiple encoders.
- mips/acelp_filters: fix incorrect register constraint
- avcodec/hevc_ps: Sanity checks for some log2_* values
- avcodec/zmbv: Check len before reading in decode_frame()
- avcodec/h264: Only reinit quant tables if a new PPS is allowed
- avcodec/snowdec: Fix ref value check
- swscale/utils: More carefully merge and clear coefficients outside the input
- avcodec/a64multienc: Assert that the Packet size does not grow
- avcodec/a64multienc: simplify frame handling code
- avcodec/a64multienc: fix use of uninitialized values in to_meta_with_crop
- avcodec/a64multienc: initialize mc_meta_charset to zero
- avcodec/a64multienc: don't set incorrect packet size
- avcodec/a64multienc: use av_frame_ref instead of copying the frame
- avcodec/x86/mlpdsp_init: Simplify mlp_filter_channel_x86()
- h264: initialize H264Context.avctx in init_thread_copy
- wtvdec: fix integer overflow resulting in errors with large files
- avcodec/gif: fix off by one in column offsetting finding
version 2.5.4:
- avcodec/arm/videodsp_armv5te: Fix linking failure with shared libs
- avcodec/mjpegdec: Skip blocks which are outside the visible area
- avcodec/h264_slice: ignore SAR changes in slices after the first
- avcodec/h264_slice: Check picture structure before setting the related fields
- avcodec/h264_slice: Do not change frame_num after the first slice
- avutil/opt: Fix type used to access AV_OPT_TYPE_SAMPLE_FMT
- avutil/opt: Fix types used to access AV_OPT_TYPE_PIXEL_FMT
- avcodec/h264: Be more strict on rejecting pps/sps changes
- avcodec/h264: Be more strict on rejecting pps_id changes
- avcodec/h264_ps: More completely check the bit depths
- avformat/thp: Check av_get_packet() for failure not only for partial output
- swscale/utils: Limit filter shifting so as not to read from prior the array
- avcodec/mpegvideo_motion: Fix gmc chroma dimensions
- avcodec/mjpegdec: Check number of components for JPEG-LS
- avcodec/mjpegdec: Check escape sequence validity
- avformat/mpc8: Use uint64_t in *_get_v() to avoid undefined behavior
- avformat/mpc8: fix broken pointer math
- avformat/mpc8: fix hang with fuzzed file
- avformat/tta: fix crash with corrupted files
- avcodec/ppc/idctdsp.c: POWER LE support in idct_add_altivec()
- swscale/input: fix rgba64 alpha non native
- swscale/input: Fix alpha of YA16 input
- libavcodec/ppc/mpegvideoencdsp.c: fix stack smashing in pix_norm1_altivec() and pix_sum_altivec()
- avformat/rmdec: Check for overflow in ff_rm_read_mdpr_codecdata()
- avformat/mpeg: do not count PES packets inside PES packets during probing
- hevc: always clip luma_log2_weight_denom
- rtpdec_h263_rfc2190: Clear the stored bits if discarding buffered data
- aacenc: correctly check returned value
- swscale: check memory allocations
- opt: check memory allocation
- avformat/utils: check for malloc failure
- avcodec/flac_parser: fix handling EOF if no headers are found
- avfilter/vf_framepack: Check and update frame_rate
- vp8: improve memory allocation checks
- configure: enable vsx together with altivec for ppc64el
- avcodec/hevc: Fix handling of skipped_bytes() reallocation failures
- qpeg: avoid pointless invalid memcpy()
version 2.5.3:
- vp9: fix parser return values in error case
- ffmpeg: Clear error message array at init.
- avcodec/dvdsubdec: fix accessing dangling pointers
- avcodec/dvdsubdec: error on bitmaps with size 0
- cmdutils: Use 64bit for file size/offset related variable in cmdutils_read_file()
- mov: Fix negative size calculation in mov_read_default().
- avformat/mov: fix integer overflow in mov_read_udta_string()
- mov: Fix overflow and error handling in read_tfra().
- mov: Avoid overflow with mov_metadata_raw()
- avcodec/dvdsubdec: fix out of bounds accesses
- avfilter/vf_sab: fix filtering tiny images
- avformat/flvdec: Increase string array size
- avformat/flvdec: do not inject dts=0 metadata packets which failed to be parsed into a new data stream
- avformat/cdxl: Fix integer overflow of image_size
- libavformat: Build hevc.o when building the RTP muxer
version 2.5.2:
- avcodec/indeo3: ensure offsets are non negative
- avcodec/h264: Check *log2_weight_denom
- avcodec/hevc_ps: Check diff_cu_qp_delta_depth
- avcodec/h264: Clear delayed_pic on deallocation
- avcodec/hevc: clear filter_slice_edges() on allocation
- avcodec/dcadec: Check that the added xch channel isnt already there
- avcodec/indeo3: use signed variables to avoid underflow
- swscale: increase yuv2rgb table headroom
- avformat/mov: fix integer overflow of size
- avformat/mov: check atom nesting depth
- avcodec/utvideodec: Fix handling of slice_height=0
- avcodec/xface: correct the XFACE_MAX_* values
- avcodec/vmdvideo: Check len before using it in method 3
- configure: create the tests directory like the doc directory
- mmvideo: check frame dimensions
- jvdec: check frame dimensions
version 2.5.1:
- lavu/frame: fix malloc error path in av_frame_copy_props()
- avformat/aviobuf: Check that avio_seek() target is non negative
- swresample/soxr_resample: fix error handling
- avformat/flvdec: fix potential use of uninitialized variables
- avformat/crypto: fix key vs iv typo
- configure: use use_pkg_config() instead of check_pkg_config() for libsmbclient
- avcodec/ppc/vp3dsp_altivec: POWER LE support to vp3_idct_add_altivec()
- avformat/matroskadec: fix handling of recursive SeekHead elements
- doc/examples/filtering_video: fix frame rate
- avcodec/mpegaudiodec_template: only allocate fdsp when its used
- doc/examples/transcoding: check encoder before using it
- update MAINTAINERS file
- POWER LE support in put_vp8_epel_h_altivec_core() put_vp8_epel_v_altivec_core() put_vp8_pixels16_altivec()
- POWER LE support in vc1_inv_trans_8x4_altivec()
version 2.5: version 2.5:
- HEVC/H.265 RTP payload format (draft v6) packetizer - HEVC/H.265 RTP payload format (draft v6) packetizer
- SUP/PGS subtitle demuxer - SUP/PGS subtitle demuxer
@ -251,7 +546,7 @@ version 2.5:
- creating DASH compatible fragmented MP4, MPEG-DASH segmenting muxer - creating DASH compatible fragmented MP4, MPEG-DASH segmenting muxer
- WebP muxer with animated WebP support - WebP muxer with animated WebP support
- zygoaudio decoding support - zygoaudio decoding support
- APNG demuxer - APNG decoder and demuxer
- postproc visualization support - postproc visualization support
@ -262,7 +557,7 @@ version 2.4:
- ICY metadata are now requested by default with the HTTP protocol - ICY metadata are now requested by default with the HTTP protocol
- support for using metadata in stream specifiers in fftools - support for using metadata in stream specifiers in fftools
- LZMA compression support in TIFF decoder - LZMA compression support in TIFF decoder
- H.261 RTP payload format (RFC 4587) depacketizer and experimental packetizer - support for H.261 RTP payload format (RFC 4587)
- HEVC/H.265 RTP payload format (draft v6) depacketizer - HEVC/H.265 RTP payload format (draft v6) depacketizer
- added codecview filter to visualize information exported by some codecs - added codecview filter to visualize information exported by some codecs
- Matroska 3D support thorugh side data - Matroska 3D support thorugh side data
@ -742,7 +1037,7 @@ easier to use. The changes are:
all the stream in the first input file, except for the second audio all the stream in the first input file, except for the second audio
stream'. stream'.
* There is a new option -c (or -codec) for choosing the decoder/encoder to * There is a new option -c (or -codec) for choosing the decoder/encoder to
use, which makes it possible to precisely specify target stream(s) consistently with use, which allows to precisely specify target stream(s) consistently with
other options. E.g. -c:v lib264 sets the codec for all video streams, -c:a:0 other options. E.g. -c:v lib264 sets the codec for all video streams, -c:a:0
libvorbis sets the codec for the first audio stream and -c copy copies all libvorbis sets the codec for the first audio stream and -c copy copies all
the streams without reencoding. Old -vcodec/-acodec/-scodec options are now the streams without reencoding. Old -vcodec/-acodec/-scodec options are now
@ -931,8 +1226,8 @@ version 0.8:
- showinfo filter added - showinfo filter added
- SMPTE 302M AES3 audio decoder - SMPTE 302M AES3 audio decoder
- Apple Core Audio Format muxer - Apple Core Audio Format muxer
- 9 bits and 10 bits per sample support in the H.264 decoder - 9bit and 10bit per sample support in the H.264 decoder
- 9 bits and 10 bits FFV1 encoding / decoding - 9bit and 10bit FFV1 encoding / decoding
- split filter added - split filter added
- select filter added - select filter added
- sdl output device added - sdl output device added
@ -1225,7 +1520,7 @@ version 0.4.9-pre1:
- rate distorted optimal lambda->qp support - rate distorted optimal lambda->qp support
- AAC encoding with libfaac - AAC encoding with libfaac
- Sunplus JPEG codec (SP5X) support - Sunplus JPEG codec (SP5X) support
- use Lagrange multiplier instead of QP for ratecontrol - use Lagrange multipler instead of QP for ratecontrol
- Theora/VP3 decoding support - Theora/VP3 decoding support
- XA and ADX ADPCM codecs - XA and ADX ADPCM codecs
- export MPEG-2 active display area / pan scan - export MPEG-2 active display area / pan scan

View File

@ -1,124 +1,106 @@
# License #FFmpeg:
Most files in FFmpeg are under the GNU Lesser General Public License version 2.1 Most files in FFmpeg are under the GNU Lesser General Public License version 2.1
or later (LGPL v2.1+). Read the file `COPYING.LGPLv2.1` for details. Some other or later (LGPL v2.1+). Read the file COPYING.LGPLv2.1 for details. Some other
files have MIT/X11/BSD-style licenses. In combination the LGPL v2.1+ applies to files have MIT/X11/BSD-style licenses. In combination the LGPL v2.1+ applies to
FFmpeg. FFmpeg.
Some optional parts of FFmpeg are licensed under the GNU General Public License Some optional parts of FFmpeg are licensed under the GNU General Public License
version 2 or later (GPL v2+). See the file `COPYING.GPLv2` for details. None of version 2 or later (GPL v2+). See the file COPYING.GPLv2 for details. None of
these parts are used by default, you have to explicitly pass `--enable-gpl` to these parts are used by default, you have to explicitly pass --enable-gpl to
configure to activate them. In this case, FFmpeg's license changes to GPL v2+. configure to activate them. In this case, FFmpeg's license changes to GPL v2+.
Specifically, the GPL parts of FFmpeg are: Specifically, the GPL parts of FFmpeg are:
- libpostproc - libpostproc
- optional x86 optimization in the files - libmpcodecs
- `libavcodec/x86/flac_dsp_gpl.asm` - optional x86 optimizations in the files
- `libavcodec/x86/idct_mmx.c` libavcodec/x86/flac_dsp_gpl.asm
- `libavfilter/x86/vf_removegrain.asm` libavcodec/x86/idct_mmx.c
- the X11 grabber in `libavdevice/x11grab.c` - libutvideo encoding/decoding wrappers in
- the following building and testing tools libavcodec/libutvideo*.cpp
- `compat/solaris/make_sunver.pl` - the X11 grabber in libavdevice/x11grab.c
- `doc/t2h.pm` - the swresample test app in
- `doc/texi2pod.pl` libswresample/swresample-test.c
- `libswresample/swresample-test.c` - the texi2pod.pl tool
- `tests/checkasm/*`
- `tests/tiny_ssim.c`
- the following filters in libavfilter: - the following filters in libavfilter:
- `f_ebur128.c` - f_ebur128.c
- `vf_blackframe.c` - vf_blackframe.c
- `vf_boxblur.c` - vf_boxblur.c
- `vf_colormatrix.c` - vf_colormatrix.c
- `vf_cover_rect.c` - vf_cropdetect.c
- `vf_cropdetect.c` - vf_decimate.c
- `vf_delogo.c` - vf_delogo.c
- `vf_eq.c` - vf_geq.c
- `vf_find_rect.c` - vf_histeq.c
- `vf_fspp.c` - vf_hqdn3d.c
- `vf_geq.c` - vf_interlace.c
- `vf_histeq.c` - vf_kerndeint.c
- `vf_hqdn3d.c` - vf_mcdeint.c
- `vf_interlace.c` - vf_mp.c
- `vf_kerndeint.c` - vf_owdenoise.c
- `vf_mcdeint.c` - vf_perspective.c
- `vf_mpdecimate.c` - vf_phase.c
- `vf_owdenoise.c` - vf_pp.c
- `vf_perspective.c` - vf_pullup.c
- `vf_phase.c` - vf_sab.c
- `vf_pp.c` - vf_smartblur.c
- `vf_pp7.c` - vf_spp.c
- `vf_pullup.c` - vf_stereo3d.c
- `vf_repeatfields.c` - vf_super2xsai.c
- `vf_sab.c` - vf_tinterlace.c
- `vf_smartblur.c` - vsrc_mptestsrc.c
- `vf_spp.c`
- `vf_stereo3d.c`
- `vf_super2xsai.c`
- `vf_tinterlace.c`
- `vf_uspp.c`
- `vsrc_mptestsrc.c`
Should you, for whatever reason, prefer to use version 3 of the (L)GPL, then Should you, for whatever reason, prefer to use version 3 of the (L)GPL, then
the configure parameter `--enable-version3` will activate this licensing option the configure parameter --enable-version3 will activate this licensing option
for you. Read the file `COPYING.LGPLv3` or, if you have enabled GPL parts, for you. Read the file COPYING.LGPLv3 or, if you have enabled GPL parts,
`COPYING.GPLv3` to learn the exact legal terms that apply in this case. COPYING.GPLv3 to learn the exact legal terms that apply in this case.
There are a handful of files under other licensing terms, namely: There are a handful of files under other licensing terms, namely:
* The files `libavcodec/jfdctfst.c`, `libavcodec/jfdctint_template.c` and * The files libavcodec/jfdctfst.c, libavcodec/jfdctint_template.c and
`libavcodec/jrevdct.c` are taken from libjpeg, see the top of the files for libavcodec/jrevdct.c are taken from libjpeg, see the top of the files for
licensing details. Specifically note that you must credit the IJG in the licensing details. Specifically note that you must credit the IJG in the
documentation accompanying your program if you only distribute executables. documentation accompanying your program if you only distribute executables.
You must also indicate any changes including additions and deletions to You must also indicate any changes including additions and deletions to
those three files in the documentation. those three files in the documentation.
* `tests/reference.pnm` is under the expat license. tests/reference.pnm is under the expat license
## External libraries external libraries
==================
FFmpeg can be combined with a number of external libraries, which sometimes FFmpeg can be combined with a number of external libraries, which sometimes
affect the licensing of binaries resulting from the combination. affect the licensing of binaries resulting from the combination.
### Compatible libraries compatible libraries
--------------------
The following libraries are under GPL: The following libraries are under GPL:
- frei0r - frei0r
- libcdio - libcdio
- librubberband - libutvideo
- libvidstab - libvidstab
- libx264 - libx264
- libx265 - libx265
- libxavs - libxavs
- libxvid - libxvid
When combining them with FFmpeg, FFmpeg needs to be licensed as GPL as well by When combining them with FFmpeg, FFmpeg needs to be licensed as GPL as well by
passing `--enable-gpl` to configure. passing --enable-gpl to configure.
The OpenCORE and VisualOn libraries are under the Apache License 2.0. That The OpenCORE and VisualOn libraries are under the Apache License 2.0. That
license is incompatible with the LGPL v2.1 and the GPL v2, but not with license is incompatible with the LGPL v2.1 and the GPL v2, but not with
version 3 of those licenses. So to combine these libraries with FFmpeg, the version 3 of those licenses. So to combine these libraries with FFmpeg, the
license version needs to be upgraded by passing `--enable-version3` to configure. license version needs to be upgraded by passing --enable-version3 to configure.
### Incompatible libraries incompatible libraries
----------------------
There are certain libraries you can combine with FFmpeg whose licenses are not The Fraunhofer AAC library, FAAC and aacplus are under licenses which
compatible with the GPL and/or the LGPL. If you wish to enable these are incompatible with the GPLv2 and v3. We do not know for certain if their
libraries, even in circumstances that their license may be incompatible, pass licenses are compatible with the LGPL.
`--enable-nonfree` to configure. But note that if you enable any of these If you wish to enable these libraries, pass --enable-nonfree to configure.
libraries the resulting binary will be under a complex license mix that is But note that if you enable any of these libraries the resulting binary will
more restrictive than the LGPL and that may result in additional obligations. be under a complex license mix that is more restrictive than the LGPL and that
It is possible that these restrictions cause the resulting binary to be may result in additional obligations. It is possible that these
unredistributable. restrictions cause the resulting binary to be unredistributeable.
The Fraunhofer FDK AAC and OpenSSL libraries are under licenses which are
incompatible with the GPLv2 and v3. To the best of our knowledge, they are
compatible with the LGPL.
The FAAC library is incompatible with all versions of GPL and LGPL.
The NVENC library, while its header file is licensed under the compatible MIT
license, requires a proprietary binary blob at run time, and is deemed to be
incompatible with the GPL. We are not certain if it is compatible with the
LGPL, but we require `--enable-nonfree` even with LGPL configurations in case
it is not.

View File

@ -42,8 +42,9 @@ QuickTime faststart:
Miscellaneous Areas Miscellaneous Areas
=================== ===================
documentation Stefano Sabatini, Mike Melanson, Timothy Gu, Lou Logan documentation Stefano Sabatini, Mike Melanson, Timothy Gu
project server Árpád Gereöffy, Michael Niedermayer, Reimar Doeffinger, Alexander Strasser, Nikolay Aleksandrov build system (configure, makefiles) Diego Biurrun, Mans Rullgard
project server Árpád Gereöffy, Michael Niedermayer, Reimar Doeffinger, Alexander Strasser
presets Robert Swain presets Robert Swain
metadata subsystem Aurelien Jacobs metadata subsystem Aurelien Jacobs
release management Michael Niedermayer release management Michael Niedermayer
@ -55,9 +56,9 @@ Communication
website Deby Barbara Lepage website Deby Barbara Lepage
fate.ffmpeg.org Timothy Gu fate.ffmpeg.org Timothy Gu
Trac bug tracker Alexander Strasser, Michael Niedermayer, Carl Eugen Hoyos, Lou Logan Trac bug tracker Alexander Strasser, Michael Niedermayer, Carl Eugen Hoyos, Lou Logan
mailing lists Baptiste Coudurier, Lou Logan mailing lists Michael Niedermayer, Baptiste Coudurier, Lou Logan
Google+ Paul B Mahol, Michael Niedermayer, Alexander Strasser Google+ Paul B Mahol, Michael Niedermayer, Alexander Strasser
Twitter Lou Logan, Reynaldo H. Verdejo Pinochet Twitter Lou Logan
Launchpad Timothy Gu Launchpad Timothy Gu
@ -70,7 +71,6 @@ Internal Interfaces:
libavutil/common.h Michael Niedermayer libavutil/common.h Michael Niedermayer
Other: Other:
aes_ctr.c, aes_ctr.h Eran Kornblau
bprint Nicolas George bprint Nicolas George
bswap.h bswap.h
des Reimar Doeffinger des Reimar Doeffinger
@ -88,6 +88,7 @@ Other:
rational.c, rational.h Michael Niedermayer rational.c, rational.h Michael Niedermayer
rc4 Reimar Doeffinger rc4 Reimar Doeffinger
ripemd.c, ripemd.h James Almer ripemd.c, ripemd.h James Almer
timecode Clément Bœsch
libavcodec libavcodec
@ -115,6 +116,8 @@ Generic Parts:
faandct.c, faandct.h Michael Niedermayer faandct.c, faandct.h Michael Niedermayer
Golomb coding: Golomb coding:
golomb.c, golomb.h Michael Niedermayer golomb.c, golomb.h Michael Niedermayer
LPC:
lpc.c, lpc.h Justin Ruggles
motion estimation: motion estimation:
motion* Michael Niedermayer motion* Michael Niedermayer
rate control: rate control:
@ -134,36 +137,43 @@ Codecs:
4xm.c Michael Niedermayer 4xm.c Michael Niedermayer
8bps.c Roberto Togni 8bps.c Roberto Togni
8svx.c Jaikrishnan Menon 8svx.c Jaikrishnan Menon
aacenc*, aaccoder.c Rostislav Pehlivanov aasc.c Kostya Shishkov
ac3* Justin Ruggles
alacenc.c Jaikrishnan Menon alacenc.c Jaikrishnan Menon
alsdec.c Thilo Borgmann alsdec.c Thilo Borgmann
apedec.c Kostya Shishkov
ass* Aurelien Jacobs ass* Aurelien Jacobs
asv* Michael Niedermayer asv* Michael Niedermayer
atrac3* Benjamin Larsson
atrac3plus* Maxim Poliakovski atrac3plus* Maxim Poliakovski
bgmc.c, bgmc.h Thilo Borgmann bgmc.c, bgmc.h Thilo Borgmann
bink.c Kostya Shishkov
binkaudio.c Peter Ross binkaudio.c Peter Ross
bmp.c Mans Rullgard, Kostya Shishkov
cavs* Stefan Gehrer cavs* Stefan Gehrer
cdxl.c Paul B Mahol cdxl.c Paul B Mahol
celp_filters.* Vitor Sessak celp_filters.* Vitor Sessak
cinepak.c Roberto Togni cinepak.c Roberto Togni
cinepakenc.c Rl / Aetey G.T. AB cinepakenc.c Rl / Aetey G.T. AB
ccaption_dec.c Anshul Maheshwari, Aman Gupta
cljr Alex Beregszaszi cljr Alex Beregszaszi
cllc.c Derek Buitenhuis
cook.c, cookdata.h Benjamin Larsson
cpia.c Stephan Hilb cpia.c Stephan Hilb
crystalhd.c Philip Langdale crystalhd.c Philip Langdale
cscd.c Reimar Doeffinger cscd.c Reimar Doeffinger
cuvid.c Timo Rothenpieler dca.c Kostya Shishkov, Benjamin Larsson
dirac* Rostislav Pehlivanov
dnxhd* Baptiste Coudurier dnxhd* Baptiste Coudurier
dpcm.c Mike Melanson dpcm.c Mike Melanson
dss_sp.c Oleksij Rempel
dv.c Roman Shaposhnik dv.c Roman Shaposhnik
dvbsubdec.c Anshul Maheshwari dvbsubdec.c Anshul Maheshwari
dxa.c Kostya Shishkov
eacmv*, eaidct*, eat* Peter Ross eacmv*, eaidct*, eat* Peter Ross
evrc* Paul B Mahol
exif.c, exif.h Thilo Borgmann exif.c, exif.h Thilo Borgmann
ffv1* Michael Niedermayer ffv1* Michael Niedermayer
ffwavesynth.c Nicolas George ffwavesynth.c Nicolas George
fic.c Derek Buitenhuis
flac* Justin Ruggles
flashsv* Benjamin Larsson
flicvideo.c Mike Melanson flicvideo.c Mike Melanson
g722.c Martin Storsjo g722.c Martin Storsjo
g726.c Roman Shaposhnik g726.c Roman Shaposhnik
@ -171,47 +181,58 @@ Codecs:
h261* Michael Niedermayer h261* Michael Niedermayer
h263* Michael Niedermayer h263* Michael Niedermayer
h264* Loren Merritt, Michael Niedermayer h264* Loren Merritt, Michael Niedermayer
hap* Tom Butterworth
huffyuv* Michael Niedermayer, Christophe Gisquet huffyuv* Michael Niedermayer, Christophe Gisquet
idcinvideo.c Mike Melanson idcinvideo.c Mike Melanson
imc* Benjamin Larsson
indeo2* Kostya Shishkov
indeo5* Kostya Shishkov
interplayvideo.c Mike Melanson interplayvideo.c Mike Melanson
jni*, ffjni* Matthieu Bouron ivi* Kostya Shishkov
jacosub* Clément Bœsch
jpeg2000* Nicolas Bertrand jpeg2000* Nicolas Bertrand
jpeg_ls.c Kostya Shishkov
jvdec.c Peter Ross jvdec.c Peter Ross
kmvc.c Kostya Shishkov
lcl*.c Roberto Togni, Reimar Doeffinger lcl*.c Roberto Togni, Reimar Doeffinger
libcelt_dec.c Nicolas George libcelt_dec.c Nicolas George
libdirac* David Conrad libdirac* David Conrad
libgsm.c Michel Bardiaux libgsm.c Michel Bardiaux
libkvazaar.c Arttu Ylä-Outinen
libopenjpeg.c Jaikrishnan Menon libopenjpeg.c Jaikrishnan Menon
libopenjpegenc.c Michael Bradshaw libopenjpegenc.c Michael Bradshaw
libschroedinger* David Conrad libschroedinger* David Conrad
libspeexdec.c Justin Ruggles
libtheoraenc.c David Conrad libtheoraenc.c David Conrad
libutvideo* Derek Buitenhuis
libvorbis.c David Conrad libvorbis.c David Conrad
libvpx* James Zern libvpx* James Zern
libx264.c Mans Rullgard, Jason Garrett-Glaser
libx265.c Derek Buitenhuis
libxavs.c Stefan Gehrer libxavs.c Stefan Gehrer
libzvbi-teletextdec.c Marton Balint libzvbi-teletextdec.c Marton Balint
loco.c Kostya Shishkov
lzo.h, lzo.c Reimar Doeffinger lzo.h, lzo.c Reimar Doeffinger
mdec.c Michael Niedermayer mdec.c Michael Niedermayer
mimic.c Ramiro Polla mimic.c Ramiro Polla
mjpeg*.c Michael Niedermayer mjpeg*.c Michael Niedermayer
mlp* Ramiro Polla mlp* Ramiro Polla
mmvideo.c Peter Ross mmvideo.c Peter Ross
mpc* Kostya Shishkov
mpeg12.c, mpeg12data.h Michael Niedermayer mpeg12.c, mpeg12data.h Michael Niedermayer
mpegvideo.c, mpegvideo.h Michael Niedermayer mpegvideo.c, mpegvideo.h Michael Niedermayer
mqc* Nicolas Bertrand mqc* Nicolas Bertrand
msmpeg4.c, msmpeg4data.h Michael Niedermayer msmpeg4.c, msmpeg4data.h Michael Niedermayer
msrle.c Mike Melanson msrle.c Mike Melanson
msvideo1.c Mike Melanson msvideo1.c Mike Melanson
nellymoserdec.c Benjamin Larsson
nuv.c Reimar Doeffinger nuv.c Reimar Doeffinger
nvenc* Timo Rothenpieler
paf.* Paul B Mahol paf.* Paul B Mahol
pcx.c Ivo van Poorten pcx.c Ivo van Poorten
pgssubdec.c Reimar Doeffinger pgssubdec.c Reimar Doeffinger
ptx.c Ivo van Poorten ptx.c Ivo van Poorten
qcelp* Reynaldo H. Verdejo Pinochet qcelp* Reynaldo H. Verdejo Pinochet
qdm2.c, qdm2data.h Roberto Togni qdm2.c, qdm2data.h Roberto Togni, Benjamin Larsson
qsv* Ivan Uskov qdrw.c Kostya Shishkov
qpeg.c Kostya Shishkov
qtrle.c Mike Melanson qtrle.c Mike Melanson
ra144.c, ra144.h, ra288.c, ra288.h Roberto Togni ra144.c, ra144.h, ra288.c, ra288.h Roberto Togni
resample2.c Michael Niedermayer resample2.c Michael Niedermayer
@ -219,8 +240,10 @@ Codecs:
rpza.c Roberto Togni rpza.c Roberto Togni
rtjpeg.c, rtjpeg.h Reimar Doeffinger rtjpeg.c, rtjpeg.h Reimar Doeffinger
rv10.c Michael Niedermayer rv10.c Michael Niedermayer
rv4* Christophe Gisquet rv3* Kostya Shishkov
rv4* Kostya Shishkov, Christophe Gisquet
s3tc* Ivo van Poorten s3tc* Ivo van Poorten
smacker.c Kostya Shishkov
smc.c Mike Melanson smc.c Mike Melanson
smvjpegdec.c Ash Hughes smvjpegdec.c Ash Hughes
snow* Michael Niedermayer, Loren Merritt snow* Michael Niedermayer, Loren Merritt
@ -229,41 +252,53 @@ Codecs:
sunrast.c Ivo van Poorten sunrast.c Ivo van Poorten
svq3.c Michael Niedermayer svq3.c Michael Niedermayer
tak* Paul B Mahol tak* Paul B Mahol
targa.c Kostya Shishkov
tiff.c Kostya Shishkov
truemotion1* Mike Melanson truemotion1* Mike Melanson
truemotion2* Kostya Shishkov
truespeech.c Kostya Shishkov
tscc.c Kostya Shishkov
tta.c Alex Beregszaszi, Jaikrishnan Menon tta.c Alex Beregszaszi, Jaikrishnan Menon
ttaenc.c Paul B Mahol ttaenc.c Paul B Mahol
txd.c Ivo van Poorten txd.c Ivo van Poorten
vc1* Christophe Gisquet ulti* Kostya Shishkov
vc2* Rostislav Pehlivanov v410*.c Derek Buitenhuis
vb.c Kostya Shishkov
vble.c Derek Buitenhuis
vc1* Kostya Shishkov, Christophe Gisquet
vcr1.c Michael Niedermayer vcr1.c Michael Niedermayer
vda_h264_dec.c Xidorn Quan vda_h264_dec.c Xidorn Quan
videotoolboxenc.c Rick Kern
vima.c Paul B Mahol vima.c Paul B Mahol
vmnc.c Kostya Shishkov
vorbisdec.c Denes Balatoni, David Conrad vorbisdec.c Denes Balatoni, David Conrad
vorbisenc.c Oded Shimon vorbisenc.c Oded Shimon
vp3* Mike Melanson vp3* Mike Melanson
vp5 Aurelien Jacobs vp5 Aurelien Jacobs
vp6 Aurelien Jacobs vp6 Aurelien Jacobs
vp8 David Conrad, Ronald Bultje vp8 David Conrad, Jason Garrett-Glaser, Ronald Bultje
vp9 Ronald Bultje vp9 Ronald Bultje, Clément Bœsch
vqavideo.c Mike Melanson vqavideo.c Mike Melanson
wavpack.c Kostya Shishkov
wmaprodec.c Sascha Sommer wmaprodec.c Sascha Sommer
wmavoice.c Ronald S. Bultje wmavoice.c Ronald S. Bultje
wmv2.c Michael Niedermayer wmv2.c Michael Niedermayer
wnv1.c Kostya Shishkov
xan.c Mike Melanson xan.c Mike Melanson
xbm* Paul B Mahol xbm* Paul B Mahol
xface Stefano Sabatini xface Stefano Sabatini
xl.c Kostya Shishkov
xvmc.c Ivan Kalvachev xvmc.c Ivan Kalvachev
xwd* Paul B Mahol xwd* Paul B Mahol
zerocodec.c Derek Buitenhuis
zmbv* Kostya Shishkov
Hardware acceleration: Hardware acceleration:
crystalhd.c Philip Langdale crystalhd.c Philip Langdale
dxva2* Hendrik Leppkes, Laurent Aimar dxva2* Laurent Aimar
mediacodec* Matthieu Bouron libstagefright.cpp Mohamed Naufal
vaapi* Gwenole Beauchesne vaapi* Gwenole Beauchesne
vaapi_encode* Mark Thompson vda* Sebastien Zwickert
vdpau* Philip Langdale, Carl Eugen Hoyos vdpau* Carl Eugen Hoyos
videotoolbox* Rick Kern
libavdevice libavdevice
@ -295,7 +330,6 @@ Generic parts:
graphdump.c Nicolas George graphdump.c Nicolas George
Filters: Filters:
f_drawgraph.c Paul B Mahol
af_adelay.c Paul B Mahol af_adelay.c Paul B Mahol
af_aecho.c Paul B Mahol af_aecho.c Paul B Mahol
af_afade.c Paul B Mahol af_afade.c Paul B Mahol
@ -303,30 +337,19 @@ Filters:
af_aphaser.c Paul B Mahol af_aphaser.c Paul B Mahol
af_aresample.c Michael Niedermayer af_aresample.c Michael Niedermayer
af_astats.c Paul B Mahol af_astats.c Paul B Mahol
af_astreamsync.c Nicolas George
af_atempo.c Pavel Koshevoy af_atempo.c Pavel Koshevoy
af_biquads.c Paul B Mahol af_biquads.c Paul B Mahol
af_chorus.c Paul B Mahol
af_compand.c Paul B Mahol af_compand.c Paul B Mahol
af_firequalizer.c Muhammad Faiz
af_hdcd.c Burt P.
af_ladspa.c Paul B Mahol af_ladspa.c Paul B Mahol
af_loudnorm.c Kyle Swanson
af_pan.c Nicolas George af_pan.c Nicolas George
af_sidechaincompress.c Paul B Mahol
af_silenceremove.c Paul B Mahol af_silenceremove.c Paul B Mahol
avf_aphasemeter.c Paul B Mahol
avf_avectorscope.c Paul B Mahol avf_avectorscope.c Paul B Mahol
avf_showcqt.c Muhammad Faiz avf_showcqt.c Muhammad Faiz
vf_blend.c Paul B Mahol vf_blend.c Paul B Mahol
vf_chromakey.c Timo Rothenpieler
vf_colorchannelmixer.c Paul B Mahol
vf_colorbalance.c Paul B Mahol vf_colorbalance.c Paul B Mahol
vf_colorkey.c Timo Rothenpieler
vf_colorlevels.c Paul B Mahol
vf_coreimage.m Thilo Borgmann
vf_deband.c Paul B Mahol
vf_dejudder.c Nicholas Robbins vf_dejudder.c Nicholas Robbins
vf_delogo.c Jean Delvare (CC <jdelvare@suse.com>) vf_delogo.c Jean Delvare (CC <khali@linux-fr.org>)
vf_drawbox.c/drawgrid Andrey Utkin vf_drawbox.c/drawgrid Andrey Utkin
vf_extractplanes.c Paul B Mahol vf_extractplanes.c Paul B Mahol
vf_histogram.c Paul B Mahol vf_histogram.c Paul B Mahol
@ -335,17 +358,12 @@ Filters:
vf_il.c Paul B Mahol vf_il.c Paul B Mahol
vf_lenscorrection.c Daniel Oberhoff vf_lenscorrection.c Daniel Oberhoff
vf_mergeplanes.c Paul B Mahol vf_mergeplanes.c Paul B Mahol
vf_neighbor.c Paul B Mahol
vf_psnr.c Paul B Mahol vf_psnr.c Paul B Mahol
vf_random.c Paul B Mahol
vf_readvitc.c Tobias Rapp (CC t.rapp at noa-archive dot com)
vf_scale.c Michael Niedermayer vf_scale.c Michael Niedermayer
vf_separatefields.c Paul B Mahol vf_separatefields.c Paul B Mahol
vf_ssim.c Paul B Mahol
vf_stereo3d.c Paul B Mahol vf_stereo3d.c Paul B Mahol
vf_telecine.c Paul B Mahol vf_telecine.c Paul B Mahol
vf_yadif.c Michael Niedermayer vf_yadif.c Michael Niedermayer
vf_zoompan.c Paul B Mahol
Sources: Sources:
vsrc_mandelbrot.c Michael Niedermayer vsrc_mandelbrot.c Michael Niedermayer
@ -358,16 +376,15 @@ Generic parts:
libavformat/avformat.h Michael Niedermayer libavformat/avformat.h Michael Niedermayer
Utility Code: Utility Code:
libavformat/utils.c Michael Niedermayer libavformat/utils.c Michael Niedermayer
Text Subtitles Clément Bœsch
Muxers/Demuxers: Muxers/Demuxers:
4xm.c Mike Melanson 4xm.c Mike Melanson
aadec.c Vesselin Bontchev (vesselin.bontchev at yandex dot com)
adtsenc.c Robert Swain adtsenc.c Robert Swain
afc.c Paul B Mahol afc.c Paul B Mahol
aiffdec.c Baptiste Coudurier, Matthieu Bouron aiffdec.c Baptiste Coudurier, Matthieu Bouron
aiffenc.c Baptiste Coudurier, Matthieu Bouron aiffenc.c Baptiste Coudurier, Matthieu Bouron
ape.c Kostya Shishkov
apngdec.c Benoit Fouet apngdec.c Benoit Fouet
ass* Aurelien Jacobs ass* Aurelien Jacobs
astdec.c Paul B Mahol astdec.c Paul B Mahol
@ -381,18 +398,18 @@ Muxers/Demuxers:
cdxl.c Paul B Mahol cdxl.c Paul B Mahol
crc.c Michael Niedermayer crc.c Michael Niedermayer
daud.c Reimar Doeffinger daud.c Reimar Doeffinger
dss.c Oleksij Rempel
dtshddec.c Paul B Mahol dtshddec.c Paul B Mahol
dv.c Roman Shaposhnik dv.c Roman Shaposhnik
dxa.c Kostya Shishkov
electronicarts.c Peter Ross electronicarts.c Peter Ross
epafdec.c Paul B Mahol epafdec.c Paul B Mahol
ffm* Baptiste Coudurier ffm* Baptiste Coudurier
flac* Justin Ruggles
flic.c Mike Melanson flic.c Mike Melanson
flvdec.c, flvenc.c Michael Niedermayer flvdec.c, flvenc.c Michael Niedermayer
gxf.c Reimar Doeffinger gxf.c Reimar Doeffinger
gxfenc.c Baptiste Coudurier gxfenc.c Baptiste Coudurier
hls.c Anssi Hannula hls.c Anssi Hannula
hls encryption (hlsenc.c) Christian Suloway
idcin.c Mike Melanson idcin.c Mike Melanson
idroqdec.c Mike Melanson idroqdec.c Mike Melanson
iff.c Jaikrishnan Menon iff.c Jaikrishnan Menon
@ -400,10 +417,10 @@ Muxers/Demuxers:
ipmovie.c Mike Melanson ipmovie.c Mike Melanson
ircam* Paul B Mahol ircam* Paul B Mahol
iss.c Stefan Gehrer iss.c Stefan Gehrer
jacosub* Clément Bœsch
jvdec.c Peter Ross jvdec.c Peter Ross
libmodplug.c Clément Bœsch libmodplug.c Clément Bœsch
libnut.c Oded Shimon libnut.c Oded Shimon
libopenmpt.c Josh de Kock
lmlm4.c Ivo van Poorten lmlm4.c Ivo van Poorten
lvfdec.c Paul B Mahol lvfdec.c Paul B Mahol
lxfdec.c Tomas Härdin lxfdec.c Tomas Härdin
@ -415,9 +432,9 @@ Muxers/Demuxers:
mgsts.c Paul B Mahol mgsts.c Paul B Mahol
microdvd* Aurelien Jacobs microdvd* Aurelien Jacobs
mm.c Peter Ross mm.c Peter Ross
mov.c Baptiste Coudurier mov.c Michael Niedermayer, Baptiste Coudurier
movenc.c Baptiste Coudurier, Matthieu Bouron movenc.c Baptiste Coudurier, Matthieu Bouron
movenccenc.c Eran Kornblau mpc.c Kostya Shishkov
mpeg.c Michael Niedermayer mpeg.c Michael Niedermayer
mpegenc.c Michael Niedermayer mpegenc.c Michael Niedermayer
mpegts.c Marton Balint mpegts.c Marton Balint
@ -433,7 +450,6 @@ Muxers/Demuxers:
oggdec.c, oggdec.h David Conrad oggdec.c, oggdec.h David Conrad
oggenc.c Baptiste Coudurier oggenc.c Baptiste Coudurier
oggparse*.c David Conrad oggparse*.c David Conrad
oggparsedaala* Rostislav Pehlivanov
oma.c Maxim Poliakovski oma.c Maxim Poliakovski
paf.c Paul B Mahol paf.c Paul B Mahol
psxstr.c Mike Melanson psxstr.c Mike Melanson
@ -443,21 +459,20 @@ Muxers/Demuxers:
raw.c Michael Niedermayer raw.c Michael Niedermayer
rdt.c Ronald S. Bultje rdt.c Ronald S. Bultje
rl2.c Sascha Sommer rl2.c Sascha Sommer
rmdec.c, rmenc.c Ronald S. Bultje rmdec.c, rmenc.c Ronald S. Bultje, Kostya Shishkov
rtmp* Kostya Shishkov
rtp.c, rtpenc.c Martin Storsjo rtp.c, rtpenc.c Martin Storsjo
rtpdec_ac3.* Gilles Chanteperdrix
rtpdec_dv.* Thomas Volkert
rtpdec_h261.*, rtpenc_h261.* Thomas Volkert rtpdec_h261.*, rtpenc_h261.* Thomas Volkert
rtpdec_hevc.*, rtpenc_hevc.* Thomas Volkert rtpdec_hevc.*, rtpenc_hevc.* Thomas Volkert
rtpdec_mpa_robust.* Gilles Chanteperdrix
rtpdec_asf.* Ronald S. Bultje rtpdec_asf.* Ronald S. Bultje
rtpdec_vc2hq.*, rtpenc_vc2hq.* Thomas Volkert
rtpdec_vp9.c Thomas Volkert
rtpenc_mpv.*, rtpenc_aac.* Martin Storsjo rtpenc_mpv.*, rtpenc_aac.* Martin Storsjo
rtsp.c Luca Barbato
sbgdec.c Nicolas George sbgdec.c Nicolas George
sdp.c Martin Storsjo sdp.c Martin Storsjo
segafilm.c Mike Melanson segafilm.c Mike Melanson
segment.c Stefano Sabatini segment.c Stefano Sabatini
siff.c Kostya Shishkov
smacker.c Kostya Shishkov
smjpeg* Paul B Mahol smjpeg* Paul B Mahol
spdif* Anssi Hannula spdif* Anssi Hannula
srtdec.c Aurelien Jacobs srtdec.c Aurelien Jacobs
@ -472,10 +487,10 @@ Muxers/Demuxers:
webvtt* Matthew J Heaney webvtt* Matthew J Heaney
westwood.c Mike Melanson westwood.c Mike Melanson
wtv.c Peter Ross wtv.c Peter Ross
wv.c Kostya Shishkov
wvenc.c Paul B Mahol wvenc.c Paul B Mahol
Protocols: Protocols:
async.c Zhang Rui
bluray.c Petri Hintukainen bluray.c Petri Hintukainen
ftp.c Lukasz Marek ftp.c Lukasz Marek
http.c Ronald S. Bultje http.c Ronald S. Bultje
@ -502,25 +517,25 @@ Resamplers:
Operating systems / CPU architectures Operating systems / CPU architectures
===================================== =====================================
Alpha Falk Hueffner Alpha Mans Rullgard, Falk Hueffner
MIPS Nedeljko Babic ARM Mans Rullgard
AVR32 Mans Rullgard
MIPS Mans Rullgard, Nedeljko Babic
Mac OS X / PowerPC Romain Dolbeau, Guillaume Poirier Mac OS X / PowerPC Romain Dolbeau, Guillaume Poirier
Amiga / PowerPC Colin Ward Amiga / PowerPC Colin Ward
Linux / PowerPC Luca Barbato
Windows MinGW Alex Beregszaszi, Ramiro Polla Windows MinGW Alex Beregszaszi, Ramiro Polla
Windows Cygwin Victor Paesa Windows Cygwin Victor Paesa
Windows MSVC Matthew Oliver, Hendrik Leppkes Windows MSVC Matthew Oliver
Windows ICL Matthew Oliver Windows ICL Matthew Oliver
ADI/Blackfin DSP Marc Hoffman ADI/Blackfin DSP Marc Hoffman
Sparc Roman Shaposhnik Sparc Roman Shaposhnik
OS/2 KO Myung-Hun x86 Michael Niedermayer
Releases Releases
======== ========
2.8 Michael Niedermayer
2.7 Michael Niedermayer
2.6 Michael Niedermayer
2.5 Michael Niedermayer 2.5 Michael Niedermayer
If you want to maintain an older release, please contact us If you want to maintain an older release, please contact us
@ -531,6 +546,7 @@ GnuPG Fingerprints of maintainers and contributors
Alexander Strasser 1C96 78B7 83CB 8AA7 9AF5 D1EB A7D8 A57B A876 E58F Alexander Strasser 1C96 78B7 83CB 8AA7 9AF5 D1EB A7D8 A57B A876 E58F
Anssi Hannula 1A92 FF42 2DD9 8D2E 8AF7 65A9 4278 C520 513D F3CB Anssi Hannula 1A92 FF42 2DD9 8D2E 8AF7 65A9 4278 C520 513D F3CB
Anton Khirnov 6D0C 6625 56F8 65D1 E5F5 814B B50A 1241 C067 07AB
Ash Hughes 694D 43D2 D180 C7C7 6421 ABD3 A641 D0B7 623D 6029 Ash Hughes 694D 43D2 D180 C7C7 6421 ABD3 A641 D0B7 623D 6029
Attila Kinali 11F0 F9A6 A1D2 11F6 C745 D10C 6520 BCDD F2DF E765 Attila Kinali 11F0 F9A6 A1D2 11F6 C745 D10C 6520 BCDD F2DF E765
Baptiste Coudurier 8D77 134D 20CC 9220 201F C5DB 0AC9 325C 5C1A BAAA Baptiste Coudurier 8D77 134D 20CC 9220 201F C5DB 0AC9 325C 5C1A BAAA
@ -538,19 +554,19 @@ Ben Littler 3EE3 3723 E560 3214 A8CD 4DEB 2CDB FCE7 768C 8D2C
Benoit Fouet B22A 4F4F 43EF 636B BB66 FCDC 0023 AE1E 2985 49C8 Benoit Fouet B22A 4F4F 43EF 636B BB66 FCDC 0023 AE1E 2985 49C8
Clément Bœsch 52D0 3A82 D445 F194 DB8B 2B16 87EE 2CB8 F4B8 FCF9 Clément Bœsch 52D0 3A82 D445 F194 DB8B 2B16 87EE 2CB8 F4B8 FCF9
Daniel Verkamp 78A6 07ED 782C 653E C628 B8B9 F0EB 8DD8 2F0E 21C7 Daniel Verkamp 78A6 07ED 782C 653E C628 B8B9 F0EB 8DD8 2F0E 21C7
Diego Biurrun 8227 1E31 B6D9 4994 7427 E220 9CAE D6CC 4757 FCC5
FFmpeg release signing key FCF9 86EA 15E6 E293 A564 4F10 B432 2F04 D676 58D8 FFmpeg release signing key FCF9 86EA 15E6 E293 A564 4F10 B432 2F04 D676 58D8
Ganesh Ajjanagadde C96A 848E 97C3 CEA2 AB72 5CE4 45F9 6A2D 3C36 FB1B
Gwenole Beauchesne 2E63 B3A6 3E44 37E2 017D 2704 53C7 6266 B153 99C4 Gwenole Beauchesne 2E63 B3A6 3E44 37E2 017D 2704 53C7 6266 B153 99C4
Jaikrishnan Menon 61A1 F09F 01C9 2D45 78E1 C862 25DC 8831 AF70 D368 Jaikrishnan Menon 61A1 F09F 01C9 2D45 78E1 C862 25DC 8831 AF70 D368
Jean Delvare 7CA6 9F44 60F1 BDC4 1FD2 C858 A552 6B9B B3CD 4E6A Jean Delvare 7CA6 9F44 60F1 BDC4 1FD2 C858 A552 6B9B B3CD 4E6A
Justin Ruggles 3136 ECC0 C10D 6C04 5F43 CA29 FCBE CD2A 3787 1EBF
Loren Merritt ABD9 08F4 C920 3F65 D8BE 35D7 1540 DAA7 060F 56DE Loren Merritt ABD9 08F4 C920 3F65 D8BE 35D7 1540 DAA7 060F 56DE
Lou Logan 7D68 DC73 CBEF EABB 671A B6CF 621C 2E28 82F8 DC3A Lou Logan 7D68 DC73 CBEF EABB 671A B6CF 621C 2E28 82F8 DC3A
Luca Barbato 6677 4209 213C 8843 5B67 29E7 E84C 78C2 84E9 0E34
Michael Niedermayer 9FF2 128B 147E F673 0BAD F133 611E C787 040B 0FAB Michael Niedermayer 9FF2 128B 147E F673 0BAD F133 611E C787 040B 0FAB
Nicolas George 24CE 01CE 9ACC 5CEB 74D8 8D9D B063 D997 36E5 4C93 Nicolas George 24CE 01CE 9ACC 5CEB 74D8 8D9D B063 D997 36E5 4C93
Nikolay Aleksandrov 8978 1D8C FB71 588E 4B27 EAA8 C4F0 B5FC E011 13B1
Panagiotis Issaris 6571 13A3 33D9 3726 F728 AA98 F643 B12E ECF3 E029 Panagiotis Issaris 6571 13A3 33D9 3726 F728 AA98 F643 B12E ECF3 E029
Peter Ross A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B Peter Ross A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B
Philip Langdale 5DC5 8D66 5FBA 3A43 18EC 045E F8D6 B194 6A75 682E
Reimar Doeffinger C61D 16E5 9E2C D10C 8958 38A4 0899 A2B9 06D4 D9C7 Reimar Doeffinger C61D 16E5 9E2C D10C 8958 38A4 0899 A2B9 06D4 D9C7
Reinhard Tartler 9300 5DC2 7E87 6C37 ED7B CA9A 9808 3544 9453 48A4 Reinhard Tartler 9300 5DC2 7E87 6C37 ED7B CA9A 9808 3544 9453 48A4
Reynaldo H. Verdejo Pinochet 6E27 CD34 170C C78E 4D4F 5F40 C18E 077F 3114 452A Reynaldo H. Verdejo Pinochet 6E27 CD34 170C C78E 4D4F 5F40 C18E 077F 3114 452A

View File

@ -4,7 +4,6 @@ include config.mak
vpath %.c $(SRC_PATH) vpath %.c $(SRC_PATH)
vpath %.cpp $(SRC_PATH) vpath %.cpp $(SRC_PATH)
vpath %.h $(SRC_PATH) vpath %.h $(SRC_PATH)
vpath %.inc $(SRC_PATH)
vpath %.m $(SRC_PATH) vpath %.m $(SRC_PATH)
vpath %.S $(SRC_PATH) vpath %.S $(SRC_PATH)
vpath %.asm $(SRC_PATH) vpath %.asm $(SRC_PATH)
@ -30,18 +29,12 @@ $(foreach prog,$(AVBASENAMES),$(eval OBJS-$(prog) += cmdutils.o))
$(foreach prog,$(AVBASENAMES),$(eval OBJS-$(prog)-$(CONFIG_OPENCL) += cmdutils_opencl.o)) $(foreach prog,$(AVBASENAMES),$(eval OBJS-$(prog)-$(CONFIG_OPENCL) += cmdutils_opencl.o))
OBJS-ffmpeg += ffmpeg_opt.o ffmpeg_filter.o OBJS-ffmpeg += ffmpeg_opt.o ffmpeg_filter.o
OBJS-ffmpeg-$(CONFIG_VIDEOTOOLBOX) += ffmpeg_videotoolbox.o
OBJS-ffmpeg-$(CONFIG_LIBMFX) += ffmpeg_qsv.o
OBJS-ffmpeg-$(CONFIG_VAAPI) += ffmpeg_vaapi.o
ifndef CONFIG_VIDEOTOOLBOX
OBJS-ffmpeg-$(CONFIG_VDA) += ffmpeg_videotoolbox.o
endif
OBJS-ffmpeg-$(CONFIG_CUVID) += ffmpeg_cuvid.o
OBJS-ffmpeg-$(HAVE_DXVA2_LIB) += ffmpeg_dxva2.o
OBJS-ffmpeg-$(HAVE_VDPAU_X11) += ffmpeg_vdpau.o OBJS-ffmpeg-$(HAVE_VDPAU_X11) += ffmpeg_vdpau.o
OBJS-ffmpeg-$(HAVE_DXVA2_LIB) += ffmpeg_dxva2.o
OBJS-ffmpeg-$(CONFIG_VDA) += ffmpeg_vda.o
OBJS-ffserver += ffserver_config.o OBJS-ffserver += ffserver_config.o
TESTTOOLS = audiogen videogen rotozoom tiny_psnr tiny_ssim base64 audiomatch TESTTOOLS = audiogen videogen rotozoom tiny_psnr tiny_ssim base64
HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options HOSTPROGS := $(TESTTOOLS:%=tests/%) doc/print_options
TOOLS = qt-faststart trasher uncoded_frame TOOLS = qt-faststart trasher uncoded_frame
TOOLS-$(CONFIG_ZLIB) += cws2fws TOOLS-$(CONFIG_ZLIB) += cws2fws
@ -61,14 +54,12 @@ FFLIBS := avutil
DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.ffpreset) $(SRC_PATH)/doc/ffprobe.xsd DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.ffpreset) $(SRC_PATH)/doc/ffprobe.xsd
EXAMPLES_FILES := $(wildcard $(SRC_PATH)/doc/examples/*.c) $(SRC_PATH)/doc/examples/Makefile $(SRC_PATH)/doc/examples/README EXAMPLES_FILES := $(wildcard $(SRC_PATH)/doc/examples/*.c) $(SRC_PATH)/doc/examples/Makefile $(SRC_PATH)/doc/examples/README
SKIPHEADERS = cmdutils_common_opts.h \ SKIPHEADERS = cmdutils_common_opts.h compat/w32pthreads.h
compat/w32pthreads.h
include $(SRC_PATH)/common.mak include $(SRC_PATH)/common.mak
FF_EXTRALIBS := $(FFEXTRALIBS) FF_EXTRALIBS := $(FFEXTRALIBS)
FF_DEP_LIBS := $(DEP_LIBS) FF_DEP_LIBS := $(DEP_LIBS)
FF_STATIC_DEP_LIBS := $(STATIC_DEP_LIBS)
all: $(AVPROGS) all: $(AVPROGS)
@ -89,8 +80,8 @@ SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS \
HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS \ HEADERS ARCH_HEADERS BUILT_HEADERS SKIPHEADERS \
ARMV5TE-OBJS ARMV6-OBJS ARMV8-OBJS VFP-OBJS NEON-OBJS \ ARMV5TE-OBJS ARMV6-OBJS ARMV8-OBJS VFP-OBJS NEON-OBJS \
ALTIVEC-OBJS MMX-OBJS YASM-OBJS \ ALTIVEC-OBJS MMX-OBJS YASM-OBJS \
MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSP-OBJS MSA-OBJS \ MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSPR1-OBJS MIPS32R2-OBJS \
MMI-OBJS OBJS SLIBOBJS HOSTOBJS TESTOBJS OBJS SLIBOBJS HOSTOBJS TESTOBJS
define RESET define RESET
$(1) := $(1) :=
@ -180,15 +171,11 @@ clean::
$(RM) $(CLEANSUFFIXES) $(RM) $(CLEANSUFFIXES)
$(RM) $(CLEANSUFFIXES:%=tools/%) $(RM) $(CLEANSUFFIXES:%=tools/%)
$(RM) -r coverage-html $(RM) -r coverage-html
$(RM) -rf coverage.info coverage.info.in lcov $(RM) -rf coverage.info lcov
distclean:: distclean::
$(RM) $(DISTCLEANSUFFIXES) $(RM) $(DISTCLEANSUFFIXES)
$(RM) config.* .config libavutil/avconfig.h .version mapfile avversion.h version.h libavutil/ffversion.h libavcodec/codec_names.h libavcodec/bsf_list.c libavformat/protocol_list.c $(RM) config.* .config libavutil/avconfig.h .version version.h libavutil/ffversion.h libavcodec/codec_names.h
ifeq ($(SRC_LINK),src)
$(RM) src
endif
$(RM) -rf doc/examples/pc-uninstalled
config: config:
$(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION) $(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)

View File

@ -16,21 +16,19 @@ such as audio, video, subtitles and related metadata.
## Tools ## Tools
* [ffmpeg](https://ffmpeg.org/ffmpeg.html) is a command line toolbox to * [ffmpeg](http://ffmpeg.org/ffmpeg.html) is a command line toolbox to
manipulate, convert and stream multimedia content. manipulate, convert and stream multimedia content.
* [ffplay](https://ffmpeg.org/ffplay.html) is a minimalistic multimedia player. * [ffplay](http://ffmpeg.org/ffplay.html) is a minimalistic multimedia player.
* [ffprobe](https://ffmpeg.org/ffprobe.html) is a simple analysis tool to inspect * [ffprobe](http://ffmpeg.org/ffprobe.html) is a simple analisys tool to inspect
multimedia content. multimedia content.
* [ffserver](https://ffmpeg.org/ffserver.html) is a multimedia streaming server
for live broadcasts.
* Additional small tools such as `aviocat`, `ismindex` and `qt-faststart`. * Additional small tools such as `aviocat`, `ismindex` and `qt-faststart`.
## Documentation ## Documentation
The offline documentation is available in the **doc/** directory. The offline documentation is available in the **doc/** directory.
The online documentation is available in the main [website](https://ffmpeg.org) The online documentation is available in the main [website](http://ffmpeg.org)
and in the [wiki](https://trac.ffmpeg.org). and in the [wiki](http://trac.ffmpeg.org).
### Examples ### Examples
@ -40,10 +38,3 @@ Coding examples are available in the **doc/examples** directory.
FFmpeg codebase is mainly LGPL-licensed with optional components licensed under FFmpeg codebase is mainly LGPL-licensed with optional components licensed under
GPL. Please refer to the LICENSE file for detailed information. GPL. Please refer to the LICENSE file for detailed information.
## Contributing
Patches should be submitted to the ffmpeg-devel mailing list using
`git format-patch` or `git send-email`. Github pull requests should be
avoided because they are not part of our review process. Few developers
follow pull requests so they will likely be ignored.

View File

@ -1 +1 @@
3.0.git 2.5.11

101
RELEASE_NOTES Normal file
View File

@ -0,0 +1,101 @@
┌────────────────────────────────────────┐
│ RELEASE NOTES for FFmpeg 2.5 "Bohr" │
└────────────────────────────────────────┘
The FFmpeg Project proudly presents FFmpeg 2.5 "Bohr", 2.5 months after the
release of 2.4.
The most important new features are AVFoundation screen-grabbing support,
animated WebP decoding support, and Animated PNG support. In addition, many
exciting features for video streaming are also implemented, including MPEG-
DASH fragmenting muxer, HEVC RTP payload muxer, and UDP Lite support.
As usual, if you have any question on this release or any FFmpeg related
topic, feel free to join us on the #ffmpeg IRC channel (on
irc.freenode.net).
┌────────────────────────────┐
│ 🔨 API Information │
└────────────────────────────┘
FFmpeg 2.5 includes the following library versions:
• libavutil 54.15.100
• libavcodec 56.13.100
• libavformat 56.15.102
• libavdevice 56. 3.100
• libavfilter 5. 2.103
• libswscale 3. 1.101
• libswresample 1. 1.100
• libpostproc 53. 3.100
Important API changes since 2.4:
• avpriv_dv_frame_profile2() has been deprecated
Please refer to the doc/APIchanges file for more information.
┌────────────────────────────┐
│ ★ List of New Features │
└────────────────────────────┘
┌────────────────────────────┐
│ ffprobe │
└────────────────────────────┘
• -show_pixel_formats option
┌────────────────────────────┐
│ ffserver │
└────────────────────────────┘
• codec private options support
┌────────────────────────────┐
│ libavcodec │
└────────────────────────────┘
• STL subtitle decoder
• libutvideo YUV 4:2:2 10bit support
• animated WebP decoding support
• zygoaudio decoding support
• APNG decoder
┌────────────────────────────┐
│ libavdevice │
└────────────────────────────┘
• XCB-based screen-grabber
• AVFoundation screen capturing support
┌────────────────────────────┐
│ libavformat │
└────────────────────────────┘
• HEVC/H.265 RTP payload format (draft v6) packetizer
• SUP/PGS subtitle demuxer
• STL subtitle demuxer
• UDP-Lite support (RFC 3828)
• MPEG-DASH segmenting muxer, which allows creating DASH compatible
fragmented MP4
• WebP muxer
• APNG demuxer
┌────────────────────────────┐
│ libavfilter │
└────────────────────────────┘
• xBR scaling filter
┌────────────────────────────┐
│ libavutil │
└────────────────────────────┘
• CAST128 symmetric block cipher, ECB mode
┌────────────────────────────┐
│ libpostproc │
└────────────────────────────┘
• visualization support

View File

@ -5,13 +5,11 @@ OBJS-$(HAVE_VFP) += $(VFP-OBJS) $(VFP-OBJS-yes)
OBJS-$(HAVE_NEON) += $(NEON-OBJS) $(NEON-OBJS-yes) OBJS-$(HAVE_NEON) += $(NEON-OBJS) $(NEON-OBJS-yes)
OBJS-$(HAVE_MIPSFPU) += $(MIPSFPU-OBJS) $(MIPSFPU-OBJS-yes) OBJS-$(HAVE_MIPSFPU) += $(MIPSFPU-OBJS) $(MIPSFPU-OBJS-yes)
OBJS-$(HAVE_MIPSDSP) += $(MIPSDSP-OBJS) $(MIPSDSP-OBJS-yes) OBJS-$(HAVE_MIPS32R2) += $(MIPS32R2-OBJS) $(MIPS32R2-OBJS-yes)
OBJS-$(HAVE_MIPSDSPR1) += $(MIPSDSPR1-OBJS) $(MIPSDSPR1-OBJS-yes)
OBJS-$(HAVE_MIPSDSPR2) += $(MIPSDSPR2-OBJS) $(MIPSDSPR2-OBJS-yes) OBJS-$(HAVE_MIPSDSPR2) += $(MIPSDSPR2-OBJS) $(MIPSDSPR2-OBJS-yes)
OBJS-$(HAVE_MSA) += $(MSA-OBJS) $(MSA-OBJS-yes)
OBJS-$(HAVE_MMI) += $(MMI-OBJS) $(MMI-OBJS-yes)
OBJS-$(HAVE_ALTIVEC) += $(ALTIVEC-OBJS) $(ALTIVEC-OBJS-yes) OBJS-$(HAVE_ALTIVEC) += $(ALTIVEC-OBJS) $(ALTIVEC-OBJS-yes)
OBJS-$(HAVE_VSX) += $(VSX-OBJS) $(VSX-OBJS-yes)
OBJS-$(HAVE_MMX) += $(MMX-OBJS) $(MMX-OBJS-yes) OBJS-$(HAVE_MMX) += $(MMX-OBJS) $(MMX-OBJS-yes)
OBJS-$(HAVE_YASM) += $(YASM-OBJS) $(YASM-OBJS-yes) OBJS-$(HAVE_YASM) += $(YASM-OBJS) $(YASM-OBJS-yes)

View File

@ -41,10 +41,8 @@
#include "libavutil/avassert.h" #include "libavutil/avassert.h"
#include "libavutil/avstring.h" #include "libavutil/avstring.h"
#include "libavutil/bprint.h" #include "libavutil/bprint.h"
#include "libavutil/display.h"
#include "libavutil/mathematics.h" #include "libavutil/mathematics.h"
#include "libavutil/imgutils.h" #include "libavutil/imgutils.h"
#include "libavutil/libm.h"
#include "libavutil/parseutils.h" #include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h" #include "libavutil/pixdesc.h"
#include "libavutil/eval.h" #include "libavutil/eval.h"
@ -52,7 +50,6 @@
#include "libavutil/opt.h" #include "libavutil/opt.h"
#include "libavutil/cpu.h" #include "libavutil/cpu.h"
#include "libavutil/ffversion.h" #include "libavutil/ffversion.h"
#include "libavutil/version.h"
#include "cmdutils.h" #include "cmdutils.h"
#if CONFIG_NETWORK #if CONFIG_NETWORK
#include "libavformat/network.h" #include "libavformat/network.h"
@ -64,7 +61,7 @@
static int init_report(const char *env); static int init_report(const char *env);
AVDictionary *sws_dict; struct SwsContext *sws_opts;
AVDictionary *swr_opts; AVDictionary *swr_opts;
AVDictionary *format_opts, *codec_opts, *resample_opts; AVDictionary *format_opts, *codec_opts, *resample_opts;
@ -74,13 +71,20 @@ int hide_banner = 0;
void init_opts(void) void init_opts(void)
{ {
av_dict_set(&sws_dict, "flags", "bicubic", 0);
if(CONFIG_SWSCALE)
sws_opts = sws_getContext(16, 16, 0, 16, 16, 0, SWS_BICUBIC,
NULL, NULL, NULL);
} }
void uninit_opts(void) void uninit_opts(void)
{ {
#if CONFIG_SWSCALE
sws_freeContext(sws_opts);
sws_opts = NULL;
#endif
av_dict_free(&swr_opts); av_dict_free(&swr_opts);
av_dict_free(&sws_dict);
av_dict_free(&format_opts); av_dict_free(&format_opts);
av_dict_free(&codec_opts); av_dict_free(&codec_opts);
av_dict_free(&resample_opts); av_dict_free(&resample_opts);
@ -286,14 +290,10 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
if (po->flags & OPT_SPEC) { if (po->flags & OPT_SPEC) {
SpecifierOpt **so = dst; SpecifierOpt **so = dst;
char *p = strchr(opt, ':'); char *p = strchr(opt, ':');
char *str;
dstcount = (int *)(so + 1); dstcount = (int *)(so + 1);
*so = grow_array(*so, sizeof(**so), dstcount, *dstcount + 1); *so = grow_array(*so, sizeof(**so), dstcount, *dstcount + 1);
str = av_strdup(p ? p + 1 : ""); (*so)[*dstcount - 1].specifier = av_strdup(p ? p + 1 : "");
if (!str)
return AVERROR(ENOMEM);
(*so)[*dstcount - 1].specifier = str;
dst = &(*so)[*dstcount - 1].u; dst = &(*so)[*dstcount - 1].u;
} }
@ -301,8 +301,6 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
char *str; char *str;
str = av_strdup(arg); str = av_strdup(arg);
av_freep(dst); av_freep(dst);
if (!str)
return AVERROR(ENOMEM);
*(char **)dst = str; *(char **)dst = str;
} else if (po->flags & OPT_BOOL || po->flags & OPT_INT) { } else if (po->flags & OPT_BOOL || po->flags & OPT_INT) {
*(int *)dst = parse_number_or_die(opt, arg, OPT_INT64, INT_MIN, INT_MAX); *(int *)dst = parse_number_or_die(opt, arg, OPT_INT64, INT_MIN, INT_MAX);
@ -476,22 +474,10 @@ static void dump_argument(const char *a)
fputc('"', report_file); fputc('"', report_file);
} }
static void check_options(const OptionDef *po)
{
while (po->name) {
if (po->flags & OPT_PERFILE)
av_assert0(po->flags & (OPT_INPUT | OPT_OUTPUT));
po++;
}
}
void parse_loglevel(int argc, char **argv, const OptionDef *options) void parse_loglevel(int argc, char **argv, const OptionDef *options)
{ {
int idx = locate_option(argc, argv, options, "loglevel"); int idx = locate_option(argc, argv, options, "loglevel");
const char *env; const char *env;
check_options(options);
if (!idx) if (!idx)
idx = locate_option(argc, argv, options, "v"); idx = locate_option(argc, argv, options, "v");
if (idx && argv[idx + 1]) if (idx && argv[idx + 1])
@ -523,7 +509,7 @@ static const AVOption *opt_find(void *obj, const char *name, const char *unit,
return o; return o;
} }
#define FLAGS (o->type == AV_OPT_TYPE_FLAGS && (arg[0]=='-' || arg[0]=='+')) ? AV_DICT_APPEND : 0 #define FLAGS (o->type == AV_OPT_TYPE_FLAGS) ? AV_DICT_APPEND : 0
int opt_default(void *optctx, const char *opt, const char *arg) int opt_default(void *optctx, const char *opt, const char *arg)
{ {
const AVOption *o; const AVOption *o;
@ -534,12 +520,7 @@ int opt_default(void *optctx, const char *opt, const char *arg)
#if CONFIG_AVRESAMPLE #if CONFIG_AVRESAMPLE
const AVClass *rc = avresample_get_class(); const AVClass *rc = avresample_get_class();
#endif #endif
#if CONFIG_SWSCALE const AVClass *sc, *swr_class;
const AVClass *sc = sws_get_class();
#endif
#if CONFIG_SWRESAMPLE
const AVClass *swr_class = swr_get_class();
#endif
if (!strcmp(opt, "debug") || !strcmp(opt, "fdebug")) if (!strcmp(opt, "debug") || !strcmp(opt, "fdebug"))
av_log_set_level(AV_LOG_DEBUG); av_log_set_level(AV_LOG_DEBUG);
@ -563,24 +544,15 @@ int opt_default(void *optctx, const char *opt, const char *arg)
consumed = 1; consumed = 1;
} }
#if CONFIG_SWSCALE #if CONFIG_SWSCALE
if (!consumed && (o = opt_find(&sc, opt, NULL, 0, sc = sws_get_class();
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) { if (!consumed && opt_find(&sc, opt, NULL, 0,
struct SwsContext *sws = sws_alloc_context(); AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ)) {
int ret = av_opt_set(sws, opt, arg, 0); // XXX we only support sws_flags, not arbitrary sws options
sws_freeContext(sws); int ret = av_opt_set(sws_opts, opt, arg, 0);
if (!strcmp(opt, "srcw") || !strcmp(opt, "srch") ||
!strcmp(opt, "dstw") || !strcmp(opt, "dsth") ||
!strcmp(opt, "src_format") || !strcmp(opt, "dst_format")) {
av_log(NULL, AV_LOG_ERROR, "Directly using swscale dimensions/format options is not supported, please use the -s or -pix_fmt options\n");
return AVERROR(EINVAL);
}
if (ret < 0) { if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", opt); av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", opt);
return ret; return ret;
} }
av_dict_set(&sws_dict, opt, arg, FLAGS);
consumed = 1; consumed = 1;
} }
#else #else
@ -590,6 +562,7 @@ int opt_default(void *optctx, const char *opt, const char *arg)
} }
#endif #endif
#if CONFIG_SWRESAMPLE #if CONFIG_SWRESAMPLE
swr_class = swr_get_class();
if (!consumed && (o=opt_find(&swr_class, opt, NULL, 0, if (!consumed && (o=opt_find(&swr_class, opt, NULL, 0,
AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) { AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {
struct SwrContext *swr = swr_alloc(); struct SwrContext *swr = swr_alloc();
@ -653,7 +626,9 @@ static void finish_group(OptionParseContext *octx, int group_idx,
*g = octx->cur_group; *g = octx->cur_group;
g->arg = arg; g->arg = arg;
g->group_def = l->group_def; g->group_def = l->group_def;
g->sws_dict = sws_dict; #if CONFIG_SWSCALE
g->sws_opts = sws_opts;
#endif
g->swr_opts = swr_opts; g->swr_opts = swr_opts;
g->codec_opts = codec_opts; g->codec_opts = codec_opts;
g->format_opts = format_opts; g->format_opts = format_opts;
@ -662,7 +637,9 @@ static void finish_group(OptionParseContext *octx, int group_idx,
codec_opts = NULL; codec_opts = NULL;
format_opts = NULL; format_opts = NULL;
resample_opts = NULL; resample_opts = NULL;
sws_dict = NULL; #if CONFIG_SWSCALE
sws_opts = NULL;
#endif
swr_opts = NULL; swr_opts = NULL;
init_opts(); init_opts();
@ -718,8 +695,9 @@ void uninit_parse_context(OptionParseContext *octx)
av_dict_free(&l->groups[j].codec_opts); av_dict_free(&l->groups[j].codec_opts);
av_dict_free(&l->groups[j].format_opts); av_dict_free(&l->groups[j].format_opts);
av_dict_free(&l->groups[j].resample_opts); av_dict_free(&l->groups[j].resample_opts);
#if CONFIG_SWSCALE
av_dict_free(&l->groups[j].sws_dict); sws_freeContext(l->groups[j].sws_opts);
#endif
av_dict_free(&l->groups[j].swr_opts); av_dict_free(&l->groups[j].swr_opts);
} }
av_freep(&l->groups); av_freep(&l->groups);
@ -861,7 +839,6 @@ int opt_loglevel(void *optctx, const char *opt, const char *arg)
{ "info" , AV_LOG_INFO }, { "info" , AV_LOG_INFO },
{ "verbose", AV_LOG_VERBOSE }, { "verbose", AV_LOG_VERBOSE },
{ "debug" , AV_LOG_DEBUG }, { "debug" , AV_LOG_DEBUG },
{ "trace" , AV_LOG_TRACE },
}; };
char *tail; char *tail;
int level; int level;
@ -1059,8 +1036,7 @@ static int warned_cfg = 0;
LIB##LIBNAME##_VERSION_MAJOR, \ LIB##LIBNAME##_VERSION_MAJOR, \
LIB##LIBNAME##_VERSION_MINOR, \ LIB##LIBNAME##_VERSION_MINOR, \
LIB##LIBNAME##_VERSION_MICRO, \ LIB##LIBNAME##_VERSION_MICRO, \
AV_VERSION_MAJOR(version), AV_VERSION_MINOR(version),\ version >> 16, version >> 8 & 0xff, version & 0xff); \
AV_VERSION_MICRO(version)); \
} \ } \
if (flags & SHOW_CONFIG) { \ if (flags & SHOW_CONFIG) { \
const char *cfg = libname##_configuration(); \ const char *cfg = libname##_configuration(); \
@ -1079,15 +1055,15 @@ static int warned_cfg = 0;
static void print_all_libs_info(int flags, int level) static void print_all_libs_info(int flags, int level)
{ {
PRINT_LIB_INFO(avutil, AVUTIL, flags, level); PRINT_LIB_INFO(avutil, AVUTIL, flags, level);
PRINT_LIB_INFO(avcodec, AVCODEC, flags, level); PRINT_LIB_INFO(avcodec, AVCODEC, flags, level);
PRINT_LIB_INFO(avformat, AVFORMAT, flags, level); PRINT_LIB_INFO(avformat, AVFORMAT, flags, level);
PRINT_LIB_INFO(avdevice, AVDEVICE, flags, level); PRINT_LIB_INFO(avdevice, AVDEVICE, flags, level);
PRINT_LIB_INFO(avfilter, AVFILTER, flags, level); PRINT_LIB_INFO(avfilter, AVFILTER, flags, level);
PRINT_LIB_INFO(avresample, AVRESAMPLE, flags, level); PRINT_LIB_INFO(avresample, AVRESAMPLE, flags, level);
PRINT_LIB_INFO(swscale, SWSCALE, flags, level); PRINT_LIB_INFO(swscale, SWSCALE, flags, level);
PRINT_LIB_INFO(swresample, SWRESAMPLE, flags, level); PRINT_LIB_INFO(swresample,SWRESAMPLE, flags, level);
PRINT_LIB_INFO(postproc, POSTPROC, flags, level); PRINT_LIB_INFO(postproc, POSTPROC, flags, level);
} }
static void print_program_info(int flags, int level) static void print_program_info(int flags, int level)
@ -1099,7 +1075,8 @@ static void print_program_info(int flags, int level)
av_log(NULL, level, " Copyright (c) %d-%d the FFmpeg developers", av_log(NULL, level, " Copyright (c) %d-%d the FFmpeg developers",
program_birth_year, CONFIG_THIS_YEAR); program_birth_year, CONFIG_THIS_YEAR);
av_log(NULL, level, "\n"); av_log(NULL, level, "\n");
av_log(NULL, level, "%sbuilt with %s\n", indent, CC_IDENT); av_log(NULL, level, "%sbuilt on %s %s with %s\n",
indent, __DATE__, __TIME__, CC_IDENT);
av_log(NULL, level, "%sconfiguration: " FFMPEG_CONFIGURATION "\n", indent); av_log(NULL, level, "%sconfiguration: " FFMPEG_CONFIGURATION "\n", indent);
} }
@ -1236,7 +1213,12 @@ static int is_device(const AVClass *avclass)
{ {
if (!avclass) if (!avclass)
return 0; return 0;
return AV_IS_INPUT_DEVICE(avclass->category) || AV_IS_OUTPUT_DEVICE(avclass->category); return avclass->category == AV_CLASS_CATEGORY_DEVICE_VIDEO_OUTPUT ||
avclass->category == AV_CLASS_CATEGORY_DEVICE_VIDEO_INPUT ||
avclass->category == AV_CLASS_CATEGORY_DEVICE_AUDIO_OUTPUT ||
avclass->category == AV_CLASS_CATEGORY_DEVICE_AUDIO_INPUT ||
avclass->category == AV_CLASS_CATEGORY_DEVICE_OUTPUT ||
avclass->category == AV_CLASS_CATEGORY_DEVICE_INPUT;
} }
static int show_formats_devices(void *optctx, const char *opt, const char *arg, int device_only) static int show_formats_devices(void *optctx, const char *opt, const char *arg, int device_only)
@ -1324,47 +1306,16 @@ static void print_codec(const AVCodec *c)
printf("%s %s [%s]:\n", encoder ? "Encoder" : "Decoder", c->name, printf("%s %s [%s]:\n", encoder ? "Encoder" : "Decoder", c->name,
c->long_name ? c->long_name : ""); c->long_name ? c->long_name : "");
printf(" General capabilities: ");
if (c->capabilities & AV_CODEC_CAP_DRAW_HORIZ_BAND)
printf("horizband ");
if (c->capabilities & AV_CODEC_CAP_DR1)
printf("dr1 ");
if (c->capabilities & AV_CODEC_CAP_TRUNCATED)
printf("trunc ");
if (c->capabilities & AV_CODEC_CAP_DELAY)
printf("delay ");
if (c->capabilities & AV_CODEC_CAP_SMALL_LAST_FRAME)
printf("small ");
if (c->capabilities & AV_CODEC_CAP_SUBFRAMES)
printf("subframes ");
if (c->capabilities & AV_CODEC_CAP_EXPERIMENTAL)
printf("exp ");
if (c->capabilities & AV_CODEC_CAP_CHANNEL_CONF)
printf("chconf ");
if (c->capabilities & AV_CODEC_CAP_PARAM_CHANGE)
printf("paramchange ");
if (c->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE)
printf("variable ");
if (c->capabilities & (AV_CODEC_CAP_FRAME_THREADS |
AV_CODEC_CAP_SLICE_THREADS |
AV_CODEC_CAP_AUTO_THREADS))
printf("threads ");
if (!c->capabilities)
printf("none");
printf("\n");
if (c->type == AVMEDIA_TYPE_VIDEO || if (c->type == AVMEDIA_TYPE_VIDEO ||
c->type == AVMEDIA_TYPE_AUDIO) { c->type == AVMEDIA_TYPE_AUDIO) {
printf(" Threading capabilities: "); printf(" Threading capabilities: ");
switch (c->capabilities & (AV_CODEC_CAP_FRAME_THREADS | switch (c->capabilities & (CODEC_CAP_FRAME_THREADS |
AV_CODEC_CAP_SLICE_THREADS | CODEC_CAP_SLICE_THREADS)) {
AV_CODEC_CAP_AUTO_THREADS)) { case CODEC_CAP_FRAME_THREADS |
case AV_CODEC_CAP_FRAME_THREADS | CODEC_CAP_SLICE_THREADS: printf("frame and slice"); break;
AV_CODEC_CAP_SLICE_THREADS: printf("frame and slice"); break; case CODEC_CAP_FRAME_THREADS: printf("frame"); break;
case AV_CODEC_CAP_FRAME_THREADS: printf("frame"); break; case CODEC_CAP_SLICE_THREADS: printf("slice"); break;
case AV_CODEC_CAP_SLICE_THREADS: printf("slice"); break; default: printf("no"); break;
case AV_CODEC_CAP_AUTO_THREADS : printf("auto"); break;
default: printf("none"); break;
} }
printf("\n"); printf("\n");
} }
@ -1423,7 +1374,7 @@ static int compare_codec_desc(const void *a, const void *b)
const AVCodecDescriptor * const *da = a; const AVCodecDescriptor * const *da = a;
const AVCodecDescriptor * const *db = b; const AVCodecDescriptor * const *db = b;
return (*da)->type != (*db)->type ? FFDIFFSIGN((*da)->type, (*db)->type) : return (*da)->type != (*db)->type ? (*da)->type - (*db)->type :
strcmp((*da)->name, (*db)->name); strcmp((*da)->name, (*db)->name);
} }
@ -1537,11 +1488,11 @@ static void print_codecs(int encoder)
while ((codec = next_codec_for_id(desc->id, codec, encoder))) { while ((codec = next_codec_for_id(desc->id, codec, encoder))) {
printf(" %c", get_media_type_char(desc->type)); printf(" %c", get_media_type_char(desc->type));
printf((codec->capabilities & AV_CODEC_CAP_FRAME_THREADS) ? "F" : "."); printf((codec->capabilities & CODEC_CAP_FRAME_THREADS) ? "F" : ".");
printf((codec->capabilities & AV_CODEC_CAP_SLICE_THREADS) ? "S" : "."); printf((codec->capabilities & CODEC_CAP_SLICE_THREADS) ? "S" : ".");
printf((codec->capabilities & AV_CODEC_CAP_EXPERIMENTAL) ? "X" : "."); printf((codec->capabilities & CODEC_CAP_EXPERIMENTAL) ? "X" : ".");
printf((codec->capabilities & AV_CODEC_CAP_DRAW_HORIZ_BAND)?"B" : "."); printf((codec->capabilities & CODEC_CAP_DRAW_HORIZ_BAND)?"B" : ".");
printf((codec->capabilities & AV_CODEC_CAP_DR1) ? "D" : "."); printf((codec->capabilities & CODEC_CAP_DR1) ? "D" : ".");
printf(" %-20s %s", codec->name, codec->long_name ? codec->long_name : ""); printf(" %-20s %s", codec->name, codec->long_name ? codec->long_name : "");
if (strcmp(codec->name, desc->name)) if (strcmp(codec->name, desc->name))
@ -1584,10 +1535,10 @@ int show_protocols(void *optctx, const char *opt, const char *arg)
printf("Supported file protocols:\n" printf("Supported file protocols:\n"
"Input:\n"); "Input:\n");
while ((name = avio_enum_protocols(&opaque, 0))) while ((name = avio_enum_protocols(&opaque, 0)))
printf(" %s\n", name); printf("%s\n", name);
printf("Output:\n"); printf("Output:\n");
while ((name = avio_enum_protocols(&opaque, 1))) while ((name = avio_enum_protocols(&opaque, 1)))
printf(" %s\n", name); printf("%s\n", name);
return 0; return 0;
} }
@ -1602,7 +1553,7 @@ int show_filters(void *optctx, const char *opt, const char *arg)
printf("Filters:\n" printf("Filters:\n"
" T.. = Timeline support\n" " T.. = Timeline support\n"
" .S. = Slice threading\n" " .S. = Slice threading\n"
" ..C = Command support\n" " ..C = Commmand support\n"
" A = Audio input/output\n" " A = Audio input/output\n"
" V = Video input/output\n" " V = Video input/output\n"
" N = Dynamic number and/or type of input/output\n" " N = Dynamic number and/or type of input/output\n"
@ -1615,17 +1566,17 @@ int show_filters(void *optctx, const char *opt, const char *arg)
*(descr_cur++) = '>'; *(descr_cur++) = '>';
} }
pad = i ? filter->outputs : filter->inputs; pad = i ? filter->outputs : filter->inputs;
for (j = 0; pad && avfilter_pad_get_name(pad, j); j++) { for (j = 0; pad && pad[j].name; j++) {
if (descr_cur >= descr + sizeof(descr) - 4) if (descr_cur >= descr + sizeof(descr) - 4)
break; break;
*(descr_cur++) = get_media_type_char(avfilter_pad_get_type(pad, j)); *(descr_cur++) = get_media_type_char(pad[j].type);
} }
if (!j) if (!j)
*(descr_cur++) = ((!i && (filter->flags & AVFILTER_FLAG_DYNAMIC_INPUTS)) || *(descr_cur++) = ((!i && (filter->flags & AVFILTER_FLAG_DYNAMIC_INPUTS)) ||
( i && (filter->flags & AVFILTER_FLAG_DYNAMIC_OUTPUTS))) ? 'N' : '|'; ( i && (filter->flags & AVFILTER_FLAG_DYNAMIC_OUTPUTS))) ? 'N' : '|';
} }
*descr_cur = 0; *descr_cur = 0;
printf(" %c%c%c %-17s %-10s %s\n", printf(" %c%c%c %-16s %-10s %s\n",
filter->flags & AVFILTER_FLAG_SUPPORT_TIMELINE ? 'T' : '.', filter->flags & AVFILTER_FLAG_SUPPORT_TIMELINE ? 'T' : '.',
filter->flags & AVFILTER_FLAG_SLICE_THREADS ? 'S' : '.', filter->flags & AVFILTER_FLAG_SLICE_THREADS ? 'S' : '.',
filter->process_command ? 'C' : '.', filter->process_command ? 'C' : '.',
@ -1870,8 +1821,6 @@ int show_help(void *optctx, const char *opt, const char *arg)
av_log_set_callback(log_callback_help); av_log_set_callback(log_callback_help);
topic = av_strdup(arg ? arg : ""); topic = av_strdup(arg ? arg : "");
if (!topic)
return AVERROR(ENOMEM);
par = strchr(topic, '='); par = strchr(topic, '=');
if (par) if (par)
*par++ = 0; *par++ = 0;
@ -1909,6 +1858,50 @@ int read_yesno(void)
return yesno; return yesno;
} }
int cmdutils_read_file(const char *filename, char **bufptr, size_t *size)
{
int64_t ret;
FILE *f = av_fopen_utf8(filename, "rb");
if (!f) {
ret = AVERROR(errno);
av_log(NULL, AV_LOG_ERROR, "Cannot read file '%s': %s\n", filename,
strerror(errno));
return ret;
}
fseek(f, 0, SEEK_END);
*size = ftell(f);
fseek(f, 0, SEEK_SET);
if (*size == (size_t)-1) {
ret = AVERROR(errno);
av_log(NULL, AV_LOG_ERROR, "IO error: %s\n", strerror(errno));
fclose(f);
return ret;
}
*bufptr = av_malloc(*size + 1);
if (!*bufptr) {
av_log(NULL, AV_LOG_ERROR, "Could not allocate file buffer\n");
fclose(f);
return AVERROR(ENOMEM);
}
ret = fread(*bufptr, 1, *size, f);
if (ret < *size) {
av_free(*bufptr);
if (ferror(f)) {
ret = AVERROR(errno);
av_log(NULL, AV_LOG_ERROR, "Error while reading file '%s': %s\n",
filename, strerror(errno));
} else
ret = AVERROR_EOF;
} else {
ret = 0;
(*bufptr)[(*size)++] = '\0';
}
fclose(f);
return ret;
}
FILE *get_preset_file(char *filename, size_t filename_size, FILE *get_preset_file(char *filename, size_t filename_size,
const char *preset_name, int is_path, const char *preset_name, int is_path,
const char *codec_name) const char *codec_name)
@ -2051,7 +2044,7 @@ void *grow_array(void *array, int elem_size, int *size, int new_size)
exit_program(1); exit_program(1);
} }
if (*size < new_size) { if (*size < new_size) {
uint8_t *tmp = av_realloc_array(array, new_size, elem_size); uint8_t *tmp = av_realloc(array, new_size*elem_size);
if (!tmp) { if (!tmp) {
av_log(NULL, AV_LOG_ERROR, "Could not alloc buffer.\n"); av_log(NULL, AV_LOG_ERROR, "Could not alloc buffer.\n");
exit_program(1); exit_program(1);
@ -2063,38 +2056,13 @@ void *grow_array(void *array, int elem_size, int *size, int new_size)
return array; return array;
} }
double get_rotation(AVStream *st)
{
AVDictionaryEntry *rotate_tag = av_dict_get(st->metadata, "rotate", NULL, 0);
uint8_t* displaymatrix = av_stream_get_side_data(st,
AV_PKT_DATA_DISPLAYMATRIX, NULL);
double theta = 0;
if (rotate_tag && *rotate_tag->value && strcmp(rotate_tag->value, "0")) {
char *tail;
theta = av_strtod(rotate_tag->value, &tail);
if (*tail)
theta = 0;
}
if (displaymatrix && !theta)
theta = -av_display_rotation_get((int32_t*) displaymatrix);
theta -= 360*floor(theta/360 + 0.9/360);
if (fabs(theta - 90*round(theta/90)) > 2)
av_log(NULL, AV_LOG_WARNING, "Odd rotation angle.\n"
"If you want to help, upload a sample "
"of this file to ftp://upload.ffmpeg.org/incoming/ "
"and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)");
return theta;
}
#if CONFIG_AVDEVICE #if CONFIG_AVDEVICE
static int print_device_sources(AVInputFormat *fmt, AVDictionary *opts) static int print_device_sources(AVInputFormat *fmt, AVDictionary *opts)
{ {
int ret, i; int ret, i;
AVFormatContext *dev = NULL;
AVDeviceInfoList *device_list = NULL; AVDeviceInfoList *device_list = NULL;
AVDictionary *tmp_opts = NULL;
if (!fmt || !fmt->priv_class || !AV_IS_INPUT_DEVICE(fmt->priv_class->category)) if (!fmt || !fmt->priv_class || !AV_IS_INPUT_DEVICE(fmt->priv_class->category))
return AVERROR(EINVAL); return AVERROR(EINVAL);
@ -2106,7 +2074,15 @@ static int print_device_sources(AVInputFormat *fmt, AVDictionary *opts)
goto fail; goto fail;
} }
if ((ret = avdevice_list_input_sources(fmt, NULL, opts, &device_list)) < 0) { /* TODO: avformat_open_input calls read_header callback which is not necessary.
Function like avformat_alloc_output_context2 for input could be helpful here. */
av_dict_copy(&tmp_opts, opts, 0);
if ((ret = avformat_open_input(&dev, NULL, fmt, &tmp_opts)) < 0) {
printf("Cannot open device: %s.\n", fmt->name);
goto fail;
}
if ((ret = avdevice_list_devices(dev, &device_list)) < 0) {
printf("Cannot list sources.\n"); printf("Cannot list sources.\n");
goto fail; goto fail;
} }
@ -2117,14 +2093,18 @@ static int print_device_sources(AVInputFormat *fmt, AVDictionary *opts)
} }
fail: fail:
av_dict_free(&tmp_opts);
avdevice_free_list_devices(&device_list); avdevice_free_list_devices(&device_list);
avformat_close_input(&dev);
return ret; return ret;
} }
static int print_device_sinks(AVOutputFormat *fmt, AVDictionary *opts) static int print_device_sinks(AVOutputFormat *fmt, AVDictionary *opts)
{ {
int ret, i; int ret, i;
AVFormatContext *dev = NULL;
AVDeviceInfoList *device_list = NULL; AVDeviceInfoList *device_list = NULL;
AVDictionary *tmp_opts = NULL;
if (!fmt || !fmt->priv_class || !AV_IS_OUTPUT_DEVICE(fmt->priv_class->category)) if (!fmt || !fmt->priv_class || !AV_IS_OUTPUT_DEVICE(fmt->priv_class->category))
return AVERROR(EINVAL); return AVERROR(EINVAL);
@ -2136,7 +2116,14 @@ static int print_device_sinks(AVOutputFormat *fmt, AVDictionary *opts)
goto fail; goto fail;
} }
if ((ret = avdevice_list_output_sinks(fmt, NULL, opts, &device_list)) < 0) { if ((ret = avformat_alloc_output_context2(&dev, fmt, NULL, NULL)) < 0) {
printf("Cannot open device: %s.\n", fmt->name);
goto fail;
}
av_dict_copy(&tmp_opts, opts, 0);
av_opt_set_dict2(dev, &tmp_opts, AV_OPT_SEARCH_CHILDREN);
if ((ret = avdevice_list_devices(dev, &device_list)) < 0) {
printf("Cannot list sinks.\n"); printf("Cannot list sinks.\n");
goto fail; goto fail;
} }
@ -2147,7 +2134,9 @@ static int print_device_sinks(AVOutputFormat *fmt, AVDictionary *opts)
} }
fail: fail:
av_dict_free(&tmp_opts);
avdevice_free_list_devices(&device_list); avdevice_free_list_devices(&device_list);
avformat_free_context(dev);
return ret; return ret;
} }
@ -2191,7 +2180,7 @@ int show_sources(void *optctx, const char *opt, const char *arg)
if (fmt) { if (fmt) {
if (!strcmp(fmt->name, "lavfi")) if (!strcmp(fmt->name, "lavfi"))
continue; //it's pointless to probe lavfi continue; //it's pointless to probe lavfi
if (dev && !av_match_name(dev, fmt->name)) if (dev && strcmp(fmt->name, dev))
continue; continue;
print_device_sources(fmt, opts); print_device_sources(fmt, opts);
} }
@ -2199,7 +2188,7 @@ int show_sources(void *optctx, const char *opt, const char *arg)
do { do {
fmt = av_input_video_device_next(fmt); fmt = av_input_video_device_next(fmt);
if (fmt) { if (fmt) {
if (dev && !av_match_name(dev, fmt->name)) if (dev && strcmp(fmt->name, dev))
continue; continue;
print_device_sources(fmt, opts); print_device_sources(fmt, opts);
} }
@ -2227,7 +2216,7 @@ int show_sinks(void *optctx, const char *opt, const char *arg)
do { do {
fmt = av_output_audio_device_next(fmt); fmt = av_output_audio_device_next(fmt);
if (fmt) { if (fmt) {
if (dev && !av_match_name(dev, fmt->name)) if (dev && strcmp(fmt->name, dev))
continue; continue;
print_device_sinks(fmt, opts); print_device_sinks(fmt, opts);
} }
@ -2235,7 +2224,7 @@ int show_sinks(void *optctx, const char *opt, const char *arg)
do { do {
fmt = av_output_video_device_next(fmt); fmt = av_output_video_device_next(fmt);
if (fmt) { if (fmt) {
if (dev && !av_match_name(dev, fmt->name)) if (dev && strcmp(fmt->name, dev))
continue; continue;
print_device_sinks(fmt, opts); print_device_sinks(fmt, opts);
} }
@ -2246,5 +2235,4 @@ int show_sinks(void *optctx, const char *opt, const char *arg)
av_log_set_level(error_level); av_log_set_level(error_level);
return ret; return ret;
} }
#endif #endif

View File

@ -19,8 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifndef CMDUTILS_H #ifndef FFMPEG_CMDUTILS_H
#define CMDUTILS_H #define FFMPEG_CMDUTILS_H
#include <stdint.h> #include <stdint.h>
@ -46,7 +46,7 @@ extern const int program_birth_year;
extern AVCodecContext *avcodec_opts[AVMEDIA_TYPE_NB]; extern AVCodecContext *avcodec_opts[AVMEDIA_TYPE_NB];
extern AVFormatContext *avformat_opts; extern AVFormatContext *avformat_opts;
extern AVDictionary *sws_dict; extern struct SwsContext *sws_opts;
extern AVDictionary *swr_opts; extern AVDictionary *swr_opts;
extern AVDictionary *format_opts, *codec_opts, *resample_opts; extern AVDictionary *format_opts, *codec_opts, *resample_opts;
extern int hide_banner; extern int hide_banner;
@ -277,7 +277,7 @@ typedef struct OptionGroup {
AVDictionary *codec_opts; AVDictionary *codec_opts;
AVDictionary *format_opts; AVDictionary *format_opts;
AVDictionary *resample_opts; AVDictionary *resample_opts;
AVDictionary *sws_dict; struct SwsContext *sws_opts;
AVDictionary *swr_opts; AVDictionary *swr_opts;
} OptionGroup; } OptionGroup;
@ -529,6 +529,18 @@ int show_colors(void *optctx, const char *opt, const char *arg);
*/ */
int read_yesno(void); int read_yesno(void);
/**
* Read the file with name filename, and put its content in a newly
* allocated 0-terminated buffer.
*
* @param filename file to read from
* @param bufptr location where pointer to buffer is returned
* @param size location where size of buffer is returned
* @return >= 0 in case of success, a negative value corresponding to an
* AVERROR error code in case of failure.
*/
int cmdutils_read_file(const char *filename, char **bufptr, size_t *size);
/** /**
* Get a file corresponding to a preset file. * Get a file corresponding to a preset file.
* *
@ -585,6 +597,4 @@ void *grow_array(void *array, int elem_size, int *size, int new_size);
char name[128];\ char name[128];\
av_get_channel_layout_string(name, sizeof(name), 0, ch_layout); av_get_channel_layout_string(name, sizeof(name), 0, ch_layout);
double get_rotation(AVStream *st);
#endif /* CMDUTILS_H */ #endif /* CMDUTILS_H */

View File

@ -206,9 +206,7 @@ end:
static int compare_ocl_device_desc(const void *a, const void *b) static int compare_ocl_device_desc(const void *a, const void *b)
{ {
const OpenCLDeviceBenchmark* va = (const OpenCLDeviceBenchmark*)a; return ((OpenCLDeviceBenchmark*)a)->runtime - ((OpenCLDeviceBenchmark*)b)->runtime;
const OpenCLDeviceBenchmark* vb = (const OpenCLDeviceBenchmark*)b;
return FFDIFFSIGN(va->runtime , vb->runtime);
} }
int opt_opencl_bench(void *optctx, const char *opt, const char *arg) int opt_opencl_bench(void *optctx, const char *opt, const char *arg)

View File

@ -5,20 +5,12 @@
# first so "all" becomes default target # first so "all" becomes default target
all: all-yes all: all-yes
DEFAULT_YASMD=.dbg
ifeq ($(DBG),1)
YASMD=$(DEFAULT_YASMD)
else
YASMD=
endif
ifndef SUBDIR ifndef SUBDIR
ifndef V ifndef V
Q = @ Q = @
ECHO = printf "$(1)\t%s\n" $(2) ECHO = printf "$(1)\t%s\n" $(2)
BRIEF = CC CXX OBJCC HOSTCC HOSTLD AS YASM AR LD STRIP CP WINDRES BRIEF = CC CXX HOSTCC HOSTLD AS YASM AR LD STRIP CP WINDRES
SILENT = DEPCC DEPHOSTCC DEPAS DEPYASM RANLIB RM SILENT = DEPCC DEPHOSTCC DEPAS DEPYASM RANLIB RM
MSG = $@ MSG = $@
@ -32,14 +24,12 @@ endif
ALLFFLIBS = avcodec avdevice avfilter avformat avresample avutil postproc swscale swresample ALLFFLIBS = avcodec avdevice avfilter avformat avresample avutil postproc swscale swresample
# NASM requires -I path terminated with / # NASM requires -I path terminated with /
IFLAGS := -I. -I$(SRC_LINK)/ IFLAGS := -I. -I$(SRC_PATH)/
CPPFLAGS := $(IFLAGS) $(CPPFLAGS) CPPFLAGS := $(IFLAGS) $(CPPFLAGS)
CFLAGS += $(ECFLAGS) CFLAGS += $(ECFLAGS)
CCFLAGS = $(CPPFLAGS) $(CFLAGS) CCFLAGS = $(CPPFLAGS) $(CFLAGS)
OBJCFLAGS += $(EOBJCFLAGS)
OBJCCFLAGS = $(CPPFLAGS) $(CFLAGS) $(OBJCFLAGS)
ASFLAGS := $(CPPFLAGS) $(ASFLAGS) ASFLAGS := $(CPPFLAGS) $(ASFLAGS)
CXXFLAGS := $(CPPFLAGS) $(CFLAGS) $(CXXFLAGS) CXXFLAGS += $(CPPFLAGS) $(CFLAGS)
YASMFLAGS += $(IFLAGS:%=%/) -Pconfig.asm YASMFLAGS += $(IFLAGS:%=%/) -Pconfig.asm
HOSTCCFLAGS = $(IFLAGS) $(HOSTCPPFLAGS) $(HOSTCFLAGS) HOSTCCFLAGS = $(IFLAGS) $(HOSTCPPFLAGS) $(HOSTCFLAGS)
@ -47,13 +37,12 @@ LDFLAGS := $(ALLFFLIBS:%=$(LD_PATH)lib%) $(LDFLAGS)
define COMPILE define COMPILE
$(call $(1)DEP,$(1)) $(call $(1)DEP,$(1))
$($(1)) $($(1)FLAGS) $($(1)_DEPFLAGS) $($(1)_C) $($(1)_O) $(patsubst $(SRC_PATH)/%,$(SRC_LINK)/%,$<) $($(1)) $($(1)FLAGS) $($(1)_DEPFLAGS) $($(1)_C) $($(1)_O) $<
endef endef
COMPILE_C = $(call COMPILE,CC) COMPILE_C = $(call COMPILE,CC)
COMPILE_CXX = $(call COMPILE,CXX) COMPILE_CXX = $(call COMPILE,CXX)
COMPILE_S = $(call COMPILE,AS) COMPILE_S = $(call COMPILE,AS)
COMPILE_M = $(call COMPILE,OBJCC)
COMPILE_HOSTC = $(call COMPILE,HOSTCC) COMPILE_HOSTC = $(call COMPILE,HOSTCC)
%.o: %.c %.o: %.c
@ -63,10 +52,10 @@ COMPILE_HOSTC = $(call COMPILE,HOSTCC)
$(COMPILE_CXX) $(COMPILE_CXX)
%.o: %.m %.o: %.m
$(COMPILE_M) $(COMPILE_C)
%.s: %.c %.s: %.c
$(CC) $(CCFLAGS) -S -o $@ $< $(CC) $(CPPFLAGS) $(CFLAGS) -S -o $@ $<
%.o: %.S %.o: %.S
$(COMPILE_S) $(COMPILE_S)
@ -83,7 +72,10 @@ COMPILE_HOSTC = $(call COMPILE,HOSTCC)
%.h.c: %.h.c:
$(Q)echo '#include "$*.h"' >$@ $(Q)echo '#include "$*.h"' >$@
%.c %.h %.ver: TAG = GEN %.ver: %.v
$(Q)sed 's/$$MAJOR/$($(basename $(@F))_VERSION_MAJOR)/' $^ > $@
%.c %.h: TAG = GEN
# Dummy rule to stop make trying to rebuild removed or renamed headers # Dummy rule to stop make trying to rebuild removed or renamed headers
%.h: %.h:
@ -109,8 +101,8 @@ FFEXTRALIBS := $(LDLIBS:%=$(LD_LIB)) $(EXTRALIBS)
OBJS := $(sort $(OBJS:%=$(SUBDIR)%)) OBJS := $(sort $(OBJS:%=$(SUBDIR)%))
SLIBOBJS := $(sort $(SLIBOBJS:%=$(SUBDIR)%)) SLIBOBJS := $(sort $(SLIBOBJS:%=$(SUBDIR)%))
TESTOBJS := $(TESTOBJS:%=$(SUBDIR)tests/%) $(TESTPROGS:%=$(SUBDIR)tests/%.o) TESTOBJS := $(TESTOBJS:%=$(SUBDIR)%) $(TESTPROGS:%=$(SUBDIR)%-test.o)
TESTPROGS := $(TESTPROGS:%=$(SUBDIR)tests/%$(EXESUF)) TESTPROGS := $(TESTPROGS:%=$(SUBDIR)%-test$(EXESUF))
HOSTOBJS := $(HOSTPROGS:%=$(SUBDIR)%.o) HOSTOBJS := $(HOSTPROGS:%=$(SUBDIR)%.o)
HOSTPROGS := $(HOSTPROGS:%=$(SUBDIR)%$(HOSTEXESUF)) HOSTPROGS := $(HOSTPROGS:%=$(SUBDIR)%$(HOSTEXESUF))
TOOLS += $(TOOLS-yes) TOOLS += $(TOOLS-yes)
@ -118,9 +110,8 @@ TOOLOBJS := $(TOOLS:%=tools/%.o)
TOOLS := $(TOOLS:%=tools/%$(EXESUF)) TOOLS := $(TOOLS:%=tools/%$(EXESUF))
HEADERS += $(HEADERS-yes) HEADERS += $(HEADERS-yes)
PATH_LIBNAME = $(foreach NAME,$(1),lib$(NAME)/$($(2)LIBNAME)) PATH_LIBNAME = $(foreach NAME,$(1),lib$(NAME)/$($(CONFIG_SHARED:yes=S)LIBNAME))
DEP_LIBS := $(foreach lib,$(FFLIBS),$(call PATH_LIBNAME,$(lib),$(CONFIG_SHARED:yes=S))) DEP_LIBS := $(foreach lib,$(FFLIBS),$(call PATH_LIBNAME,$(lib)))
STATIC_DEP_LIBS := $(foreach lib,$(FFLIBS),$(call PATH_LIBNAME,$(lib)))
SRC_DIR := $(SRC_PATH)/lib$(NAME) SRC_DIR := $(SRC_PATH)/lib$(NAME)
ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h)) ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
@ -147,15 +138,17 @@ $(TOOLOBJS): | tools
OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(SLIBOBJS) $(TESTOBJS)) OBJDIRS := $(OBJDIRS) $(dir $(OBJS) $(HOBJS) $(HOSTOBJS) $(SLIBOBJS) $(TESTOBJS))
CLEANSUFFIXES = *.d *.o *~ *.h.c *.gcda *.gcno *.map *.ver *.ho *$(DEFAULT_YASMD).asm CLEANSUFFIXES = *.d *.o *~ *.h.c *.map *.ver *.ho *.gcno *.gcda
DISTCLEANSUFFIXES = *.pc DISTCLEANSUFFIXES = *.pc
LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a
define RULES define RULES
clean:: clean::
$(RM) $(HOSTPROGS) $(TESTPROGS) $(TOOLS) $(RM) $(OBJS) $(OBJS:.o=.d)
$(RM) $(HOSTPROGS)
$(RM) $(TOOLS)
endef endef
$(eval $(RULES)) $(eval $(RULES))
-include $(wildcard $(OBJS:.o=.d) $(HOSTOBJS:.o=.d) $(TESTOBJS:.o=.d) $(HOBJS:.o=.d) $(SLIBOBJS:.o=.d)) $(OBJS:.o=$(DEFAULT_YASMD).d) -include $(wildcard $(OBJS:.o=.d) $(HOSTOBJS:.o=.d) $(TESTOBJS:.o=.d) $(HOBJS:.o=.d) $(SLIBOBJS:.o=.d))

View File

@ -19,8 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifndef COMPAT_AIX_MATH_H #ifndef FFMPEG_COMPAT_AIX_MATH_H
#define COMPAT_AIX_MATH_H #define FFMPEG_COMPAT_AIX_MATH_H
#define class class_in_math_h_causes_problems #define class class_in_math_h_causes_problems
@ -28,4 +28,4 @@
#undef class #undef class
#endif /* COMPAT_AIX_MATH_H */ #endif /* FFMPEG_COMPAT_AIX_MATH_H */

View File

@ -38,9 +38,40 @@
#ifndef __AVISYNTH_C__ #ifndef __AVISYNTH_C__
#define __AVISYNTH_C__ #define __AVISYNTH_C__
#include "avs/config.h" #ifdef __cplusplus
#include "avs/capi.h" # define EXTERN_C extern "C"
#include "avs/types.h" #else
# define EXTERN_C
#endif
#define AVSC_USE_STDCALL 1
#ifndef AVSC_USE_STDCALL
# define AVSC_CC __cdecl
#else
# define AVSC_CC __stdcall
#endif
#define AVSC_INLINE static __inline
#ifdef AVISYNTH_C_EXPORTS
# define AVSC_EXPORT EXTERN_C
# define AVSC_API(ret, name) EXTERN_C __declspec(dllexport) ret AVSC_CC name
#else
# define AVSC_EXPORT EXTERN_C __declspec(dllexport)
# ifndef AVSC_NO_DECLSPEC
# define AVSC_API(ret, name) EXTERN_C __declspec(dllimport) ret AVSC_CC name
# else
# define AVSC_API(ret, name) typedef ret (AVSC_CC *name##_func)
# endif
#endif
typedef unsigned char BYTE;
#ifdef __GNUC__
typedef long long int INT64;
#else
typedef __int64 INT64;
#endif
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
@ -48,8 +79,8 @@
// Constants // Constants
// //
#ifndef __AVISYNTH_6_H__ #ifndef __AVISYNTH_H__
enum { AVISYNTH_INTERFACE_VERSION = 6 }; enum { AVISYNTH_INTERFACE_VERSION = 4 };
#endif #endif
enum {AVS_SAMPLE_INT8 = 1<<0, enum {AVS_SAMPLE_INT8 = 1<<0,
@ -81,8 +112,8 @@ enum {AVS_CS_BGR = 1<<28,
AVS_CS_PLANAR = 1<<31, AVS_CS_PLANAR = 1<<31,
AVS_CS_SHIFT_SUB_WIDTH = 0, AVS_CS_SHIFT_SUB_WIDTH = 0,
AVS_CS_SHIFT_SUB_HEIGHT = 8, AVS_CS_SHIFT_SUB_HEIGHT = 1 << 3,
AVS_CS_SHIFT_SAMPLE_BITS = 16, AVS_CS_SHIFT_SAMPLE_BITS = 1 << 4,
AVS_CS_SUB_WIDTH_MASK = 7 << AVS_CS_SHIFT_SUB_WIDTH, AVS_CS_SUB_WIDTH_MASK = 7 << AVS_CS_SHIFT_SUB_WIDTH,
AVS_CS_SUB_WIDTH_1 = 3 << AVS_CS_SHIFT_SUB_WIDTH, // YV24 AVS_CS_SUB_WIDTH_1 = 3 << AVS_CS_SHIFT_SUB_WIDTH, // YV24
@ -149,66 +180,15 @@ enum { //SUBTYPES
AVS_FILTER_OUTPUT_TYPE_DIFFERENT=4}; AVS_FILTER_OUTPUT_TYPE_DIFFERENT=4};
enum { enum {
// New 2.6 explicitly defined cache hints. AVS_CACHE_NOTHING=0,
AVS_CACHE_NOTHING=10, // Do not cache video. AVS_CACHE_RANGE=1,
AVS_CACHE_WINDOW=11, // Hard protect upto X frames within a range of X from the current frame N. AVS_CACHE_ALL=2,
AVS_CACHE_GENERIC=12, // LRU cache upto X frames. AVS_CACHE_AUDIO=3,
AVS_CACHE_FORCE_GENERIC=13, // LRU cache upto X frames, override any previous CACHE_WINDOW. AVS_CACHE_AUDIO_NONE=4,
AVS_CACHE_AUDIO_AUTO=5
AVS_CACHE_GET_POLICY=30, // Get the current policy.
AVS_CACHE_GET_WINDOW=31, // Get the current window h_span.
AVS_CACHE_GET_RANGE=32, // Get the current generic frame range.
AVS_CACHE_AUDIO=50, // Explicitly do cache audio, X byte cache.
AVS_CACHE_AUDIO_NOTHING=51, // Explicitly do not cache audio.
AVS_CACHE_AUDIO_NONE=52, // Audio cache off (auto mode), X byte intial cache.
AVS_CACHE_AUDIO_AUTO=53, // Audio cache on (auto mode), X byte intial cache.
AVS_CACHE_GET_AUDIO_POLICY=70, // Get the current audio policy.
AVS_CACHE_GET_AUDIO_SIZE=71, // Get the current audio cache size.
AVS_CACHE_PREFETCH_FRAME=100, // Queue request to prefetch frame N.
AVS_CACHE_PREFETCH_GO=101, // Action video prefetches.
AVS_CACHE_PREFETCH_AUDIO_BEGIN=120, // Begin queue request transaction to prefetch audio (take critical section).
AVS_CACHE_PREFETCH_AUDIO_STARTLO=121, // Set low 32 bits of start.
AVS_CACHE_PREFETCH_AUDIO_STARTHI=122, // Set high 32 bits of start.
AVS_CACHE_PREFETCH_AUDIO_COUNT=123, // Set low 32 bits of length.
AVS_CACHE_PREFETCH_AUDIO_COMMIT=124, // Enqueue request transaction to prefetch audio (release critical section).
AVS_CACHE_PREFETCH_AUDIO_GO=125, // Action audio prefetches.
AVS_CACHE_GETCHILD_CACHE_MODE=200, // Cache ask Child for desired video cache mode.
AVS_CACHE_GETCHILD_CACHE_SIZE=201, // Cache ask Child for desired video cache size.
AVS_CACHE_GETCHILD_AUDIO_MODE=202, // Cache ask Child for desired audio cache mode.
AVS_CACHE_GETCHILD_AUDIO_SIZE=203, // Cache ask Child for desired audio cache size.
AVS_CACHE_GETCHILD_COST=220, // Cache ask Child for estimated processing cost.
AVS_CACHE_COST_ZERO=221, // Child response of zero cost (ptr arithmetic only).
AVS_CACHE_COST_UNIT=222, // Child response of unit cost (less than or equal 1 full frame blit).
AVS_CACHE_COST_LOW=223, // Child response of light cost. (Fast)
AVS_CACHE_COST_MED=224, // Child response of medium cost. (Real time)
AVS_CACHE_COST_HI=225, // Child response of heavy cost. (Slow)
AVS_CACHE_GETCHILD_THREAD_MODE=240, // Cache ask Child for thread safetyness.
AVS_CACHE_THREAD_UNSAFE=241, // Only 1 thread allowed for all instances. 2.5 filters default!
AVS_CACHE_THREAD_CLASS=242, // Only 1 thread allowed for each instance. 2.6 filters default!
AVS_CACHE_THREAD_SAFE=243, // Allow all threads in any instance.
AVS_CACHE_THREAD_OWN=244, // Safe but limit to 1 thread, internally threaded.
AVS_CACHE_GETCHILD_ACCESS_COST=260, // Cache ask Child for preferred access pattern.
AVS_CACHE_ACCESS_RAND=261, // Filter is access order agnostic.
AVS_CACHE_ACCESS_SEQ0=262, // Filter prefers sequential access (low cost)
AVS_CACHE_ACCESS_SEQ1=263, // Filter needs sequential access (high cost)
}; };
#ifdef BUILDING_AVSCORE #define AVS_FRAME_ALIGN 16
struct AVS_ScriptEnvironment {
IScriptEnvironment * env;
const char * error;
AVS_ScriptEnvironment(IScriptEnvironment * e = 0)
: env(e), error(0) {}
};
#endif
typedef struct AVS_Clip AVS_Clip; typedef struct AVS_Clip AVS_Clip;
typedef struct AVS_ScriptEnvironment AVS_ScriptEnvironment; typedef struct AVS_ScriptEnvironment AVS_ScriptEnvironment;
@ -258,23 +238,29 @@ AVSC_INLINE int avs_is_yuv(const AVS_VideoInfo * p)
AVSC_INLINE int avs_is_yuy2(const AVS_VideoInfo * p) AVSC_INLINE int avs_is_yuy2(const AVS_VideoInfo * p)
{ return (p->pixel_type & AVS_CS_YUY2) == AVS_CS_YUY2; } { return (p->pixel_type & AVS_CS_YUY2) == AVS_CS_YUY2; }
AVSC_API(int, avs_is_yv24)(const AVS_VideoInfo * p); AVSC_INLINE int avs_is_yv24(const AVS_VideoInfo * p)
{ return (p->pixel_type & AVS_CS_PLANAR_MASK) == (AVS_CS_YV24 & AVS_CS_PLANAR_FILTER); }
AVSC_API(int, avs_is_yv16)(const AVS_VideoInfo * p); AVSC_INLINE int avs_is_yv16(const AVS_VideoInfo * p)
{ return (p->pixel_type & AVS_CS_PLANAR_MASK) == (AVS_CS_YV16 & AVS_CS_PLANAR_FILTER); }
AVSC_API(int, avs_is_yv12)(const AVS_VideoInfo * p) ; AVSC_INLINE int avs_is_yv12(const AVS_VideoInfo * p)
{ return (p->pixel_type & AVS_CS_PLANAR_MASK) == (AVS_CS_YV12 & AVS_CS_PLANAR_FILTER); }
AVSC_API(int, avs_is_yv411)(const AVS_VideoInfo * p); AVSC_INLINE int avs_is_yv411(const AVS_VideoInfo * p)
{ return (p->pixel_type & AVS_CS_PLANAR_MASK) == (AVS_CS_YV411 & AVS_CS_PLANAR_FILTER); }
AVSC_API(int, avs_is_y8)(const AVS_VideoInfo * p); AVSC_INLINE int avs_is_y8(const AVS_VideoInfo * p)
{ return (p->pixel_type & AVS_CS_PLANAR_MASK) == (AVS_CS_Y8 & AVS_CS_PLANAR_FILTER); }
AVSC_INLINE int avs_is_property(const AVS_VideoInfo * p, int property) AVSC_INLINE int avs_is_property(const AVS_VideoInfo * p, int property)
{ return ((p->image_type & property)==property ); } { return ((p->pixel_type & property)==property ); }
AVSC_INLINE int avs_is_planar(const AVS_VideoInfo * p) AVSC_INLINE int avs_is_planar(const AVS_VideoInfo * p)
{ return !!(p->pixel_type & AVS_CS_PLANAR); } { return !!(p->pixel_type & AVS_CS_PLANAR); }
AVSC_API(int, avs_is_color_space)(const AVS_VideoInfo * p, int c_space); AVSC_INLINE int avs_is_color_space(const AVS_VideoInfo * p, int c_space)
{ return avs_is_planar(p) ? ((p->pixel_type & AVS_CS_PLANAR_MASK) == (c_space & AVS_CS_PLANAR_FILTER)) : ((p->pixel_type & c_space) == c_space); }
AVSC_INLINE int avs_is_field_based(const AVS_VideoInfo * p) AVSC_INLINE int avs_is_field_based(const AVS_VideoInfo * p)
{ return !!(p->image_type & AVS_IT_FIELDBASED); } { return !!(p->image_type & AVS_IT_FIELDBASED); }
@ -288,18 +274,25 @@ AVSC_INLINE int avs_is_bff(const AVS_VideoInfo * p)
AVSC_INLINE int avs_is_tff(const AVS_VideoInfo * p) AVSC_INLINE int avs_is_tff(const AVS_VideoInfo * p)
{ return !!(p->image_type & AVS_IT_TFF); } { return !!(p->image_type & AVS_IT_TFF); }
AVSC_API(int, avs_get_plane_width_subsampling)(const AVS_VideoInfo * p, int plane); AVSC_INLINE int avs_bits_per_pixel(const AVS_VideoInfo * p)
{
switch (p->pixel_type) {
case AVS_CS_BGR24: return 24;
case AVS_CS_BGR32: return 32;
case AVS_CS_YUY2: return 16;
case AVS_CS_YV12:
case AVS_CS_I420: return 12;
default: return 0;
}
}
AVSC_INLINE int avs_bytes_from_pixels(const AVS_VideoInfo * p, int pixels)
{ return pixels * (avs_bits_per_pixel(p)>>3); } // Will work on planar images, but will return only luma planes
AVSC_API(int, avs_get_plane_height_subsampling)(const AVS_VideoInfo * p, int plane); AVSC_INLINE int avs_row_size(const AVS_VideoInfo * p)
{ return avs_bytes_from_pixels(p,p->width); } // Also only returns first plane on planar images
AVSC_INLINE int avs_bmp_size(const AVS_VideoInfo * vi)
AVSC_API(int, avs_bits_per_pixel)(const AVS_VideoInfo * p); { if (avs_is_planar(vi)) {int p = vi->height * ((avs_row_size(vi)+3) & ~3); p+=p>>1; return p; } return vi->height * ((avs_row_size(vi)+3) & ~3); }
AVSC_API(int, avs_bytes_from_pixels)(const AVS_VideoInfo * p, int pixels);
AVSC_API(int, avs_row_size)(const AVS_VideoInfo * p, int plane);
AVSC_API(int, avs_bmp_size)(const AVS_VideoInfo * vi);
AVSC_INLINE int avs_samples_per_second(const AVS_VideoInfo * p) AVSC_INLINE int avs_samples_per_second(const AVS_VideoInfo * p)
{ return p->audio_samples_per_second; } { return p->audio_samples_per_second; }
@ -357,13 +350,11 @@ AVSC_INLINE void avs_set_fps(AVS_VideoInfo * p, unsigned numerator, unsigned den
p->fps_denominator = denominator/x; p->fps_denominator = denominator/x;
} }
#ifdef AVS_IMPLICIT_FUNCTION_DECLARATION_ERROR
AVSC_INLINE int avs_is_same_colorspace(AVS_VideoInfo * x, AVS_VideoInfo * y) AVSC_INLINE int avs_is_same_colorspace(AVS_VideoInfo * x, AVS_VideoInfo * y)
{ {
return (x->pixel_type == y->pixel_type) return (x->pixel_type == y->pixel_type)
|| (avs_is_yv12(x) && avs_is_yv12(y)); || (avs_is_yv12(x) && avs_is_yv12(y));
} }
#endif
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
// //
@ -400,38 +391,89 @@ typedef struct AVS_VideoFrame {
} AVS_VideoFrame; } AVS_VideoFrame;
// Access functions for AVS_VideoFrame // Access functions for AVS_VideoFrame
AVSC_API(int, avs_get_pitch_p)(const AVS_VideoFrame * p, int plane);
#ifdef AVS_IMPLICIT_FUNCTION_DECLARATION_ERROR
AVSC_INLINE int avs_get_pitch(const AVS_VideoFrame * p) { AVSC_INLINE int avs_get_pitch(const AVS_VideoFrame * p) {
return avs_get_pitch_p(p, 0);} return p->pitch;}
#endif
AVSC_API(int, avs_get_row_size_p)(const AVS_VideoFrame * p, int plane); AVSC_INLINE int avs_get_pitch_p(const AVS_VideoFrame * p, int plane) {
switch (plane) {
case AVS_PLANAR_U: case AVS_PLANAR_V: return p->pitchUV;}
return p->pitch;}
AVSC_INLINE int avs_get_row_size(const AVS_VideoFrame * p) { AVSC_INLINE int avs_get_row_size(const AVS_VideoFrame * p) {
return p->row_size; } return p->row_size; }
AVSC_API(int, avs_get_height_p)(const AVS_VideoFrame * p, int plane); AVSC_INLINE int avs_get_row_size_p(const AVS_VideoFrame * p, int plane) {
int r;
switch (plane) {
case AVS_PLANAR_U: case AVS_PLANAR_V:
if (p->pitchUV) return p->row_sizeUV;
else return 0;
case AVS_PLANAR_U_ALIGNED: case AVS_PLANAR_V_ALIGNED:
if (p->pitchUV) {
r = (p->row_sizeUV+AVS_FRAME_ALIGN-1)&(~(AVS_FRAME_ALIGN-1)); // Aligned rowsize
if (r < p->pitchUV)
return r;
return p->row_sizeUV;
} else return 0;
case AVS_PLANAR_Y_ALIGNED:
r = (p->row_size+AVS_FRAME_ALIGN-1)&(~(AVS_FRAME_ALIGN-1)); // Aligned rowsize
if (r <= p->pitch)
return r;
return p->row_size;
}
return p->row_size;
}
AVSC_INLINE int avs_get_height(const AVS_VideoFrame * p) { AVSC_INLINE int avs_get_height(const AVS_VideoFrame * p) {
return p->height;} return p->height;}
AVSC_API(const BYTE *, avs_get_read_ptr_p)(const AVS_VideoFrame * p, int plane); AVSC_INLINE int avs_get_height_p(const AVS_VideoFrame * p, int plane) {
switch (plane) {
case AVS_PLANAR_U: case AVS_PLANAR_V:
if (p->pitchUV) return p->heightUV;
return 0;
}
return p->height;}
#ifdef AVS_IMPLICIT_FUNCTION_DECLARATION_ERROR
AVSC_INLINE const BYTE* avs_get_read_ptr(const AVS_VideoFrame * p) { AVSC_INLINE const BYTE* avs_get_read_ptr(const AVS_VideoFrame * p) {
return avs_get_read_ptr_p(p, 0);} return p->vfb->data + p->offset;}
#endif
AVSC_API(int, avs_is_writable)(const AVS_VideoFrame * p); AVSC_INLINE const BYTE* avs_get_read_ptr_p(const AVS_VideoFrame * p, int plane)
{
switch (plane) {
case AVS_PLANAR_U: return p->vfb->data + p->offsetU;
case AVS_PLANAR_V: return p->vfb->data + p->offsetV;
default: return p->vfb->data + p->offset;}
}
AVSC_API(BYTE *, avs_get_write_ptr_p)(const AVS_VideoFrame * p, int plane); AVSC_INLINE int avs_is_writable(const AVS_VideoFrame * p) {
return (p->refcount == 1 && p->vfb->refcount == 1);}
AVSC_INLINE BYTE* avs_get_write_ptr(const AVS_VideoFrame * p)
{
if (avs_is_writable(p)) {
++p->vfb->sequence_number;
return p->vfb->data + p->offset;
} else
return 0;
}
AVSC_INLINE BYTE* avs_get_write_ptr_p(const AVS_VideoFrame * p, int plane)
{
if (plane==AVS_PLANAR_Y && avs_is_writable(p)) {
++p->vfb->sequence_number;
return p->vfb->data + p->offset;
} else if (plane==AVS_PLANAR_Y) {
return 0;
} else {
switch (plane) {
case AVS_PLANAR_U: return p->vfb->data + p->offsetU;
case AVS_PLANAR_V: return p->vfb->data + p->offsetV;
default: return p->vfb->data + p->offset;
}
}
}
#ifdef AVS_IMPLICIT_FUNCTION_DECLARATION_ERROR
AVSC_INLINE BYTE* avs_get_write_ptr(const AVS_VideoFrame * p) {
return avs_get_write_ptr_p(p, 0);}
#endif
AVSC_API(void, avs_release_video_frame)(AVS_VideoFrame *); AVSC_API(void, avs_release_video_frame)(AVS_VideoFrame *);
// makes a shallow copy of a video frame // makes a shallow copy of a video frame
@ -616,16 +658,12 @@ enum {
AVS_CPUF_SSSE3 = 0x200, // Core 2 AVS_CPUF_SSSE3 = 0x200, // Core 2
AVS_CPUF_SSE4 = 0x400, // Penryn, Wolfdale, Yorkfield AVS_CPUF_SSE4 = 0x400, // Penryn, Wolfdale, Yorkfield
AVS_CPUF_SSE4_1 = 0x400, AVS_CPUF_SSE4_1 = 0x400,
//AVS_CPUF_AVX = 0x800, // Sandy Bridge, Bulldozer AVS_CPUF_SSE4_2 = 0x800, // Nehalem
AVS_CPUF_SSE4_2 = 0x1000, // Nehalem
//AVS_CPUF_AVX2 = 0x2000, // Haswell
//AVS_CPUF_AVX512 = 0x4000, // Knights Landing
}; };
AVSC_API(const char *, avs_get_error)(AVS_ScriptEnvironment *); // return 0 if no error AVSC_API(const char *, avs_get_error)(AVS_ScriptEnvironment *); // return 0 if no error
AVSC_API(int, avs_get_cpu_flags)(AVS_ScriptEnvironment *); AVSC_API(long, avs_get_cpu_flags)(AVS_ScriptEnvironment *);
AVSC_API(int, avs_check_version)(AVS_ScriptEnvironment *, int version); AVSC_API(int, avs_check_version)(AVS_ScriptEnvironment *, int version);
AVSC_API(char *, avs_save_string)(AVS_ScriptEnvironment *, const char* s, int length); AVSC_API(char *, avs_save_string)(AVS_ScriptEnvironment *, const char* s, int length);
@ -662,12 +700,12 @@ AVSC_API(AVS_VideoFrame *, avs_new_video_frame_a)(AVS_ScriptEnvironment *,
AVSC_INLINE AVSC_INLINE
AVS_VideoFrame * avs_new_video_frame(AVS_ScriptEnvironment * env, AVS_VideoFrame * avs_new_video_frame(AVS_ScriptEnvironment * env,
const AVS_VideoInfo * vi) const AVS_VideoInfo * vi)
{return avs_new_video_frame_a(env,vi,FRAME_ALIGN);} {return avs_new_video_frame_a(env,vi,AVS_FRAME_ALIGN);}
AVSC_INLINE AVSC_INLINE
AVS_VideoFrame * avs_new_frame(AVS_ScriptEnvironment * env, AVS_VideoFrame * avs_new_frame(AVS_ScriptEnvironment * env,
const AVS_VideoInfo * vi) const AVS_VideoInfo * vi)
{return avs_new_video_frame_a(env,vi,FRAME_ALIGN);} {return avs_new_video_frame_a(env,vi,AVS_FRAME_ALIGN);}
#endif #endif
@ -735,6 +773,7 @@ struct AVS_Library {
AVSC_DECLARE_FUNC(avs_function_exists); AVSC_DECLARE_FUNC(avs_function_exists);
AVSC_DECLARE_FUNC(avs_get_audio); AVSC_DECLARE_FUNC(avs_get_audio);
AVSC_DECLARE_FUNC(avs_get_cpu_flags); AVSC_DECLARE_FUNC(avs_get_cpu_flags);
AVSC_DECLARE_FUNC(avs_get_error);
AVSC_DECLARE_FUNC(avs_get_frame); AVSC_DECLARE_FUNC(avs_get_frame);
AVSC_DECLARE_FUNC(avs_get_parity); AVSC_DECLARE_FUNC(avs_get_parity);
AVSC_DECLARE_FUNC(avs_get_var); AVSC_DECLARE_FUNC(avs_get_var);
@ -759,27 +798,6 @@ struct AVS_Library {
AVSC_DECLARE_FUNC(avs_subframe_planar); AVSC_DECLARE_FUNC(avs_subframe_planar);
AVSC_DECLARE_FUNC(avs_take_clip); AVSC_DECLARE_FUNC(avs_take_clip);
AVSC_DECLARE_FUNC(avs_vsprintf); AVSC_DECLARE_FUNC(avs_vsprintf);
AVSC_DECLARE_FUNC(avs_get_error);
AVSC_DECLARE_FUNC(avs_is_yv24);
AVSC_DECLARE_FUNC(avs_is_yv16);
AVSC_DECLARE_FUNC(avs_is_yv12);
AVSC_DECLARE_FUNC(avs_is_yv411);
AVSC_DECLARE_FUNC(avs_is_y8);
AVSC_DECLARE_FUNC(avs_is_color_space);
AVSC_DECLARE_FUNC(avs_get_plane_width_subsampling);
AVSC_DECLARE_FUNC(avs_get_plane_height_subsampling);
AVSC_DECLARE_FUNC(avs_bits_per_pixel);
AVSC_DECLARE_FUNC(avs_bytes_from_pixels);
AVSC_DECLARE_FUNC(avs_row_size);
AVSC_DECLARE_FUNC(avs_bmp_size);
AVSC_DECLARE_FUNC(avs_get_pitch_p);
AVSC_DECLARE_FUNC(avs_get_row_size_p);
AVSC_DECLARE_FUNC(avs_get_height_p);
AVSC_DECLARE_FUNC(avs_get_read_ptr_p);
AVSC_DECLARE_FUNC(avs_is_writable);
AVSC_DECLARE_FUNC(avs_get_write_ptr_p);
}; };
#undef AVSC_DECLARE_FUNC #undef AVSC_DECLARE_FUNC
@ -787,7 +805,7 @@ struct AVS_Library {
AVSC_INLINE AVS_Library * avs_load_library() { AVSC_INLINE AVS_Library * avs_load_library() {
AVS_Library *library = (AVS_Library *)malloc(sizeof(AVS_Library)); AVS_Library *library = (AVS_Library *)malloc(sizeof(AVS_Library));
if (library == NULL) if (!library)
return NULL; return NULL;
library->handle = LoadLibrary("avisynth"); library->handle = LoadLibrary("avisynth");
if (library->handle == NULL) if (library->handle == NULL)
@ -814,6 +832,7 @@ AVSC_INLINE AVS_Library * avs_load_library() {
AVSC_LOAD_FUNC(avs_function_exists); AVSC_LOAD_FUNC(avs_function_exists);
AVSC_LOAD_FUNC(avs_get_audio); AVSC_LOAD_FUNC(avs_get_audio);
AVSC_LOAD_FUNC(avs_get_cpu_flags); AVSC_LOAD_FUNC(avs_get_cpu_flags);
AVSC_LOAD_FUNC(avs_get_error);
AVSC_LOAD_FUNC(avs_get_frame); AVSC_LOAD_FUNC(avs_get_frame);
AVSC_LOAD_FUNC(avs_get_parity); AVSC_LOAD_FUNC(avs_get_parity);
AVSC_LOAD_FUNC(avs_get_var); AVSC_LOAD_FUNC(avs_get_var);
@ -839,27 +858,6 @@ AVSC_INLINE AVS_Library * avs_load_library() {
AVSC_LOAD_FUNC(avs_take_clip); AVSC_LOAD_FUNC(avs_take_clip);
AVSC_LOAD_FUNC(avs_vsprintf); AVSC_LOAD_FUNC(avs_vsprintf);
AVSC_LOAD_FUNC(avs_get_error);
AVSC_LOAD_FUNC(avs_is_yv24);
AVSC_LOAD_FUNC(avs_is_yv16);
AVSC_LOAD_FUNC(avs_is_yv12);
AVSC_LOAD_FUNC(avs_is_yv411);
AVSC_LOAD_FUNC(avs_is_y8);
AVSC_LOAD_FUNC(avs_is_color_space);
AVSC_LOAD_FUNC(avs_get_plane_width_subsampling);
AVSC_LOAD_FUNC(avs_get_plane_height_subsampling);
AVSC_LOAD_FUNC(avs_bits_per_pixel);
AVSC_LOAD_FUNC(avs_bytes_from_pixels);
AVSC_LOAD_FUNC(avs_row_size);
AVSC_LOAD_FUNC(avs_bmp_size);
AVSC_LOAD_FUNC(avs_get_pitch_p);
AVSC_LOAD_FUNC(avs_get_row_size_p);
AVSC_LOAD_FUNC(avs_get_height_p);
AVSC_LOAD_FUNC(avs_get_read_ptr_p);
AVSC_LOAD_FUNC(avs_is_writable);
AVSC_LOAD_FUNC(avs_get_write_ptr_p);
#undef __AVSC_STRINGIFY #undef __AVSC_STRINGIFY
#undef AVSC_STRINGIFY #undef AVSC_STRINGIFY
#undef AVSC_LOAD_FUNC #undef AVSC_LOAD_FUNC
@ -872,7 +870,7 @@ fail:
} }
AVSC_INLINE void avs_free_library(AVS_Library *library) { AVSC_INLINE void avs_free_library(AVS_Library *library) {
if (library == NULL) if (!library)
return; return;
FreeLibrary(library->handle); FreeLibrary(library->handle);
free(library); free(library);

View File

@ -0,0 +1,68 @@
// Copyright (c) 2011 FFmpegSource Project
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
/* these are defines/functions that are used and were changed in the switch to 2.6
* and are needed to maintain full compatility with 2.5 */
enum {
AVS_CS_YV12_25 = 1<<3 | AVS_CS_YUV | AVS_CS_PLANAR, // y-v-u, planar
AVS_CS_I420_25 = 1<<4 | AVS_CS_YUV | AVS_CS_PLANAR, // y-u-v, planar
};
AVSC_INLINE int avs_get_height_p_25(const AVS_VideoFrame * p, int plane) {
switch (plane)
{
case AVS_PLANAR_U: case AVS_PLANAR_V:
if (p->pitchUV)
return p->height>>1;
return 0;
}
return p->height;}
AVSC_INLINE int avs_get_row_size_p_25(const AVS_VideoFrame * p, int plane) {
int r;
switch (plane)
{
case AVS_PLANAR_U: case AVS_PLANAR_V:
if (p->pitchUV)
return p->row_size>>1;
else
return 0;
case AVS_PLANAR_U_ALIGNED: case AVS_PLANAR_V_ALIGNED:
if (p->pitchUV)
{
r = ((p->row_size+AVS_FRAME_ALIGN-1)&(~(AVS_FRAME_ALIGN-1)) )>>1; // Aligned rowsize
if (r < p->pitchUV)
return r;
return p->row_size>>1;
}
else
return 0;
case AVS_PLANAR_Y_ALIGNED:
r = (p->row_size+AVS_FRAME_ALIGN-1)&(~(AVS_FRAME_ALIGN-1)); // Aligned rowsize
if (r <= p->pitch)
return r;
return p->row_size;
}
return p->row_size;
}
AVSC_INLINE int avs_is_yv12_25(const AVS_VideoInfo * p)
{ return ((p->pixel_type & AVS_CS_YV12_25) == AVS_CS_YV12_25)||((p->pixel_type & AVS_CS_I420_25) == AVS_CS_I420_25); }

View File

@ -1,62 +0,0 @@
// Avisynth C Interface Version 0.20
// Copyright 2003 Kevin Atkinson
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit
// http://www.gnu.org/copyleft/gpl.html .
//
// As a special exception, I give you permission to link to the
// Avisynth C interface with independent modules that communicate with
// the Avisynth C interface solely through the interfaces defined in
// avisynth_c.h, regardless of the license terms of these independent
// modules, and to copy and distribute the resulting combined work
// under terms of your choice, provided that every copy of the
// combined work is accompanied by a complete copy of the source code
// of the Avisynth C interface and Avisynth itself (with the version
// used to produce the combined work), being distributed under the
// terms of the GNU General Public License plus this exception. An
// independent module is a module which is not derived from or based
// on Avisynth C Interface, such as 3rd-party filters, import and
// export plugins, or graphical user interfaces.
#ifndef AVS_CAPI_H
#define AVS_CAPI_H
#ifdef __cplusplus
# define EXTERN_C extern "C"
#else
# define EXTERN_C
#endif
#ifndef AVSC_USE_STDCALL
# define AVSC_CC __cdecl
#else
# define AVSC_CC __stdcall
#endif
#define AVSC_INLINE static __inline
#ifdef BUILDING_AVSCORE
# define AVSC_EXPORT EXTERN_C
# define AVSC_API(ret, name) EXTERN_C __declspec(dllexport) ret AVSC_CC name
#else
# define AVSC_EXPORT EXTERN_C __declspec(dllexport)
# ifndef AVSC_NO_DECLSPEC
# define AVSC_API(ret, name) EXTERN_C __declspec(dllimport) ret AVSC_CC name
# else
# define AVSC_API(ret, name) typedef ret (AVSC_CC *name##_func)
# endif
#endif
#endif //AVS_CAPI_H

View File

@ -1,55 +0,0 @@
// Avisynth C Interface Version 0.20
// Copyright 2003 Kevin Atkinson
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit
// http://www.gnu.org/copyleft/gpl.html .
//
// As a special exception, I give you permission to link to the
// Avisynth C interface with independent modules that communicate with
// the Avisynth C interface solely through the interfaces defined in
// avisynth_c.h, regardless of the license terms of these independent
// modules, and to copy and distribute the resulting combined work
// under terms of your choice, provided that every copy of the
// combined work is accompanied by a complete copy of the source code
// of the Avisynth C interface and Avisynth itself (with the version
// used to produce the combined work), being distributed under the
// terms of the GNU General Public License plus this exception. An
// independent module is a module which is not derived from or based
// on Avisynth C Interface, such as 3rd-party filters, import and
// export plugins, or graphical user interfaces.
#ifndef AVS_CONFIG_H
#define AVS_CONFIG_H
// Undefine this to get cdecl calling convention
#define AVSC_USE_STDCALL 1
// NOTE TO PLUGIN AUTHORS:
// Because FRAME_ALIGN can be substantially higher than the alignment
// a plugin actually needs, plugins should not use FRAME_ALIGN to check for
// alignment. They should always request the exact alignment value they need.
// This is to make sure that plugins work over the widest range of AviSynth
// builds possible.
#define FRAME_ALIGN 32
#if defined(_M_AMD64) || defined(__x86_64)
# define X86_64
#elif defined(_M_IX86) || defined(__i386__)
# define X86_32
#else
# error Unsupported CPU architecture.
#endif
#endif //AVS_CONFIG_H

View File

@ -1,51 +0,0 @@
// Avisynth C Interface Version 0.20
// Copyright 2003 Kevin Atkinson
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit
// http://www.gnu.org/copyleft/gpl.html .
//
// As a special exception, I give you permission to link to the
// Avisynth C interface with independent modules that communicate with
// the Avisynth C interface solely through the interfaces defined in
// avisynth_c.h, regardless of the license terms of these independent
// modules, and to copy and distribute the resulting combined work
// under terms of your choice, provided that every copy of the
// combined work is accompanied by a complete copy of the source code
// of the Avisynth C interface and Avisynth itself (with the version
// used to produce the combined work), being distributed under the
// terms of the GNU General Public License plus this exception. An
// independent module is a module which is not derived from or based
// on Avisynth C Interface, such as 3rd-party filters, import and
// export plugins, or graphical user interfaces.
#ifndef AVS_TYPES_H
#define AVS_TYPES_H
// Define all types necessary for interfacing with avisynth.dll
// Raster types used by VirtualDub & Avisynth
typedef unsigned int Pixel32;
typedef unsigned char BYTE;
// Audio Sample information
typedef float SFLOAT;
#ifdef __GNUC__
typedef long long int INT64;
#else
typedef __int64 INT64;
#endif
#endif //AVS_TYPES_H

View File

@ -513,21 +513,21 @@ AVSC_INLINE AVS_Value avs_array_elt(AVS_Value v, int index)
// only use these functions on am AVS_Value that does not already have // only use these functions on am AVS_Value that does not already have
// an active value. Remember, treat AVS_Value as a fat pointer. // an active value. Remember, treat AVS_Value as a fat pointer.
AVSC_INLINE AVS_Value avs_new_value_bool(int v0) AVSC_INLINE AVS_Value avs_new_value_bool(int v0)
{ AVS_Value v = {0}; v.type = 'b'; v.d.boolean = v0 == 0 ? 0 : 1; return v; } { AVS_Value v; v.type = 'b'; v.d.boolean = v0 == 0 ? 0 : 1; return v; }
AVSC_INLINE AVS_Value avs_new_value_int(int v0) AVSC_INLINE AVS_Value avs_new_value_int(int v0)
{ AVS_Value v = {0}; v.type = 'i'; v.d.integer = v0; return v; } { AVS_Value v; v.type = 'i'; v.d.integer = v0; return v; }
AVSC_INLINE AVS_Value avs_new_value_string(const char * v0) AVSC_INLINE AVS_Value avs_new_value_string(const char * v0)
{ AVS_Value v = {0}; v.type = 's'; v.d.string = v0; return v; } { AVS_Value v; v.type = 's'; v.d.string = v0; return v; }
AVSC_INLINE AVS_Value avs_new_value_float(float v0) AVSC_INLINE AVS_Value avs_new_value_float(float v0)
{ AVS_Value v = {0}; v.type = 'f'; v.d.floating_pt = v0; return v;} { AVS_Value v; v.type = 'f'; v.d.floating_pt = v0; return v;}
AVSC_INLINE AVS_Value avs_new_value_error(const char * v0) AVSC_INLINE AVS_Value avs_new_value_error(const char * v0)
{ AVS_Value v = {0}; v.type = 'e'; v.d.string = v0; return v; } { AVS_Value v; v.type = 'e'; v.d.string = v0; return v; }
#ifndef AVSC_NO_DECLSPEC #ifndef AVSC_NO_DECLSPEC
AVSC_INLINE AVS_Value avs_new_value_clip(AVS_Clip * v0) AVSC_INLINE AVS_Value avs_new_value_clip(AVS_Clip * v0)
{ AVS_Value v = {0}; avs_set_to_clip(&v, v0); return v; } { AVS_Value v; avs_set_to_clip(&v, v0); return v; }
#endif #endif
AVSC_INLINE AVS_Value avs_new_value_array(AVS_Value * v0, int size) AVSC_INLINE AVS_Value avs_new_value_array(AVS_Value * v0, int size)
{ AVS_Value v = {0}; v.type = 'a'; v.d.array = v0; v.array_size = size; return v; } { AVS_Value v; v.type = 'a'; v.d.array = v0; v.array_size = size; return v; }
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
// //

View File

@ -52,8 +52,8 @@ namespace avxsynth {
// //
// Functions // Functions
// //
#define MAKEDWORD(a,b,c,d) (((a) << 24) | ((b) << 16) | ((c) << 8) | (d)) #define MAKEDWORD(a,b,c,d) ((a << 24) | (b << 16) | (c << 8) | (d))
#define MAKEWORD(a,b) (((a) << 8) | (b)) #define MAKEWORD(a,b) ((a << 8) | (b))
#define lstrlen strlen #define lstrlen strlen
#define lstrcpy strcpy #define lstrcpy strcpy

View File

@ -1,42 +0,0 @@
/*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef COMPAT_DISPATCH_SEMAPHORE_SEMAPHORE_H
#define COMPAT_DISPATCH_SEMAPHORE_SEMAPHORE_H
#include <dispatch/dispatch.h>
#include <errno.h>
#define sem_t dispatch_semaphore_t
#define sem_post(psem) dispatch_semaphore_signal(*psem)
#define sem_wait(psem) dispatch_semaphore_wait(*psem, DISPATCH_TIME_FOREVER)
#define sem_timedwait(psem, val) dispatch_semaphore_wait(*psem, dispatch_walltime(val, 0))
#define sem_destroy(psem) dispatch_release(*psem)
static inline int compat_sem_init(dispatch_semaphore_t *psem,
int unused, int val)
{
int ret = !!(*psem = dispatch_semaphore_create(val)) - 1;
if (ret < 0)
errno = ENOMEM;
return ret;
}
#define sem_init compat_sem_init
#endif /* COMPAT_DISPATCH_SEMAPHORE_SEMAPHORE_H */

View File

@ -19,8 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifndef COMPAT_MSVCRT_SNPRINTF_H #ifndef COMPAT_SNPRINTF_H
#define COMPAT_MSVCRT_SNPRINTF_H #define COMPAT_SNPRINTF_H
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
@ -35,4 +35,4 @@ int avpriv_vsnprintf(char *s, size_t n, const char *fmt, va_list ap);
#define _snprintf avpriv_snprintf #define _snprintf avpriv_snprintf
#define vsnprintf avpriv_vsnprintf #define vsnprintf avpriv_vsnprintf
#endif /* COMPAT_MSVCRT_SNPRINTF_H */ #endif /* COMPAT_SNPRINTF_H */

View File

@ -23,8 +23,8 @@
* os2threads to pthreads wrapper * os2threads to pthreads wrapper
*/ */
#ifndef COMPAT_OS2THREADS_H #ifndef AVCODEC_OS2PTHREADS_H
#define COMPAT_OS2THREADS_H #define AVCODEC_OS2PTHREADS_H
#define INCL_DOS #define INCL_DOS
#include <os2.h> #include <os2.h>
@ -32,71 +32,57 @@
#undef __STRICT_ANSI__ /* for _beginthread() */ #undef __STRICT_ANSI__ /* for _beginthread() */
#include <stdlib.h> #include <stdlib.h>
#include <sys/builtin.h> #include "libavutil/mem.h"
#include <sys/fmutex.h>
#include "libavutil/attributes.h"
typedef struct {
TID tid;
void *(*start_routine)(void *);
void *arg;
void *result;
} pthread_t;
typedef TID pthread_t;
typedef void pthread_attr_t; typedef void pthread_attr_t;
typedef HMTX pthread_mutex_t; typedef HMTX pthread_mutex_t;
typedef void pthread_mutexattr_t; typedef void pthread_mutexattr_t;
typedef struct { typedef struct {
HEV event_sem; HEV event_sem;
HEV ack_sem; int wait_count;
volatile unsigned wait_count;
} pthread_cond_t; } pthread_cond_t;
typedef void pthread_condattr_t; typedef void pthread_condattr_t;
typedef struct { struct thread_arg {
volatile int done; void *(*start_routine)(void *);
_fmutex mtx; void *arg;
} pthread_once_t; };
#define PTHREAD_ONCE_INIT {0, _FMUTEX_INITIALIZER}
static void thread_entry(void *arg) static void thread_entry(void *arg)
{ {
pthread_t *thread = arg; struct thread_arg *thread_arg = arg;
thread->result = thread->start_routine(thread->arg); thread_arg->start_routine(thread_arg->arg);
av_free(thread_arg);
} }
static av_always_inline int pthread_create(pthread_t *thread, static av_always_inline int pthread_create(pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)(void*), void *arg)
const pthread_attr_t *attr,
void *(*start_routine)(void*),
void *arg)
{ {
thread->start_routine = start_routine; struct thread_arg *thread_arg;
thread->arg = arg;
thread->result = NULL;
thread->tid = _beginthread(thread_entry, NULL, 1024 * 1024, thread); thread_arg = av_mallocz(sizeof(struct thread_arg));
thread_arg->start_routine = start_routine;
thread_arg->arg = arg;
*thread = _beginthread(thread_entry, NULL, 256 * 1024, thread_arg);
return 0; return 0;
} }
static av_always_inline int pthread_join(pthread_t thread, void **value_ptr) static av_always_inline int pthread_join(pthread_t thread, void **value_ptr)
{ {
DosWaitThread(&thread.tid, DCWW_WAIT); DosWaitThread((PTID)&thread, DCWW_WAIT);
if (value_ptr)
*value_ptr = thread.result;
return 0; return 0;
} }
static av_always_inline int pthread_mutex_init(pthread_mutex_t *mutex, static av_always_inline int pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr)
const pthread_mutexattr_t *attr)
{ {
DosCreateMutexSem(NULL, (PHMTX)mutex, 0, FALSE); DosCreateMutexSem(NULL, (PHMTX)mutex, 0, FALSE);
@ -124,11 +110,9 @@ static av_always_inline int pthread_mutex_unlock(pthread_mutex_t *mutex)
return 0; return 0;
} }
static av_always_inline int pthread_cond_init(pthread_cond_t *cond, static av_always_inline int pthread_cond_init(pthread_cond_t *cond, const pthread_condattr_t *attr)
const pthread_condattr_t *attr)
{ {
DosCreateEventSem(NULL, &cond->event_sem, DCE_POSTONE, FALSE); DosCreateEventSem(NULL, &cond->event_sem, DCE_POSTONE, FALSE);
DosCreateEventSem(NULL, &cond->ack_sem, DCE_POSTONE, FALSE);
cond->wait_count = 0; cond->wait_count = 0;
@ -138,16 +122,16 @@ static av_always_inline int pthread_cond_init(pthread_cond_t *cond,
static av_always_inline int pthread_cond_destroy(pthread_cond_t *cond) static av_always_inline int pthread_cond_destroy(pthread_cond_t *cond)
{ {
DosCloseEventSem(cond->event_sem); DosCloseEventSem(cond->event_sem);
DosCloseEventSem(cond->ack_sem);
return 0; return 0;
} }
static av_always_inline int pthread_cond_signal(pthread_cond_t *cond) static av_always_inline int pthread_cond_signal(pthread_cond_t *cond)
{ {
if (!__atomic_cmpxchg32(&cond->wait_count, 0, 0)) { if (cond->wait_count > 0) {
DosPostEventSem(cond->event_sem); DosPostEventSem(cond->event_sem);
DosWaitEventSem(cond->ack_sem, SEM_INDEFINITE_WAIT);
cond->wait_count--;
} }
return 0; return 0;
@ -155,47 +139,26 @@ static av_always_inline int pthread_cond_signal(pthread_cond_t *cond)
static av_always_inline int pthread_cond_broadcast(pthread_cond_t *cond) static av_always_inline int pthread_cond_broadcast(pthread_cond_t *cond)
{ {
while (!__atomic_cmpxchg32(&cond->wait_count, 0, 0)) while (cond->wait_count > 0) {
pthread_cond_signal(cond); DosPostEventSem(cond->event_sem);
cond->wait_count--;
}
return 0; return 0;
} }
static av_always_inline int pthread_cond_wait(pthread_cond_t *cond, static av_always_inline int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
pthread_mutex_t *mutex)
{ {
__atomic_increment(&cond->wait_count); cond->wait_count++;
pthread_mutex_unlock(mutex); pthread_mutex_unlock(mutex);
DosWaitEventSem(cond->event_sem, SEM_INDEFINITE_WAIT); DosWaitEventSem(cond->event_sem, SEM_INDEFINITE_WAIT);
__atomic_decrement(&cond->wait_count);
DosPostEventSem(cond->ack_sem);
pthread_mutex_lock(mutex); pthread_mutex_lock(mutex);
return 0; return 0;
} }
static av_always_inline int pthread_once(pthread_once_t *once_control, #endif /* AVCODEC_OS2PTHREADS_H */
void (*init_routine)(void))
{
if (!once_control->done)
{
_fmutex_request(&once_control->mtx, 0);
if (!once_control->done)
{
init_routine();
once_control->done = 1;
}
_fmutex_release(&once_control->mtx);
}
return 0;
}
#endif /* COMPAT_OS2THREADS_H */

View File

@ -1,352 +0,0 @@
#!/usr/bin/env perl
# make_sunver.pl
#
# Copyright (C) 2010, 2011, 2012, 2013
# Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING.GPLv3. If not see
# <http://www.gnu.org/licenses/>.
# This script takes at least two arguments, a GNU style version script and
# a list of object and archive files, and generates a corresponding Sun
# style version script as follows:
#
# Each glob pattern, C++ mangled pattern or literal in the input script is
# matched against all global symbols in the input objects, emitting those
# that matched (or nothing if no match was found).
# A comment with the original pattern and its type is left in the output
# file to make it easy to understand the matches.
#
# It uses elfdump when present (native), GNU readelf otherwise.
# It depends on the GNU version of c++filt, since it must understand the
# GNU mangling style.
use FileHandle;
use IPC::Open2;
# Enforce C locale.
$ENV{'LC_ALL'} = "C";
$ENV{'LANG'} = "C";
# Input version script, GNU style.
my $symvers = shift;
##########
# Get all the symbols from the library, match them, and add them to a hash.
my %sym_hash = ();
# List of objects and archives to process.
my @OBJECTS = ();
# List of shared objects to omit from processing.
my @SHAREDOBJS = ();
# Filter out those input archives that have corresponding shared objects to
# avoid adding all symbols matched in the archive to the output map.
foreach $file (@ARGV) {
if (($so = $file) =~ s/\.a$/.so/ && -e $so) {
printf STDERR "omitted $file -> $so\n";
push (@SHAREDOBJS, $so);
} else {
push (@OBJECTS, $file);
}
}
# We need to detect and ignore hidden symbols. Solaris nm can only detect
# this in the harder to parse default output format, and GNU nm not at all,
# so use elfdump -s in the native case and GNU readelf -s otherwise.
# GNU objdump -t cannot be used since it produces a variable number of
# columns.
# The path to elfdump.
my $elfdump = "/usr/ccs/bin/elfdump";
if (-f $elfdump) {
open ELFDUMP,$elfdump.' -s '.(join ' ',@OBJECTS).'|' or die $!;
my $skip_arsym = 0;
while (<ELFDUMP>) {
chomp;
# Ignore empty lines.
if (/^$/) {
# End of archive symbol table, stop skipping.
$skip_arsym = 0 if $skip_arsym;
next;
}
# Keep skipping until end of archive symbol table.
next if ($skip_arsym);
# Ignore object name header for individual objects and archives.
next if (/:$/);
# Ignore table header lines.
next if (/^Symbol Table Section:/);
next if (/index.*value.*size/);
# Start of archive symbol table: start skipping.
if (/^Symbol Table: \(archive/) {
$skip_arsym = 1;
next;
}
# Split table.
(undef, undef, undef, undef, $bind, $oth, undef, $shndx, $name) = split;
# Error out for unknown input.
die "unknown input line:\n$_" unless defined($bind);
# Ignore local symbols.
next if ($bind eq "LOCL");
# Ignore hidden symbols.
next if ($oth eq "H");
# Ignore undefined symbols.
next if ($shndx eq "UNDEF");
# Error out for unhandled cases.
if ($bind !~ /^(GLOB|WEAK)/ or $oth ne "D") {
die "unhandled symbol:\n$_";
}
# Remember symbol.
$sym_hash{$name}++;
}
close ELFDUMP or die "$elfdump error";
} else {
open READELF, 'readelf -s -W '.(join ' ',@OBJECTS).'|' or die $!;
# Process each symbol.
while (<READELF>) {
chomp;
# Ignore empty lines.
next if (/^$/);
# Ignore object name header.
next if (/^File: .*$/);
# Ignore table header lines.
next if (/^Symbol table.*contains.*:/);
next if (/Num:.*Value.*Size/);
# Split table.
(undef, undef, undef, undef, $bind, $vis, $ndx, $name) = split;
# Error out for unknown input.
die "unknown input line:\n$_" unless defined($bind);
# Ignore local symbols.
next if ($bind eq "LOCAL");
# Ignore hidden symbols.
next if ($vis eq "HIDDEN");
# Ignore undefined symbols.
next if ($ndx eq "UND");
# Error out for unhandled cases.
if ($bind !~ /^(GLOBAL|WEAK)/ or $vis ne "DEFAULT") {
die "unhandled symbol:\n$_";
}
# Remember symbol.
$sym_hash{$name}++;
}
close READELF or die "readelf error";
}
##########
# The various types of glob patterns.
#
# A glob pattern that is to be applied to the demangled name: 'cxx'.
# A glob patterns that applies directly to the name in the .o files: 'glob'.
# This pattern is ignored; used for local variables (usually just '*'): 'ign'.
# The type of the current pattern.
my $glob = 'glob';
# We're currently inside `extern "C++"', which Sun ld doesn't understand.
my $in_extern = 0;
# The c++filt command to use. This *must* be GNU c++filt; the Sun Studio
# c++filt doesn't handle the GNU mangling style.
my $cxxfilt = $ENV{'CXXFILT'} || "c++filt";
# The current version name.
my $current_version = "";
# Was there any attempt to match a symbol to this version?
my $matches_attempted;
# The number of versions which matched this symbol.
my $matched_symbols;
open F,$symvers or die $!;
# Print information about generating this file
print "# This file was generated by make_sunver.pl. DO NOT EDIT!\n";
print "# It was generated by:\n";
printf "# %s %s %s\n", $0, $symvers, (join ' ',@ARGV);
printf "# Omitted archives with corresponding shared libraries: %s\n",
(join ' ', @SHAREDOBJS) if $#SHAREDOBJS >= 0;
print "#\n\n";
print "\$mapfile_version 2\n";
while (<F>) {
# Lines of the form '};'
if (/^([ \t]*)(\}[ \t]*;[ \t]*)$/) {
$glob = 'glob';
if ($in_extern) {
$in_extern--;
print "$1##$2\n";
} else {
print;
}
next;
}
# Lines of the form '} SOME_VERSION_NAME_1.0;'
if (/^[ \t]*\}[ \tA-Z0-9_.a-z]+;[ \t]*$/) {
$glob = 'glob';
# We tried to match symbols agains this version, but none matched.
# Emit dummy hidden symbol to avoid marking this version WEAK.
if ($matches_attempted && $matched_symbols == 0) {
print " hidden:\n";
print " .force_WEAK_off_$current_version = DATA S0x0 V0x0;\n";
}
print; next;
}
# Comment and blank lines
if (/^[ \t]*\#/) { print; next; }
if (/^[ \t]*$/) { print; next; }
# Lines of the form '{'
if (/^([ \t]*){$/) {
if ($in_extern) {
print "$1##{\n";
} else {
print;
}
next;
}
# Lines of the form 'SOME_VERSION_NAME_1.1 {'
if (/^([A-Z0-9_.]+)[ \t]+{$/) {
# Record version name.
$current_version = $1;
# Reset match attempts, #matched symbols for this version.
$matches_attempted = 0;
$matched_symbols = 0;
print "SYMBOL_VERSION $1 {\n";
next;
}
# Ignore 'global:'
if (/^[ \t]*global:$/) { print; next; }
# After 'local:', globs should be ignored, they won't be exported.
if (/^[ \t]*local:$/) {
$glob = 'ign';
print;
next;
}
# After 'extern "C++"', globs are C++ patterns
if (/^([ \t]*)(extern \"C\+\+\"[ \t]*)$/) {
$in_extern++;
$glob = 'cxx';
# Need to comment, Sun ld cannot handle this.
print "$1##$2\n"; next;
}
# Chomp newline now we're done with passing through the input file.
chomp;
# Catch globs. Note that '{}' is not allowed in globs by this script,
# so only '*' and '[]' are available.
if (/^([ \t]*)([^ \t;{}#]+);?[ \t]*$/) {
my $ws = $1;
my $ptn = $2;
# Turn the glob into a regex by replacing '*' with '.*', '?' with '.'.
# Keep $ptn so we can still print the original form.
($pattern = $ptn) =~ s/\*/\.\*/g;
$pattern =~ s/\?/\./g;
if ($glob eq 'ign') {
# We're in a local: * section; just continue.
print "$_\n";
next;
}
# Print the glob commented for human readers.
print "$ws##$ptn ($glob)\n";
# We tried to match a symbol to this version.
$matches_attempted++;
if ($glob eq 'glob') {
my %ptn_syms = ();
# Match ptn against symbols in %sym_hash.
foreach my $sym (keys %sym_hash) {
# Maybe it matches one of the patterns based on the symbol in
# the .o file.
$ptn_syms{$sym}++ if ($sym =~ /^$pattern$/);
}
foreach my $sym (sort keys(%ptn_syms)) {
$matched_symbols++;
print "$ws$sym;\n";
}
} elsif ($glob eq 'cxx') {
my %dem_syms = ();
# Verify that we're actually using GNU c++filt. Other versions
# most likely cannot handle GNU style symbol mangling.
my $cxxout = `$cxxfilt --version 2>&1`;
$cxxout =~ m/GNU/ or die "$0 requires GNU c++filt to function";
# Talk to c++filt through a pair of file descriptors.
# Need to start a fresh instance per pattern, otherwise the
# process grows to 500+ MB.
my $pid = open2(*FILTIN, *FILTOUT, $cxxfilt) or die $!;
# Match ptn against symbols in %sym_hash.
foreach my $sym (keys %sym_hash) {
# No? Well, maybe its demangled form matches one of those
# patterns.
printf FILTOUT "%s\n",$sym;
my $dem = <FILTIN>;
chomp $dem;
$dem_syms{$sym}++ if ($dem =~ /^$pattern$/);
}
close FILTOUT or die "c++filt error";
close FILTIN or die "c++filt error";
# Need to wait for the c++filt process to avoid lots of zombies.
waitpid $pid, 0;
foreach my $sym (sort keys(%dem_syms)) {
$matched_symbols++;
print "$ws$sym;\n";
}
} else {
# No? Well, then ignore it.
}
next;
}
# Important sanity check. This script can't handle lots of formats
# that GNU ld can, so be sure to error out if one is seen!
die "strange line `$_'";
}
close F;

View File

@ -16,8 +16,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifndef COMPAT_TMS470_MATH_H #ifndef FFMPEG_COMPAT_TMS470_MATH_H
#define COMPAT_TMS470_MATH_H #define FFMPEG_COMPAT_TMS470_MATH_H
#include_next <math.h> #include_next <math.h>
@ -27,4 +27,4 @@
#define INFINITY (*(const float*)((const unsigned []){ 0x7f800000 })) #define INFINITY (*(const float*)((const unsigned []){ 0x7f800000 }))
#define NAN (*(const float*)((const unsigned []){ 0x7fc00000 })) #define NAN (*(const float*)((const unsigned []){ 0x7fc00000 }))
#endif /* COMPAT_TMS470_MATH_H */ #endif /* FFMPEG_COMPAT_TMS470_MATH_H */

View File

@ -19,9 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/ */
#ifndef COMPAT_VA_COPY_H
#define COMPAT_VA_COPY_H
#include <stdarg.h> #include <stdarg.h>
#if !defined(va_copy) && defined(_MSC_VER) #if !defined(va_copy) && defined(_MSC_VER)
@ -30,5 +27,3 @@
#if !defined(va_copy) && defined(__GNUC__) && __GNUC__ < 3 #if !defined(va_copy) && defined(__GNUC__) && __GNUC__ < 3
#define va_copy(dst, src) __va_copy(dst, src) #define va_copy(dst, src) __va_copy(dst, src)
#endif #endif
#endif /* COMPAT_VA_COPY_H */

View File

@ -26,8 +26,8 @@
* w32threads to pthreads wrapper * w32threads to pthreads wrapper
*/ */
#ifndef COMPAT_W32PTHREADS_H #ifndef FFMPEG_COMPAT_W32PTHREADS_H
#define COMPAT_W32PTHREADS_H #define FFMPEG_COMPAT_W32PTHREADS_H
/* Build up a pthread-like API using underlying Windows API. Have only static /* Build up a pthread-like API using underlying Windows API. Have only static
* methods so as to not conflict with a potentially linked in pthread-win32 * methods so as to not conflict with a potentially linked in pthread-win32
@ -39,11 +39,6 @@
#include <windows.h> #include <windows.h>
#include <process.h> #include <process.h>
#if _WIN32_WINNT < 0x0600 && defined(__MINGW32__)
#undef MemoryBarrier
#define MemoryBarrier __sync_synchronize
#endif
#include "libavutil/attributes.h" #include "libavutil/attributes.h"
#include "libavutil/common.h" #include "libavutil/common.h"
#include "libavutil/internal.h" #include "libavutil/internal.h"
@ -87,29 +82,19 @@ static av_unused int pthread_create(pthread_t *thread, const void *unused_attr,
{ {
thread->func = start_routine; thread->func = start_routine;
thread->arg = arg; thread->arg = arg;
#if HAVE_WINRT
thread->handle = (void*)CreateThread(NULL, 0, win32thread_worker, thread,
0, NULL);
#else
thread->handle = (void*)_beginthreadex(NULL, 0, win32thread_worker, thread, thread->handle = (void*)_beginthreadex(NULL, 0, win32thread_worker, thread,
0, NULL); 0, NULL);
#endif
return !thread->handle; return !thread->handle;
} }
static av_unused int pthread_join(pthread_t thread, void **value_ptr) static av_unused void pthread_join(pthread_t thread, void **value_ptr)
{ {
DWORD ret = WaitForSingleObject(thread.handle, INFINITE); DWORD ret = WaitForSingleObject(thread.handle, INFINITE);
if (ret != WAIT_OBJECT_0) { if (ret != WAIT_OBJECT_0)
if (ret == WAIT_ABANDONED) return;
return EINVAL;
else
return EDEADLK;
}
if (value_ptr) if (value_ptr)
*value_ptr = thread.ret; *value_ptr = thread.ret;
CloseHandle(thread.handle); CloseHandle(thread.handle);
return 0;
} }
static inline int pthread_mutex_init(pthread_mutex_t *m, void* attr) static inline int pthread_mutex_init(pthread_mutex_t *m, void* attr)
@ -134,19 +119,6 @@ static inline int pthread_mutex_unlock(pthread_mutex_t *m)
} }
#if _WIN32_WINNT >= 0x0600 #if _WIN32_WINNT >= 0x0600
typedef INIT_ONCE pthread_once_t;
#define PTHREAD_ONCE_INIT INIT_ONCE_STATIC_INIT
static av_unused int pthread_once(pthread_once_t *once_control, void (*init_routine)(void))
{
BOOL pending = FALSE;
InitOnceBeginInitialize(once_control, 0, &pending, NULL);
if (pending)
init_routine();
InitOnceComplete(once_control, 0, NULL);
return 0;
}
static inline int pthread_cond_init(pthread_cond_t *cond, const void *unused_attr) static inline int pthread_cond_init(pthread_cond_t *cond, const void *unused_attr)
{ {
InitializeConditionVariable(cond); InitializeConditionVariable(cond);
@ -154,15 +126,14 @@ static inline int pthread_cond_init(pthread_cond_t *cond, const void *unused_att
} }
/* native condition variables do not destroy */ /* native condition variables do not destroy */
static inline int pthread_cond_destroy(pthread_cond_t *cond) static inline void pthread_cond_destroy(pthread_cond_t *cond)
{ {
return 0; return;
} }
static inline int pthread_cond_broadcast(pthread_cond_t *cond) static inline void pthread_cond_broadcast(pthread_cond_t *cond)
{ {
WakeAllConditionVariable(cond); WakeAllConditionVariable(cond);
return 0;
} }
static inline int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) static inline int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
@ -171,77 +142,14 @@ static inline int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex
return 0; return 0;
} }
static inline int pthread_cond_signal(pthread_cond_t *cond) static inline void pthread_cond_signal(pthread_cond_t *cond)
{ {
WakeConditionVariable(cond); WakeConditionVariable(cond);
return 0;
} }
#else // _WIN32_WINNT < 0x0600 #else // _WIN32_WINNT < 0x0600
/* atomic init state of dynamically loaded functions */
static LONG w32thread_init_state = 0;
static av_unused void w32thread_init(void);
/* for pre-Windows 6.0 platforms, define INIT_ONCE struct,
* compatible to the one used in the native API */
typedef union pthread_once_t {
void * Ptr; ///< For the Windows 6.0+ native functions
LONG state; ///< For the pre-Windows 6.0 compat code
} pthread_once_t;
#define PTHREAD_ONCE_INIT {0}
/* function pointers to init once API on windows 6.0+ kernels */
static BOOL (WINAPI *initonce_begin)(pthread_once_t *lpInitOnce, DWORD dwFlags, BOOL *fPending, void **lpContext);
static BOOL (WINAPI *initonce_complete)(pthread_once_t *lpInitOnce, DWORD dwFlags, void *lpContext);
/* pre-Windows 6.0 compat using a spin-lock */
static inline void w32thread_once_fallback(LONG volatile *state, void (*init_routine)(void))
{
switch (InterlockedCompareExchange(state, 1, 0)) {
/* Initial run */
case 0:
init_routine();
InterlockedExchange(state, 2);
break;
/* Another thread is running init */
case 1:
while (1) {
MemoryBarrier();
if (*state == 2)
break;
Sleep(0);
}
break;
/* Initialization complete */
case 2:
break;
}
}
static av_unused int pthread_once(pthread_once_t *once_control, void (*init_routine)(void))
{
w32thread_once_fallback(&w32thread_init_state, w32thread_init);
/* Use native functions on Windows 6.0+ */
if (initonce_begin && initonce_complete) {
BOOL pending = FALSE;
initonce_begin(once_control, 0, &pending, NULL);
if (pending)
init_routine();
initonce_complete(once_control, 0, NULL);
return 0;
}
w32thread_once_fallback(&once_control->state, init_routine);
return 0;
}
/* for pre-Windows 6.0 platforms we need to define and use our own condition /* for pre-Windows 6.0 platforms we need to define and use our own condition
* variable and api */ * variable and api */
typedef struct win32_cond_t { typedef struct win32_cond_t {
pthread_mutex_t mtx_broadcast; pthread_mutex_t mtx_broadcast;
pthread_mutex_t mtx_waiter_count; pthread_mutex_t mtx_waiter_count;
@ -261,9 +169,6 @@ static BOOL (WINAPI *cond_wait)(pthread_cond_t *cond, pthread_mutex_t *mutex,
static av_unused int pthread_cond_init(pthread_cond_t *cond, const void *unused_attr) static av_unused int pthread_cond_init(pthread_cond_t *cond, const void *unused_attr)
{ {
win32_cond_t *win32_cond = NULL; win32_cond_t *win32_cond = NULL;
w32thread_once_fallback(&w32thread_init_state, w32thread_init);
if (cond_init) { if (cond_init) {
cond_init(cond); cond_init(cond);
return 0; return 0;
@ -286,12 +191,12 @@ static av_unused int pthread_cond_init(pthread_cond_t *cond, const void *unused_
return 0; return 0;
} }
static av_unused int pthread_cond_destroy(pthread_cond_t *cond) static av_unused void pthread_cond_destroy(pthread_cond_t *cond)
{ {
win32_cond_t *win32_cond = cond->Ptr; win32_cond_t *win32_cond = cond->Ptr;
/* native condition variables do not destroy */ /* native condition variables do not destroy */
if (cond_init) if (cond_init)
return 0; return;
/* non native condition variables */ /* non native condition variables */
CloseHandle(win32_cond->semaphore); CloseHandle(win32_cond->semaphore);
@ -300,17 +205,16 @@ static av_unused int pthread_cond_destroy(pthread_cond_t *cond)
pthread_mutex_destroy(&win32_cond->mtx_broadcast); pthread_mutex_destroy(&win32_cond->mtx_broadcast);
av_freep(&win32_cond); av_freep(&win32_cond);
cond->Ptr = NULL; cond->Ptr = NULL;
return 0;
} }
static av_unused int pthread_cond_broadcast(pthread_cond_t *cond) static av_unused void pthread_cond_broadcast(pthread_cond_t *cond)
{ {
win32_cond_t *win32_cond = cond->Ptr; win32_cond_t *win32_cond = cond->Ptr;
int have_waiter; int have_waiter;
if (cond_broadcast) { if (cond_broadcast) {
cond_broadcast(cond); cond_broadcast(cond);
return 0; return;
} }
/* non native condition variables */ /* non native condition variables */
@ -332,7 +236,6 @@ static av_unused int pthread_cond_broadcast(pthread_cond_t *cond)
} else } else
pthread_mutex_unlock(&win32_cond->mtx_waiter_count); pthread_mutex_unlock(&win32_cond->mtx_waiter_count);
pthread_mutex_unlock(&win32_cond->mtx_broadcast); pthread_mutex_unlock(&win32_cond->mtx_broadcast);
return 0;
} }
static av_unused int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex) static av_unused int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)
@ -367,13 +270,13 @@ static av_unused int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mu
return pthread_mutex_lock(mutex); return pthread_mutex_lock(mutex);
} }
static av_unused int pthread_cond_signal(pthread_cond_t *cond) static av_unused void pthread_cond_signal(pthread_cond_t *cond)
{ {
win32_cond_t *win32_cond = cond->Ptr; win32_cond_t *win32_cond = cond->Ptr;
int have_waiter; int have_waiter;
if (cond_signal) { if (cond_signal) {
cond_signal(cond); cond_signal(cond);
return 0; return;
} }
pthread_mutex_lock(&win32_cond->mtx_broadcast); pthread_mutex_lock(&win32_cond->mtx_broadcast);
@ -390,7 +293,6 @@ static av_unused int pthread_cond_signal(pthread_cond_t *cond)
} }
pthread_mutex_unlock(&win32_cond->mtx_broadcast); pthread_mutex_unlock(&win32_cond->mtx_broadcast);
return 0;
} }
#endif #endif
@ -407,12 +309,8 @@ static av_unused void w32thread_init(void)
(void*)GetProcAddress(kernel_dll, "WakeConditionVariable"); (void*)GetProcAddress(kernel_dll, "WakeConditionVariable");
cond_wait = cond_wait =
(void*)GetProcAddress(kernel_dll, "SleepConditionVariableCS"); (void*)GetProcAddress(kernel_dll, "SleepConditionVariableCS");
initonce_begin =
(void*)GetProcAddress(kernel_dll, "InitOnceBeginInitialize");
initonce_complete =
(void*)GetProcAddress(kernel_dll, "InitOnceComplete");
#endif #endif
} }
#endif /* COMPAT_W32PTHREADS_H */ #endif /* FFMPEG_COMPAT_W32PTHREADS_H */

View File

@ -1,9 +0,0 @@
#!/bin/sh
LINK_EXE_PATH=$(dirname "$(command -v cl)")/link
if [ -x "$LINK_EXE_PATH" ]; then
"$LINK_EXE_PATH" $@
else
link $@
fi
exit $?

1817
configure vendored

File diff suppressed because it is too large Load Diff

9
doc/.gitignore vendored
View File

@ -1,9 +0,0 @@
/*.1
/*.3
/*.html
/*.pod
/config.texi
/avoptions_codec.texi
/avoptions_format.texi
/fate.txt
/print_options

View File

@ -2,383 +2,19 @@ Never assume the API of libav* to be stable unless at least 1 month has passed
since the last major version increase or the API was added. since the last major version increase or the API was added.
The last version increases were: The last version increases were:
libavcodec: 2015-08-28 libavcodec: 2014-08-09
libavdevice: 2015-08-28 libavdevice: 2014-08-09
libavfilter: 2015-08-28 libavfilter: 2014-08-09
libavformat: 2015-08-28 libavformat: 2014-08-09
libavresample: 2015-08-28 libavresample: 2014-08-09
libpostproc: 2015-08-28 libpostproc: 2014-08-09
libswresample: 2015-08-28 libswresample: 2014-08-09
libswscale: 2015-08-28 libswscale: 2014-08-09
libavutil: 2015-08-28 libavutil: 2014-08-09
API changes, most recent first: API changes, most recent first:
2016-07-09 - xxxxxxx / 90f469a - lavc 57.50.100 / 57.20.0 - avcodec.h
Add FF_PROFILE_H264_MULTIVIEW_HIGH and FF_PROFILE_H264_STEREO_HIGH.
2016-06-30 - c1c7e0ab - lavf 57.41.100 - avformat.h
Moved codecpar field from AVStream to the end of the struct, so that
the following private fields are in the same location as in FFmpeg 3.0 (lavf 57.25.100).
2016-06-30 - 042fb69d - lavu 55.28.100 - frame.h
Moved hw_frames_ctx field from AVFrame to the end of the struct, so that
the following private fields are in the same location as in FFmpeg 3.0 (lavu 55.17.103).
2016-06-29 - 1a751455 - lavfi 6.47.100 - avfilter.h
Fix accidental ABI breakage in AVFilterContext.
ABI was broken in 8688d3a, lavfi 6.42.100 and released as ffmpeg 3.1.
Because of this, ffmpeg and ffplay built against lavfi>=6.42.100 will not be
compatible with lavfi>=6.47.100. Potentially also affects other users of
libavfilter if they are using one of the affected fields.
-------- 8< --------- FFmpeg 3.1 was cut here -------- 8< ---------
2016-06-26 - 481f320 / 1c9e861 - lavu 55.27.100 / 55.13.0 - hwcontext.h
Add av_hwdevice_ctx_create().
2016-06-26 - b95534b / e47b8bb - lavc 57.48.101 / 57.19.1 - avcodec.h
Adjust values for JPEG 2000 profiles.
2016-06-23 - 5d75e46 / db7968b - lavf 57.40.100 / 57.7.0 - avio.h
Add AVIODataMarkerType, write_data_type, ignore_boundary_point and
avio_write_marker.
2016-06-23 - abb3cc4 / 0c4468d - lavu 55.26.100 / 55.12.0 - opt.h
Add av_stereo3d_type_name() and av_stereo3d_from_name().
2016-06-22 - 3689efe / c46db38 - lavu 55.25.100 / 55.11.0 - hwcontext_dxva2.h
Add new installed header with DXVA2-specific hwcontext definitions.
2016-04-27 - fb91871 - lavu 55.23.100 - log.h
Add a new function av_log_format_line2() which returns number of bytes
written to the target buffer.
2016-04-21 - 7fc329e - lavc 57.37.100 - avcodec.h
Add a new audio/video encoding and decoding API with decoupled input
and output -- avcodec_send_packet(), avcodec_receive_frame(),
avcodec_send_frame() and avcodec_receive_packet().
2016-04-17 - af9cac1 / 33d1898 - lavc 57.35.100 / 57.15.0 - avcodec.h
Add a new bitstream filtering API working with AVPackets.
Deprecate the old bitstream filtering API.
2016-04-14 - 8688d3a / 07a844f - lavfi 6.42.100 / 6.3.0 - avfilter.h
Add AVFilterContext.hw_device_ctx.
2016-04-14 - 28abb21 / 551c677 - lavu 55.22.100 / 55.9.0 - hwcontext_vaapi.h
Add new installed header with VAAPI-specific hwcontext definitions.
2016-04-14 - afccfaf / b1f01e8 - lavu 55.21.100 / 55.7.0 - hwcontext.h
Add AVHWFramesConstraints and associated API.
2016-04-11 - 6f69f7a / 9200514 - lavf 57.33.100 / 57.5.0 - avformat.h
Add AVStream.codecpar, deprecate AVStream.codec.
2016-04-02 - e8a9b64 - lavu 55.20.100 - base64.h
Add AV_BASE64_DECODE_SIZE(x) macro.
2016-xx-xx - lavc 57.33.100 / 57.14.0 - avcodec.h
f9b1cf1 / 998e1b8 - Add AVCodecParameters and its related API.
e6053b3 / a806834 - Add av_get_audio_frame_duration2().
2016-03-11 - 6d8ab35 - lavf/lavc 57.28.101
Add requirement to bitstream filtering API that returned packets with
size == 0 and side_data_elems == 0 are to be skipped by the caller.
2016-03-04 - 9362973 - lavf 57.28.100
Add protocol blacklisting API
2016-02-28 - 4dd4d53 - lavc 57.27.101
Validate AVFrame returned by get_buffer2 to have required
planes not NULL and unused planes set to NULL as crashes
and buffer overflow are possible with certain streams if
that is not the case.
2016-02-26 - 30e7685 - lavc 57.27.100 - avcodec.h
"flags2" decoding option now allows the flag "ass_ro_flush_noop" preventing
the reset of the ASS ReadOrder field on flush. This affects the content of
AVSubtitles.rects[N]->ass when "sub_text_format" is set to "ass" (see
previous entry).
2016-02-26 - 2941282 - lavc 57.26.100 - avcodec.h
Add a "sub_text_format" subtitles decoding option allowing the values "ass"
(recommended) and "ass_with_timings" (not recommended, deprecated, default).
The default value for this option will change to "ass" at the next major
libavcodec version bump.
The current default is "ass_with_timings" for compatibility. This means that
all subtitles text decoders currently still output ASS with timings printed
as strings in the AVSubtitles.rects[N]->ass fields.
Setting "sub_text_format" to "ass" allows a better timing accuracy (ASS
timing is limited to a 1/100 time base, so this is relevant for any subtitles
format needing a bigger one), ease timing adjustments, and prevents the need
of removing the timing from the decoded string yourself. This form is also
known as "the Matroska form". The timing information (start time, duration)
can be found in the AVSubtitles fields.
2016-02-24 - 7e49cdd / 7b3214d0 - lavc 57.25.100 / 57.13.0 - avcodec.h
Add AVCodecContext.hw_frames_ctx.
2016-02-24 - 1042402 / b3dd30d - lavfi 6.36.100 / 6.2.0 - avfilter.h
avfilter.h - Add AVFilterLink.hw_frames_ctx.
buffersrc.h - Add AVBufferSrcParameters and functions for handling it.
2016-02-23 - 14f7a3d - lavc 57.25.100
Add AV_PKT_DATA_MPEGTS_STREAM_ID for exporting the MPEGTS stream ID.
2016-02-18 - 08acab8 - lavu 55.18.100 - audio_fifo.h
Add av_audio_fifo_peek_at().
2016-xx-xx - lavu 55.18.100 / 55.6.0
26abd51 / 721a4ef buffer.h - Add av_buffer_pool_init2().
1a70878 / 89923e4 hwcontext.h - Add a new installed header hwcontext.h with a new API
for handling hwaccel frames.
6992276 / ad884d1 hwcontext_cuda.h - Add a new installed header hwcontext_cuda.h with
CUDA-specific hwcontext definitions.
d779d8d / a001ce3 hwcontext_vdpau.h - Add a new installed header hwcontext_vdpau.h with
VDPAU-specific hwcontext definitions.
63c3e35 / 7bc780c pixfmt.h - Add AV_PIX_FMT_CUDA.
-------- 8< --------- FFmpeg 3.0 was cut here -------- 8< ---------
2016-02-10 - bc9a596 / 9f61abc - lavf 57.25.100 / 57.3.0 - avformat.h
Add AVFormatContext.opaque, io_open and io_close, allowing custom IO
2016-02-01 - 1dba837 - lavf 57.24.100 - avformat.h, avio.h
Add protocol_whitelist to AVFormatContext, AVIOContext
2016-01-31 - 66e9d2f - lavu 55.17.100 - frame.h
Add AV_FRAME_DATA_GOP_TIMECODE for exporting MPEG1/2 GOP timecodes.
2016-01-01 - 5e8b053 / 2c68113 - lavc 57.21.100 / 57.12.0 - avcodec.h
Add AVCodecDescriptor.profiles and avcodec_profile_name().
2015-12-28 - 1f9139b - lavf 57.21.100 - avformat.h
Add automatic bitstream filtering; add av_apply_bitstream_filters()
2015-12-22 - 39a09e9 - lavfi 6.21.101 - avfilter.h
Deprecate avfilter_link_set_closed().
Applications are not supposed to mess with links,
they should close the sinks.
2015-12-17 - lavc 57.18.100 / 57.11.0 - avcodec.h dirac.h
xxxxxxx - Add av_packet_add_side_data().
xxxxxxx - Add AVCodecContext.coded_side_data.
xxxxxxx - Add AVCPBProperties API.
xxxxxxx - Add a new public header dirac.h containing
av_dirac_parse_sequence_header()
2015-12-11 - 676a93f - lavf 57.20.100 - avformat.h
Add av_program_add_stream_index()
2015-11-29 - 93fb4a4 - lavc 57.16.101 - avcodec.h
Deprecate rtp_callback without replacement, i.e. it won't be possible to
get image slices before the full frame is encoded any more. The libavformat
rtpenc muxer can still be used for RFC-2190 packetization.
2015-11-22 - fe20e34 - lavc 57.16.100 - avcodec.h
Add AV_PKT_DATA_FALLBACK_TRACK for making fallback associations between
streams.
2015-11-22 - ad317c9 - lavf 57.19.100 - avformat.h
Add av_stream_new_side_data().
2015-11-22 - e12f403 - lavu 55.8.100 - xtea.h
Add av_xtea_le_init and av_xtea_le_crypt
2015-11-18 - lavu 55.7.100 - mem.h
Add av_fast_mallocz()
2015-10-29 - lavc 57.12.100 / 57.8.0 - avcodec.h
xxxxxx - Deprecate av_free_packet(). Use av_packet_unref() as replacement,
it resets the packet in a more consistent way.
xxxxxx - Deprecate av_dup_packet(), it is a no-op for most cases.
Use av_packet_ref() to make a non-refcounted AVPacket refcounted.
xxxxxx - Add av_packet_alloc(), av_packet_clone(), av_packet_free().
They match the AVFrame functions with the same name.
2015-10-27 - 1e477a9 - lavu 55.5.100 - cpu.h
Add AV_CPU_FLAG_AESNI.
2015-10-22 - ee573b4 / a17a766 - lavc 57.9.100 / 57.5.0 - avcodec.h
Add data and linesize array to AVSubtitleRect, to be used instead of
the ones from the embedded AVPicture.
2015-10-22 - 866a417 / dc923bc - lavc 57.8.100 / 57.0.0 - qsv.h
Add an API for allocating opaque surfaces.
2015-10-15 - 2c2d162 - lavf 57.4.100
Remove the latm demuxer that was a duplicate of the loas demuxer.
2015-10-14 - b994788 / 11c5f43 - lavu 55.4.100 / 55.2.0 - dict.h
Change return type of av_dict_copy() from void to int, so that a proper
error code can be reported.
2015-09-29 - b01891a / 948f3c1 - lavc 57.3.100 / 57.2.0 - avcodec.h
Change type of AVPacket.duration from int to int64_t.
2015-09-17 - 7c46f24 / e3d4784 - lavc 57.3.100 / 57.2.0 - d3d11va.h
Add av_d3d11va_alloc_context(). This function must from now on be used for
allocating AVD3D11VAContext.
2015-09-15 - lavf 57.2.100 - avformat.h
probesize and max_analyze_duration switched to 64bit, both
are only accessible through AVOptions
2015-09-15 - lavf 57.1.100 - avformat.h
bit_rate was changed to 64bit, make sure you update any
printf() or other type sensitive code
2015-09-15 - lavc 57.2.100 - avcodec.h
bit_rate/rc_max_rate/rc_min_rate were changed to 64bit, make sure you update
any printf() or other type sensitive code
2015-09-07 - lavu 55.0.100 / 55.0.0
c734b34 / b8b5d82 - Change type of AVPixFmtDescriptor.flags from uint8_t to uint64_t.
f53569a / 6b3ef7f - Change type of AVComponentDescriptor fields from uint16_t to int
and drop bit packing.
151aa2e / 2268db2 - Add step, offset, and depth to AVComponentDescriptor to replace
the deprecated step_minus1, offset_plus1, and depth_minus1.
-------- 8< --------- FFmpeg 2.8 was cut here -------- 8< ---------
2015-08-27 - 1dd854e1 - lavc 56.58.100 - vaapi.h
Deprecate old VA-API context (vaapi_context) fields that were only
set and used by libavcodec. They are all managed internally now.
2015-08-19 - 9f8e57ef - lavu 54.31.100 - pixfmt.h
Add a unique pixel format for VA-API (AV_PIX_FMT_VAAPI) that
indicates the nature of the underlying storage: a VA surface. This
yields the same value as AV_PIX_FMT_VAAPI_VLD.
Deprecate old VA-API related pixel formats: AV_PIX_FMT_VAAPI_MOCO,
AV_PIX_FMT_VAAPI_IDCT, AV_PIX_FMT_VAAPI_VLD.
2015-08-02 - lavu 54.30.100 / 54.17.0
9ed59f1 / 7a7df34c - Add av_blowfish_alloc().
a130ec9 / ae365453 - Add av_rc4_alloc().
9ca1997 / 5d8bea3b - Add av_xtea_alloc().
3cf08e9 / d9e8b47e - Add av_des_alloc().
2015-07-27 - lavc 56.56.100 / 56.35.0 - avcodec.h
94d68a4 / 7c6eb0a1 - Rename CODEC_FLAG* defines to AV_CODEC_FLAG*.
444e987 / def97856 - Rename CODEC_CAP_* defines to AV_CODEC_CAP_*.
29d147c / 059a9348 - Rename FF_INPUT_BUFFER_PADDING_SIZE and FF_MIN_BUFFER_SIZE
to AV_INPUT_BUFFER_PADDING_SIZE and AV_INPUT_BUFFER_MIN_SIZE.
2015-07-22 - c40ecff - lavc 56.51.100 - avcodec.h
Add AV_PKT_DATA_QUALITY_STATS to export the quality value, PSNR, and pict_type
of an AVPacket.
2015-07-16 - 8dad213 - lavc 56.49.100
Add av_codec_get_codec_properties(), FF_CODEC_PROPERTY_LOSSLESS
and FF_CODEC_PROPERTY_CLOSED_CAPTIONS
2015-07-03 - d563e13 / 83212943 - lavu 54.28.100 / 56.15.0
Add av_version_info().
-------- 8< --------- FFmpeg 2.7 was cut here -------- 8< ---------
2015-06-04 - cc17b43 - lswr 1.2.100
Add swr_get_out_samples()
2015-05-27 - c312bfa - lavu 54.26.100 - cpu.h
Add AV_CPU_FLAG_AVXSLOW.
2015-05-26 - 1fb9b2a - lavu 54.25.100 - rational.h
Add av_q2intfloat().
2015-05-13 - cc48409 / e7c5e17 - lavc 56.39.100 / 56.23.0
Add av_vda_default_init2.
2015-05-11 - 541d75f - lavf 56.33.100 - avformat.h
Add AVOpenCallback AVFormatContext.open_cb
2015-05-07 - a7dd933 - 56.38.100 - avcodec.h
Add av_packet_side_data_name().
2015-05-07 - 01e59d4 - 56.37.102 - avcodec.h
Add FF_PROFILE_VP9_2 and FF_PROFILE_VP9_3.
2015-05-04 - 079b7f6 - 56.37.100 - avcodec.h
Add FF_PROFILE_VP9_0 and FF_PROFILE_VP9_1.
2015-04-22 - 748d481 - lavf 56.31.100 - avformat.h
Add AVFMT_FLAG_FAST_SEEK flag. Some formats (initially mp3) use it to enable
fast, but inaccurate seeking.
2015-04-20 - 8e8219e / c253340 - lavu 54.23.100 / 54.12.0 - log.h
Add AV_LOG_TRACE for extremely verbose debugging.
2015-04-02 - 26e0e393 - lavf 56.29.100 - avio.h
Add AVIODirEntryType.AVIO_ENTRY_SERVER.
Add AVIODirEntryType.AVIO_ENTRY_SHARE.
Add AVIODirEntryType.AVIO_ENTRY_WORKGROUP.
2015-03-31 - 3188696 - lavu 54.22.100 - avstring.h
Add av_append_path_component()
2015-03-27 - 184084c - lavf 56.27.100 - avio.h url.h
New directory listing API.
Add AVIODirEntryType enum.
Add AVIODirEntry, AVIODirContext structures.
Add avio_open_dir(), avio_read_dir(), avio_close_dir(), avio_free_directory_entry().
Add ff_alloc_dir_entry().
Extend URLProtocol with url_open_dir(), url_read_dir(), url_close_dir().
2015-03-29 - 268ff17 / c484561 - lavu 54.21.100 / 54.10.0 - pixfmt.h
Add AV_PIX_FMT_MMAL for MMAL hardware acceleration.
2015-03-19 - 11fe56c - 56.29.100 / lavc 56.22.0
Add FF_PROFILE_DTS_EXPRESS.
-------- 8< --------- FFmpeg 2.6 was cut here -------- 8< ---------
2015-03-04 - cca4476 - lavf 56.25.100
Add avformat_flush()
2015-03-03 - 81a9126 - lavf 56.24.100
Add avio_put_str16be()
2015-02-19 - 560eb71 / 31d2039 - lavc 56.23.100 / 56.13.0
Add width, height, coded_width, coded_height and format to
AVCodecParserContext.
2015-02-19 - e375511 / 5b1d9ce - lavu 54.19.100 / 54.9.0
Add AV_PIX_FMT_QSV for QSV hardware acceleration.
2015-02-14 - ba22295 - lavc 56.21.102
Deprecate VIMA decoder.
2015-01-27 - 62a82c6 / 728685f - lavc 56.21.100 / 56.12.0, lavu 54.18.100 / 54.8.0 - avcodec.h, frame.h
Add AV_PKT_DATA_AUDIO_SERVICE_TYPE and AV_FRAME_DATA_AUDIO_SERVICE_TYPE for
storing the audio service type as side data.
2015-01-16 - a47c933 - lavf 56.19.100 - avformat.h
Add data_codec and data_codec_id for storing codec of data stream
2015-01-11 - 007c33d - lavd 56.4.100 - avdevice.h
Add avdevice_list_input_sources().
Add avdevice_list_output_sinks().
2014-12-25 - d7aaeea / c220a60 - lavc 56.19.100 / 56.10.0 - vdpau.h
Add av_vdpau_get_surface_parameters().
2014-12-25 - ddb9a24 / 6c99c92 - lavc 56.18.100 / 56.9.0 - avcodec.h
Add AV_HWACCEL_FLAG_ALLOW_HIGH_DEPTH flag to av_vdpau_bind_context().
2014-12-25 - d16079a / 57b6704 - lavc 56.17.100 / 56.8.0 - avcodec.h
Add AVCodecContext.sw_pix_fmt.
2014-12-04 - 6e9ac02 - lavc 56.14.100 - dv_profile.h
Add av_dv_codec_profile2().
-------- 8< --------- FFmpeg 2.5 was cut here -------- 8< ---------
2014-11-21 - ab922f9 - lavu 54.15.100 - dict.h 2014-11-21 - ab922f9 - lavu 54.15.100 - dict.h
Add av_dict_get_string(). Add av_dict_get_string().
@ -434,12 +70,12 @@ API changes, most recent first:
-------- 8< --------- FFmpeg 2.4 was cut here -------- 8< --------- -------- 8< --------- FFmpeg 2.4 was cut here -------- 8< ---------
2014-08-25 - 215db29 / b263f8f - lavf 56.3.100 / 56.3.0 - avformat.h
Add AVFormatContext.max_ts_probe.
2014-08-28 - f30a815 / 9301486 - lavc 56.1.100 / 56.1.0 - avcodec.h 2014-08-28 - f30a815 / 9301486 - lavc 56.1.100 / 56.1.0 - avcodec.h
Add AV_PKT_DATA_STEREO3D to export container-level stereo3d information. Add AV_PKT_DATA_STEREO3D to export container-level stereo3d information.
2014-08-25 - 215db29 / b263f8f - lavf 56.3.100 / 56.3.0 - avformat.h
Add AVFormatContext.max_ts_probe.
2014-08-23 - 8fc9bd0 - lavu 54.7.100 - dict.h 2014-08-23 - 8fc9bd0 - lavu 54.7.100 - dict.h
AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL arguments are now AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL arguments are now
freed even on error. This is consistent with the behaviour all users freed even on error. This is consistent with the behaviour all users
@ -617,7 +253,7 @@ API changes, most recent first:
Add avcodec_free_context(). From now on it should be used for freeing Add avcodec_free_context(). From now on it should be used for freeing
AVCodecContext. AVCodecContext.
2014-05-17 - 0eec06e / 1bd0bdc - lavu 52.84.100 / 54.5.0 - time.h 2014-05-17 - 0eec06e - lavu 52.84.100 - time.h
Add av_gettime_relative() av_gettime_relative_is_monotonic() Add av_gettime_relative() av_gettime_relative_is_monotonic()
2014-05-15 - eacf7d6 / 0c1959b - lavf 55.38.100 / 55.17.0 - avformat.h 2014-05-15 - eacf7d6 / 0c1959b - lavf 55.38.100 / 55.17.0 - avformat.h
@ -957,9 +593,6 @@ API changes, most recent first:
av_ripemd_update() av_ripemd_update()
av_ripemd_final() av_ripemd_final()
2013-06-10 - 82ef670 - lavu 52.35.101 - hmac.h
Add AV_HMAC_SHA224, AV_HMAC_SHA256, AV_HMAC_SHA384, AV_HMAC_SHA512
2013-06-04 - 30b491f / fc962d4 - lavu 52.35.100 / 52.13.0 - mem.h 2013-06-04 - 30b491f / fc962d4 - lavu 52.35.100 / 52.13.0 - mem.h
Add av_realloc_array and av_reallocp_array Add av_realloc_array and av_reallocp_array
@ -1212,7 +845,7 @@ lavd 54.4.100 / 54.0.0, lavfi 3.5.0
* base -- is now stored in AVBufferRef * base -- is now stored in AVBufferRef
* reference, type, buffer_hints -- are unnecessary in the new API * reference, type, buffer_hints -- are unnecessary in the new API
* hwaccel_picture_private, owner, thread_opaque -- should not * hwaccel_picture_private, owner, thread_opaque -- should not
have been accessed from outside of lavc have been acessed from outside of lavc
* qscale_table, qstride, qscale_type, mbskip_table, motion_val, * qscale_table, qstride, qscale_type, mbskip_table, motion_val,
mb_type, dct_coeff, ref_index -- mpegvideo-specific tables, mb_type, dct_coeff, ref_index -- mpegvideo-specific tables,
which are not exported anymore. which are not exported anymore.
@ -1249,14 +882,15 @@ lavd 54.4.100 / 54.0.0, lavfi 3.5.0
Add avresample_set_channel_mapping() for input channel reordering, Add avresample_set_channel_mapping() for input channel reordering,
duplication, and silencing. duplication, and silencing.
2012-12-29 - lavu 52.13.100 / 52.3.0 - avstring.h 2012-12-29 - 2ce43b3 / d8fd06c - lavu 52.13.100 / 52.3.0 - avstring.h
2ce43b3 / d8fd06c - Add av_basename() and av_dirname(). Add av_basename() and av_dirname().
e13d5e9 / c1a02e8 - Add av_pix_fmt_get_chroma_sub_sample and deprecate
avcodec_get_chroma_sub_sample.
2012-11-11 - 03b0787 / 5980f5d - lavu 52.6.100 / 52.2.0 - audioconvert.h 2012-11-11 - 03b0787 / 5980f5d - lavu 52.6.100 / 52.2.0 - audioconvert.h
Rename audioconvert.h to channel_layout.h. audioconvert.h is now deprecated. Rename audioconvert.h to channel_layout.h. audioconvert.h is now deprecated.
2012-11-05 - 7d26be6 / dfde8a3 - lavu 52.5.100 / 52.1.0 - intmath.h
Add av_ctz() for trailing zero bit count
2012-10-21 - e3a91c5 / a893655 - lavu 51.77.100 / 51.45.0 - error.h 2012-10-21 - e3a91c5 / a893655 - lavu 51.77.100 / 51.45.0 - error.h
Add AVERROR_EXPERIMENTAL Add AVERROR_EXPERIMENTAL

File diff suppressed because it is too large Load Diff

View File

@ -36,7 +36,6 @@ DOCS-$(CONFIG_MANPAGES) += $(MANPAGES)
DOCS-$(CONFIG_TXTPAGES) += $(TXTPAGES) DOCS-$(CONFIG_TXTPAGES) += $(TXTPAGES)
DOCS = $(DOCS-yes) DOCS = $(DOCS-yes)
DOC_EXAMPLES-$(CONFIG_AVIO_DIR_CMD_EXAMPLE) += avio_dir_cmd
DOC_EXAMPLES-$(CONFIG_AVIO_READING_EXAMPLE) += avio_reading DOC_EXAMPLES-$(CONFIG_AVIO_READING_EXAMPLE) += avio_reading
DOC_EXAMPLES-$(CONFIG_AVCODEC_EXAMPLE) += avcodec DOC_EXAMPLES-$(CONFIG_AVCODEC_EXAMPLE) += avcodec
DOC_EXAMPLES-$(CONFIG_DECODING_ENCODING_EXAMPLE) += decoding_encoding DOC_EXAMPLES-$(CONFIG_DECODING_ENCODING_EXAMPLE) += decoding_encoding
@ -47,7 +46,6 @@ DOC_EXAMPLES-$(CONFIG_FILTERING_AUDIO_EXAMPLE) += filtering_audio
DOC_EXAMPLES-$(CONFIG_FILTERING_VIDEO_EXAMPLE) += filtering_video DOC_EXAMPLES-$(CONFIG_FILTERING_VIDEO_EXAMPLE) += filtering_video
DOC_EXAMPLES-$(CONFIG_METADATA_EXAMPLE) += metadata DOC_EXAMPLES-$(CONFIG_METADATA_EXAMPLE) += metadata
DOC_EXAMPLES-$(CONFIG_MUXING_EXAMPLE) += muxing DOC_EXAMPLES-$(CONFIG_MUXING_EXAMPLE) += muxing
DOC_EXAMPLES-$(CONFIG_QSVDEC_EXAMPLE) += qsvdec
DOC_EXAMPLES-$(CONFIG_REMUXING_EXAMPLE) += remuxing DOC_EXAMPLES-$(CONFIG_REMUXING_EXAMPLE) += remuxing
DOC_EXAMPLES-$(CONFIG_RESAMPLING_AUDIO_EXAMPLE) += resampling_audio DOC_EXAMPLES-$(CONFIG_RESAMPLING_AUDIO_EXAMPLE) += resampling_audio
DOC_EXAMPLES-$(CONFIG_SCALING_VIDEO_EXAMPLE) += scaling_video DOC_EXAMPLES-$(CONFIG_SCALING_VIDEO_EXAMPLE) += scaling_video
@ -116,20 +114,19 @@ doc/%-all.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI)
doc/%.1 doc/%.3: TAG = MAN doc/%.1 doc/%.3: TAG = MAN
doc/%.1: doc/%.pod $(GENTEXI) doc/%.1: doc/%.pod $(GENTEXI)
$(M)pod2man --section=1 --center=" " --release=" " --date=" " $< > $@ $(M)pod2man --section=1 --center=" " --release=" " $< > $@
doc/%.3: doc/%.pod $(GENTEXI) doc/%.3: doc/%.pod $(GENTEXI)
$(M)pod2man --section=3 --center=" " --release=" " --date=" " $< > $@ $(M)pod2man --section=3 --center=" " --release=" " $< > $@
$(DOCS) doc/doxy/html: | doc/ $(DOCS) doc/doxy/html: | doc/
$(DOC_EXAMPLES:%$(EXESUF)=%.o): | doc/examples $(DOC_EXAMPLES:%$(EXESUF)=%.o): | doc/examples
OBJDIRS += doc/examples OBJDIRS += doc/examples
DOXY_INPUT = $(INSTHEADERS) $(DOC_EXAMPLES:%$(EXESUF)=%.c) $(LIB_EXAMPLES:%$(EXESUF)=%.c) DOXY_INPUT = $(addprefix $(SRC_PATH)/, $(INSTHEADERS) $(DOC_EXAMPLES:%$(EXESUF)=%.c) $(LIB_EXAMPLES:%$(EXESUF)=%.c))
DOXY_INPUT_DEPS = $(addprefix $(SRC_PATH)/, $(DOXY_INPUT)) config.mak
doc/doxy/html: TAG = DOXY doc/doxy/html: TAG = DOXY
doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(SRC_PATH)/doc/doxy-wrapper.sh $(DOXY_INPUT_DEPS) doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(SRC_PATH)/doc/doxy-wrapper.sh $(DOXY_INPUT)
$(M)OUT_DIR=$$PWD/doc/doxy; cd $(SRC_PATH); ./doc/doxy-wrapper.sh $$OUT_DIR $< $(DOXYGEN) $(DOXY_INPUT); $(M)$(SRC_PATH)/doc/doxy-wrapper.sh $(SRC_PATH) $< $(DOXYGEN) $(DOXY_INPUT)
install-doc: install-html install-man install-doc: install-html install-man

View File

@ -67,10 +67,6 @@ the header stored in extradata to the key packets:
ffmpeg -i INPUT -map 0 -flags:v +global_header -c:v libx264 -bsf:v dump_extra out.ts ffmpeg -i INPUT -map 0 -flags:v +global_header -c:v libx264 -bsf:v dump_extra out.ts
@end example @end example
@section dca_core
Extract DCA core from DTS-HD streams.
@section h264_mp4toannexb @section h264_mp4toannexb
Convert an H.264 bitstream from length prefixed mode to start code Convert an H.264 bitstream from length prefixed mode to start code
@ -143,26 +139,6 @@ ffmpeg -i frame_%d.jpg -c:v copy rotated.avi
@section mp3_header_decompress @section mp3_header_decompress
@section mpeg4_unpack_bframes
Unpack DivX-style packed B-frames.
DivX-style packed B-frames are not valid MPEG-4 and were only a
workaround for the broken Video for Windows subsystem.
They use more space, can cause minor AV sync issues, require more
CPU power to decode (unless the player has some decoded picture queue
to compensate the 2,0,2,0 frame per packet style) and cause
trouble if copied into a standard container like mp4 or mpeg-ps/ts,
because MPEG-4 decoders may not be able to decode them, since they are
not valid MPEG-4.
For example to fix an AVI file containing an MPEG-4 stream with
DivX-style packed B-frames using @command{ffmpeg}, you can use the command:
@example
ffmpeg -i INPUT.avi -codec copy -bsf:v mpeg4_unpack_bframes OUTPUT.avi
@end example
@section noise @section noise
Damages the contents of packets without damaging the container. Can be Damages the contents of packets without damaging the container. Can be

View File

@ -7,28 +7,20 @@ V
Disable the default terse mode, the full command issued by make and its Disable the default terse mode, the full command issued by make and its
output will be shown on the screen. output will be shown on the screen.
DBG
Preprocess x86 external assembler files to a .dbg.asm file in the object
directory, which then gets compiled. Helps in developing those assembler
files.
DESTDIR DESTDIR
Destination directory for the install targets, useful to prepare packages Destination directory for the install targets, useful to prepare packages
or install FFmpeg in cross-environments. or install FFmpeg in cross-environments.
GEN
Set to 1 to generate the missing or mismatched references.
Makefile targets: Makefile targets:
all all
Default target, builds all the libraries and the executables. Default target, builds all the libraries and the executables.
fate fate
Run the fate test suite, note that you must have installed it. Run the fate test suite, note you must have installed it
fate-list fate-list
List all fate/regression test targets. Will list all fate/regression test targets
install install
Install headers, libraries and programs. Install headers, libraries and programs.
@ -39,23 +31,26 @@ examples
libavformat/output-example libavformat/output-example
Build the libavformat basic example. Build the libavformat basic example.
libavcodec/api-example
Build the libavcodec basic example.
libswscale/swscale-test libswscale/swscale-test
Build the swscale self-test (useful also as an example). Build the swscale self-test (useful also as example).
config config
Reconfigure the project with the current configuration. Reconfigure the project with current configuration.
Useful standard make commands: Useful standard make commands:
make -t <target> make -t <target>
Touch all files that otherwise would be built, this is useful to reduce Touch all files that otherwise would be build, this is useful to reduce
unneeded rebuilding when changing headers, but note that you must force rebuilds unneeded rebuilding when changing headers, but note you must force rebuilds
of files that actually need it by hand then. of files that actually need it by hand then.
make -j<num> make -j<num>
Rebuild with multiple jobs at the same time. Faster on multi processor systems. rebuild with multiple jobs at the same time. Faster on multi processor systems
make -k make -k
Continue build in case of errors, this is useful for the regression tests continue build in case of errors, this is useful for the regression tests
sometimes but note that it will still not run all reg tests. sometimes but note it will still not run all reg tests.

View File

@ -7,7 +7,7 @@ all the encoders and decoders. In addition each codec may support
so-called private options, which are specific for a given codec. so-called private options, which are specific for a given codec.
Sometimes, a global option may only affect a specific kind of codec, Sometimes, a global option may only affect a specific kind of codec,
and may be nonsensical or ignored by another, so you need to be aware and may be unsensical or ignored by another, so you need to be aware
of the meaning of the specified options. Also some options are of the meaning of the specified options. Also some options are
meant only for decoding or encoding. meant only for decoding or encoding.
@ -129,7 +129,7 @@ should be @code{1 / frame_rate} and timestamp increments should be
identically 1. identically 1.
@item g @var{integer} (@emph{encoding,video}) @item g @var{integer} (@emph{encoding,video})
Set the group of picture (GOP) size. Default value is 12. Set the group of picture size. Default value is 12.
@item ar @var{integer} (@emph{decoding/encoding,audio}) @item ar @var{integer} (@emph{decoding/encoding,audio})
Set audio sampling rate (in Hz). Set audio sampling rate (in Hz).
@ -257,7 +257,7 @@ Specify how strictly to follow the standards.
Possible values: Possible values:
@table @samp @table @samp
@item very @item very
strictly conform to an older more strict version of the spec or reference software strictly conform to a older more strict version of the spec or reference software
@item strict @item strict
strictly conform to all the things in the spec no matter what consequences strictly conform to all the things in the spec no matter what consequences
@item normal @item normal
@ -456,9 +456,6 @@ Possible values:
@item aspect @var{rational number} (@emph{encoding,video}) @item aspect @var{rational number} (@emph{encoding,video})
Set sample aspect ratio. Set sample aspect ratio.
@item sar @var{rational number} (@emph{encoding,video})
Set sample aspect ratio. Alias to @var{aspect}.
@item debug @var{flags} (@emph{decoding/encoding,audio,video,subtitles}) @item debug @var{flags} (@emph{decoding/encoding,audio,video,subtitles})
Print specific debug info. Print specific debug info.
@ -478,9 +475,6 @@ per-block quantization parameter (QP)
motion vector motion vector
@item dct_coeff @item dct_coeff
@item green_metadata
display complexity metadata for the upcoming frame, GoP or for a given duration.
@item skip @item skip
@item startcode @item startcode
@ -501,8 +495,6 @@ visualize block types
picture buffer allocations picture buffer allocations
@item thread_ops @item thread_ops
threading operations threading operations
@item nomc
skip motion compensation
@end table @end table
@item vismv @var{integer} (@emph{decoding,video}) @item vismv @var{integer} (@emph{decoding,video})
@ -820,17 +812,13 @@ for codecs that support it. See also @file{doc/examples/export_mvs.c}.
Deprecated, use mpegvideo private options instead. Deprecated, use mpegvideo private options instead.
@item threads @var{integer} (@emph{decoding/encoding,video}) @item threads @var{integer} (@emph{decoding/encoding,video})
Set the number of threads to be used, in case the selected codec
implementation supports multi-threading.
Possible values: Possible values:
@table @samp @table @samp
@item auto, 0 @item auto
automatically select the number of threads to set detect a good number of threads
@end table @end table
Default value is @samp{auto}.
@item me_threshold @var{integer} (@emph{encoding,video}) @item me_threshold @var{integer} (@emph{encoding,video})
Set motion estimation threshold. Set motion estimation threshold.
@ -875,14 +863,6 @@ Possible values:
@item mpeg2_aac_he @item mpeg2_aac_he
@item mpeg4_sp
@item mpeg4_core
@item mpeg4_main
@item mpeg4_asp
@item dts @item dts
@item dts_es @item dts_es
@ -1050,44 +1030,9 @@ Possible values:
@item rc_min_vbv_use @var{float} (@emph{encoding,video}) @item rc_min_vbv_use @var{float} (@emph{encoding,video})
@item ticks_per_frame @var{integer} (@emph{decoding/encoding,audio,video}) @item ticks_per_frame @var{integer} (@emph{decoding/encoding,audio,video})
@item color_primaries @var{integer} (@emph{decoding/encoding,video}) @item color_primaries @var{integer} (@emph{decoding/encoding,video})
@item color_trc @var{integer} (@emph{decoding/encoding,video}) @item color_trc @var{integer} (@emph{decoding/encoding,video})
Possible values:
@table @samp
@item bt709
BT.709
@item gamma22
BT.470 M
@item gamma28
BT.470 BG
@item linear
SMPTE 170 M
@item log
SMPTE 240 M
@item log_sqrt
Linear
@item iec61966_2_4
Log
@item bt1361
Log square root
@item iec61966_2_1
IEC 61966-2-4
@item bt2020_10bit
BT.1361
@item bt2020_12bit
IEC 61966-2-1
@item smpte2084
BT.2020 - 10 bit
@item smpte428_1
BT.2020 - 12 bit
@end table
@item colorspace @var{integer} (@emph{decoding/encoding,video}) @item colorspace @var{integer} (@emph{decoding/encoding,video})
@item color_range @var{integer} (@emph{decoding/encoding,video}) @item color_range @var{integer} (@emph{decoding/encoding,video})
If used as input parameter, it serves as a hint to the decoder, which
color_range the input has.
@item chroma_sample_location @var{integer} (@emph{decoding/encoding,video}) @item chroma_sample_location @var{integer} (@emph{decoding/encoding,video})
@item log_level_offset @var{integer} @item log_level_offset @var{integer}

View File

@ -25,13 +25,6 @@ enabled decoders.
A description of some of the currently available video decoders A description of some of the currently available video decoders
follows. follows.
@section hevc
HEVC / H.265 decoder.
Note: the @option{skip_loop_filter} option has effect only at level
@code{all}.
@section rawvideo @section rawvideo
Raw video decoder. Raw video decoder.
@ -90,23 +83,6 @@ Loud sounds are fully compressed. Soft sounds are enhanced.
@end table @end table
@section flac
FLAC audio decoder.
This decoder aims to implement the complete FLAC specification from Xiph.
@subsection FLAC Decoder options
@table @option
@item -use_buggy_lpc
The lavc FLAC encoder used to produce buggy streams with high lpc values
(like the default value). This option makes it possible to decode such streams
correctly by using lavc's old buggy lpc logic for decoding.
@end table
@section ffwavesynth @section ffwavesynth
Internal wave synthetizer. Internal wave synthetizer.
@ -195,25 +171,6 @@ without this library.
@chapter Subtitles Decoders @chapter Subtitles Decoders
@c man begin SUBTILES DECODERS @c man begin SUBTILES DECODERS
@section dvbsub
@subsection Options
@table @option
@item compute_clut
@table @option
@item -1
Compute clut if no matching CLUT is in the stream.
@item 0
Never compute CLUT
@item 1
Always compute CLUT and override the one provided in the stream.
@end table
@item dvb_substream
Selects the dvb substream, or all substreams if -1 which is default.
@end table
@section dvdsub @section dvdsub
This codec decodes the bitmap subtitles used in DVDs; the same subtitles can This codec decodes the bitmap subtitles used in DVDs; the same subtitles can
@ -279,16 +236,10 @@ present between the subtitle lines because of double-sized teletext charactes.
Default value is 1. Default value is 1.
@item txt_duration @item txt_duration
Sets the display duration of the decoded teletext pages or subtitles in Sets the display duration of the decoded teletext pages or subtitles in
milliseconds. Default value is 30000 which is 30 seconds. miliseconds. Default value is 30000 which is 30 seconds.
@item txt_transparent @item txt_transparent
Force transparent background of the generated teletext bitmaps. Default value Force transparent background of the generated teletext bitmaps. Default value
is 0 which means an opaque background. is 0 which means an opaque (black) background.
@item txt_opacity
Sets the opacity (0-255) of the teletext background. If
@option{txt_transparent} is not set, it only affects characters between a start
box and an end box, typically subtitles. Default value is 0 if
@option{txt_transparent} is set, 255 otherwise.
@end table @end table
@c man end SUBTILES DECODERS @c man end SUBTILES DECODERS

View File

@ -18,12 +18,6 @@ enabled demuxers.
The description of some of the currently available demuxers follows. The description of some of the currently available demuxers follows.
@section aa
Audible Format 2, 3, and 4 demuxer.
This demuxer is used to demux Audible Format 2, 3, and 4 (.aa) files.
@section applehttp @section applehttp
Apple HTTP Live Streaming demuxer. Apple HTTP Live Streaming demuxer.
@ -104,7 +98,7 @@ All subsequent file-related directives apply to that file.
@item @code{ffconcat version 1.0} @item @code{ffconcat version 1.0}
Identify the script type and version. It also sets the @option{safe} option Identify the script type and version. It also sets the @option{safe} option
to 1 if it was -1. to 1 if it was to its default -1.
To make FFmpeg recognize the format automatically, this directive must To make FFmpeg recognize the format automatically, this directive must
appears exactly as is (no extra space or byte-order-mark) on the very first appears exactly as is (no extra space or byte-order-mark) on the very first
@ -118,47 +112,6 @@ file is not available or accurate.
If the duration is set for all files, then it is possible to seek in the If the duration is set for all files, then it is possible to seek in the
whole concatenated video. whole concatenated video.
@item @code{inpoint @var{timestamp}}
In point of the file. When the demuxer opens the file it instantly seeks to the
specified timestamp. Seeking is done so that all streams can be presented
successfully at In point.
This directive works best with intra frame codecs, because for non-intra frame
ones you will usually get extra packets before the actual In point and the
decoded content will most likely contain frames before In point too.
For each file, packets before the file In point will have timestamps less than
the calculated start timestamp of the file (negative in case of the first
file), and the duration of the files (if not specified by the @code{duration}
directive) will be reduced based on their specified In point.
Because of potential packets before the specified In point, packet timestamps
may overlap between two concatenated files.
@item @code{outpoint @var{timestamp}}
Out point of the file. When the demuxer reaches the specified decoding
timestamp in any of the streams, it handles it as an end of file condition and
skips the current and all the remaining packets from all streams.
Out point is exclusive, which means that the demuxer will not output packets
with a decoding timestamp greater or equal to Out point.
This directive works best with intra frame codecs and formats where all streams
are tightly interleaved. For non-intra frame codecs you will usually get
additional packets with presentation timestamp after Out point therefore the
decoded content will most likely contain frames after Out point too. If your
streams are not tightly interleaved you may not get all the packets from all
streams before Out point and you may only will be able to decode the earliest
stream until Out point.
The duration of the files (if not specified by the @code{duration}
directive) will be reduced based on their specified Out point.
@item @code{file_packet_metadata @var{key=value}}
Metadata of the packets of the file. The specified metadata will be set for
each file packet. You can specify this directive multiple times to add multiple
metadata entries.
@item @code{stream} @item @code{stream}
Introduce a stream in the virtual file. Introduce a stream in the virtual file.
All subsequent stream-related directives apply to the last introduced All subsequent stream-related directives apply to the last introduced
@ -192,57 +145,19 @@ component.
If set to 0, any file name is accepted. If set to 0, any file name is accepted.
The default is 1. The default is -1, it is equivalent to 1 if the format was automatically
-1 is equivalent to 1 if the format was automatically
probed and 0 otherwise. probed and 0 otherwise.
@item auto_convert @item auto_convert
If set to 1, try to perform automatic conversions on packet data to make the If set to 1, try to perform automatic conversions on packet data to make the
streams concatenable. streams concatenable.
The default is 1.
Currently, the only conversion is adding the h264_mp4toannexb bitstream Currently, the only conversion is adding the h264_mp4toannexb bitstream
filter to H.264 streams in MP4 format. This is necessary in particular if filter to H.264 streams in MP4 format. This is necessary in particular if
there are resolution changes. there are resolution changes.
@item segment_time_metadata
If set to 1, every packet will contain the @var{lavf.concat.start_time} and the
@var{lavf.concat.duration} packet metadata values which are the start_time and
the duration of the respective file segments in the concatenated output
expressed in microseconds. The duration metadata is only set if it is known
based on the concat file.
The default is 0.
@end table @end table
@subsection Examples
@itemize
@item
Use absolute filenames and include some comments:
@example
# my first filename
file /mnt/share/file-1.wav
# my second filename including whitespace
file '/mnt/share/file 2.wav'
# my third filename including whitespace plus single quote
file '/mnt/share/file 3'\''.wav'
@end example
@item
Allow for input format auto-probing, use safe filenames and set the duration of
the first file:
@example
ffconcat version 1.0
file file-1.wav
duration 20.0
file subdir/file-2.wav
@end example
@end itemize
@section flv @section flv
Adobe Flash Video Format demuxer. Adobe Flash Video Format demuxer.
@ -267,32 +182,17 @@ track. Track indexes start at 0. The demuxer exports the number of tracks as
For very large files, the @option{max_size} option may have to be adjusted. For very large files, the @option{max_size} option may have to be adjusted.
@section libopenmpt @section libquvi
libopenmpt based module demuxer Play media from Internet services using the quvi project.
See @url{https://lib.openmpt.org/libopenmpt/} for more information. The demuxer accepts a @option{format} option to request a specific quality. It
is by default set to @var{best}.
Some files have multiple subsongs (tracks) this can be set with the @option{subsong} See @url{http://quvi.sourceforge.net/} for more information.
option.
It accepts the following options: FFmpeg needs to be built with @code{--enable-libquvi} for this demuxer to be
enabled.
@table @option
@item subsong
Set the subsong index. This can be either 'all', 'auto', or the index of the
subsong. Subsong indexes start at 0. The default is 'auto'.
The default value is to let libopenmpt choose.
@item layout
Set the channel layout. Valid values are 1, 2, and 4 channel layouts.
The default value is STEREO.
@item sample_rate
Set the sample rate for libopenmpt to output.
Range is from 1000 to INT_MAX. The value default is 48000.
@end table
@section gif @section gif
@ -305,11 +205,6 @@ It accepts the following options:
Set the minimum valid delay between frames in hundredths of seconds. Set the minimum valid delay between frames in hundredths of seconds.
Range is 0 to 6000. Default value is 2. Range is 0 to 6000. Default value is 2.
@item max_gif_delay
Set the maximum valid delay between frames in hundredth of seconds.
Range is 0 to 65535. Default value is 65535 (nearly eleven minutes),
the maximum value allowed by the specification.
@item default_delay @item default_delay
Set the default delay between frames in hundredths of seconds. Set the default delay between frames in hundredths of seconds.
Range is 0 to 6000. Default value is 10. Range is 0 to 6000. Default value is 10.
@ -358,10 +253,6 @@ Select the pattern type used to interpret the provided filename.
@var{pattern_type} accepts one of the following values. @var{pattern_type} accepts one of the following values.
@table @option @table @option
@item none
Disable pattern matching, therefore the video will only contain the specified
image. You should use this option if you do not want to create sequences from
multiple images and your filenames may contain special pattern characters.
@item sequence @item sequence
Select a sequence pattern type, used to specify a sequence of files Select a sequence pattern type, used to specify a sequence of files
indexed by sequential numbers. indexed by sequential numbers.
@ -468,9 +359,9 @@ ffmpeg -framerate 10 -pattern_type glob -i "*.png" out.mkv
@end example @end example
@end itemize @end itemize
@section mov/mp4/3gp/QuickTime @section mov/mp4/3gp/Quicktme
QuickTime / MP4 demuxer. Quicktime / MP4 demuxer.
This demuxer accepts the following options: This demuxer accepts the following options:
@table @option @table @option
@ -489,41 +380,13 @@ is known to be non malicious.
MPEG-2 transport stream demuxer. MPEG-2 transport stream demuxer.
This demuxer accepts the following options:
@table @option @table @option
@item resync_size
Set size limit for looking up a new synchronization. Default value is
65536.
@item fix_teletext_pts @item fix_teletext_pts
Override teletext packet PTS and DTS values with the timestamps calculated Overrides teletext packet PTS and DTS values with the timestamps calculated
from the PCR of the first program which the teletext stream is part of and is from the PCR of the first program which the teletext stream is part of and is
not discarded. Default value is 1, set this option to 0 if you want your not discarded. Default value is 1, set this option to 0 if you want your
teletext packet PTS and DTS values untouched. teletext packet PTS and DTS values untouched.
@item ts_packetsize
Output option carrying the raw packet size in bytes.
Show the detected raw packet size, cannot be set by the user.
@item scan_all_pmts
Scan and combine all PMTs. The value is an integer with value from -1
to 1 (-1 means automatic setting, 1 means enabled, 0 means
disabled). Default value is -1.
@end table
@section mpjpeg
MJPEG encapsulated in multi-part MIME demuxer.
This demuxer allows reading of MJPEG, where each frame is represented as a part of
multipart/x-mixed-replace stream.
@table @option
@item strict_mime_boundary
Default implementation applies a relaxed standard to multi-part MIME boundary detection,
to prevent regression with numerous existing endpoints not generating a proper MIME
MJPEG stream. Turning this option on by setting it to 1 will result in a stricter check
of the boundary value.
@end table @end table
@section rawvideo @section rawvideo

View File

@ -1,5 +1,4 @@
\input texinfo @c -*- texinfo -*- \input texinfo @c -*- texinfo -*-
@documentencoding UTF-8
@settitle Developer Documentation @settitle Developer Documentation
@titlepage @titlepage
@ -28,14 +27,14 @@ this document.
For more detailed legal information about the use of FFmpeg in For more detailed legal information about the use of FFmpeg in
external programs read the @file{LICENSE} file in the source tree and external programs read the @file{LICENSE} file in the source tree and
consult @url{https://ffmpeg.org/legal.html}. consult @url{http://ffmpeg.org/legal.html}.
@section Contributing @section Contributing
There are 3 ways by which code gets into FFmpeg. There are 3 ways by which code gets into ffmpeg.
@itemize @bullet @itemize @bullet
@item Submitting patches to the main developer mailing list. @item Submitting Patches to the main developer mailing list
See @ref{Submitting patches} for details. see @ref{Submitting patches} for details.
@item Directly committing changes to the main tree. @item Directly committing changes to the main tree.
@item Committing changes to a git clone, for example on github.com or @item Committing changes to a git clone, for example on github.com or
gitorious.org. And asking us to merge these changes. gitorious.org. And asking us to merge these changes.
@ -65,9 +64,6 @@ rejected by the git repository.
@item @item
You should try to limit your code lines to 80 characters; however, do so if You should try to limit your code lines to 80 characters; however, do so if
and only if this improves readability. and only if this improves readability.
@item
K&R coding style is used.
@end itemize @end itemize
The presentation is one inspired by 'indent -i4 -kr -nut'. The presentation is one inspired by 'indent -i4 -kr -nut'.
@ -127,10 +123,10 @@ the @samp{inline} keyword;
@samp{//} comments; @samp{//} comments;
@item @item
designated struct initializers (@samp{struct s x = @{ .i = 17 @};}); designated struct initializers (@samp{struct s x = @{ .i = 17 @};})
@item @item
compound literals (@samp{x = (struct s) @{ 17, 23 @};}). compound literals (@samp{x = (struct s) @{ 17, 23 @};})
@end itemize @end itemize
These features are supported by all compilers we care about, so we will not These features are supported by all compilers we care about, so we will not
@ -159,7 +155,7 @@ GCC statement expressions (@samp{(x = (@{ int y = 4; y; @})}).
All names should be composed with underscores (_), not CamelCase. For example, All names should be composed with underscores (_), not CamelCase. For example,
@samp{avfilter_get_video_buffer} is an acceptable function name and @samp{avfilter_get_video_buffer} is an acceptable function name and
@samp{AVFilterGetVideo} is not. The exception from this are type names, like @samp{AVFilterGetVideo} is not. The exception from this are type names, like
for example structs and enums; they should always be in CamelCase. for example structs and enums; they should always be in the CamelCase
There are the following conventions for naming variables and functions: There are the following conventions for naming variables and functions:
@ -231,7 +227,7 @@ autocmd InsertEnter * match ForbiddenWhitespace /\t\|\s\+\%#\@@<!$/
@end example @end example
For Emacs, add these roughly equivalent lines to your @file{.emacs.d/init.el}: For Emacs, add these roughly equivalent lines to your @file{.emacs.d/init.el}:
@lisp @example
(c-add-style "ffmpeg" (c-add-style "ffmpeg"
'("k&r" '("k&r"
(c-basic-offset . 4) (c-basic-offset . 4)
@ -242,7 +238,7 @@ For Emacs, add these roughly equivalent lines to your @file{.emacs.d/init.el}:
) )
) )
(setq c-default-style "ffmpeg") (setq c-default-style "ffmpeg")
@end lisp @end example
@section Development Policy @section Development Policy
@ -397,41 +393,12 @@ or obfuscates the code.
Make sure that no parts of the codebase that you maintain are missing from the Make sure that no parts of the codebase that you maintain are missing from the
@file{MAINTAINERS} file. If something that you want to maintain is missing add it with @file{MAINTAINERS} file. If something that you want to maintain is missing add it with
your name after it. your name after it.
If at some point you no longer want to maintain some code, then please help in If at some point you no longer want to maintain some code, then please help
finding a new maintainer and also don't forget to update the @file{MAINTAINERS} file. finding a new maintainer and also don't forget updating the @file{MAINTAINERS} file.
@end enumerate @end enumerate
We think our rules are not too hard. If you have comments, contact us. We think our rules are not too hard. If you have comments, contact us.
@section Code of conduct
Be friendly and respectful towards others and third parties.
Treat others the way you yourself want to be treated.
Be considerate. Not everyone shares the same viewpoint and priorities as you do.
Different opinions and interpretations help the project.
Looking at issues from a different perspective assists development.
Do not assume malice for things that can be attributed to incompetence. Even if
it is malice, it's rarely good to start with that as initial assumption.
Stay friendly even if someone acts contrarily. Everyone has a bad day
once in a while.
If you yourself have a bad day or are angry then try to take a break and reply
once you are calm and without anger if you have to.
Try to help other team members and cooperate if you can.
The goal of software development is to create technical excellence, not for any
individual to be better and "win" against the others. Large software projects
are only possible and successful through teamwork.
If someone struggles do not put them down. Give them a helping hand
instead and point them in the right direction.
Finally, keep in mind the immortal words of Bill and Ted,
"Be excellent to each other."
@anchor{Submitting patches} @anchor{Submitting patches}
@section Submitting patches @section Submitting patches
@ -439,7 +406,7 @@ First, read the @ref{Coding Rules} above if you did not yet, in particular
the rules regarding patch submission. the rules regarding patch submission.
When you submit your patch, please use @code{git format-patch} or When you submit your patch, please use @code{git format-patch} or
@code{git send-email}. We cannot read other diffs :-). @code{git send-email}. We cannot read other diffs :-)
Also please do not submit a patch which contains several unrelated changes. Also please do not submit a patch which contains several unrelated changes.
Split it into separate, self-contained pieces. This does not mean splitting Split it into separate, self-contained pieces. This does not mean splitting
@ -462,7 +429,7 @@ Also please if you send several patches, send each patch as a separate mail,
do not attach several unrelated patches to the same mail. do not attach several unrelated patches to the same mail.
Patches should be posted to the Patches should be posted to the
@uref{https://lists.ffmpeg.org/mailman/listinfo/ffmpeg-devel, ffmpeg-devel} @uref{http://lists.ffmpeg.org/mailman/listinfo/ffmpeg-devel, ffmpeg-devel}
mailing list. Use @code{git send-email} when possible since it will properly mailing list. Use @code{git send-email} when possible since it will properly
send patches without requiring extra care. If you cannot, then send patches send patches without requiring extra care. If you cannot, then send patches
as base64-encoded attachments, so your patch is not trashed during as base64-encoded attachments, so your patch is not trashed during
@ -575,10 +542,6 @@ tools/trasher, the noise bitstream filter, and
should not crash, end in a (near) infinite loop, or allocate ridiculous should not crash, end in a (near) infinite loop, or allocate ridiculous
amounts of memory when fed damaged data. amounts of memory when fed damaged data.
@item
Did you test your decoder or demuxer against sample files?
Samples may be obtained at @url{https://samples.ffmpeg.org}.
@item @item
Does the patch not mix functional and cosmetic changes? Does the patch not mix functional and cosmetic changes?
@ -599,7 +562,7 @@ If the patch fixes a bug, did you provide a verbose analysis of the bug?
If the patch fixes a bug, did you provide enough information, including If the patch fixes a bug, did you provide enough information, including
a sample, so the bug can be reproduced and the fix can be verified? a sample, so the bug can be reproduced and the fix can be verified?
Note please do not attach samples >100k to mails but rather provide a Note please do not attach samples >100k to mails but rather provide a
URL, you can upload to ftp://upload.ffmpeg.org. URL, you can upload to ftp://upload.ffmpeg.org
@item @item
Did you provide a verbose summary about what the patch does change? Did you provide a verbose summary about what the patch does change?
@ -628,10 +591,10 @@ Lines with similar content should be aligned vertically when doing so
improves readability. improves readability.
@item @item
Consider adding a regression test for your code. Consider to add a regression test for your code.
@item @item
If you added YASM code please check that things still work with --disable-yasm. If you added YASM code please check that things still work with --disable-yasm
@item @item
Make sure you check the return values of function and return appropriate Make sure you check the return values of function and return appropriate
@ -669,10 +632,6 @@ not related to the comments received during review. Such patches will
be rejected. Instead, submit significant changes or new features as be rejected. Instead, submit significant changes or new features as
separate patches. separate patches.
Everyone is welcome to review patches. Also if you are waiting for your patch
to be reviewed, please consider helping to review other patches, that is a great
way to get everyone's patches reviewed sooner.
@anchor{Regression tests} @anchor{Regression tests}
@section Regression tests @section Regression tests
@ -688,14 +647,15 @@ accordingly].
@subsection Adding files to the fate-suite dataset @subsection Adding files to the fate-suite dataset
When there is no muxer or encoder available to generate test media for a When there is no muxer or encoder available to generate test media for a
specific test then the media has to be included in the fate-suite. specific test then the media has to be inlcuded in the fate-suite.
First please make sure that the sample file is as small as possible to test the First please make sure that the sample file is as small as possible to test the
respective decoder or demuxer sufficiently. Large files increase network respective decoder or demuxer sufficiently. Large files increase network
bandwidth and disk space requirements. bandwidth and disk space requirements.
Once you have a working fate test and fate sample, provide in the commit Once you have a working fate test and fate sample, provide in the commit
message or introductory message for the patch series that you post to message or introductionary message for the patch series that you post to
the ffmpeg-devel mailing list, a direct link to download the sample media. the ffmpeg-devel mailing list, a direct link to download the sample media.
@subsection Visualizing Test Coverage @subsection Visualizing Test Coverage
The FFmpeg build system allows visualizing the test coverage in an easy The FFmpeg build system allows visualizing the test coverage in an easy
@ -743,7 +703,7 @@ FFmpeg maintains a set of @strong{release branches}, which are the
recommended deliverable for system integrators and distributors (such as recommended deliverable for system integrators and distributors (such as
Linux distributions, etc.). At regular times, a @strong{release Linux distributions, etc.). At regular times, a @strong{release
manager} prepares, tests and publishes tarballs on the manager} prepares, tests and publishes tarballs on the
@url{https://ffmpeg.org} website. @url{http://ffmpeg.org} website.
There are two kinds of releases: There are two kinds of releases:
@ -822,7 +782,7 @@ Prepare the release tarballs in @code{bz2} and @code{gz} formats, and
supplementing files that contain @code{gpg} signatures supplementing files that contain @code{gpg} signatures
@item @item
Publish the tarballs at @url{https://ffmpeg.org/releases}. Create and Publish the tarballs at @url{http://ffmpeg.org/releases}. Create and
push an annotated tag in the form @code{nX}, with @code{X} push an annotated tag in the form @code{nX}, with @code{X}
containing the version number. containing the version number.
@ -834,7 +794,7 @@ with a news entry for the website.
Publish the news entry. Publish the news entry.
@item @item
Send an announcement to the mailing list. Send announcement to the mailing list.
@end enumerate @end enumerate
@bye @bye

View File

@ -1,21 +1,13 @@
#!/bin/sh #!/bin/sh
OUT_DIR="${1}" SRC_PATH="${1}"
DOXYFILE="${2}" DOXYFILE="${2}"
DOXYGEN="${3}" DOXYGEN="${3}"
shift 3 shift 3
if [ -e "VERSION" ]; then
VERSION=`cat "VERSION"`
else
VERSION=`git describe`
fi
$DOXYGEN - <<EOF $DOXYGEN - <<EOF
@INCLUDE = ${DOXYFILE} @INCLUDE = ${DOXYFILE}
INPUT = $@ INPUT = $@
HTML_TIMESTAMP = NO EXAMPLE_PATH = ${SRC_PATH}/doc/examples
PROJECT_NUMBER = $VERSION
OUTPUT_DIRECTORY = $OUT_DIR
EOF EOF

1
doc/doxy/.gitignore vendored
View File

@ -1 +0,0 @@
/html/

View File

@ -30,119 +30,81 @@ follows.
Advanced Audio Coding (AAC) encoder. Advanced Audio Coding (AAC) encoder.
This encoder is the default AAC encoder, natively implemented into FFmpeg. Its This encoder is an experimental FFmpeg-native AAC encoder. Currently only the
quality is on par or better than libfdk_aac at the default bitrate of 128kbps. low complexity (AAC-LC) profile is supported. To use this encoder, you must set
This encoder also implements more options, profiles and samplerates than @option{strict} option to @samp{experimental} or lower.
other encoders (with only the AAC-HE profile pending to be implemented) so this
encoder has become the default and is the recommended choice. As this encoder is experimental, unexpected behavior may exist from time to
time. For a more stable AAC encoder, see @ref{libvo-aacenc}. However, be warned
that it has a worse quality reported by some users.
@c todo @ref{libaacplus}
See also @ref{libfdk-aac-enc,,libfdk_aac} and @ref{libfaac}.
@subsection Options @subsection Options
@table @option @table @option
@item b @item b
Set bit rate in bits/s. Setting this automatically activates constant bit rate Set bit rate in bits/s. Setting this automatically activates constant bit rate
(CBR) mode. If this option is unspecified it is set to 128kbps. (CBR) mode.
@item q @item q
Set quality for variable bit rate (VBR) mode. This option is valid only using Set quality for variable bit rate (VBR) mode. This option is valid only using
the @command{ffmpeg} command-line tool. For library interface users, use the @command{ffmpeg} command-line tool. For library interface users, use
@option{global_quality}. @option{global_quality}.
@item cutoff @item stereo_mode
Set cutoff frequency. If unspecified will allow the encoder to dynamically Set stereo encoding mode. Possible values:
adjust the cutoff to improve clarity on low bitrates.
@table @samp
@item auto
Automatically selected by the encoder.
@item ms_off
Disable middle/side encoding. This is the default.
@item ms_force
Force middle/side encoding.
@end table
@item aac_coder @item aac_coder
Set AAC encoder coding method. Possible values: Set AAC encoder coding method. Possible values:
@table @samp @table @samp
@item faac
FAAC-inspired method.
This method is a simplified reimplementation of the method used in FAAC, which
sets thresholds proportional to the band energies, and then decreases all the
thresholds with quantizer steps to find the appropriate quantization with
distortion below threshold band by band.
The quality of this method is comparable to the two loop searching method
described below, but somewhat a little better and slower.
@item anmr
Average noise to mask ratio (ANMR) trellis-based solution.
This has a theoretic best quality out of all the coding methods, but at the
cost of the slowest speed.
@item twoloop @item twoloop
Two loop searching (TLS) method. Two loop searching (TLS) method.
This method first sets quantizers depending on band thresholds and then tries This method first sets quantizers depending on band thresholds and then tries
to find an optimal combination by adding or subtracting a specific value from to find an optimal combination by adding or subtracting a specific value from
all quantizers and adjusting some individual quantizer a little. all quantizers and adjusting some individual quantizer a little.
Will tune itself based on whether aac_is/aac_ms/aac_pns are enabled.
This is the default choice for a coder.
@item anmr This method produces similar quality with the FAAC method and is the default.
Average noise to mask ratio (ANMR) trellis-based solution.
This is an experimental coder which currently produces a lower quality, is more
unstable and is slower than the default twoloop coder but has potential.
Currently has no support for the @option{aac_is} or @option{aac_pns} options.
Not currently recommended.
@item fast @item fast
Constant quantizer method. Constant quantizer method.
This method sets a constant quantizer for all bands. This is the fastest of all This method sets a constant quantizer for all bands. This is the fastest of all
the methods and has no rate control or support for @option{aac_is} or the methods, yet produces the worst quality.
@option{aac_pns}.
Not recommended.
@end table @end table
@item aac_ms
Sets mid/side coding mode. The default value of auto will automatically use
M/S with bands which will benefit from such coding. Can be forced for all bands
using the value "enable", which is mainly useful for debugging or disabled using
"disable".
@item aac_is
Sets intensity stereo coding tool usage. By default, it's enabled and will
automatically toggle IS for similar pairs of stereo bands if it's benefitial.
Can be disabled for debugging by setting the value to "disable".
@item aac_pns
Uses perceptual noise substitution to replace low entropy high frequency bands
with imperceivable white noise during the decoding process. By default, it's
enabled, but can be disabled for debugging purposes by using "disable".
@item aac_tns
Enables the use of a multitap FIR filter which spans through the high frequency
bands to hide quantization noise during the encoding process and is reverted
by the decoder. As well as decreasing unpleasant artifacts in the high range
this also reduces the entropy in the high bands and allows for more bits to
be used by the mid-low bands. By default it's enabled but can be disabled for
debugging by setting the option to "disable".
@item aac_ltp
Enables the use of the long term prediction extension which increases coding
efficiency in very low bandwidth situations such as encoding of voice or
solo piano music by extending constant harmonic peaks in bands throughout
frames. This option is implied by profile:a aac_low and is incompatible with
aac_pred. Use in conjunction with @option{-ar} to decrease the samplerate.
@item aac_pred
Enables the use of a more traditional style of prediction where the spectral
coefficients transmitted are replaced by the difference of the current
coefficients minus the previous "predicted" coefficients. In theory and sometimes
in practice this can improve quality for low to mid bitrate audio.
This option implies the aac_main profile and is incompatible with aac_ltp.
@item profile
Sets the encoding profile, possible values:
@table @samp
@item aac_low
The default, AAC "Low-complexity" profile. Is the most compatible and produces
decent quality.
@item mpeg2_aac_low
Equivalent to -profile:a aac_low -aac_pns 0. PNS was introduced with the MPEG4
specifications.
@item aac_ltp
Long term prediction profile, is enabled by and will enable the aac_ltp option.
Introduced in MPEG4.
@item aac_main
Main-type prediction profile, is enabled by and will enable the aac_pred option.
Introduced in MPEG2.
If this option is unspecified it is set to @samp{aac_low}.
@end table
@end table @end table
@section ac3 and ac3_fixed @section ac3 and ac3_fixed
@ -532,98 +494,21 @@ Selected by Encoder (default)
@end table @end table
@anchor{flac}
@section flac
FLAC (Free Lossless Audio Codec) Encoder
@subsection Options
The following options are supported by FFmpeg's flac encoder.
@table @option
@item compression_level
Sets the compression level, which chooses defaults for many other options
if they are not set explicitly.
@item frame_size
Sets the size of the frames in samples per channel.
@item lpc_coeff_precision
Sets the LPC coefficient precision, valid values are from 1 to 15, 15 is the
default.
@item lpc_type
Sets the first stage LPC algorithm
@table @samp
@item none
LPC is not used
@item fixed
fixed LPC coefficients
@item levinson
@item cholesky
@end table
@item lpc_passes
Number of passes to use for Cholesky factorization during LPC analysis
@item min_partition_order
The minimum partition order
@item max_partition_order
The maximum partition order
@item prediction_order_method
@table @samp
@item estimation
@item 2level
@item 4level
@item 8level
@item search
Bruteforce search
@item log
@end table
@item ch_mode
Channel mode
@table @samp
@item auto
The mode is chosen automatically for each frame
@item indep
Chanels are independently coded
@item left_side
@item right_side
@item mid_side
@end table
@item exact_rice_parameters
Chooses if rice parameters are calculated exactly or approximately.
if set to 1 then they are chosen exactly, which slows the code down slightly and
improves compression slightly.
@item multi_dim_quant
Multi Dimensional Quantization. If set to 1 then a 2nd stage LPC algorithm is
applied after the first stage to finetune the coefficients. This is quite slow
and slightly improves compression.
@end table
@anchor{libfaac} @anchor{libfaac}
@section libfaac @section libfaac
libfaac AAC (Advanced Audio Coding) encoder wrapper. libfaac AAC (Advanced Audio Coding) encoder wrapper.
This encoder is of much lower quality and is more unstable than any other AAC Requires the presence of the libfaac headers and library during
encoders, so it's highly recommended to instead use other encoders, like configuration. You need to explicitly configure the build with
@ref{aacenc,,the native FFmpeg AAC encoder}.
This encoder also requires the presence of the libfaac headers and library
during configuration. You need to explicitly configure the build with
@code{--enable-libfaac --enable-nonfree}. @code{--enable-libfaac --enable-nonfree}.
This encoder is considered to be of higher quality with respect to the
@ref{aacenc,,the native experimental FFmpeg AAC encoder}.
For more information see the libfaac project at
@url{http://www.audiocoding.com/faac.html/}.
@subsection Options @subsection Options
The following shared FFmpeg codec options are recognized. The following shared FFmpeg codec options are recognized.
@ -730,10 +615,9 @@ configuration. You need to explicitly configure the build with
so if you allow the use of GPL, you should configure with so if you allow the use of GPL, you should configure with
@code{--enable-gpl --enable-nonfree --enable-libfdk-aac}. @code{--enable-gpl --enable-nonfree --enable-libfdk-aac}.
This encoder is considered to produce output on par or worse at 128kbps to the This encoder is considered to be of higher quality with respect to
@ref{aacenc,,the native FFmpeg AAC encoder} but can often produce better both @ref{aacenc,,the native experimental FFmpeg AAC encoder} and
sounding audio at identical or lower bitrates and has support for the @ref{libfaac}.
AAC-HE profiles.
VBR encoding, enabled through the @option{vbr} or @option{flags VBR encoding, enabled through the @option{vbr} or @option{flags
+qscale} options, is experimental and only works with some +qscale} options, is experimental and only works with some
@ -1075,6 +959,31 @@ Set MPEG audio original flag when set to 1. The default value is 0
@end table @end table
@anchor{libvo-aacenc}
@section libvo-aacenc
VisualOn AAC encoder.
Requires the presence of the libvo-aacenc headers and library during
configuration. You need to explicitly configure the build with
@code{--enable-libvo-aacenc --enable-version3}.
This encoder is considered to be worse than the
@ref{aacenc,,native experimental FFmpeg AAC encoder}, according to
multiple sources.
@subsection Options
The VisualOn AAC encoder only support encoding AAC-LC and up to 2
channels. It is also CBR-only.
@table @option
@item b
Set bit rate in bits/s.
@end table
@section libvo-amrwbenc @section libvo-amrwbenc
VisualOn Adaptive Multi-Rate Wideband encoder. VisualOn Adaptive Multi-Rate Wideband encoder.
@ -1137,7 +1046,7 @@ kilobits/s.
@item vbr (@emph{vbr}, @emph{hard-cbr}, and @emph{cvbr}) @item vbr (@emph{vbr}, @emph{hard-cbr}, and @emph{cvbr})
Set VBR mode. The FFmpeg @option{vbr} option has the following Set VBR mode. The FFmpeg @option{vbr} option has the following
valid arguments, with the @command{opusenc} equivalent options valid arguments, with the their @command{opusenc} equivalent options
in parentheses: in parentheses:
@table @samp @table @samp
@ -1184,17 +1093,6 @@ following: 4000, 6000, 8000, 12000, or 20000, corresponding to
narrowband, mediumband, wideband, super wideband, and fullband narrowband, mediumband, wideband, super wideband, and fullband
respectively. The default is 0 (cutoff disabled). respectively. The default is 0 (cutoff disabled).
@item mapping_family (@emph{mapping_family})
Set channel mapping family to be used by the encoder. The default value of -1
uses mapping family 0 for mono and stereo inputs, and mapping family 1
otherwise. The default also disables the surround masking and LFE bandwidth
optimzations in libopus, and requires that the input contains 8 channels or
fewer.
Other values include 0 for mono and stereo, 1 for surround sound with masking
and LFE bandwidth optimizations, and 255 for independent streams with an
unspecified channel layout.
@end table @end table
@section libvorbis @section libvorbis
@ -1365,96 +1263,6 @@ disabled
A description of some of the currently available video encoders A description of some of the currently available video encoders
follows. follows.
@section libopenh264
Cisco libopenh264 H.264/MPEG-4 AVC encoder wrapper.
This encoder requires the presence of the libopenh264 headers and
library during configuration. You need to explicitly configure the
build with @code{--enable-libopenh264}. The library is detected using
@command{pkg-config}.
For more information about the library see
@url{http://www.openh264.org}.
@subsection Options
The following FFmpeg global options affect the configurations of the
libopenh264 encoder.
@table @option
@item b
Set the bitrate (as a number of bits per second).
@item g
Set the GOP size.
@item maxrate
Set the max bitrate (as a number of bits per second).
@item flags +global_header
Set global header in the bitstream.
@item slices
Set the number of slices, used in parallelized encoding. Default value
is 0. This is only used when @option{slice_mode} is set to
@samp{fixed}.
@item slice_mode
Set slice mode. Can assume one of the following possible values:
@table @samp
@item fixed
a fixed number of slices
@item rowmb
one slice per row of macroblocks
@item auto
automatic number of slices according to number of threads
@item dyn
dynamic slicing
@end table
Default value is @samp{auto}.
@item loopfilter
Enable loop filter, if set to 1 (automatically enabled). To disable
set a value of 0.
@item profile
Set profile restrictions. If set to the value of @samp{main} enable
CABAC (set the @code{SEncParamExt.iEntropyCodingModeFlag} flag to 1).
@item max_nal_size
Set maximum NAL size in bytes.
@item allow_skip_frames
Allow skipping frames to hit the target bitrate if set to 1.
@end table
@section jpeg2000
The native jpeg 2000 encoder is lossy by default, the @code{-q:v}
option can be used to set the encoding quality. Lossless encoding
can be selected with @code{-pred 1}.
@subsection Options
@table @option
@item format
Can be set to either @code{j2k} or @code{jp2} (the default) that
makes it possible to store non-rgb pix_fmts.
@end table
@section snow
@subsection Options
@table @option
@item iterative_dia_size
dia size for the iterative motion estimation
@end table
@section libtheora @section libtheora
libtheora Theora encoder wrapper. libtheora Theora encoder wrapper.
@ -1529,159 +1337,113 @@ You need to explicitly configure the build with @code{--enable-libvpx}.
@subsection Options @subsection Options
The following options are supported by the libvpx wrapper. The Mapping from FFmpeg to libvpx options with conversion notes in parentheses.
@command{vpxenc}-equivalent options or values are listed in parentheses
for easy migration.
To reduce the duplication of documentation, only the private options
and some others requiring special attention are documented here. For
the documentation of the undocumented generic options, see
@ref{codec-options,,the Codec Options chapter}.
To get more documentation of the libvpx options, invoke the command
@command{ffmpeg -h encoder=libvpx}, @command{ffmpeg -h encoder=libvpx-vp9} or
@command{vpxenc --help}. Further information is available in the libvpx API
documentation.
@table @option @table @option
@item b (@emph{target-bitrate}) @item threads
Set bitrate in bits/s. Note that FFmpeg's @option{b} option is g_threads
expressed in bits/s, while @command{vpxenc}'s @option{target-bitrate} is in
kilobits/s.
@item g (@emph{kf-max-dist}) @item profile
g_profile
@item keyint_min (@emph{kf-min-dist}) @item vb
rc_target_bitrate
@item qmin (@emph{min-q}) @item g
kf_max_dist
@item qmax (@emph{max-q}) @item keyint_min
kf_min_dist
@item bufsize (@emph{buf-sz}, @emph{buf-optimal-sz}) @item qmin
Set ratecontrol buffer size (in bits). Note @command{vpxenc}'s options are rc_min_quantizer
specified in milliseconds, the libvpx wrapper converts this value as follows:
@code{buf-sz = bufsize * 1000 / bitrate},
@code{buf-optimal-sz = bufsize * 1000 / bitrate * 5 / 6}.
@item rc_init_occupancy (@emph{buf-initial-sz}) @item qmax
Set number of bits which should be loaded into the rc buffer before decoding rc_max_quantizer
starts. Note @command{vpxenc}'s option is specified in milliseconds, the libvpx
wrapper converts this value as follows:
@code{rc_init_occupancy * 1000 / bitrate}.
@item undershoot-pct @item bufsize, vb
Set datarate undershoot (min) percentage of the target bitrate. rc_buf_sz
@code{(bufsize * 1000 / vb)}
@item overshoot-pct rc_buf_optimal_sz
Set datarate overshoot (max) percentage of the target bitrate. @code{(bufsize * 1000 / vb * 5 / 6)}
@item skip_threshold (@emph{drop-frame}) @item rc_init_occupancy, vb
rc_buf_initial_sz
@code{(rc_init_occupancy * 1000 / vb)}
@item qcomp (@emph{bias-pct}) @item rc_buffer_aggressivity
rc_undershoot_pct
@item maxrate (@emph{maxsection-pct}) @item skip_threshold
Set GOP max bitrate in bits/s. Note @command{vpxenc}'s option is specified as a rc_dropframe_thresh
percentage of the target bitrate, the libvpx wrapper converts this value as
follows: @code{(maxrate * 100 / bitrate)}.
@item minrate (@emph{minsection-pct}) @item qcomp
Set GOP min bitrate in bits/s. Note @command{vpxenc}'s option is specified as a rc_2pass_vbr_bias_pct
percentage of the target bitrate, the libvpx wrapper converts this value as
follows: @code{(minrate * 100 / bitrate)}.
@item minrate, maxrate, b @emph{end-usage=cbr} @item maxrate, vb
@code{(minrate == maxrate == bitrate)}. rc_2pass_vbr_maxsection_pct
@code{(maxrate * 100 / vb)}
@item crf (@emph{end-usage=cq}, @emph{cq-level}) @item minrate, vb
rc_2pass_vbr_minsection_pct
@code{(minrate * 100 / vb)}
@item tune (@emph{tune}) @item minrate, maxrate, vb
@table @samp @code{VPX_CBR}
@item psnr (@emph{psnr}) @code{(minrate == maxrate == vb)}
@item ssim (@emph{ssim})
@item crf
@code{VPX_CQ}, @code{VP8E_SET_CQ_LEVEL}
@item quality
@table @option
@item @var{best}
@code{VPX_DL_BEST_QUALITY}
@item @var{good}
@code{VPX_DL_GOOD_QUALITY}
@item @var{realtime}
@code{VPX_DL_REALTIME}
@end table @end table
@item quality, deadline (@emph{deadline}) @item speed
@table @samp @code{VP8E_SET_CPUUSED}
@item best
Use best quality deadline. Poorly named and quite slow, this option should be
avoided as it may give worse quality output than good.
@item good
Use good quality deadline. This is a good trade-off between speed and quality
when used with the @option{cpu-used} option.
@item realtime
Use realtime quality deadline.
@end table
@item speed, cpu-used (@emph{cpu-used}) @item nr
Set quality/speed ratio modifier. Higher values speed up the encode at the cost @code{VP8E_SET_NOISE_SENSITIVITY}
of quality.
@item nr (@emph{noise-sensitivity}) @item mb_threshold
@code{VP8E_SET_STATIC_THRESHOLD}
@item static-thresh @item slices
Set a change threshold on blocks below which they will be skipped by the @code{VP8E_SET_TOKEN_PARTITIONS}
encoder.
@item slices (@emph{token-parts})
Note that FFmpeg's @option{slices} option gives the total number of partitions,
while @command{vpxenc}'s @option{token-parts} is given as
@code{log2(partitions)}.
@item max-intra-rate @item max-intra-rate
Set maximum I-frame bitrate as a percentage of the target bitrate. A value of 0 @code{VP8E_SET_MAX_INTRA_BITRATE_PCT}
means unlimited.
@item force_key_frames @item force_key_frames
@code{VPX_EFLAG_FORCE_KF} @code{VPX_EFLAG_FORCE_KF}
@item Alternate reference frame related @item Alternate reference frame related
@table @option @table @option
@item auto-alt-ref @item vp8flags altref
Enable use of alternate reference frames (2-pass only). @code{VP8E_SET_ENABLEAUTOALTREF}
@item arnr-max-frames @item @var{arnr_max_frames}
Set altref noise reduction max frame count. @code{VP8E_SET_ARNR_MAXFRAMES}
@item arnr-type @item @var{arnr_type}
Set altref noise reduction filter type: backward, forward, centered. @code{VP8E_SET_ARNR_TYPE}
@item arnr-strength @item @var{arnr_strength}
Set altref noise reduction filter strength. @code{VP8E_SET_ARNR_STRENGTH}
@item rc-lookahead, lag-in-frames (@emph{lag-in-frames}) @item @var{rc_lookahead}
Set number of frames to look ahead for frametype and ratecontrol. g_lag_in_frames
@end table @end table
@item error-resilient @item vp8flags error_resilient
Enable error resiliency features. g_error_resilient
@item VP9-specific options @item aq_mode
@table @option @code{VP9E_SET_AQ_MODE}
@item lossless
Enable lossless mode.
@item tile-columns
Set number of tile columns to use. Note this is given as
@code{log2(tile_columns)}. For example, 8 tile columns would be requested by
setting the @option{tile-columns} option to 3.
@item tile-rows
Set number of tile rows to use. Note this is given as @code{log2(tile_rows)}.
For example, 4 tile rows would be requested by setting the @option{tile-rows}
option to 2.
@item frame-parallel
Enable frame parallel decodability features.
@item aq-mode
Set adaptive quantization mode (0: off (default), 1: variance 2: complexity, 3:
cyclic refresh).
@item colorspace @emph{color-space}
Set input color space. The VP9 bitstream supports signaling the following
colorspaces:
@table @option
@item @samp{rgb} @emph{sRGB}
@item @samp{bt709} @emph{bt709}
@item @samp{unspecified} @emph{unknown}
@item @samp{bt470bg} @emph{bt601}
@item @samp{smpte170m} @emph{smpte170}
@item @samp{smpte240m} @emph{smpte240}
@item @samp{bt2020_ncl} @emph{bt2020}
@end table
@end table
@end table @end table
@ -2106,10 +1868,6 @@ For example to specify libx264 encoding options with @command{ffmpeg}:
ffmpeg -i foo.mpg -vcodec libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv ffmpeg -i foo.mpg -vcodec libx264 -x264opts keyint=123:min-keyint=20 -an out.mkv
@end example @end example
@item a53cc @var{boolean}
Import closed captions (which must be ATSC compatible format) into output.
Only the mpeg2 and h264 decoders provide these. Default is 0 (off).
@item x264-params (N.A.) @item x264-params (N.A.)
Override the x264 configuration using a :-separated list of key=value Override the x264 configuration using a :-separated list of key=value
parameters. parameters.
@ -2413,7 +2171,7 @@ Use @var{0} to disable alpha plane coding.
@subsection Speed considerations @subsection Speed considerations
In the default mode of operation the encoder has to honor frame constraints In the default mode of operation the encoder has to honor frame constraints
(i.e. not produce frames with size bigger than requested) while still making (i.e. not produc frames with size bigger than requested) while still making
output picture as good as possible. output picture as good as possible.
A frame containing a lot of small details is harder to compress and the encoder A frame containing a lot of small details is harder to compress and the encoder
would spend more time searching for appropriate quantizers for each slice. would spend more time searching for appropriate quantizers for each slice.
@ -2423,180 +2181,6 @@ Setting a higher @option{bits_per_mb} limit will improve the speed.
For the fastest encoding speed set the @option{qscale} parameter (4 is the For the fastest encoding speed set the @option{qscale} parameter (4 is the
recommended value) and do not set a size constraint. recommended value) and do not set a size constraint.
@section libkvazaar
Kvazaar H.265/HEVC encoder.
Requires the presence of the libkvazaar headers and library during
configuration. You need to explicitly configure the build with
@option{--enable-libkvazaar}.
@subsection Options
@table @option
@item b
Set target video bitrate in bit/s and enable rate control.
@item kvazaar-params
Set kvazaar parameters as a list of @var{name}=@var{value} pairs separated
by commas (,). See kvazaar documentation for a list of options.
@end table
@section QSV encoders
The family of Intel QuickSync Video encoders (MPEG-2, H.264 and HEVC)
The ratecontrol method is selected as follows:
@itemize @bullet
@item
When @option{global_quality} is specified, a quality-based mode is used.
Specifically this means either
@itemize @minus
@item
@var{CQP} - constant quantizer scale, when the @option{qscale} codec flag is
also set (the @option{-qscale} ffmpeg option).
@item
@var{LA_ICQ} - intelligent constant quality with lookahead, when the
@option{look_ahead} option is also set.
@item
@var{ICQ} -- intelligent constant quality otherwise.
@end itemize
@item
Otherwise, a bitrate-based mode is used. For all of those, you should specify at
least the desired average bitrate with the @option{b} option.
@itemize @minus
@item
@var{LA} - VBR with lookahead, when the @option{look_ahead} option is specified.
@item
@var{VCM} - video conferencing mode, when the @option{vcm} option is set.
@item
@var{CBR} - constant bitrate, when @option{maxrate} is specified and equal to
the average bitrate.
@item
@var{VBR} - variable bitrate, when @option{maxrate} is specified, but is higher
than the average bitrate.
@item
@var{AVBR} - average VBR mode, when @option{maxrate} is not specified. This mode
is further configured by the @option{avbr_accuracy} and
@option{avbr_convergence} options.
@end itemize
@end itemize
Note that depending on your system, a different mode than the one you specified
may be selected by the encoder. Set the verbosity level to @var{verbose} or
higher to see the actual settings used by the QSV runtime.
Additional libavcodec global options are mapped to MSDK options as follows:
@itemize
@item
@option{g/gop_size} -> @option{GopPicSize}
@item
@option{bf/max_b_frames}+1 -> @option{GopRefDist}
@item
@option{rc_init_occupancy/rc_initial_buffer_occupancy} ->
@option{InitialDelayInKB}
@item
@option{slices} -> @option{NumSlice}
@item
@option{refs} -> @option{NumRefFrame}
@item
@option{b_strategy/b_frame_strategy} -> @option{BRefType}
@item
@option{cgop/CLOSED_GOP} codec flag -> @option{GopOptFlag}
@item
For the @var{CQP} mode, the @option{i_qfactor/i_qoffset} and
@option{b_qfactor/b_qoffset} set the difference between @var{QPP} and @var{QPI},
and @var{QPP} and @var{QPB} respectively.
@item
Setting the @option{coder} option to the value @var{vlc} will make the H.264
encoder use CAVLC instead of CABAC.
@end itemize
@section vc2
SMPTE VC-2 (previously BBC Dirac Pro). This codec was primarily aimed at
professional broadcasting but since it supports yuv420, yuv422 and yuv444 at
8 (limited range or full range), 10 or 12 bits, this makes it suitable for
other tasks which require low overhead and low compression (like screen
recording).
@subsection Options
@table @option
@item b
Sets target video bitrate. Usually that's around 1:6 of the uncompressed
video bitrate (e.g. for 1920x1080 50fps yuv422p10 that's around 400Mbps). Higher
values (close to the uncompressed bitrate) turn on lossless compression mode.
@item field_order
Enables field coding when set (e.g. to tt - top field first) for interlaced
inputs. Should increase compression with interlaced content as it splits the
fields and encodes each separately.
@item wavelet_depth
Sets the total amount of wavelet transforms to apply, between 1 and 5 (default).
Lower values reduce compression and quality. Less capable decoders may not be
able to handle values of @option{wavelet_depth} over 3.
@item wavelet_type
Sets the transform type. Currently only @var{5_3} (LeGall) and @var{9_7}
(Deslauriers-Dubuc)
are implemented, with 9_7 being the one with better compression and thus
is the default.
@item slice_width
@item slice_height
Sets the slice size for each slice. Larger values result in better compression.
For compatibility with other more limited decoders use @option{slice_width} of
32 and @option{slice_height} of 8.
@item tolerance
Sets the undershoot tolerance of the rate control system in percent. This is
to prevent an expensive search from being run.
@item qm
Sets the quantization matrix preset to use by default or when @option{wavelet_depth}
is set to 5
@itemize @minus
@item
@var{default}
Uses the default quantization matrix from the specifications, extended with
values for the fifth level. This provides a good balance between keeping detail
and omitting artifacts.
@item
@var{flat}
Use a completely zeroed out quantization matrix. This increases PSNR but might
reduce perception. Use in bogus benchmarks.
@item
@var{color}
Reduces detail but attempts to preserve color at extremely low bitrates.
@end itemize
@end table
@c man end VIDEO ENCODERS @c man end VIDEO ENCODERS
@chapter Subtitles Encoders @chapter Subtitles Encoders

View File

@ -76,7 +76,7 @@ EMFILE POSIX ++++++ Too many open files
EMLINK POSIX ++++++ Too many links EMLINK POSIX ++++++ Too many links
EMSGSIZE POSIX +++..+ Message too long EMSGSIZE POSIX +++..+ Message too long
EMULTIHOP POSIX ++4... Multihop attempted EMULTIHOP POSIX ++4... Multihop attempted
ENAMETOOLONG POSIX - ++++++ File name too long ENAMETOOLONG POSIX - ++++++ Filen ame too long
ENAVAIL +..... No XENIX semaphores available ENAVAIL +..... No XENIX semaphores available
ENEEDAUTH .++... Need authenticator ENEEDAUTH .++... Need authenticator
ENETDOWN POSIX +++..+ Network is down ENETDOWN POSIX +++..+ Network is down

View File

@ -1,16 +0,0 @@
/avio_dir_cmd
/avio_reading
/decoding_encoding
/demuxing_decoding
/extract_mvs
/filter_audio
/filtering_audio
/filtering_video
/metadata
/muxing
/pc-uninstalled
/remuxing
/resampling_audio
/scaling_video
/transcode_aac
/transcoding

View File

@ -11,14 +11,12 @@ CFLAGS += -Wall -g
CFLAGS := $(shell pkg-config --cflags $(FFMPEG_LIBS)) $(CFLAGS) CFLAGS := $(shell pkg-config --cflags $(FFMPEG_LIBS)) $(CFLAGS)
LDLIBS := $(shell pkg-config --libs $(FFMPEG_LIBS)) $(LDLIBS) LDLIBS := $(shell pkg-config --libs $(FFMPEG_LIBS)) $(LDLIBS)
EXAMPLES= avio_dir_cmd \ EXAMPLES= avio_reading \
avio_reading \
decoding_encoding \ decoding_encoding \
demuxing_decoding \ demuxing_decoding \
extract_mvs \ extract_mvs \
filtering_video \ filtering_video \
filtering_audio \ filtering_audio \
http_multiclient \
metadata \ metadata \
muxing \ muxing \
remuxing \ remuxing \

View File

@ -1,180 +0,0 @@
/*
* Copyright (c) 2014 Lukasz Marek
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavformat/avio.h>
static const char *type_string(int type)
{
switch (type) {
case AVIO_ENTRY_DIRECTORY:
return "<DIR>";
case AVIO_ENTRY_FILE:
return "<FILE>";
case AVIO_ENTRY_BLOCK_DEVICE:
return "<BLOCK DEVICE>";
case AVIO_ENTRY_CHARACTER_DEVICE:
return "<CHARACTER DEVICE>";
case AVIO_ENTRY_NAMED_PIPE:
return "<PIPE>";
case AVIO_ENTRY_SYMBOLIC_LINK:
return "<LINK>";
case AVIO_ENTRY_SOCKET:
return "<SOCKET>";
case AVIO_ENTRY_SERVER:
return "<SERVER>";
case AVIO_ENTRY_SHARE:
return "<SHARE>";
case AVIO_ENTRY_WORKGROUP:
return "<WORKGROUP>";
case AVIO_ENTRY_UNKNOWN:
default:
break;
}
return "<UNKNOWN>";
}
static int list_op(const char *input_dir)
{
AVIODirEntry *entry = NULL;
AVIODirContext *ctx = NULL;
int cnt, ret;
char filemode[4], uid_and_gid[20];
if ((ret = avio_open_dir(&ctx, input_dir, NULL)) < 0) {
av_log(NULL, AV_LOG_ERROR, "Cannot open directory: %s.\n", av_err2str(ret));
goto fail;
}
cnt = 0;
for (;;) {
if ((ret = avio_read_dir(ctx, &entry)) < 0) {
av_log(NULL, AV_LOG_ERROR, "Cannot list directory: %s.\n", av_err2str(ret));
goto fail;
}
if (!entry)
break;
if (entry->filemode == -1) {
snprintf(filemode, 4, "???");
} else {
snprintf(filemode, 4, "%3"PRIo64, entry->filemode);
}
snprintf(uid_and_gid, 20, "%"PRId64"(%"PRId64")", entry->user_id, entry->group_id);
if (cnt == 0)
av_log(NULL, AV_LOG_INFO, "%-9s %12s %30s %10s %s %16s %16s %16s\n",
"TYPE", "SIZE", "NAME", "UID(GID)", "UGO", "MODIFIED",
"ACCESSED", "STATUS_CHANGED");
av_log(NULL, AV_LOG_INFO, "%-9s %12"PRId64" %30s %10s %s %16"PRId64" %16"PRId64" %16"PRId64"\n",
type_string(entry->type),
entry->size,
entry->name,
uid_and_gid,
filemode,
entry->modification_timestamp,
entry->access_timestamp,
entry->status_change_timestamp);
avio_free_directory_entry(&entry);
cnt++;
};
fail:
avio_close_dir(&ctx);
return ret;
}
static int del_op(const char *url)
{
int ret = avpriv_io_delete(url);
if (ret < 0)
av_log(NULL, AV_LOG_ERROR, "Cannot delete '%s': %s.\n", url, av_err2str(ret));
return ret;
}
static int move_op(const char *src, const char *dst)
{
int ret = avpriv_io_move(src, dst);
if (ret < 0)
av_log(NULL, AV_LOG_ERROR, "Cannot move '%s' into '%s': %s.\n", src, dst, av_err2str(ret));
return ret;
}
static void usage(const char *program_name)
{
fprintf(stderr, "usage: %s OPERATION entry1 [entry2]\n"
"API example program to show how to manipulate resources "
"accessed through AVIOContext.\n"
"OPERATIONS:\n"
"list list content of the directory\n"
"move rename content in directory\n"
"del delete content in directory\n",
program_name);
}
int main(int argc, char *argv[])
{
const char *op = NULL;
int ret;
av_log_set_level(AV_LOG_DEBUG);
if (argc < 2) {
usage(argv[0]);
return 1;
}
/* register codecs and formats and other lavf/lavc components*/
av_register_all();
avformat_network_init();
op = argv[1];
if (strcmp(op, "list") == 0) {
if (argc < 3) {
av_log(NULL, AV_LOG_INFO, "Missing argument for list operation.\n");
ret = AVERROR(EINVAL);
} else {
ret = list_op(argv[2]);
}
} else if (strcmp(op, "del") == 0) {
if (argc < 3) {
av_log(NULL, AV_LOG_INFO, "Missing argument for del operation.\n");
ret = AVERROR(EINVAL);
} else {
ret = del_op(argv[2]);
}
} else if (strcmp(op, "move") == 0) {
if (argc < 4) {
av_log(NULL, AV_LOG_INFO, "Missing argument for move operation.\n");
ret = AVERROR(EINVAL);
} else {
ret = move_op(argv[2], argv[3]);
}
} else {
av_log(NULL, AV_LOG_INFO, "Invalid operation %s\n", op);
ret = AVERROR(EINVAL);
}
avformat_network_deinit();
return ret < 0 ? 1 : 0;
}

View File

@ -25,9 +25,9 @@
* libavcodec API use example. * libavcodec API use example.
* *
* @example decoding_encoding.c * @example decoding_encoding.c
* Note that libavcodec only handles codecs (MPEG, MPEG-4, etc...), * Note that libavcodec only handles codecs (mpeg, mpeg4, etc...),
* not file formats (AVI, VOB, MP4, MOV, MKV, MXF, FLV, MPEG-TS, MPEG-PS, etc...). * not file formats (avi, vob, mp4, mov, mkv, mxf, flv, mpegts, mpegps, etc...). See library 'libavformat' for the
* See library 'libavformat' for the format handling * format handling
*/ */
#include <math.h> #include <math.h>
@ -211,7 +211,7 @@ static void audio_encode_example(const char *filename)
} }
if (got_output) { if (got_output) {
fwrite(pkt.data, 1, pkt.size, f); fwrite(pkt.data, 1, pkt.size, f);
av_packet_unref(&pkt); av_free_packet(&pkt);
} }
} }
@ -225,7 +225,7 @@ static void audio_encode_example(const char *filename)
if (got_output) { if (got_output) {
fwrite(pkt.data, 1, pkt.size, f); fwrite(pkt.data, 1, pkt.size, f);
av_packet_unref(&pkt); av_free_packet(&pkt);
} }
} }
fclose(f); fclose(f);
@ -245,7 +245,7 @@ static void audio_decode_example(const char *outfilename, const char *filename)
AVCodecContext *c= NULL; AVCodecContext *c= NULL;
int len; int len;
FILE *f, *outfile; FILE *f, *outfile;
uint8_t inbuf[AUDIO_INBUF_SIZE + AV_INPUT_BUFFER_PADDING_SIZE]; uint8_t inbuf[AUDIO_INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
AVPacket avpkt; AVPacket avpkt;
AVFrame *decoded_frame = NULL; AVFrame *decoded_frame = NULL;
@ -253,7 +253,7 @@ static void audio_decode_example(const char *outfilename, const char *filename)
printf("Decode audio file %s to %s\n", filename, outfilename); printf("Decode audio file %s to %s\n", filename, outfilename);
/* find the MPEG audio decoder */ /* find the mpeg audio decoder */
codec = avcodec_find_decoder(AV_CODEC_ID_MP2); codec = avcodec_find_decoder(AV_CODEC_ID_MP2);
if (!codec) { if (!codec) {
fprintf(stderr, "Codec not found\n"); fprintf(stderr, "Codec not found\n");
@ -356,7 +356,7 @@ static void video_encode_example(const char *filename, int codec_id)
printf("Encode video file %s\n", filename); printf("Encode video file %s\n", filename);
/* find the video encoder */ /* find the mpeg1 video encoder */
codec = avcodec_find_encoder(codec_id); codec = avcodec_find_encoder(codec_id);
if (!codec) { if (!codec) {
fprintf(stderr, "Codec not found\n"); fprintf(stderr, "Codec not found\n");
@ -454,7 +454,7 @@ static void video_encode_example(const char *filename, int codec_id)
if (got_output) { if (got_output) {
printf("Write frame %3d (size=%5d)\n", i, pkt.size); printf("Write frame %3d (size=%5d)\n", i, pkt.size);
fwrite(pkt.data, 1, pkt.size, f); fwrite(pkt.data, 1, pkt.size, f);
av_packet_unref(&pkt); av_free_packet(&pkt);
} }
} }
@ -471,11 +471,11 @@ static void video_encode_example(const char *filename, int codec_id)
if (got_output) { if (got_output) {
printf("Write frame %3d (size=%5d)\n", i, pkt.size); printf("Write frame %3d (size=%5d)\n", i, pkt.size);
fwrite(pkt.data, 1, pkt.size, f); fwrite(pkt.data, 1, pkt.size, f);
av_packet_unref(&pkt); av_free_packet(&pkt);
} }
} }
/* add sequence end code to have a real MPEG file */ /* add sequence end code to have a real mpeg file */
fwrite(endcode, 1, sizeof(endcode), f); fwrite(endcode, 1, sizeof(endcode), f);
fclose(f); fclose(f);
@ -521,7 +521,7 @@ static int decode_write_frame(const char *outfilename, AVCodecContext *avctx,
/* the picture is allocated by the decoder, no need to free it */ /* the picture is allocated by the decoder, no need to free it */
snprintf(buf, sizeof(buf), outfilename, *frame_count); snprintf(buf, sizeof(buf), outfilename, *frame_count);
pgm_save(frame->data[0], frame->linesize[0], pgm_save(frame->data[0], frame->linesize[0],
frame->width, frame->height, buf); avctx->width, avctx->height, buf);
(*frame_count)++; (*frame_count)++;
} }
if (pkt->data) { if (pkt->data) {
@ -538,17 +538,17 @@ static void video_decode_example(const char *outfilename, const char *filename)
int frame_count; int frame_count;
FILE *f; FILE *f;
AVFrame *frame; AVFrame *frame;
uint8_t inbuf[INBUF_SIZE + AV_INPUT_BUFFER_PADDING_SIZE]; uint8_t inbuf[INBUF_SIZE + FF_INPUT_BUFFER_PADDING_SIZE];
AVPacket avpkt; AVPacket avpkt;
av_init_packet(&avpkt); av_init_packet(&avpkt);
/* set end of buffer to 0 (this ensures that no overreading happens for damaged MPEG streams) */ /* set end of buffer to 0 (this ensures that no overreading happens for damaged mpeg streams) */
memset(inbuf + INBUF_SIZE, 0, AV_INPUT_BUFFER_PADDING_SIZE); memset(inbuf + INBUF_SIZE, 0, FF_INPUT_BUFFER_PADDING_SIZE);
printf("Decode video file %s to %s\n", filename, outfilename); printf("Decode video file %s to %s\n", filename, outfilename);
/* find the MPEG-1 video decoder */ /* find the mpeg1 video decoder */
codec = avcodec_find_decoder(AV_CODEC_ID_MPEG1VIDEO); codec = avcodec_find_decoder(AV_CODEC_ID_MPEG1VIDEO);
if (!codec) { if (!codec) {
fprintf(stderr, "Codec not found\n"); fprintf(stderr, "Codec not found\n");
@ -561,8 +561,8 @@ static void video_decode_example(const char *outfilename, const char *filename)
exit(1); exit(1);
} }
if (codec->capabilities & AV_CODEC_CAP_TRUNCATED) if(codec->capabilities&CODEC_CAP_TRUNCATED)
c->flags |= AV_CODEC_FLAG_TRUNCATED; // we do not send complete frames c->flags|= CODEC_FLAG_TRUNCATED; /* we do not send complete frames */
/* For some codecs, such as msmpeg4 and mpeg4, width and height /* For some codecs, such as msmpeg4 and mpeg4, width and height
MUST be initialized there because this information is not MUST be initialized there because this information is not
@ -613,9 +613,9 @@ static void video_decode_example(const char *outfilename, const char *filename)
exit(1); exit(1);
} }
/* Some codecs, such as MPEG, transmit the I- and P-frame with a /* some codecs, such as MPEG, transmit the I and P frame with a
latency of one frame. You must do the following to have a latency of one frame. You must do the following to have a
chance to get the last frame of the video. */ chance to get the last frame of the video */
avpkt.data = NULL; avpkt.data = NULL;
avpkt.size = 0; avpkt.size = 0;
decode_write_frame(outfilename, c, frame, &frame_count, &avpkt, 1); decode_write_frame(outfilename, c, frame, &frame_count, &avpkt, 1);

View File

@ -36,8 +36,6 @@
static AVFormatContext *fmt_ctx = NULL; static AVFormatContext *fmt_ctx = NULL;
static AVCodecContext *video_dec_ctx = NULL, *audio_dec_ctx; static AVCodecContext *video_dec_ctx = NULL, *audio_dec_ctx;
static int width, height;
static enum AVPixelFormat pix_fmt;
static AVStream *video_stream = NULL, *audio_stream = NULL; static AVStream *video_stream = NULL, *audio_stream = NULL;
static const char *src_filename = NULL; static const char *src_filename = NULL;
static const char *video_dst_filename = NULL; static const char *video_dst_filename = NULL;
@ -55,11 +53,17 @@ static AVPacket pkt;
static int video_frame_count = 0; static int video_frame_count = 0;
static int audio_frame_count = 0; static int audio_frame_count = 0;
/* Enable or disable frame reference counting. You are not supposed to support /* The different ways of decoding and managing data memory. You are not
* both paths in your application but pick the one most appropriate to your * supposed to support all the modes in your application but pick the one most
* needs. Look for the use of refcount in this example to see what are the * appropriate to your needs. Look for the use of api_mode in this example to
* differences of API usage between them. */ * see what are the differences of API usage between them */
static int refcount = 0; enum {
API_MODE_OLD = 0, /* old method, deprecated */
API_MODE_NEW_API_REF_COUNT = 1, /* new method, using the frame reference counting */
API_MODE_NEW_API_NO_REF_COUNT = 2, /* new method, without reference counting */
};
static int api_mode = API_MODE_OLD;
static int decode_packet(int *got_frame, int cached) static int decode_packet(int *got_frame, int cached)
{ {
@ -77,22 +81,6 @@ static int decode_packet(int *got_frame, int cached)
} }
if (*got_frame) { if (*got_frame) {
if (frame->width != width || frame->height != height ||
frame->format != pix_fmt) {
/* To handle this change, one could call av_image_alloc again and
* decode the following frames into another rawvideo file. */
fprintf(stderr, "Error: Width, height and pixel format have to be "
"constant in a rawvideo file, but the width, height or "
"pixel format of the input video changed:\n"
"old: width = %d, height = %d, format = %s\n"
"new: width = %d, height = %d, format = %s\n",
width, height, av_get_pix_fmt_name(pix_fmt),
frame->width, frame->height,
av_get_pix_fmt_name(frame->format));
return -1;
}
printf("video_frame%s n:%d coded_n:%d pts:%s\n", printf("video_frame%s n:%d coded_n:%d pts:%s\n",
cached ? "(cached)" : "", cached ? "(cached)" : "",
video_frame_count++, frame->coded_picture_number, video_frame_count++, frame->coded_picture_number,
@ -102,7 +90,7 @@ static int decode_packet(int *got_frame, int cached)
* this is required since rawvideo expects non aligned data */ * this is required since rawvideo expects non aligned data */
av_image_copy(video_dst_data, video_dst_linesize, av_image_copy(video_dst_data, video_dst_linesize,
(const uint8_t **)(frame->data), frame->linesize, (const uint8_t **)(frame->data), frame->linesize,
pix_fmt, width, height); video_dec_ctx->pix_fmt, video_dec_ctx->width, video_dec_ctx->height);
/* write to rawvideo file */ /* write to rawvideo file */
fwrite(video_dst_data[0], 1, video_dst_bufsize, video_dst_file); fwrite(video_dst_data[0], 1, video_dst_bufsize, video_dst_file);
@ -139,9 +127,9 @@ static int decode_packet(int *got_frame, int cached)
} }
} }
/* If we use frame reference counting, we own the data and need /* If we use the new API with reference counting, we own the data and need
* to de-reference it when we don't use it anymore */ * to de-reference it when we don't use it anymore */
if (*got_frame && refcount) if (*got_frame && api_mode == API_MODE_NEW_API_REF_COUNT)
av_frame_unref(frame); av_frame_unref(frame);
return decoded; return decoded;
@ -150,7 +138,7 @@ static int decode_packet(int *got_frame, int cached)
static int open_codec_context(int *stream_idx, static int open_codec_context(int *stream_idx,
AVFormatContext *fmt_ctx, enum AVMediaType type) AVFormatContext *fmt_ctx, enum AVMediaType type)
{ {
int ret, stream_index; int ret;
AVStream *st; AVStream *st;
AVCodecContext *dec_ctx = NULL; AVCodecContext *dec_ctx = NULL;
AVCodec *dec = NULL; AVCodec *dec = NULL;
@ -162,8 +150,8 @@ static int open_codec_context(int *stream_idx,
av_get_media_type_string(type), src_filename); av_get_media_type_string(type), src_filename);
return ret; return ret;
} else { } else {
stream_index = ret; *stream_idx = ret;
st = fmt_ctx->streams[stream_index]; st = fmt_ctx->streams[*stream_idx];
/* find decoder for the stream */ /* find decoder for the stream */
dec_ctx = st->codec; dec_ctx = st->codec;
@ -175,13 +163,13 @@ static int open_codec_context(int *stream_idx,
} }
/* Init the decoders, with or without reference counting */ /* Init the decoders, with or without reference counting */
av_dict_set(&opts, "refcounted_frames", refcount ? "1" : "0", 0); if (api_mode == API_MODE_NEW_API_REF_COUNT)
av_dict_set(&opts, "refcounted_frames", "1", 0);
if ((ret = avcodec_open2(dec_ctx, dec, &opts)) < 0) { if ((ret = avcodec_open2(dec_ctx, dec, &opts)) < 0) {
fprintf(stderr, "Failed to open %s codec\n", fprintf(stderr, "Failed to open %s codec\n",
av_get_media_type_string(type)); av_get_media_type_string(type));
return ret; return ret;
} }
*stream_idx = stream_index;
} }
return 0; return 0;
@ -221,19 +209,28 @@ int main (int argc, char **argv)
int ret = 0, got_frame; int ret = 0, got_frame;
if (argc != 4 && argc != 5) { if (argc != 4 && argc != 5) {
fprintf(stderr, "usage: %s [-refcount] input_file video_output_file audio_output_file\n" fprintf(stderr, "usage: %s [-refcount=<old|new_norefcount|new_refcount>] "
"input_file video_output_file audio_output_file\n"
"API example program to show how to read frames from an input file.\n" "API example program to show how to read frames from an input file.\n"
"This program reads frames from a file, decodes them, and writes decoded\n" "This program reads frames from a file, decodes them, and writes decoded\n"
"video frames to a rawvideo file named video_output_file, and decoded\n" "video frames to a rawvideo file named video_output_file, and decoded\n"
"audio frames to a rawaudio file named audio_output_file.\n\n" "audio frames to a rawaudio file named audio_output_file.\n\n"
"If the -refcount option is specified, the program use the\n" "If the -refcount option is specified, the program use the\n"
"reference counting frame system which allows keeping a copy of\n" "reference counting frame system which allows keeping a copy of\n"
"the data for longer than one decode call.\n" "the data for longer than one decode call. If unset, it's using\n"
"the classic old method.\n"
"\n", argv[0]); "\n", argv[0]);
exit(1); exit(1);
} }
if (argc == 5 && !strcmp(argv[1], "-refcount")) { if (argc == 5) {
refcount = 1; const char *mode = argv[1] + strlen("-refcount=");
if (!strcmp(mode, "old")) api_mode = API_MODE_OLD;
else if (!strcmp(mode, "new_norefcount")) api_mode = API_MODE_NEW_API_NO_REF_COUNT;
else if (!strcmp(mode, "new_refcount")) api_mode = API_MODE_NEW_API_REF_COUNT;
else {
fprintf(stderr, "unknow mode '%s'\n", mode);
exit(1);
}
argv++; argv++;
} }
src_filename = argv[1]; src_filename = argv[1];
@ -267,11 +264,9 @@ int main (int argc, char **argv)
} }
/* allocate image where the decoded image will be put */ /* allocate image where the decoded image will be put */
width = video_dec_ctx->width;
height = video_dec_ctx->height;
pix_fmt = video_dec_ctx->pix_fmt;
ret = av_image_alloc(video_dst_data, video_dst_linesize, ret = av_image_alloc(video_dst_data, video_dst_linesize,
width, height, pix_fmt, 1); video_dec_ctx->width, video_dec_ctx->height,
video_dec_ctx->pix_fmt, 1);
if (ret < 0) { if (ret < 0) {
fprintf(stderr, "Could not allocate raw video buffer\n"); fprintf(stderr, "Could not allocate raw video buffer\n");
goto end; goto end;
@ -299,7 +294,12 @@ int main (int argc, char **argv)
goto end; goto end;
} }
frame = av_frame_alloc(); /* When using the new API, you need to use the libavutil/frame.h API, while
* the classic frame management is available in libavcodec */
if (api_mode == API_MODE_OLD)
frame = avcodec_alloc_frame();
else
frame = av_frame_alloc();
if (!frame) { if (!frame) {
fprintf(stderr, "Could not allocate frame\n"); fprintf(stderr, "Could not allocate frame\n");
ret = AVERROR(ENOMEM); ret = AVERROR(ENOMEM);
@ -326,7 +326,7 @@ int main (int argc, char **argv)
pkt.data += ret; pkt.data += ret;
pkt.size -= ret; pkt.size -= ret;
} while (pkt.size > 0); } while (pkt.size > 0);
av_packet_unref(&orig_pkt); av_free_packet(&orig_pkt);
} }
/* flush cached frames */ /* flush cached frames */
@ -341,7 +341,7 @@ int main (int argc, char **argv)
if (video_stream) { if (video_stream) {
printf("Play the output video file with the command:\n" printf("Play the output video file with the command:\n"
"ffplay -f rawvideo -pix_fmt %s -video_size %dx%d %s\n", "ffplay -f rawvideo -pix_fmt %s -video_size %dx%d %s\n",
av_get_pix_fmt_name(pix_fmt), width, height, av_get_pix_fmt_name(video_dec_ctx->pix_fmt), video_dec_ctx->width, video_dec_ctx->height,
video_dst_filename); video_dst_filename);
} }
@ -376,7 +376,10 @@ end:
fclose(video_dst_file); fclose(video_dst_file);
if (audio_dst_file) if (audio_dst_file)
fclose(audio_dst_file); fclose(audio_dst_file);
av_frame_free(&frame); if (api_mode == API_MODE_OLD)
avcodec_free_frame(&frame);
else
av_frame_free(&frame);
av_free(video_dst_data[0]); av_free(video_dst_data[0]);
return ret < 0; return ret < 0;

View File

@ -167,7 +167,7 @@ int main(int argc, char **argv)
pkt.data += ret; pkt.data += ret;
pkt.size -= ret; pkt.size -= ret;
} while (pkt.size > 0); } while (pkt.size > 0);
av_packet_unref(&orig_pkt); av_free_packet(&orig_pkt);
} }
/* flush cached frames */ /* flush cached frames */

View File

@ -33,6 +33,7 @@
#include <libavcodec/avcodec.h> #include <libavcodec/avcodec.h>
#include <libavformat/avformat.h> #include <libavformat/avformat.h>
#include <libavfilter/avfiltergraph.h> #include <libavfilter/avfiltergraph.h>
#include <libavfilter/avcodec.h>
#include <libavfilter/buffersink.h> #include <libavfilter/buffersink.h>
#include <libavfilter/buffersrc.h> #include <libavfilter/buffersrc.h>
#include <libavutil/opt.h> #include <libavutil/opt.h>
@ -65,7 +66,7 @@ static int open_input_file(const char *filename)
/* select the audio stream */ /* select the audio stream */
ret = av_find_best_stream(fmt_ctx, AVMEDIA_TYPE_AUDIO, -1, -1, &dec, 0); ret = av_find_best_stream(fmt_ctx, AVMEDIA_TYPE_AUDIO, -1, -1, &dec, 0);
if (ret < 0) { if (ret < 0) {
av_log(NULL, AV_LOG_ERROR, "Cannot find an audio stream in the input file\n"); av_log(NULL, AV_LOG_ERROR, "Cannot find a audio stream in the input file\n");
return ret; return ret;
} }
audio_stream_index = ret; audio_stream_index = ret;
@ -144,28 +145,12 @@ static int init_filters(const char *filters_descr)
goto end; goto end;
} }
/* /* Endpoints for the filter graph. */
* Set the endpoints for the filter graph. The filter_graph will
* be linked to the graph described by filters_descr.
*/
/*
* The buffer source output must be connected to the input pad of
* the first filter described by filters_descr; since the first
* filter input label is not specified, it is set to "in" by
* default.
*/
outputs->name = av_strdup("in"); outputs->name = av_strdup("in");
outputs->filter_ctx = buffersrc_ctx; outputs->filter_ctx = buffersrc_ctx;
outputs->pad_idx = 0; outputs->pad_idx = 0;
outputs->next = NULL; outputs->next = NULL;
/*
* The buffer sink input must be connected to the output pad of
* the last filter described by filters_descr; since the last
* filter output label is not specified, it is set to "out" by
* default.
*/
inputs->name = av_strdup("out"); inputs->name = av_strdup("out");
inputs->filter_ctx = buffersink_ctx; inputs->filter_ctx = buffersink_ctx;
inputs->pad_idx = 0; inputs->pad_idx = 0;
@ -273,10 +258,10 @@ int main(int argc, char **argv)
} }
if (packet.size <= 0) if (packet.size <= 0)
av_packet_unref(&packet0); av_free_packet(&packet0);
} else { } else {
/* discard non-wanted packets */ /* discard non-wanted packets */
av_packet_unref(&packet0); av_free_packet(&packet0);
} }
} }
end: end:

View File

@ -33,14 +33,12 @@
#include <libavcodec/avcodec.h> #include <libavcodec/avcodec.h>
#include <libavformat/avformat.h> #include <libavformat/avformat.h>
#include <libavfilter/avfiltergraph.h> #include <libavfilter/avfiltergraph.h>
#include <libavfilter/avcodec.h>
#include <libavfilter/buffersink.h> #include <libavfilter/buffersink.h>
#include <libavfilter/buffersrc.h> #include <libavfilter/buffersrc.h>
#include <libavutil/opt.h> #include <libavutil/opt.h>
const char *filter_descr = "scale=78:24,transpose=cclock"; const char *filter_descr = "scale=78:24";
/* other way:
scale=78:24 [scl]; [scl] transpose=cclock // assumes "[in]" and "[out]" to be input output pads respectively
*/
static AVFormatContext *fmt_ctx; static AVFormatContext *fmt_ctx;
static AVCodecContext *dec_ctx; static AVCodecContext *dec_ctx;
@ -130,28 +128,12 @@ static int init_filters(const char *filters_descr)
goto end; goto end;
} }
/* /* Endpoints for the filter graph. */
* Set the endpoints for the filter graph. The filter_graph will
* be linked to the graph described by filters_descr.
*/
/*
* The buffer source output must be connected to the input pad of
* the first filter described by filters_descr; since the first
* filter input label is not specified, it is set to "in" by
* default.
*/
outputs->name = av_strdup("in"); outputs->name = av_strdup("in");
outputs->filter_ctx = buffersrc_ctx; outputs->filter_ctx = buffersrc_ctx;
outputs->pad_idx = 0; outputs->pad_idx = 0;
outputs->next = NULL; outputs->next = NULL;
/*
* The buffer sink input must be connected to the output pad of
* the last filter described by filters_descr; since the last
* filter output label is not specified, it is set to "out" by
* default.
*/
inputs->name = av_strdup("out"); inputs->name = av_strdup("out");
inputs->filter_ctx = buffersink_ctx; inputs->filter_ctx = buffersink_ctx;
inputs->pad_idx = 0; inputs->pad_idx = 0;
@ -262,7 +244,7 @@ int main(int argc, char **argv)
av_frame_unref(frame); av_frame_unref(frame);
} }
} }
av_packet_unref(&packet); av_free_packet(&packet);
} }
end: end:
avfilter_graph_free(&filter_graph); avfilter_graph_free(&filter_graph);

View File

@ -1,155 +0,0 @@
/*
* Copyright (c) 2015 Stephan Holljes
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* @file
* libavformat multi-client network API usage example.
*
* @example http_multiclient.c
* This example will serve a file without decoding or demuxing it over http.
* Multiple clients can connect and will receive the same file.
*/
#include <libavformat/avformat.h>
#include <libavutil/opt.h>
#include <unistd.h>
void process_client(AVIOContext *client, const char *in_uri)
{
AVIOContext *input = NULL;
uint8_t buf[1024];
int ret, n, reply_code;
char *resource = NULL;
while ((ret = avio_handshake(client)) > 0) {
av_opt_get(client, "resource", AV_OPT_SEARCH_CHILDREN, &resource);
// check for strlen(resource) is necessary, because av_opt_get()
// may return empty string.
if (resource && strlen(resource))
break;
}
if (ret < 0)
goto end;
av_log(client, AV_LOG_TRACE, "resource=%p\n", resource);
if (resource && resource[0] == '/' && !strcmp((resource + 1), in_uri)) {
reply_code = 200;
} else {
reply_code = AVERROR_HTTP_NOT_FOUND;
}
if ((ret = av_opt_set_int(client, "reply_code", reply_code, AV_OPT_SEARCH_CHILDREN)) < 0) {
av_log(client, AV_LOG_ERROR, "Failed to set reply_code: %s.\n", av_err2str(ret));
goto end;
}
av_log(client, AV_LOG_TRACE, "Set reply code to %d\n", reply_code);
while ((ret = avio_handshake(client)) > 0);
if (ret < 0)
goto end;
fprintf(stderr, "Handshake performed.\n");
if (reply_code != 200)
goto end;
fprintf(stderr, "Opening input file.\n");
if ((ret = avio_open2(&input, in_uri, AVIO_FLAG_READ, NULL, NULL)) < 0) {
av_log(input, AV_LOG_ERROR, "Failed to open input: %s: %s.\n", in_uri,
av_err2str(ret));
goto end;
}
for(;;) {
n = avio_read(input, buf, sizeof(buf));
if (n < 0) {
if (n == AVERROR_EOF)
break;
av_log(input, AV_LOG_ERROR, "Error reading from input: %s.\n",
av_err2str(n));
break;
}
avio_write(client, buf, n);
avio_flush(client);
}
end:
fprintf(stderr, "Flushing client\n");
avio_flush(client);
fprintf(stderr, "Closing client\n");
avio_close(client);
fprintf(stderr, "Closing input\n");
avio_close(input);
}
int main(int argc, char **argv)
{
av_log_set_level(AV_LOG_TRACE);
AVDictionary *options = NULL;
AVIOContext *client = NULL, *server = NULL;
const char *in_uri, *out_uri;
int ret, pid;
if (argc < 3) {
printf("usage: %s input http://hostname[:port]\n"
"API example program to serve http to multiple clients.\n"
"\n", argv[0]);
return 1;
}
in_uri = argv[1];
out_uri = argv[2];
av_register_all();
avformat_network_init();
if ((ret = av_dict_set(&options, "listen", "2", 0)) < 0) {
fprintf(stderr, "Failed to set listen mode for server: %s\n", av_err2str(ret));
return ret;
}
if ((ret = avio_open2(&server, out_uri, AVIO_FLAG_WRITE, NULL, &options)) < 0) {
fprintf(stderr, "Failed to open server: %s\n", av_err2str(ret));
return ret;
}
fprintf(stderr, "Entering main loop.\n");
for(;;) {
if ((ret = avio_accept(server, &client)) < 0)
goto end;
fprintf(stderr, "Accepted client, forking process.\n");
// XXX: Since we don't reap our children and don't ignore signals
// this produces zombie processes.
pid = fork();
if (pid < 0) {
perror("Fork failed");
ret = AVERROR(errno);
goto end;
}
if (pid == 0) {
fprintf(stderr, "In child.\n");
process_client(client, in_uri);
avio_close(server);
exit(0);
}
if (pid > 0)
avio_close(client);
}
end:
avio_close(server);
if (ret < 0 && ret != AVERROR_EOF) {
fprintf(stderr, "Some errors occurred: %s\n", av_err2str(ret));
return 1;
}
return 0;
}

View File

@ -52,7 +52,6 @@
// a wrapper around a single output AVStream // a wrapper around a single output AVStream
typedef struct OutputStream { typedef struct OutputStream {
AVStream *st; AVStream *st;
AVCodecContext *enc;
/* pts of the next frame that will be generated */ /* pts of the next frame that will be generated */
int64_t next_pts; int64_t next_pts;
@ -105,18 +104,13 @@ static void add_stream(OutputStream *ost, AVFormatContext *oc,
exit(1); exit(1);
} }
ost->st = avformat_new_stream(oc, NULL); ost->st = avformat_new_stream(oc, *codec);
if (!ost->st) { if (!ost->st) {
fprintf(stderr, "Could not allocate stream\n"); fprintf(stderr, "Could not allocate stream\n");
exit(1); exit(1);
} }
ost->st->id = oc->nb_streams-1; ost->st->id = oc->nb_streams-1;
c = avcodec_alloc_context3(*codec); c = ost->st->codec;
if (!c) {
fprintf(stderr, "Could not alloc an encoding context\n");
exit(1);
}
ost->enc = c;
switch ((*codec)->type) { switch ((*codec)->type) {
case AVMEDIA_TYPE_AUDIO: case AVMEDIA_TYPE_AUDIO:
@ -161,7 +155,7 @@ static void add_stream(OutputStream *ost, AVFormatContext *oc,
c->gop_size = 12; /* emit one intra frame every twelve frames at most */ c->gop_size = 12; /* emit one intra frame every twelve frames at most */
c->pix_fmt = STREAM_PIX_FMT; c->pix_fmt = STREAM_PIX_FMT;
if (c->codec_id == AV_CODEC_ID_MPEG2VIDEO) { if (c->codec_id == AV_CODEC_ID_MPEG2VIDEO) {
/* just for testing, we also add B-frames */ /* just for testing, we also add B frames */
c->max_b_frames = 2; c->max_b_frames = 2;
} }
if (c->codec_id == AV_CODEC_ID_MPEG1VIDEO) { if (c->codec_id == AV_CODEC_ID_MPEG1VIDEO) {
@ -178,7 +172,7 @@ static void add_stream(OutputStream *ost, AVFormatContext *oc,
/* Some formats want stream headers to be separate. */ /* Some formats want stream headers to be separate. */
if (oc->oformat->flags & AVFMT_GLOBALHEADER) if (oc->oformat->flags & AVFMT_GLOBALHEADER)
c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER; c->flags |= CODEC_FLAG_GLOBAL_HEADER;
} }
/**************************************************************/ /**************************************************************/
@ -219,7 +213,7 @@ static void open_audio(AVFormatContext *oc, AVCodec *codec, OutputStream *ost, A
int ret; int ret;
AVDictionary *opt = NULL; AVDictionary *opt = NULL;
c = ost->enc; c = ost->st->codec;
/* open it */ /* open it */
av_dict_copy(&opt, opt_arg, 0); av_dict_copy(&opt, opt_arg, 0);
@ -236,7 +230,7 @@ static void open_audio(AVFormatContext *oc, AVCodec *codec, OutputStream *ost, A
/* increment frequency by 110 Hz per second */ /* increment frequency by 110 Hz per second */
ost->tincr2 = 2 * M_PI * 110.0 / c->sample_rate / c->sample_rate; ost->tincr2 = 2 * M_PI * 110.0 / c->sample_rate / c->sample_rate;
if (c->codec->capabilities & AV_CODEC_CAP_VARIABLE_FRAME_SIZE) if (c->codec->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE)
nb_samples = 10000; nb_samples = 10000;
else else
nb_samples = c->frame_size; nb_samples = c->frame_size;
@ -246,13 +240,6 @@ static void open_audio(AVFormatContext *oc, AVCodec *codec, OutputStream *ost, A
ost->tmp_frame = alloc_audio_frame(AV_SAMPLE_FMT_S16, c->channel_layout, ost->tmp_frame = alloc_audio_frame(AV_SAMPLE_FMT_S16, c->channel_layout,
c->sample_rate, nb_samples); c->sample_rate, nb_samples);
/* copy the stream parameters to the muxer */
ret = avcodec_parameters_from_context(ost->st->codecpar, c);
if (ret < 0) {
fprintf(stderr, "Could not copy the stream parameters\n");
exit(1);
}
/* create resampler context */ /* create resampler context */
ost->swr_ctx = swr_alloc(); ost->swr_ctx = swr_alloc();
if (!ost->swr_ctx) { if (!ost->swr_ctx) {
@ -284,13 +271,13 @@ static AVFrame *get_audio_frame(OutputStream *ost)
int16_t *q = (int16_t*)frame->data[0]; int16_t *q = (int16_t*)frame->data[0];
/* check if we want to generate more frames */ /* check if we want to generate more frames */
if (av_compare_ts(ost->next_pts, ost->enc->time_base, if (av_compare_ts(ost->next_pts, ost->st->codec->time_base,
STREAM_DURATION, (AVRational){ 1, 1 }) >= 0) STREAM_DURATION, (AVRational){ 1, 1 }) >= 0)
return NULL; return NULL;
for (j = 0; j <frame->nb_samples; j++) { for (j = 0; j <frame->nb_samples; j++) {
v = (int)(sin(ost->t) * 10000); v = (int)(sin(ost->t) * 10000);
for (i = 0; i < ost->enc->channels; i++) for (i = 0; i < ost->st->codec->channels; i++)
*q++ = v; *q++ = v;
ost->t += ost->tincr; ost->t += ost->tincr;
ost->tincr += ost->tincr2; ost->tincr += ost->tincr2;
@ -316,7 +303,7 @@ static int write_audio_frame(AVFormatContext *oc, OutputStream *ost)
int dst_nb_samples; int dst_nb_samples;
av_init_packet(&pkt); av_init_packet(&pkt);
c = ost->enc; c = ost->st->codec;
frame = get_audio_frame(ost); frame = get_audio_frame(ost);
@ -396,7 +383,7 @@ static AVFrame *alloc_picture(enum AVPixelFormat pix_fmt, int width, int height)
static void open_video(AVFormatContext *oc, AVCodec *codec, OutputStream *ost, AVDictionary *opt_arg) static void open_video(AVFormatContext *oc, AVCodec *codec, OutputStream *ost, AVDictionary *opt_arg)
{ {
int ret; int ret;
AVCodecContext *c = ost->enc; AVCodecContext *c = ost->st->codec;
AVDictionary *opt = NULL; AVDictionary *opt = NULL;
av_dict_copy(&opt, opt_arg, 0); av_dict_copy(&opt, opt_arg, 0);
@ -427,13 +414,6 @@ static void open_video(AVFormatContext *oc, AVCodec *codec, OutputStream *ost, A
exit(1); exit(1);
} }
} }
/* copy the stream parameters to the muxer */
ret = avcodec_parameters_from_context(ost->st->codecpar, c);
if (ret < 0) {
fprintf(stderr, "Could not copy the stream parameters\n");
exit(1);
}
} }
/* Prepare a dummy image. */ /* Prepare a dummy image. */
@ -468,10 +448,10 @@ static void fill_yuv_image(AVFrame *pict, int frame_index,
static AVFrame *get_video_frame(OutputStream *ost) static AVFrame *get_video_frame(OutputStream *ost)
{ {
AVCodecContext *c = ost->enc; AVCodecContext *c = ost->st->codec;
/* check if we want to generate more frames */ /* check if we want to generate more frames */
if (av_compare_ts(ost->next_pts, c->time_base, if (av_compare_ts(ost->next_pts, ost->st->codec->time_base,
STREAM_DURATION, (AVRational){ 1, 1 }) >= 0) STREAM_DURATION, (AVRational){ 1, 1 }) >= 0)
return NULL; return NULL;
@ -513,25 +493,44 @@ static int write_video_frame(AVFormatContext *oc, OutputStream *ost)
AVCodecContext *c; AVCodecContext *c;
AVFrame *frame; AVFrame *frame;
int got_packet = 0; int got_packet = 0;
AVPacket pkt = { 0 };
c = ost->enc; c = ost->st->codec;
frame = get_video_frame(ost); frame = get_video_frame(ost);
av_init_packet(&pkt); if (oc->oformat->flags & AVFMT_RAWPICTURE) {
/* a hack to avoid data copy with some raw video muxers */
AVPacket pkt;
av_init_packet(&pkt);
/* encode the image */ if (!frame)
ret = avcodec_encode_video2(c, &pkt, frame, &got_packet); return 1;
if (ret < 0) {
fprintf(stderr, "Error encoding video frame: %s\n", av_err2str(ret));
exit(1);
}
if (got_packet) { pkt.flags |= AV_PKT_FLAG_KEY;
ret = write_frame(oc, &c->time_base, ost->st, &pkt); pkt.stream_index = ost->st->index;
pkt.data = (uint8_t *)frame;
pkt.size = sizeof(AVPicture);
pkt.pts = pkt.dts = frame->pts;
av_packet_rescale_ts(&pkt, c->time_base, ost->st->time_base);
ret = av_interleaved_write_frame(oc, &pkt);
} else { } else {
ret = 0; AVPacket pkt = { 0 };
av_init_packet(&pkt);
/* encode the image */
ret = avcodec_encode_video2(c, &pkt, frame, &got_packet);
if (ret < 0) {
fprintf(stderr, "Error encoding video frame: %s\n", av_err2str(ret));
exit(1);
}
if (got_packet) {
ret = write_frame(oc, &c->time_base, ost->st, &pkt);
} else {
ret = 0;
}
} }
if (ret < 0) { if (ret < 0) {
@ -544,7 +543,7 @@ static int write_video_frame(AVFormatContext *oc, OutputStream *ost)
static void close_stream(AVFormatContext *oc, OutputStream *ost) static void close_stream(AVFormatContext *oc, OutputStream *ost)
{ {
avcodec_free_context(&ost->enc); avcodec_close(ost->st->codec);
av_frame_free(&ost->frame); av_frame_free(&ost->frame);
av_frame_free(&ost->tmp_frame); av_frame_free(&ost->tmp_frame);
sws_freeContext(ost->sws_ctx); sws_freeContext(ost->sws_ctx);
@ -565,7 +564,6 @@ int main(int argc, char **argv)
int have_video = 0, have_audio = 0; int have_video = 0, have_audio = 0;
int encode_video = 0, encode_audio = 0; int encode_video = 0, encode_audio = 0;
AVDictionary *opt = NULL; AVDictionary *opt = NULL;
int i;
/* Initialize libavcodec, and register all codecs and formats. */ /* Initialize libavcodec, and register all codecs and formats. */
av_register_all(); av_register_all();
@ -582,9 +580,8 @@ int main(int argc, char **argv)
} }
filename = argv[1]; filename = argv[1];
for (i = 2; i+1 < argc; i+=2) { if (argc > 3 && !strcmp(argv[2], "-flags")) {
if (!strcmp(argv[i], "-flags") || !strcmp(argv[i], "-fflags")) av_dict_set(&opt, argv[2]+1, argv[3], 0);
av_dict_set(&opt, argv[i]+1, argv[i+1], 0);
} }
/* allocate the output media context */ /* allocate the output media context */
@ -642,8 +639,8 @@ int main(int argc, char **argv)
while (encode_video || encode_audio) { while (encode_video || encode_audio) {
/* select the stream to encode */ /* select the stream to encode */
if (encode_video && if (encode_video &&
(!encode_audio || av_compare_ts(video_st.next_pts, video_st.enc->time_base, (!encode_audio || av_compare_ts(video_st.next_pts, video_st.st->codec->time_base,
audio_st.next_pts, audio_st.enc->time_base) <= 0)) { audio_st.next_pts, audio_st.st->codec->time_base) <= 0)) {
encode_video = !write_video_frame(oc, &video_st); encode_video = !write_video_frame(oc, &video_st);
} else { } else {
encode_audio = !write_audio_frame(oc, &audio_st); encode_audio = !write_audio_frame(oc, &audio_st);
@ -664,7 +661,7 @@ int main(int argc, char **argv)
if (!(fmt->flags & AVFMT_NOFILE)) if (!(fmt->flags & AVFMT_NOFILE))
/* Close the output file. */ /* Close the output file. */
avio_closep(&oc->pb); avio_close(oc->pb);
/* free the stream */ /* free the stream */
avformat_free_context(oc); avformat_free_context(oc);

View File

@ -1,487 +0,0 @@
/*
* Copyright (c) 2015 Anton Khirnov
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* @file
* Intel QSV-accelerated H.264 decoding example.
*
* @example qsvdec.c
* This example shows how to do QSV-accelerated H.264 decoding with output
* frames in the VA-API video surfaces.
*/
#include "config.h"
#include <stdio.h>
#include <mfx/mfxvideo.h>
#include <va/va.h>
#include <va/va_x11.h>
#include <X11/Xlib.h>
#include "libavformat/avformat.h"
#include "libavformat/avio.h"
#include "libavcodec/avcodec.h"
#include "libavcodec/qsv.h"
#include "libavutil/error.h"
#include "libavutil/mem.h"
typedef struct DecodeContext {
mfxSession mfx_session;
VADisplay va_dpy;
VASurfaceID *surfaces;
mfxMemId *surface_ids;
int *surface_used;
int nb_surfaces;
mfxFrameInfo frame_info;
} DecodeContext;
static mfxStatus frame_alloc(mfxHDL pthis, mfxFrameAllocRequest *req,
mfxFrameAllocResponse *resp)
{
DecodeContext *decode = pthis;
int err, i;
if (decode->surfaces) {
fprintf(stderr, "Multiple allocation requests.\n");
return MFX_ERR_MEMORY_ALLOC;
}
if (!(req->Type & MFX_MEMTYPE_VIDEO_MEMORY_DECODER_TARGET)) {
fprintf(stderr, "Unsupported surface type: %d\n", req->Type);
return MFX_ERR_UNSUPPORTED;
}
if (req->Info.BitDepthLuma != 8 || req->Info.BitDepthChroma != 8 ||
req->Info.Shift || req->Info.FourCC != MFX_FOURCC_NV12 ||
req->Info.ChromaFormat != MFX_CHROMAFORMAT_YUV420) {
fprintf(stderr, "Unsupported surface properties.\n");
return MFX_ERR_UNSUPPORTED;
}
decode->surfaces = av_malloc_array (req->NumFrameSuggested, sizeof(*decode->surfaces));
decode->surface_ids = av_malloc_array (req->NumFrameSuggested, sizeof(*decode->surface_ids));
decode->surface_used = av_mallocz_array(req->NumFrameSuggested, sizeof(*decode->surface_used));
if (!decode->surfaces || !decode->surface_ids || !decode->surface_used)
goto fail;
err = vaCreateSurfaces(decode->va_dpy, VA_RT_FORMAT_YUV420,
req->Info.Width, req->Info.Height,
decode->surfaces, req->NumFrameSuggested,
NULL, 0);
if (err != VA_STATUS_SUCCESS) {
fprintf(stderr, "Error allocating VA surfaces\n");
goto fail;
}
decode->nb_surfaces = req->NumFrameSuggested;
for (i = 0; i < decode->nb_surfaces; i++)
decode->surface_ids[i] = &decode->surfaces[i];
resp->mids = decode->surface_ids;
resp->NumFrameActual = decode->nb_surfaces;
decode->frame_info = req->Info;
return MFX_ERR_NONE;
fail:
av_freep(&decode->surfaces);
av_freep(&decode->surface_ids);
av_freep(&decode->surface_used);
return MFX_ERR_MEMORY_ALLOC;
}
static mfxStatus frame_free(mfxHDL pthis, mfxFrameAllocResponse *resp)
{
return MFX_ERR_NONE;
}
static mfxStatus frame_lock(mfxHDL pthis, mfxMemId mid, mfxFrameData *ptr)
{
return MFX_ERR_UNSUPPORTED;
}
static mfxStatus frame_unlock(mfxHDL pthis, mfxMemId mid, mfxFrameData *ptr)
{
return MFX_ERR_UNSUPPORTED;
}
static mfxStatus frame_get_hdl(mfxHDL pthis, mfxMemId mid, mfxHDL *hdl)
{
*hdl = mid;
return MFX_ERR_NONE;
}
static void free_surfaces(DecodeContext *decode)
{
if (decode->surfaces)
vaDestroySurfaces(decode->va_dpy, decode->surfaces, decode->nb_surfaces);
av_freep(&decode->surfaces);
av_freep(&decode->surface_ids);
av_freep(&decode->surface_used);
decode->nb_surfaces = 0;
}
static void free_buffer(void *opaque, uint8_t *data)
{
int *used = opaque;
*used = 0;
av_freep(&data);
}
static int get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
{
DecodeContext *decode = avctx->opaque;
mfxFrameSurface1 *surf;
AVBufferRef *surf_buf;
int idx;
for (idx = 0; idx < decode->nb_surfaces; idx++) {
if (!decode->surface_used[idx])
break;
}
if (idx == decode->nb_surfaces) {
fprintf(stderr, "No free surfaces\n");
return AVERROR(ENOMEM);
}
surf = av_mallocz(sizeof(*surf));
if (!surf)
return AVERROR(ENOMEM);
surf_buf = av_buffer_create((uint8_t*)surf, sizeof(*surf), free_buffer,
&decode->surface_used[idx], AV_BUFFER_FLAG_READONLY);
if (!surf_buf) {
av_freep(&surf);
return AVERROR(ENOMEM);
}
surf->Info = decode->frame_info;
surf->Data.MemId = &decode->surfaces[idx];
frame->buf[0] = surf_buf;
frame->data[3] = (uint8_t*)surf;
decode->surface_used[idx] = 1;
return 0;
}
static int get_format(AVCodecContext *avctx, const enum AVPixelFormat *pix_fmts)
{
while (*pix_fmts != AV_PIX_FMT_NONE) {
if (*pix_fmts == AV_PIX_FMT_QSV) {
if (!avctx->hwaccel_context) {
DecodeContext *decode = avctx->opaque;
AVQSVContext *qsv = av_qsv_alloc_context();
if (!qsv)
return AV_PIX_FMT_NONE;
qsv->session = decode->mfx_session;
qsv->iopattern = MFX_IOPATTERN_OUT_VIDEO_MEMORY;
avctx->hwaccel_context = qsv;
}
return AV_PIX_FMT_QSV;
}
pix_fmts++;
}
fprintf(stderr, "The QSV pixel format not offered in get_format()\n");
return AV_PIX_FMT_NONE;
}
static int decode_packet(DecodeContext *decode, AVCodecContext *decoder_ctx,
AVFrame *frame, AVPacket *pkt,
AVIOContext *output_ctx)
{
int ret = 0;
int got_frame = 1;
while (pkt->size > 0 || (!pkt->data && got_frame)) {
ret = avcodec_decode_video2(decoder_ctx, frame, &got_frame, pkt);
if (ret < 0) {
fprintf(stderr, "Error during decoding\n");
return ret;
}
pkt->data += ret;
pkt->size -= ret;
/* A real program would do something useful with the decoded frame here.
* We just retrieve the raw data and write it to a file, which is rather
* useless but pedagogic. */
if (got_frame) {
mfxFrameSurface1 *surf = (mfxFrameSurface1*)frame->data[3];
VASurfaceID surface = *(VASurfaceID*)surf->Data.MemId;
VAImageFormat img_fmt = {
.fourcc = VA_FOURCC_NV12,
.byte_order = VA_LSB_FIRST,
.bits_per_pixel = 8,
.depth = 8,
};
VAImage img;
VAStatus err;
uint8_t *data;
int i, j;
img.buf = VA_INVALID_ID;
img.image_id = VA_INVALID_ID;
err = vaCreateImage(decode->va_dpy, &img_fmt,
frame->width, frame->height, &img);
if (err != VA_STATUS_SUCCESS) {
fprintf(stderr, "Error creating an image: %s\n",
vaErrorStr(err));
ret = AVERROR_UNKNOWN;
goto fail;
}
err = vaGetImage(decode->va_dpy, surface, 0, 0,
frame->width, frame->height,
img.image_id);
if (err != VA_STATUS_SUCCESS) {
fprintf(stderr, "Error getting an image: %s\n",
vaErrorStr(err));
ret = AVERROR_UNKNOWN;
goto fail;
}
err = vaMapBuffer(decode->va_dpy, img.buf, (void**)&data);
if (err != VA_STATUS_SUCCESS) {
fprintf(stderr, "Error mapping the image buffer: %s\n",
vaErrorStr(err));
ret = AVERROR_UNKNOWN;
goto fail;
}
for (i = 0; i < img.num_planes; i++)
for (j = 0; j < (img.height >> (i > 0)); j++)
avio_write(output_ctx, data + img.offsets[i] + j * img.pitches[i], img.width);
fail:
if (img.buf != VA_INVALID_ID)
vaUnmapBuffer(decode->va_dpy, img.buf);
if (img.image_id != VA_INVALID_ID)
vaDestroyImage(decode->va_dpy, img.image_id);
av_frame_unref(frame);
if (ret < 0)
return ret;
}
}
return 0;
}
int main(int argc, char **argv)
{
AVFormatContext *input_ctx = NULL;
AVStream *video_st = NULL;
AVCodecContext *decoder_ctx = NULL;
const AVCodec *decoder;
AVPacket pkt = { 0 };
AVFrame *frame = NULL;
DecodeContext decode = { NULL };
Display *dpy = NULL;
int va_ver_major, va_ver_minor;
mfxIMPL mfx_impl = MFX_IMPL_AUTO_ANY;
mfxVersion mfx_ver = { { 1, 1 } };
mfxFrameAllocator frame_allocator = {
.pthis = &decode,
.Alloc = frame_alloc,
.Lock = frame_lock,
.Unlock = frame_unlock,
.GetHDL = frame_get_hdl,
.Free = frame_free,
};
AVIOContext *output_ctx = NULL;
int ret, i, err;
av_register_all();
if (argc < 3) {
fprintf(stderr, "Usage: %s <input file> <output file>\n", argv[0]);
return 1;
}
/* open the input file */
ret = avformat_open_input(&input_ctx, argv[1], NULL, NULL);
if (ret < 0) {
fprintf(stderr, "Cannot open input file '%s': ", argv[1]);
goto finish;
}
/* find the first H.264 video stream */
for (i = 0; i < input_ctx->nb_streams; i++) {
AVStream *st = input_ctx->streams[i];
if (st->codecpar->codec_id == AV_CODEC_ID_H264 && !video_st)
video_st = st;
else
st->discard = AVDISCARD_ALL;
}
if (!video_st) {
fprintf(stderr, "No H.264 video stream in the input file\n");
goto finish;
}
/* initialize VA-API */
dpy = XOpenDisplay(NULL);
if (!dpy) {
fprintf(stderr, "Cannot open the X display\n");
goto finish;
}
decode.va_dpy = vaGetDisplay(dpy);
if (!decode.va_dpy) {
fprintf(stderr, "Cannot open the VA display\n");
goto finish;
}
err = vaInitialize(decode.va_dpy, &va_ver_major, &va_ver_minor);
if (err != VA_STATUS_SUCCESS) {
fprintf(stderr, "Cannot initialize VA: %s\n", vaErrorStr(err));
goto finish;
}
fprintf(stderr, "Initialized VA v%d.%d\n", va_ver_major, va_ver_minor);
/* initialize an MFX session */
err = MFXInit(mfx_impl, &mfx_ver, &decode.mfx_session);
if (err != MFX_ERR_NONE) {
fprintf(stderr, "Error initializing an MFX session\n");
goto finish;
}
MFXVideoCORE_SetHandle(decode.mfx_session, MFX_HANDLE_VA_DISPLAY, decode.va_dpy);
MFXVideoCORE_SetFrameAllocator(decode.mfx_session, &frame_allocator);
/* initialize the decoder */
decoder = avcodec_find_decoder_by_name("h264_qsv");
if (!decoder) {
fprintf(stderr, "The QSV decoder is not present in libavcodec\n");
goto finish;
}
decoder_ctx = avcodec_alloc_context3(decoder);
if (!decoder_ctx) {
ret = AVERROR(ENOMEM);
goto finish;
}
decoder_ctx->codec_id = AV_CODEC_ID_H264;
if (video_st->codecpar->extradata_size) {
decoder_ctx->extradata = av_mallocz(video_st->codecpar->extradata_size +
AV_INPUT_BUFFER_PADDING_SIZE);
if (!decoder_ctx->extradata) {
ret = AVERROR(ENOMEM);
goto finish;
}
memcpy(decoder_ctx->extradata, video_st->codecpar->extradata,
video_st->codecpar->extradata_size);
decoder_ctx->extradata_size = video_st->codecpar->extradata_size;
}
decoder_ctx->refcounted_frames = 1;
decoder_ctx->opaque = &decode;
decoder_ctx->get_buffer2 = get_buffer;
decoder_ctx->get_format = get_format;
ret = avcodec_open2(decoder_ctx, NULL, NULL);
if (ret < 0) {
fprintf(stderr, "Error opening the decoder: ");
goto finish;
}
/* open the output stream */
ret = avio_open(&output_ctx, argv[2], AVIO_FLAG_WRITE);
if (ret < 0) {
fprintf(stderr, "Error opening the output context: ");
goto finish;
}
frame = av_frame_alloc();
if (!frame) {
ret = AVERROR(ENOMEM);
goto finish;
}
/* actual decoding */
while (ret >= 0) {
ret = av_read_frame(input_ctx, &pkt);
if (ret < 0)
break;
if (pkt.stream_index == video_st->index)
ret = decode_packet(&decode, decoder_ctx, frame, &pkt, output_ctx);
av_packet_unref(&pkt);
}
/* flush the decoder */
pkt.data = NULL;
pkt.size = 0;
ret = decode_packet(&decode, decoder_ctx, frame, &pkt, output_ctx);
finish:
if (ret < 0) {
char buf[1024];
av_strerror(ret, buf, sizeof(buf));
fprintf(stderr, "%s\n", buf);
}
avformat_close_input(&input_ctx);
av_frame_free(&frame);
if (decoder_ctx)
av_freep(&decoder_ctx->hwaccel_context);
avcodec_free_context(&decoder_ctx);
free_surfaces(&decode);
if (decode.mfx_session)
MFXClose(decode.mfx_session);
if (decode.va_dpy)
vaTerminate(decode.va_dpy);
if (dpy)
XCloseDisplay(dpy);
avio_close(output_ctx);
return ret;
}

View File

@ -101,7 +101,7 @@ int main(int argc, char **argv)
} }
out_stream->codec->codec_tag = 0; out_stream->codec->codec_tag = 0;
if (ofmt_ctx->oformat->flags & AVFMT_GLOBALHEADER) if (ofmt_ctx->oformat->flags & AVFMT_GLOBALHEADER)
out_stream->codec->flags |= AV_CODEC_FLAG_GLOBAL_HEADER; out_stream->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
} }
av_dump_format(ofmt_ctx, 0, out_filename, 1); av_dump_format(ofmt_ctx, 0, out_filename, 1);
@ -143,7 +143,7 @@ int main(int argc, char **argv)
fprintf(stderr, "Error muxing packet\n"); fprintf(stderr, "Error muxing packet\n");
break; break;
} }
av_packet_unref(&pkt); av_free_packet(&pkt);
} }
av_write_trailer(ofmt_ctx); av_write_trailer(ofmt_ctx);
@ -153,7 +153,7 @@ end:
/* close output */ /* close output */
if (ofmt_ctx && !(ofmt->flags & AVFMT_NOFILE)) if (ofmt_ctx && !(ofmt->flags & AVFMT_NOFILE))
avio_closep(&ofmt_ctx->pb); avio_close(ofmt_ctx->pb);
avformat_free_context(ofmt_ctx); avformat_free_context(ofmt_ctx);
if (ret < 0 && ret != AVERROR_EOF) { if (ret < 0 && ret != AVERROR_EOF) {

View File

@ -41,9 +41,11 @@
#include "libswresample/swresample.h" #include "libswresample/swresample.h"
/** The output bit rate in kbit/s */ /** The output bit rate in kbit/s */
#define OUTPUT_BIT_RATE 96000 #define OUTPUT_BIT_RATE 48000
/** The number of output channels */ /** The number of output channels */
#define OUTPUT_CHANNELS 2 #define OUTPUT_CHANNELS 2
/** The audio sample output format */
#define OUTPUT_SAMPLE_FORMAT AV_SAMPLE_FMT_S16
/** /**
* Convert an error code into a text message. * Convert an error code into a text message.
@ -62,7 +64,6 @@ static int open_input_file(const char *filename,
AVFormatContext **input_format_context, AVFormatContext **input_format_context,
AVCodecContext **input_codec_context) AVCodecContext **input_codec_context)
{ {
AVCodecContext *avctx;
AVCodec *input_codec; AVCodec *input_codec;
int error; int error;
@ -92,39 +93,23 @@ static int open_input_file(const char *filename,
} }
/** Find a decoder for the audio stream. */ /** Find a decoder for the audio stream. */
if (!(input_codec = avcodec_find_decoder((*input_format_context)->streams[0]->codecpar->codec_id))) { if (!(input_codec = avcodec_find_decoder((*input_format_context)->streams[0]->codec->codec_id))) {
fprintf(stderr, "Could not find input codec\n"); fprintf(stderr, "Could not find input codec\n");
avformat_close_input(input_format_context); avformat_close_input(input_format_context);
return AVERROR_EXIT; return AVERROR_EXIT;
} }
/** allocate a new decoding context */
avctx = avcodec_alloc_context3(input_codec);
if (!avctx) {
fprintf(stderr, "Could not allocate a decoding context\n");
avformat_close_input(input_format_context);
return AVERROR(ENOMEM);
}
/** initialize the stream parameters with demuxer information */
error = avcodec_parameters_to_context(avctx, (*input_format_context)->streams[0]->codecpar);
if (error < 0) {
avformat_close_input(input_format_context);
avcodec_free_context(&avctx);
return error;
}
/** Open the decoder for the audio stream to use it later. */ /** Open the decoder for the audio stream to use it later. */
if ((error = avcodec_open2(avctx, input_codec, NULL)) < 0) { if ((error = avcodec_open2((*input_format_context)->streams[0]->codec,
input_codec, NULL)) < 0) {
fprintf(stderr, "Could not open input codec (error '%s')\n", fprintf(stderr, "Could not open input codec (error '%s')\n",
get_error_text(error)); get_error_text(error));
avcodec_free_context(&avctx);
avformat_close_input(input_format_context); avformat_close_input(input_format_context);
return error; return error;
} }
/** Save the decoder context for easier access later. */ /** Save the decoder context for easier access later. */
*input_codec_context = avctx; *input_codec_context = (*input_format_context)->streams[0]->codec;
return 0; return 0;
} }
@ -139,7 +124,6 @@ static int open_output_file(const char *filename,
AVFormatContext **output_format_context, AVFormatContext **output_format_context,
AVCodecContext **output_codec_context) AVCodecContext **output_codec_context)
{ {
AVCodecContext *avctx = NULL;
AVIOContext *output_io_context = NULL; AVIOContext *output_io_context = NULL;
AVStream *stream = NULL; AVStream *stream = NULL;
AVCodec *output_codec = NULL; AVCodec *output_codec = NULL;
@ -179,64 +163,43 @@ static int open_output_file(const char *filename,
} }
/** Create a new audio stream in the output file container. */ /** Create a new audio stream in the output file container. */
if (!(stream = avformat_new_stream(*output_format_context, NULL))) { if (!(stream = avformat_new_stream(*output_format_context, output_codec))) {
fprintf(stderr, "Could not create new stream\n"); fprintf(stderr, "Could not create new stream\n");
error = AVERROR(ENOMEM); error = AVERROR(ENOMEM);
goto cleanup; goto cleanup;
} }
avctx = avcodec_alloc_context3(output_codec); /** Save the encoder context for easiert access later. */
if (!avctx) { *output_codec_context = stream->codec;
fprintf(stderr, "Could not allocate an encoding context\n");
error = AVERROR(ENOMEM);
goto cleanup;
}
/** /**
* Set the basic encoder parameters. * Set the basic encoder parameters.
* The input file's sample rate is used to avoid a sample rate conversion. * The input file's sample rate is used to avoid a sample rate conversion.
*/ */
avctx->channels = OUTPUT_CHANNELS; (*output_codec_context)->channels = OUTPUT_CHANNELS;
avctx->channel_layout = av_get_default_channel_layout(OUTPUT_CHANNELS); (*output_codec_context)->channel_layout = av_get_default_channel_layout(OUTPUT_CHANNELS);
avctx->sample_rate = input_codec_context->sample_rate; (*output_codec_context)->sample_rate = input_codec_context->sample_rate;
avctx->sample_fmt = output_codec->sample_fmts[0]; (*output_codec_context)->sample_fmt = AV_SAMPLE_FMT_S16;
avctx->bit_rate = OUTPUT_BIT_RATE; (*output_codec_context)->bit_rate = OUTPUT_BIT_RATE;
/** Allow the use of the experimental AAC encoder */
avctx->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL;
/** Set the sample rate for the container. */
stream->time_base.den = input_codec_context->sample_rate;
stream->time_base.num = 1;
/** /**
* Some container formats (like MP4) require global headers to be present * Some container formats (like MP4) require global headers to be present
* Mark the encoder so that it behaves accordingly. * Mark the encoder so that it behaves accordingly.
*/ */
if ((*output_format_context)->oformat->flags & AVFMT_GLOBALHEADER) if ((*output_format_context)->oformat->flags & AVFMT_GLOBALHEADER)
avctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER; (*output_codec_context)->flags |= CODEC_FLAG_GLOBAL_HEADER;
/** Open the encoder for the audio stream to use it later. */ /** Open the encoder for the audio stream to use it later. */
if ((error = avcodec_open2(avctx, output_codec, NULL)) < 0) { if ((error = avcodec_open2(*output_codec_context, output_codec, NULL)) < 0) {
fprintf(stderr, "Could not open output codec (error '%s')\n", fprintf(stderr, "Could not open output codec (error '%s')\n",
get_error_text(error)); get_error_text(error));
goto cleanup; goto cleanup;
} }
error = avcodec_parameters_from_context(stream->codecpar, avctx);
if (error < 0) {
fprintf(stderr, "Could not initialize stream parameters\n");
goto cleanup;
}
/** Save the encoder context for easier access later. */
*output_codec_context = avctx;
return 0; return 0;
cleanup: cleanup:
avcodec_free_context(&avctx); avio_close((*output_format_context)->pb);
avio_closep(&(*output_format_context)->pb);
avformat_free_context(*output_format_context); avformat_free_context(*output_format_context);
*output_format_context = NULL; *output_format_context = NULL;
return error < 0 ? error : AVERROR_EXIT; return error < 0 ? error : AVERROR_EXIT;
@ -308,11 +271,10 @@ static int init_resampler(AVCodecContext *input_codec_context,
} }
/** Initialize a FIFO buffer for the audio samples to be encoded. */ /** Initialize a FIFO buffer for the audio samples to be encoded. */
static int init_fifo(AVAudioFifo **fifo, AVCodecContext *output_codec_context) static int init_fifo(AVAudioFifo **fifo)
{ {
/** Create the FIFO buffer based on the specified output sample format. */ /** Create the FIFO buffer based on the specified output sample format. */
if (!(*fifo = av_audio_fifo_alloc(output_codec_context->sample_fmt, if (!(*fifo = av_audio_fifo_alloc(OUTPUT_SAMPLE_FORMAT, OUTPUT_CHANNELS, 1))) {
output_codec_context->channels, 1))) {
fprintf(stderr, "Could not allocate FIFO\n"); fprintf(stderr, "Could not allocate FIFO\n");
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
} }
@ -364,7 +326,7 @@ static int decode_audio_frame(AVFrame *frame,
data_present, &input_packet)) < 0) { data_present, &input_packet)) < 0) {
fprintf(stderr, "Could not decode frame (error '%s')\n", fprintf(stderr, "Could not decode frame (error '%s')\n",
get_error_text(error)); get_error_text(error));
av_packet_unref(&input_packet); av_free_packet(&input_packet);
return error; return error;
} }
@ -374,7 +336,7 @@ static int decode_audio_frame(AVFrame *frame,
*/ */
if (*finished && *data_present) if (*finished && *data_present)
*finished = 0; *finished = 0;
av_packet_unref(&input_packet); av_free_packet(&input_packet);
return 0; return 0;
} }
@ -575,9 +537,6 @@ static int init_output_frame(AVFrame **frame,
return 0; return 0;
} }
/** Global timestamp for the audio frames */
static int64_t pts = 0;
/** Encode one frame worth of audio to the output file. */ /** Encode one frame worth of audio to the output file. */
static int encode_audio_frame(AVFrame *frame, static int encode_audio_frame(AVFrame *frame,
AVFormatContext *output_format_context, AVFormatContext *output_format_context,
@ -589,12 +548,6 @@ static int encode_audio_frame(AVFrame *frame,
int error; int error;
init_packet(&output_packet); init_packet(&output_packet);
/** Set a timestamp based on the sample rate for the container. */
if (frame) {
frame->pts = pts;
pts += frame->nb_samples;
}
/** /**
* Encode the audio frame and store it in the temporary packet. * Encode the audio frame and store it in the temporary packet.
* The output audio stream encoder is used to do this. * The output audio stream encoder is used to do this.
@ -603,7 +556,7 @@ static int encode_audio_frame(AVFrame *frame,
frame, data_present)) < 0) { frame, data_present)) < 0) {
fprintf(stderr, "Could not encode frame (error '%s')\n", fprintf(stderr, "Could not encode frame (error '%s')\n",
get_error_text(error)); get_error_text(error));
av_packet_unref(&output_packet); av_free_packet(&output_packet);
return error; return error;
} }
@ -612,11 +565,11 @@ static int encode_audio_frame(AVFrame *frame,
if ((error = av_write_frame(output_format_context, &output_packet)) < 0) { if ((error = av_write_frame(output_format_context, &output_packet)) < 0) {
fprintf(stderr, "Could not write frame (error '%s')\n", fprintf(stderr, "Could not write frame (error '%s')\n",
get_error_text(error)); get_error_text(error));
av_packet_unref(&output_packet); av_free_packet(&output_packet);
return error; return error;
} }
av_packet_unref(&output_packet); av_free_packet(&output_packet);
} }
return 0; return 0;
@ -706,7 +659,7 @@ int main(int argc, char **argv)
&resample_context)) &resample_context))
goto cleanup; goto cleanup;
/** Initialize the FIFO buffer to store audio samples to be encoded. */ /** Initialize the FIFO buffer to store audio samples to be encoded. */
if (init_fifo(&fifo, output_codec_context)) if (init_fifo(&fifo))
goto cleanup; goto cleanup;
/** Write the header of the output file container. */ /** Write the header of the output file container. */
if (write_output_file_header(output_format_context)) if (write_output_file_header(output_format_context))
@ -788,13 +741,13 @@ cleanup:
av_audio_fifo_free(fifo); av_audio_fifo_free(fifo);
swr_free(&resample_context); swr_free(&resample_context);
if (output_codec_context) if (output_codec_context)
avcodec_free_context(&output_codec_context); avcodec_close(output_codec_context);
if (output_format_context) { if (output_format_context) {
avio_closep(&output_format_context->pb); avio_close(output_format_context->pb);
avformat_free_context(output_format_context); avformat_free_context(output_format_context);
} }
if (input_codec_context) if (input_codec_context)
avcodec_free_context(&input_codec_context); avcodec_close(input_codec_context);
if (input_format_context) if (input_format_context)
avformat_close_input(&input_format_context); avformat_close_input(&input_format_context);

View File

@ -31,6 +31,7 @@
#include <libavcodec/avcodec.h> #include <libavcodec/avcodec.h>
#include <libavformat/avformat.h> #include <libavformat/avformat.h>
#include <libavfilter/avfiltergraph.h> #include <libavfilter/avfiltergraph.h>
#include <libavfilter/avcodec.h>
#include <libavfilter/buffersink.h> #include <libavfilter/buffersink.h>
#include <libavfilter/buffersrc.h> #include <libavfilter/buffersrc.h>
#include <libavutil/opt.h> #include <libavutil/opt.h>
@ -116,7 +117,7 @@ static int open_output_file(const char *filename)
/* in this example, we choose transcoding to same codec */ /* in this example, we choose transcoding to same codec */
encoder = avcodec_find_encoder(dec_ctx->codec_id); encoder = avcodec_find_encoder(dec_ctx->codec_id);
if (!encoder) { if (!encoder) {
av_log(NULL, AV_LOG_FATAL, "Necessary encoder not found\n"); av_log(NULL, AV_LOG_FATAL, "Neccessary encoder not found\n");
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
@ -128,10 +129,7 @@ static int open_output_file(const char *filename)
enc_ctx->width = dec_ctx->width; enc_ctx->width = dec_ctx->width;
enc_ctx->sample_aspect_ratio = dec_ctx->sample_aspect_ratio; enc_ctx->sample_aspect_ratio = dec_ctx->sample_aspect_ratio;
/* take first format from list of supported formats */ /* take first format from list of supported formats */
if (encoder->pix_fmts) enc_ctx->pix_fmt = encoder->pix_fmts[0];
enc_ctx->pix_fmt = encoder->pix_fmts[0];
else
enc_ctx->pix_fmt = dec_ctx->pix_fmt;
/* video time_base can be set to whatever is handy and supported by encoder */ /* video time_base can be set to whatever is handy and supported by encoder */
enc_ctx->time_base = dec_ctx->time_base; enc_ctx->time_base = dec_ctx->time_base;
} else { } else {
@ -163,7 +161,7 @@ static int open_output_file(const char *filename)
} }
if (ofmt_ctx->oformat->flags & AVFMT_GLOBALHEADER) if (ofmt_ctx->oformat->flags & AVFMT_GLOBALHEADER)
enc_ctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER; enc_ctx->flags |= CODEC_FLAG_GLOBAL_HEADER;
} }
av_dump_format(ofmt_ctx, 0, filename, 1); av_dump_format(ofmt_ctx, 0, filename, 1);
@ -451,7 +449,7 @@ static int flush_encoder(unsigned int stream_index)
int got_frame; int got_frame;
if (!(ofmt_ctx->streams[stream_index]->codec->codec->capabilities & if (!(ofmt_ctx->streams[stream_index]->codec->codec->capabilities &
AV_CODEC_CAP_DELAY)) CODEC_CAP_DELAY))
return 0; return 0;
while (1) { while (1) {
@ -539,7 +537,7 @@ int main(int argc, char **argv)
if (ret < 0) if (ret < 0)
goto end; goto end;
} }
av_packet_unref(&packet); av_free_packet(&packet);
} }
/* flush filters and encoders */ /* flush filters and encoders */
@ -563,7 +561,7 @@ int main(int argc, char **argv)
av_write_trailer(ofmt_ctx); av_write_trailer(ofmt_ctx);
end: end:
av_packet_unref(&packet); av_free_packet(&packet);
av_frame_free(&frame); av_frame_free(&frame);
for (i = 0; i < ifmt_ctx->nb_streams; i++) { for (i = 0; i < ifmt_ctx->nb_streams; i++) {
avcodec_close(ifmt_ctx->streams[i]->codec); avcodec_close(ifmt_ctx->streams[i]->codec);
@ -575,7 +573,7 @@ end:
av_free(filter_ctx); av_free(filter_ctx);
avformat_close_input(&ifmt_ctx); avformat_close_input(&ifmt_ctx);
if (ofmt_ctx && !(ofmt_ctx->oformat->flags & AVFMT_NOFILE)) if (ofmt_ctx && !(ofmt_ctx->oformat->flags & AVFMT_NOFILE))
avio_closep(&ofmt_ctx->pb); avio_close(ofmt_ctx->pb);
avformat_free_context(ofmt_ctx); avformat_free_context(ofmt_ctx);
if (ret < 0) if (ret < 0)

View File

@ -1,5 +1,4 @@
\input texinfo @c -*- texinfo -*- \input texinfo @c -*- texinfo -*-
@documentencoding UTF-8
@settitle FFmpeg FAQ @settitle FFmpeg FAQ
@titlepage @titlepage
@ -91,63 +90,13 @@ To build FFmpeg, you need to install the development package. It is usually
called @file{libfoo-dev} or @file{libfoo-devel}. You can remove it after the called @file{libfoo-dev} or @file{libfoo-devel}. You can remove it after the
build is finished, but be sure to keep the main package. build is finished, but be sure to keep the main package.
@section How do I make @command{pkg-config} find my libraries?
Somewhere along with your libraries, there is a @file{.pc} file (or several)
in a @file{pkgconfig} directory. You need to set environment variables to
point @command{pkg-config} to these files.
If you need to @emph{add} directories to @command{pkg-config}'s search list
(typical use case: library installed separately), add it to
@code{$PKG_CONFIG_PATH}:
@example
export PKG_CONFIG_PATH=/opt/x264/lib/pkgconfig:/opt/opus/lib/pkgconfig
@end example
If you need to @emph{replace} @command{pkg-config}'s search list
(typical use case: cross-compiling), set it in
@code{$PKG_CONFIG_LIBDIR}:
@example
export PKG_CONFIG_LIBDIR=/home/me/cross/usr/lib/pkgconfig:/home/me/cross/usr/local/lib/pkgconfig
@end example
If you need to know the library's internal dependencies (typical use: static
linking), add the @code{--static} option to @command{pkg-config}:
@example
./configure --pkg-config-flags=--static
@end example
@section How do I use @command{pkg-config} when cross-compiling?
The best way is to install @command{pkg-config} in your cross-compilation
environment. It will automatically use the cross-compilation libraries.
You can also use @command{pkg-config} from the host environment by
specifying explicitly @code{--pkg-config=pkg-config} to @command{configure}.
In that case, you must point @command{pkg-config} to the correct directories
using the @code{PKG_CONFIG_LIBDIR}, as explained in the previous entry.
As an intermediate solution, you can place in your cross-compilation
environment a script that calls the host @command{pkg-config} with
@code{PKG_CONFIG_LIBDIR} set. That script can look like that:
@example
#!/bin/sh
PKG_CONFIG_LIBDIR=/path/to/cross/lib/pkgconfig
export PKG_CONFIG_LIBDIR
exec /usr/bin/pkg-config "$@@"
@end example
@chapter Usage @chapter Usage
@section ffmpeg does not work; what is wrong? @section ffmpeg does not work; what is wrong?
Try a @code{make distclean} in the ffmpeg source directory before the build. Try a @code{make distclean} in the ffmpeg source directory before the build.
If this does not help see If this does not help see
(@url{https://ffmpeg.org/bugreports.html}). (@url{http://ffmpeg.org/bugreports.html}).
@section How do I encode single pictures into movies? @section How do I encode single pictures into movies?
@ -311,18 +260,18 @@ invoking ffmpeg with several @option{-i} options.
For audio, to put all channels together in a single stream (example: two For audio, to put all channels together in a single stream (example: two
mono streams into one stereo stream): this is sometimes called to mono streams into one stereo stream): this is sometimes called to
@emph{merge} them, and can be done using the @emph{merge} them, and can be done using the
@url{https://ffmpeg.org/ffmpeg-filters.html#amerge, @code{amerge}} filter. @url{http://ffmpeg.org/ffmpeg-filters.html#amerge, @code{amerge}} filter.
@item @item
For audio, to play one on top of the other: this is called to @emph{mix} For audio, to play one on top of the other: this is called to @emph{mix}
them, and can be done by first merging them into a single stream and then them, and can be done by first merging them into a single stream and then
using the @url{https://ffmpeg.org/ffmpeg-filters.html#pan, @code{pan}} filter to mix using the @url{http://ffmpeg.org/ffmpeg-filters.html#pan, @code{pan}} filter to mix
the channels at will. the channels at will.
@item @item
For video, to display both together, side by side or one on top of a part of For video, to display both together, side by side or one on top of a part of
the other; it can be done using the the other; it can be done using the
@url{https://ffmpeg.org/ffmpeg-filters.html#overlay, @code{overlay}} video filter. @url{http://ffmpeg.org/ffmpeg-filters.html#overlay, @code{overlay}} video filter.
@end itemize @end itemize
@ -333,19 +282,19 @@ There are several solutions, depending on the exact circumstances.
@subsection Concatenating using the concat @emph{filter} @subsection Concatenating using the concat @emph{filter}
FFmpeg has a @url{https://ffmpeg.org/ffmpeg-filters.html#concat, FFmpeg has a @url{http://ffmpeg.org/ffmpeg-filters.html#concat,
@code{concat}} filter designed specifically for that, with examples in the @code{concat}} filter designed specifically for that, with examples in the
documentation. This operation is recommended if you need to re-encode. documentation. This operation is recommended if you need to re-encode.
@subsection Concatenating using the concat @emph{demuxer} @subsection Concatenating using the concat @emph{demuxer}
FFmpeg has a @url{https://www.ffmpeg.org/ffmpeg-formats.html#concat, FFmpeg has a @url{http://www.ffmpeg.org/ffmpeg-formats.html#concat,
@code{concat}} demuxer which you can use when you want to avoid a re-encode and @code{concat}} demuxer which you can use when you want to avoid a re-encode and
your format doesn't support file level concatenation. your format doesn't support file level concatenation.
@subsection Concatenating using the concat @emph{protocol} (file level) @subsection Concatenating using the concat @emph{protocol} (file level)
FFmpeg has a @url{https://ffmpeg.org/ffmpeg-protocols.html#concat, FFmpeg has a @url{http://ffmpeg.org/ffmpeg-protocols.html#concat,
@code{concat}} protocol designed specifically for that, with examples in the @code{concat}} protocol designed specifically for that, with examples in the
documentation. documentation.
@ -467,40 +416,6 @@ point acceptable for your tastes. The most common options to do that are
@option{-qscale} and @option{-qmax}, but you should peruse the documentation @option{-qscale} and @option{-qmax}, but you should peruse the documentation
of the encoder you chose. of the encoder you chose.
@section I have a stretched video, why does scaling does not fix it?
A lot of video codecs and formats can store the @emph{aspect ratio} of the
video: this is the ratio between the width and the height of either the full
image (DAR, display aspect ratio) or individual pixels (SAR, sample aspect
ratio). For example, EGA screens at resolution 640×350 had 4:3 DAR and 35:48
SAR.
Most still image processing work with square pixels, i.e. 1:1 SAR, but a lot
of video standards, especially from the analogic-numeric transition era, use
non-square pixels.
Most processing filters in FFmpeg handle the aspect ratio to avoid
stretching the image: cropping adjusts the DAR to keep the SAR constant,
scaling adjusts the SAR to keep the DAR constant.
If you want to stretch, or “unstretch”, the image, you need to override the
information with the
@url{https://ffmpeg.org/ffmpeg-filters.html#setdar_002c-setsar, @code{setdar or setsar filters}}.
Do not forget to examine carefully the original video to check whether the
stretching comes from the image or from the aspect ratio information.
For example, to fix a badly encoded EGA capture, use the following commands,
either the first one to upscale to square pixels or the second one to set
the correct aspect ratio or the third one to avoid transcoding (may not work
depending on the format / codec / player / phase of the moon):
@example
ffmpeg -i ega_screen.nut -vf scale=640:480,setsar=1 ega_screen_scaled.nut
ffmpeg -i ega_screen.nut -vf setdar=4/3 ega_screen_anamorphic.nut
ffmpeg -i ega_screen.nut -aspect 4/3 -c copy ega_screen_overridden.nut
@end example
@chapter Development @chapter Development
@section Are there examples illustrating how to use the FFmpeg libraries, particularly libavcodec and libavformat? @section Are there examples illustrating how to use the FFmpeg libraries, particularly libavcodec and libavformat?
@ -589,7 +504,7 @@ see @file{libavformat/aviobuf.c} in FFmpeg and @file{libmpdemux/demux_lavf.c} in
@section Where is the documentation about ffv1, msmpeg4, asv1, 4xm? @section Where is the documentation about ffv1, msmpeg4, asv1, 4xm?
see @url{https://www.ffmpeg.org/~michael/} see @url{http://www.ffmpeg.org/~michael/}
@section How do I feed H.263-RTP (and other codecs in RTP) to libavcodec? @section How do I feed H.263-RTP (and other codecs in RTP) to libavcodec?

View File

@ -1,5 +1,4 @@
\input texinfo @c -*- texinfo -*- \input texinfo @c -*- texinfo -*-
@documentencoding UTF-8
@settitle FFmpeg Automated Testing Environment @settitle FFmpeg Automated Testing Environment
@titlepage @titlepage
@ -13,36 +12,36 @@
@chapter Introduction @chapter Introduction
FATE is an extended regression suite on the client-side and a means FATE is an extended regression suite on the client-side and a means
for results aggregation and presentation on the server-side. for results aggregation and presentation on the server-side.
The first part of this document explains how you can use FATE from The first part of this document explains how you can use FATE from
your FFmpeg source directory to test your ffmpeg binary. The second your FFmpeg source directory to test your ffmpeg binary. The second
part describes how you can run FATE to submit the results to FFmpeg's part describes how you can run FATE to submit the results to FFmpeg's
FATE server. FATE server.
In any way you can have a look at the publicly viewable FATE results In any way you can have a look at the publicly viewable FATE results
by visiting this website: by visiting this website:
@url{http://fate.ffmpeg.org/} @url{http://fate.ffmpeg.org/}
This is especially recommended for all people contributing source This is especially recommended for all people contributing source
code to FFmpeg, as it can be seen if some test on some platform broke code to FFmpeg, as it can be seen if some test on some platform broke
with their recent contribution. This usually happens on the platforms with their recent contribution. This usually happens on the platforms
the developers could not test on. the developers could not test on.
The second part of this document describes how you can run FATE to The second part of this document describes how you can run FATE to
submit your results to FFmpeg's FATE server. If you want to submit your submit your results to FFmpeg's FATE server. If you want to submit your
results be sure to check that your combination of CPU, OS and compiler results be sure to check that your combination of CPU, OS and compiler
is not already listed on the above mentioned website. is not already listed on the above mentioned website.
In the third part you can find a comprehensive listing of FATE makefile In the third part you can find a comprehensive listing of FATE makefile
targets and variables. targets and variables.
@chapter Using FATE from your FFmpeg source directory @chapter Using FATE from your FFmpeg source directory
If you want to run FATE on your machine you need to have the samples If you want to run FATE on your machine you need to have the samples
in place. You can get the samples via the build target fate-rsync. in place. You can get the samples via the build target fate-rsync.
Use this command from the top-level source directory: Use this command from the top-level source directory:
@ -51,11 +50,11 @@ make fate-rsync SAMPLES=fate-suite/
make fate SAMPLES=fate-suite/ make fate SAMPLES=fate-suite/
@end example @end example
The above commands set the samples location by passing a makefile The above commands set the samples location by passing a makefile
variable via command line. It is also possible to set the samples variable via command line. It is also possible to set the samples
location at source configuration time by invoking configure with location at source configuration time by invoking configure with
@option{--samples=<path to the samples directory>}. Afterwards you can `--samples=<path to the samples directory>'. Afterwards you can
invoke the makefile targets without setting the @var{SAMPLES} makefile invoke the makefile targets without setting the SAMPLES makefile
variable. This is illustrated by the following commands: variable. This is illustrated by the following commands:
@example @example
@ -64,7 +63,7 @@ make fate-rsync
make fate make fate
@end example @end example
Yet another way to tell FATE about the location of the sample Yet another way to tell FATE about the location of the sample
directory is by making sure the environment variable FATE_SAMPLES directory is by making sure the environment variable FATE_SAMPLES
contains the path to your samples directory. This can be achieved contains the path to your samples directory. This can be achieved
by e.g. putting that variable in your shell profile or by setting by e.g. putting that variable in your shell profile or by setting
@ -85,7 +84,7 @@ To use a custom wrapper to run the test, pass @option{--target-exec} to
@chapter Submitting the results to the FFmpeg result aggregation server @chapter Submitting the results to the FFmpeg result aggregation server
To submit your results to the server you should run fate through the To submit your results to the server you should run fate through the
shell script @file{tests/fate.sh} from the FFmpeg sources. This script needs shell script @file{tests/fate.sh} from the FFmpeg sources. This script needs
to be invoked with a configuration file as its first argument. to be invoked with a configuration file as its first argument.
@ -93,23 +92,23 @@ to be invoked with a configuration file as its first argument.
tests/fate.sh /path/to/fate_config tests/fate.sh /path/to/fate_config
@end example @end example
A configuration file template with comments describing the individual A configuration file template with comments describing the individual
configuration variables can be found at @file{doc/fate_config.sh.template}. configuration variables can be found at @file{doc/fate_config.sh.template}.
@ifhtml @ifhtml
The mentioned configuration template is also available here: The mentioned configuration template is also available here:
@verbatiminclude fate_config.sh.template @verbatiminclude fate_config.sh.template
@end ifhtml @end ifhtml
Create a configuration that suits your needs, based on the configuration Create a configuration that suits your needs, based on the configuration
template. The @env{slot} configuration variable can be any string that is not template. The `slot' configuration variable can be any string that is not
yet used, but it is suggested that you name it adhering to the following yet used, but it is suggested that you name it adhering to the following
pattern @samp{@var{arch}-@var{os}-@var{compiler}-@var{compiler version}}. The pattern <arch>-<os>-<compiler>-<compiler version>. The configuration file
configuration file itself will be sourced in a shell script, therefore all itself will be sourced in a shell script, therefore all shell features may
shell features may be used. This enables you to setup the environment as you be used. This enables you to setup the environment as you need it for your
need it for your build. build.
For your first test runs the @env{fate_recv} variable should be empty or For your first test runs the `fate_recv' variable should be empty or
commented out. This will run everything as normal except that it will omit commented out. This will run everything as normal except that it will omit
the submission of the results to the server. The following files should be the submission of the results to the server. The following files should be
present in $workdir as specified in the configuration file: present in $workdir as specified in the configuration file:
@ -122,29 +121,29 @@ present in $workdir as specified in the configuration file:
@item version @item version
@end itemize @end itemize
When you have everything working properly you can create an SSH key pair When you have everything working properly you can create an SSH key pair
and send the public key to the FATE server administrator who can be contacted and send the public key to the FATE server administrator who can be contacted
at the email address @email{fate-admin@@ffmpeg.org}. at the email address @email{fate-admin@@ffmpeg.org}.
Configure your SSH client to use public key authentication with that key Configure your SSH client to use public key authentication with that key
when connecting to the FATE server. Also do not forget to check the identity when connecting to the FATE server. Also do not forget to check the identity
of the server and to accept its host key. This can usually be achieved by of the server and to accept its host key. This can usually be achieved by
running your SSH client manually and killing it after you accepted the key. running your SSH client manually and killing it after you accepted the key.
The FATE server's fingerprint is: The FATE server's fingerprint is:
@table @samp @table @option
@item RSA @item RSA
d3:f1:83:97:a4:75:2b:a6:fb:d6:e8:aa:81:93:97:51 d3:f1:83:97:a4:75:2b:a6:fb:d6:e8:aa:81:93:97:51
@item ECDSA @item ECDSA
76:9f:68:32:04:1e:d5:d4:ec:47:3f:dc:fc:18:17:86 76:9f:68:32:04:1e:d5:d4:ec:47:3f:dc:fc:18:17:86
@end table @end table
If you have problems connecting to the FATE server, it may help to try out If you have problems connecting to the FATE server, it may help to try out
the @command{ssh} command with one or more @option{-v} options. You should the @command{ssh} command with one or more @option{-v} options. You should
get detailed output concerning your SSH configuration and the authentication get detailed output concerning your SSH configuration and the authentication
process. process.
The only thing left is to automate the execution of the fate.sh script and The only thing left is to automate the execution of the fate.sh script and
the synchronisation of the samples directory. the synchronisation of the samples directory.
@ -165,7 +164,7 @@ Run the FATE test suite (requires the fate-suite dataset).
@section Makefile variables @section Makefile variables
@table @env @table @option
@item V @item V
Verbosity level, can be set to 0, 1 or 2. Verbosity level, can be set to 0, 1 or 2.
@itemize @itemize
@ -183,20 +182,20 @@ Specify how many threads to use while running regression tests, it is
quite useful to detect thread-related regressions. quite useful to detect thread-related regressions.
@item THREAD_TYPE @item THREAD_TYPE
Specify which threading strategy test, either @samp{slice} or @samp{frame}, Specify which threading strategy test, either @var{slice} or @var{frame},
by default @samp{slice+frame} by default @var{slice+frame}
@item CPUFLAGS @item CPUFLAGS
Specify CPU flags. Specify CPU flags.
@item TARGET_EXEC @item TARGET_EXEC
Specify or override the wrapper used to run the tests. Specify or override the wrapper used to run the tests.
The @env{TARGET_EXEC} option provides a way to run FATE wrapped in The @var{TARGET_EXEC} option provides a way to run FATE wrapped in
@command{valgrind}, @command{qemu-user} or @command{wine} or on remote targets @command{valgrind}, @command{qemu-user} or @command{wine} or on remote targets
through @command{ssh}. through @command{ssh}.
@item GEN @item GEN
Set to @samp{1} to generate the missing or mismatched references. Set to @var{1} to generate the missing or mismatched references.
@end table @end table
@section Examples @section Examples

View File

@ -1,6 +1,5 @@
slot= # some unique identifier slot= # some unique identifier
repo=git://source.ffmpeg.org/ffmpeg.git # the source repository repo=git://source.ffmpeg.org/ffmpeg.git # the source repository
#branch=release/2.6 # the branch to test
samples= # path to samples directory samples= # path to samples directory
workdir= # directory in which to do all the work workdir= # directory in which to do all the work
#fate_recv="ssh -T fate@fate.ffmpeg.org" # command to submit report #fate_recv="ssh -T fate@fate.ffmpeg.org" # command to submit report

View File

@ -1,5 +1,4 @@
\input texinfo @c -*- texinfo -*- \input texinfo @c -*- texinfo -*-
@documentencoding UTF-8
@settitle FFmpeg Bitstream Filters Documentation @settitle FFmpeg Bitstream Filters Documentation
@titlepage @titlepage

View File

@ -1,5 +1,4 @@
\input texinfo @c -*- texinfo -*- \input texinfo @c -*- texinfo -*-
@documentencoding UTF-8
@settitle FFmpeg Codecs Documentation @settitle FFmpeg Codecs Documentation
@titlepage @titlepage

View File

@ -1,5 +1,4 @@
\input texinfo @c -*- texinfo -*- \input texinfo @c -*- texinfo -*-
@documentencoding UTF-8
@settitle FFmpeg Devices Documentation @settitle FFmpeg Devices Documentation
@titlepage @titlepage

View File

@ -1,5 +1,4 @@
\input texinfo @c -*- texinfo -*- \input texinfo @c -*- texinfo -*-
@documentencoding UTF-8
@settitle FFmpeg Filters Documentation @settitle FFmpeg Filters Documentation
@titlepage @titlepage

View File

@ -1,5 +1,4 @@
\input texinfo @c -*- texinfo -*- \input texinfo @c -*- texinfo -*-
@documentencoding UTF-8
@settitle FFmpeg Formats Documentation @settitle FFmpeg Formats Documentation
@titlepage @titlepage

View File

@ -1,5 +1,4 @@
\input texinfo @c -*- texinfo -*- \input texinfo @c -*- texinfo -*-
@documentencoding UTF-8
@settitle FFmpeg Protocols Documentation @settitle FFmpeg Protocols Documentation
@titlepage @titlepage

View File

@ -1,5 +1,4 @@
\input texinfo @c -*- texinfo -*- \input texinfo @c -*- texinfo -*-
@documentencoding UTF-8
@settitle FFmpeg Resampler Documentation @settitle FFmpeg Resampler Documentation
@titlepage @titlepage

View File

@ -1,5 +1,4 @@
\input texinfo @c -*- texinfo -*- \input texinfo @c -*- texinfo -*-
@documentencoding UTF-8
@settitle FFmpeg Scaler Documentation @settitle FFmpeg Scaler Documentation
@titlepage @titlepage

View File

@ -1,5 +1,4 @@
\input texinfo @c -*- texinfo -*- \input texinfo @c -*- texinfo -*-
@documentencoding UTF-8
@settitle FFmpeg Utilities Documentation @settitle FFmpeg Utilities Documentation
@titlepage @titlepage

View File

@ -1,5 +1,4 @@
\input texinfo @c -*- texinfo -*- \input texinfo @c -*- texinfo -*-
@documentencoding UTF-8
@settitle ffmpeg Documentation @settitle ffmpeg Documentation
@titlepage @titlepage
@ -80,7 +79,7 @@ The format option may be needed for raw input files.
The transcoding process in @command{ffmpeg} for each output can be described by The transcoding process in @command{ffmpeg} for each output can be described by
the following diagram: the following diagram:
@verbatim @example
_______ ______________ _______ ______________
| | | | | | | |
| input | demuxer | encoded data | decoder | input | demuxer | encoded data | decoder
@ -99,7 +98,7 @@ the following diagram:
|________| |______________| |________| |______________|
@end verbatim @end example
@command{ffmpeg} calls the libavformat library (containing demuxers) to read @command{ffmpeg} calls the libavformat library (containing demuxers) to read
input files and get packets containing encoded data from them. When there are input files and get packets containing encoded data from them. When there are
@ -124,7 +123,7 @@ Simple filtergraphs are those that have exactly one input and output, both of
the same type. In the above diagram they can be represented by simply inserting the same type. In the above diagram they can be represented by simply inserting
an additional step between decoding and encoding: an additional step between decoding and encoding:
@verbatim @example
_________ ______________ _________ ______________
| | | | | | | |
| decoded | | encoded data | | decoded | | encoded data |
@ -136,19 +135,19 @@ an additional step between decoding and encoding:
| frames | | frames |
|__________| |__________|
@end verbatim @end example
Simple filtergraphs are configured with the per-stream @option{-filter} option Simple filtergraphs are configured with the per-stream @option{-filter} option
(with @option{-vf} and @option{-af} aliases for video and audio respectively). (with @option{-vf} and @option{-af} aliases for video and audio respectively).
A simple filtergraph for video can look for example like this: A simple filtergraph for video can look for example like this:
@verbatim @example
_______ _____________ _______ ________ _______ _____________ _______ ________
| | | | | | | | | | | | | | | |
| input | ---> | deinterlace | ---> | scale | ---> | output | | input | ---> | deinterlace | ---> | scale | ---> | output |
|_______| |_____________| |_______| |________| |_______| |_____________| |_______| |________|
@end verbatim @end example
Note that some filters change frame properties but not frame contents. E.g. the Note that some filters change frame properties but not frame contents. E.g. the
@code{fps} filter in the example above changes number of frames, but does not @code{fps} filter in the example above changes number of frames, but does not
@ -161,7 +160,7 @@ processing chain applied to one stream. This is the case, for example, when the
more than one input and/or output, or when output stream type is different from more than one input and/or output, or when output stream type is different from
input. They can be represented with the following diagram: input. They can be represented with the following diagram:
@verbatim @example
_________ _________
| | | |
| input 0 |\ __________ | input 0 |\ __________
@ -179,7 +178,7 @@ input. They can be represented with the following diagram:
| input 2 |/ | input 2 |/
|_________| |_________|
@end verbatim @end example
Complex filtergraphs are configured with the @option{-filter_complex} option. Complex filtergraphs are configured with the @option{-filter_complex} option.
Note that this option is global, since a complex filtergraph, by its nature, Note that this option is global, since a complex filtergraph, by its nature,
@ -198,14 +197,14 @@ step for the specified stream, so it does only demuxing and muxing. It is useful
for changing the container format or modifying container-level metadata. The for changing the container format or modifying container-level metadata. The
diagram above will, in this case, simplify to this: diagram above will, in this case, simplify to this:
@verbatim @example
_______ ______________ ________ _______ ______________ ________
| | | | | | | | | | | |
| input | demuxer | encoded data | muxer | output | | input | demuxer | encoded data | muxer | output |
| file | ---------> | packets | -------> | file | | file | ---------> | packets | -------> | file |
|_______| |______________| |________| |_______| |______________| |________|
@end verbatim @end example
Since there is no decoding or encoding, it is very fast and there is no quality Since there is no decoding or encoding, it is very fast and there is no quality
loss. However, it might not work in some cases because of many factors. Applying loss. However, it might not work in some cases because of many factors. Applying
@ -253,10 +252,6 @@ Overwrite output files without asking.
Do not overwrite output files, and exit immediately if a specified Do not overwrite output files, and exit immediately if a specified
output file already exists. output file already exists.
@item -stream_loop @var{number} (@emph{input})
Set number of times input stream shall be looped. Loop 0 means no loop,
loop -1 means infinite loop.
@item -c[:@var{stream_specifier}] @var{codec} (@emph{input/output,per-stream}) @item -c[:@var{stream_specifier}] @var{codec} (@emph{input/output,per-stream})
@itemx -codec[:@var{stream_specifier}] @var{codec} (@emph{input/output,per-stream}) @itemx -codec[:@var{stream_specifier}] @var{codec} (@emph{input/output,per-stream})
Select an encoder (when used before an output file) or a decoder (when used Select an encoder (when used before an output file) or a decoder (when used
@ -284,27 +279,23 @@ data read from the input file.
When used as an output option (before an output filename), stop writing the When used as an output option (before an output filename), stop writing the
output after its duration reaches @var{duration}. output after its duration reaches @var{duration}.
@var{duration} must be a time duration specification, @var{duration} may be a number in seconds, or in @code{hh:mm:ss[.xxx]} form.
see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
-to and -t are mutually exclusive and -t has priority. -to and -t are mutually exclusive and -t has priority.
@item -to @var{position} (@emph{output}) @item -to @var{position} (@emph{output})
Stop writing the output at @var{position}. Stop writing the output at @var{position}.
@var{position} must be a time duration specification, @var{position} may be a number in seconds, or in @code{hh:mm:ss[.xxx]} form.
see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
-to and -t are mutually exclusive and -t has priority. -to and -t are mutually exclusive and -t has priority.
@item -fs @var{limit_size} (@emph{output}) @item -fs @var{limit_size} (@emph{output})
Set the file size limit, expressed in bytes. No further chunk of bytes is written Set the file size limit, expressed in bytes.
after the limit is exceeded. The size of the output file is slightly more than the
requested file size.
@item -ss @var{position} (@emph{input/output}) @item -ss @var{position} (@emph{input/output})
When used as an input option (before @code{-i}), seeks in this input file to When used as an input option (before @code{-i}), seeks in this input file to
@var{position}. Note that in most formats it is not possible to seek exactly, @var{position}. Note the in most formats it is not possible to seek exactly, so
so @command{ffmpeg} will seek to the closest seek point before @var{position}. @command{ffmpeg} will seek to the closest seek point before @var{position}.
When transcoding and @option{-accurate_seek} is enabled (the default), this When transcoding and @option{-accurate_seek} is enabled (the default), this
extra segment between the seek point and @var{position} will be decoded and extra segment between the seek point and @var{position} will be decoded and
discarded. When doing stream copy or when @option{-noaccurate_seek} is used, it discarded. When doing stream copy or when @option{-noaccurate_seek} is used, it
@ -313,13 +304,7 @@ will be preserved.
When used as an output option (before an output filename), decodes but discards When used as an output option (before an output filename), decodes but discards
input until the timestamps reach @var{position}. input until the timestamps reach @var{position}.
@var{position} must be a time duration specification, @var{position} may be either in seconds or in @code{hh:mm:ss[.xxx]} form.
see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
@item -sseof @var{position} (@emph{input/output})
Like the @code{-ss} option but relative to the "end of file". That is negative
values are earlier in the file, 0 is at EOF.
@item -itsoffset @var{offset} (@emph{input}) @item -itsoffset @var{offset} (@emph{input})
Set the input time offset. Set the input time offset.
@ -334,15 +319,15 @@ the time duration specified in @var{offset}.
@item -timestamp @var{date} (@emph{output}) @item -timestamp @var{date} (@emph{output})
Set the recording timestamp in the container. Set the recording timestamp in the container.
@var{date} must be a date specification, @var{date} must be a time duration specification,
see @ref{date syntax,,the Date section in the ffmpeg-utils(1) manual,ffmpeg-utils}. see @ref{date syntax,,the Date section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
@item -metadata[:metadata_specifier] @var{key}=@var{value} (@emph{output,per-metadata}) @item -metadata[:metadata_specifier] @var{key}=@var{value} (@emph{output,per-metadata})
Set a metadata key/value pair. Set a metadata key/value pair.
An optional @var{metadata_specifier} may be given to set metadata An optional @var{metadata_specifier} may be given to set metadata
on streams, chapters or programs. See @code{-map_metadata} on streams or chapters. See @code{-map_metadata} documentation for
documentation for details. details.
This option overrides metadata set with @code{-map_metadata}. It is This option overrides metadata set with @code{-map_metadata}. It is
also possible to delete metadata by using an empty value. also possible to delete metadata by using an empty value.
@ -357,11 +342,6 @@ To set the language of the first audio stream:
ffmpeg -i INPUT -metadata:s:a:0 language=eng OUTPUT ffmpeg -i INPUT -metadata:s:a:0 language=eng OUTPUT
@end example @end example
@item -program [title=@var{title}:][program_num=@var{program_num}:]st=@var{stream}[:st=@var{stream}...] (@emph{output})
Creates a program with the specified @var{title}, @var{program_num} and adds the specified
@var{stream}(s) to it.
@item -target @var{type} (@emph{output}) @item -target @var{type} (@emph{output})
Specify target file type (@code{vcd}, @code{svcd}, @code{dvd}, @code{dv}, Specify target file type (@code{vcd}, @code{svcd}, @code{dvd}, @code{dv},
@code{dv50}). @var{type} may be prefixed with @code{pal-}, @code{ntsc-} or @code{dv50}). @var{type} may be prefixed with @code{pal-}, @code{ntsc-} or
@ -481,9 +461,6 @@ Technical note -- attachments are implemented as codec extradata, so this
option can actually be used to extract extradata from any stream, not just option can actually be used to extract extradata from any stream, not just
attachments. attachments.
@item -noautorotate
Disable automatically rotating video based on file metadata.
@end table @end table
@section Video Options @section Video Options
@ -682,16 +659,6 @@ Use VDPAU (Video Decode and Presentation API for Unix) hardware acceleration.
@item dxva2 @item dxva2
Use DXVA2 (DirectX Video Acceleration) hardware acceleration. Use DXVA2 (DirectX Video Acceleration) hardware acceleration.
@item qsv
Use the Intel QuickSync Video acceleration for video transcoding.
Unlike most other values, this option does not enable accelerated decoding (that
is used automatically whenever a qsv decoder is selected), but accelerated
transcoding, without copying the frames into the system memory.
For it to work, both the decoder and the encoder must support QSV acceleration
and no filters must be used.
@end table @end table
This option has no effect if the selected hwaccel is not available or not This option has no effect if the selected hwaccel is not available or not
@ -718,27 +685,9 @@ is not specified, the value of the @var{DISPLAY} environment variable is used
@item dxva2 @item dxva2
For DXVA2, this option should contain the number of the display adapter to use. For DXVA2, this option should contain the number of the display adapter to use.
If this option is not specified, the default adapter is used. If this option is not specified, the default adapter is used.
@item qsv
For QSV, this option corresponds to the values of MFX_IMPL_* . Allowed values
are:
@table @option
@item auto
@item sw
@item hw
@item auto_any
@item hw_any
@item hw2
@item hw3
@item hw4
@end table @end table
@end table @end table
@item -hwaccels
List all hardware acceleration methods supported in this build of ffmpeg.
@end table
@section Audio Options @section Audio Options
@table @option @table @option
@ -882,14 +831,6 @@ ffmpeg -i INPUT -map 0:m:language:eng OUTPUT
Note that using this option disables the default mappings for this output file. Note that using this option disables the default mappings for this output file.
@item -ignore_unknown
Ignore input streams with unknown type instead of failing if copying
such streams is attempted.
@item -copy_unknown
Allow input streams with unknown type to be copied instead of failing if copying
such streams is attempted.
@item -map_channel [@var{input_file_id}.@var{stream_specifier}.@var{channel_id}|-1][:@var{output_file_id}.@var{stream_specifier}] @item -map_channel [@var{input_file_id}.@var{stream_specifier}.@var{channel_id}|-1][:@var{output_file_id}.@var{stream_specifier}]
Map an audio channel from a given input to an output. If Map an audio channel from a given input to an output. If
@var{output_file_id}.@var{stream_specifier} is not set, the audio channel will @var{output_file_id}.@var{stream_specifier} is not set, the audio channel will
@ -1053,13 +994,6 @@ With -map you can select from which stream the timestamps should be
taken. You can leave either video or audio unchanged and sync the taken. You can leave either video or audio unchanged and sync the
remaining stream(s) to the unchanged one. remaining stream(s) to the unchanged one.
@item -frame_drop_threshold @var{parameter}
Frame drop threshold, which specifies how much behind video frames can
be before they are dropped. In frame rate units, so 1.0 is one frame.
The default is -1.1. One possible usecase is to avoid framedrops in case
of noisy timestamps or to increase frame drop precision in case of exact
timestamps.
@item -async @var{samples_per_second} @item -async @var{samples_per_second}
Audio sync method. "Stretches/squeezes" the audio stream to match the timestamps, 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. the parameter is the maximum samples per second by which the audio is changed.
@ -1216,19 +1150,6 @@ This option enables or disables accurate seeking in input files with the
transcoding. Use @option{-noaccurate_seek} to disable it, which may be useful transcoding. Use @option{-noaccurate_seek} to disable it, which may be useful
e.g. when copying some streams and transcoding the others. e.g. when copying some streams and transcoding the others.
@item -seek_timestamp (@emph{input})
This option enables or disables seeking by timestamp in input files with the
@option{-ss} option. It is disabled by default. If enabled, the argument
to the @option{-ss} option is considered an actual timestamp, and is not
offset by the start time of the file. This matters only for files which do
not start from timestamp 0, such as transport streams.
@item -thread_queue_size @var{size} (@emph{input})
This option sets the maximum number of queued packets when reading from the
file or device. With low latency / high rate live streams, packets may be
discarded if they are not read in a timely manner; raising this value can
avoid it.
@item -override_ffserver (@emph{global}) @item -override_ffserver (@emph{global})
Overrides the input specifications from @command{ffserver}. Using this Overrides the input specifications from @command{ffserver}. Using this
option you can map any input stream to @command{ffserver} and control option you can map any input stream to @command{ffserver} and control
@ -1239,11 +1160,6 @@ requested by @command{ffserver}.
The option is intended for cases where features are needed that cannot be The option is intended for cases where features are needed that cannot be
specified to @command{ffserver} but can be to @command{ffmpeg}. specified to @command{ffserver} but can be to @command{ffmpeg}.
@item -sdp_file @var{file} (@emph{global})
Print sdp information for an output stream to @var{file}.
This allows dumping sdp information when at least one output isn't an
rtp stream. (Requires at least one of the output formats to be rtp).
@item -discard (@emph{input}) @item -discard (@emph{input})
Allows discarding specific streams or frames of streams at the demuxer. Allows discarding specific streams or frames of streams at the demuxer.
Not all demuxers support this. Not all demuxers support this.
@ -1268,17 +1184,6 @@ Discard all frames excepts keyframes.
Discard all frames. Discard all frames.
@end table @end table
@item -abort_on @var{flags} (@emph{global})
Stop and abort on various conditions. The following flags are available:
@table @option
@item empty_output
No packets were passed to the muxer, the output is empty.
@end table
@item -xerror (@emph{global})
Stop and exit on error
@end table @end table
As a special exception, you can use a bitmap subtitle stream as input: it As a special exception, you can use a bitmap subtitle stream as input: it
@ -1304,10 +1209,7 @@ awkward to specify on the command line. Lines starting with the hash
('#') character are ignored and are used to provide comments. Check ('#') character are ignored and are used to provide comments. Check
the @file{presets} directory in the FFmpeg source tree for examples. the @file{presets} directory in the FFmpeg source tree for examples.
There are two types of preset files: ffpreset and avpreset files. Preset files are specified with the @code{vpre}, @code{apre},
@subsection ffpreset files
ffpreset files are specified with the @code{vpre}, @code{apre},
@code{spre}, and @code{fpre} options. The @code{fpre} option takes the @code{spre}, and @code{fpre} options. The @code{fpre} option takes the
filename of the preset instead of a preset name as input and can be filename of the preset instead of a preset name as input and can be
used for any kind of codec. For the @code{vpre}, @code{apre}, and used for any kind of codec. For the @code{vpre}, @code{apre}, and
@ -1332,31 +1234,67 @@ 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 preset file options will be applied. For example, if you select
the video codec with @code{-vcodec libvpx} and use @code{-vpre 1080p}, the video codec with @code{-vcodec libvpx} and use @code{-vpre 1080p},
then it will search for the file @file{libvpx-1080p.ffpreset}. then it will search for the file @file{libvpx-1080p.ffpreset}.
@subsection avpreset files
avpreset files are specified with the @code{pre} option. They work similar to
ffpreset files, but they only allow encoder- specific options. Therefore, an
@var{option}=@var{value} pair specifying an encoder cannot be used.
When the @code{pre} option is specified, ffmpeg will look for files with the
suffix .avpreset in the directories @file{$AVCONV_DATADIR} (if set), and
@file{$HOME/.avconv}, and in the datadir defined at configuration time (usually
@file{PREFIX/share/ffmpeg}), in that order.
First ffmpeg searches for a file named @var{codec_name}-@var{arg}.avpreset in
the above-mentioned 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 libvpx} and use @code{-pre 1080p}, then it will
search for the file @file{libvpx-1080p.avpreset}.
If no such file is found, then ffmpeg will search for a file named
@var{arg}.avpreset in the same directories.
@c man end OPTIONS @c man end OPTIONS
@chapter Tips
@c man begin TIPS
@itemize
@item
For streaming at very low bitrates, use a low frame rate
and a small GOP size. This is especially true for RealVideo where
the Linux player does not seem to be very fast, so it can miss
frames. An example is:
@example
ffmpeg -g 3 -r 3 -t 10 -b:v 50k -s qcif -f rv10 /tmp/b.rm
@end example
@item
The parameter 'q' which is displayed while encoding is the current
quantizer. The value 1 indicates that a very good quality could
be achieved. The value 31 indicates the worst quality. If q=31 appears
too often, it means that the encoder cannot compress enough to meet
your bitrate. You must either increase the bitrate, decrease the
frame rate or decrease the frame size.
@item
If your computer is not fast enough, you can speed up the
compression at the expense of the compression ratio. You can use
'-me zero' to speed up motion estimation, and '-g 0' to disable
motion estimation completely (you have only I-frames, which means it
is about as good as JPEG compression).
@item
To have very low audio bitrates, reduce the sampling frequency
(down to 22050 Hz for MPEG audio, 22050 or 11025 for AC-3).
@item
To have a constant quality (but a variable bitrate), use the option
'-qscale n' when 'n' is between 1 (excellent quality) and 31 (worst
quality).
@end itemize
@c man end TIPS
@chapter Examples @chapter Examples
@c man begin EXAMPLES @c man begin EXAMPLES
@section Preset files
A preset file contains a sequence of @var{option=value} pairs, one for
each line, specifying a sequence of options which can be specified also on
the command line. Lines starting with the hash ('#') character are ignored and
are used to provide comments. Empty lines are also ignored. Check the
@file{presets} directory in the FFmpeg source tree for examples.
Preset files are specified with the @code{pre} option, this option takes a
preset name as input. FFmpeg searches for a file named @var{preset_name}.avpreset in
the directories @file{$AVCONV_DATADIR} (if set), and @file{$HOME/.ffmpeg}, and in
the data directory defined at configuration time (usually @file{$PREFIX/share/ffmpeg})
in that order. For example, if the argument is @code{libx264-max}, it will
search for the file @file{libx264-max.avpreset}.
@section Video and Audio grabbing @section Video and Audio grabbing
If you specify the input format and device then ffmpeg can grab video If you specify the input format and device then ffmpeg can grab video
@ -1504,7 +1442,7 @@ combination with -ss to start extracting from a certain point in time.
For creating a video from many images: For creating a video from many images:
@example @example
ffmpeg -f image2 -framerate 12 -i foo-%03d.jpeg -s WxH foo.avi ffmpeg -f image2 -i foo-%03d.jpeg -r 12 -s WxH foo.avi
@end example @end example
The syntax @code{foo-%03d.jpeg} specifies to use a decimal number The syntax @code{foo-%03d.jpeg} specifies to use a decimal number
@ -1519,7 +1457,7 @@ image2-specific @code{-pattern_type glob} option.
For example, for creating a video from filenames matching the glob pattern For example, for creating a video from filenames matching the glob pattern
@code{foo-*.jpeg}: @code{foo-*.jpeg}:
@example @example
ffmpeg -f image2 -pattern_type glob -framerate 12 -i 'foo-*.jpeg' -s WxH foo.avi ffmpeg -f image2 -pattern_type glob -i 'foo-*.jpeg' -r 12 -s WxH foo.avi
@end example @end example
@item @item

View File

@ -1,5 +1,4 @@
\input texinfo @c -*- texinfo -*- \input texinfo @c -*- texinfo -*-
@documentencoding UTF-8
@settitle ffplay Documentation @settitle ffplay Documentation
@titlepage @titlepage
@ -47,17 +46,9 @@ Disable video.
@item -sn @item -sn
Disable subtitles. Disable subtitles.
@item -ss @var{pos} @item -ss @var{pos}
Seek to @var{pos}. Note that in most formats it is not possible to seek Seek to a given position in seconds.
exactly, so @command{ffplay} will seek to the nearest seek point to
@var{pos}.
@var{pos} must be a time duration specification,
see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
@item -t @var{duration} @item -t @var{duration}
Play @var{duration} seconds of audio/video. play <duration> seconds of audio/video
@var{duration} must be a time duration specification,
see @ref{time duration syntax,,the Time duration section in the ffmpeg-utils(1) manual,ffmpeg-utils}.
@item -bytes @item -bytes
Seek by bytes. Seek by bytes.
@item -nodisp @item -nodisp
@ -133,20 +124,24 @@ master clock is used to control audio-video synchronization. Most media
players use audio as master clock, but in some cases (streaming or high players use audio as master clock, but in some cases (streaming or high
quality broadcast) it is necessary to change that. This option is mainly quality broadcast) it is necessary to change that. This option is mainly
used for debugging purposes. used for debugging purposes.
@item -ast @var{audio_stream_specifier} @item -threads @var{count}
Select the desired audio stream using the given stream specifier. The stream Set the thread count. By default, @command{ffplay} automatically detects a
specifiers are described in the @ref{Stream specifiers} chapter. If this option suitable number of threads to use.
is not specified, the "best" audio stream is selected in the program of the @item -ast @var{audio_stream_number}
already selected video stream. Select the desired audio stream number, counting from 0. The number
@item -vst @var{video_stream_specifier} refers to the list of all the input audio streams. If it is greater
Select the desired video stream using the given stream specifier. The stream than the number of audio streams minus one, then the last one is
specifiers are described in the @ref{Stream specifiers} chapter. If this option selected, if it is negative the audio playback is disabled.
is not specified, the "best" video stream is selected. @item -vst @var{video_stream_number}
@item -sst @var{subtitle_stream_specifier} Select the desired video stream number, counting from 0. The number
Select the desired subtitle stream using the given stream specifier. The stream refers to the list of all the input video streams. If it is greater
specifiers are described in the @ref{Stream specifiers} chapter. If this option than the number of video streams minus one, then the last one is
is not specified, the "best" subtitle stream is selected in the program of the selected, if it is negative the video playback is disabled.
already selected video or audio stream. @item -sst @var{subtitle_stream_number}
Select the desired subtitle stream number, counting from 0. The number
refers to the list of all the input subtitle streams. If it is greater
than the number of subtitle streams minus one, then the last one is
selected, if it is negative the subtitle rendering is disabled.
@item -autoexit @item -autoexit
Exit when video is done playing. Exit when video is done playing.
@item -exitonkeydown @item -exitonkeydown
@ -169,7 +164,7 @@ Force a specific video decoder.
Force a specific subtitle decoder. Force a specific subtitle decoder.
@item -autorotate @item -autorotate
Automatically rotate the video according to file metadata. Enabled by Automatically rotate the video according to presentation metadata. Enabled by
default, use @option{-noautorotate} to disable it. default, use @option{-noautorotate} to disable it.
@item -framedrop @item -framedrop
@ -197,15 +192,6 @@ Toggle full screen.
@item p, SPC @item p, SPC
Pause. Pause.
@item m
Toggle mute.
@item 9, 0
Decrease and increase volume respectively.
@item /, *
Decrease and increase volume respectively.
@item a @item a
Cycle audio channel in the current program. Cycle audio channel in the current program.
@ -238,12 +224,9 @@ Seek to the previous/next chapter.
or if there are no chapters or if there are no chapters
Seek backward/forward 10 minutes. Seek backward/forward 10 minutes.
@item right mouse click @item mouse click
Seek to percentage in file corresponding to fraction of width. Seek to percentage in file corresponding to fraction of width.
@item left mouse double-click
Toggle full screen.
@end table @end table
@c man end @c man end

View File

@ -1,5 +1,4 @@
\input texinfo @c -*- texinfo -*- \input texinfo @c -*- texinfo -*-
@documentencoding UTF-8
@settitle ffprobe Documentation @settitle ffprobe Documentation
@titlepage @titlepage
@ -447,17 +446,17 @@ writer).
It can assume one of the following values: It can assume one of the following values:
@table @option @table @option
@item c @item c
Perform C-like escaping. Strings containing a newline (@samp{\n}), carriage Perform C-like escaping. Strings containing a newline ('\n'), carriage
return (@samp{\r}), a tab (@samp{\t}), a form feed (@samp{\f}), the escaping return ('\r'), a tab ('\t'), a form feed ('\f'), the escaping
character (@samp{\}) or the item separator character @var{SEP} are escaped character ('\') or the item separator character @var{SEP} are escaped using C-like fashioned
using C-like fashioned escaping, so that a newline is converted to the escaping, so that a newline is converted to the sequence "\n", a
sequence @samp{\n}, a carriage return to @samp{\r}, @samp{\} to @samp{\\} and carriage return to "\r", '\' to "\\" and the separator @var{SEP} is
the separator @var{SEP} is converted to @samp{\@var{SEP}}. converted to "\@var{SEP}".
@item csv @item csv
Perform CSV-like escaping, as described in RFC4180. Strings Perform CSV-like escaping, as described in RFC4180. Strings
containing a newline (@samp{\n}), a carriage return (@samp{\r}), a double quote containing a newline ('\n'), a carriage return ('\r'), a double quote
(@samp{"}), or @var{SEP} are enclosed in double-quotes. ('"'), or @var{SEP} are enclosed in double-quotes.
@item none @item none
Perform no escaping. Perform no escaping.
@ -485,7 +484,7 @@ The description of the accepted options follows.
Separator character used to separate the chapter, the section name, IDs and Separator character used to separate the chapter, the section name, IDs and
potential tags in the printed field key. potential tags in the printed field key.
Default value is @samp{.}. Default value is '.'.
@item hierarchical, h @item hierarchical, h
Specify if the section name specification should be hierarchical. If Specify if the section name specification should be hierarchical. If
@ -507,22 +506,21 @@ The following conventions are adopted:
@item @item
all key and values are UTF-8 all key and values are UTF-8
@item @item
@samp{.} is the subgroup separator '.' is the subgroup separator
@item @item
newline, @samp{\t}, @samp{\f}, @samp{\b} and the following characters are newline, '\t', '\f', '\b' and the following characters are escaped
escaped
@item @item
@samp{\} is the escape character '\' is the escape character
@item @item
@samp{#} is the comment indicator '#' is the comment indicator
@item @item
@samp{=} is the key/value separator '=' is the key/value separator
@item @item
@samp{:} is not used but usually parsed as key/value separator ':' is not used but usually parsed as key/value separator
@end itemize @end itemize
This writer accepts options as a list of @var{key}=@var{value} pairs, This writer accepts options as a list of @var{key}=@var{value} pairs,
separated by @samp{:}. separated by ":".
The description of the accepted options follows. The description of the accepted options follows.

View File

@ -48,11 +48,6 @@
</xsd:complexType> </xsd:complexType>
<xsd:complexType name="packetType"> <xsd:complexType name="packetType">
<xsd:sequence>
<xsd:element name="tag" type="ffprobe:tagType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="side_data_list" type="ffprobe:packetSideDataListType" minOccurs="0" maxOccurs="1" />
</xsd:sequence>
<xsd:attribute name="codec_type" type="xsd:string" use="required" /> <xsd:attribute name="codec_type" type="xsd:string" use="required" />
<xsd:attribute name="stream_index" type="xsd:int" use="required" /> <xsd:attribute name="stream_index" type="xsd:int" use="required" />
<xsd:attribute name="pts" type="xsd:long" /> <xsd:attribute name="pts" type="xsd:long" />
@ -70,16 +65,6 @@
<xsd:attribute name="data_hash" type="xsd:string" /> <xsd:attribute name="data_hash" type="xsd:string" />
</xsd:complexType> </xsd:complexType>
<xsd:complexType name="packetSideDataListType">
<xsd:sequence>
<xsd:element name="side_data" type="ffprobe:packetSideDataType" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="packetSideDataType">
<xsd:attribute name="side_data_type" type="xsd:string"/>
<xsd:attribute name="side_data_size" type="xsd:int" />
</xsd:complexType>
<xsd:complexType name="frameType"> <xsd:complexType name="frameType">
<xsd:sequence> <xsd:sequence>
<xsd:element name="tag" type="ffprobe:tagType" minOccurs="0" maxOccurs="unbounded"/> <xsd:element name="tag" type="ffprobe:tagType" minOccurs="0" maxOccurs="unbounded"/>
@ -87,7 +72,6 @@
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="media_type" type="xsd:string" use="required"/> <xsd:attribute name="media_type" type="xsd:string" use="required"/>
<xsd:attribute name="stream_index" type="xsd:int" />
<xsd:attribute name="key_frame" type="xsd:int" use="required"/> <xsd:attribute name="key_frame" type="xsd:int" use="required"/>
<xsd:attribute name="pts" type="xsd:long" /> <xsd:attribute name="pts" type="xsd:long" />
<xsd:attribute name="pts_time" type="xsd:float"/> <xsd:attribute name="pts_time" type="xsd:float"/>
@ -129,7 +113,6 @@
<xsd:complexType name="frameSideDataType"> <xsd:complexType name="frameSideDataType">
<xsd:attribute name="side_data_type" type="xsd:string"/> <xsd:attribute name="side_data_type" type="xsd:string"/>
<xsd:attribute name="side_data_size" type="xsd:int" /> <xsd:attribute name="side_data_size" type="xsd:int" />
<xsd:attribute name="timecode" type="xsd:string"/>
</xsd:complexType> </xsd:complexType>
<xsd:complexType name="subtitleType"> <xsd:complexType name="subtitleType">
@ -172,7 +155,6 @@
<xsd:sequence> <xsd:sequence>
<xsd:element name="disposition" type="ffprobe:streamDispositionType" minOccurs="0" maxOccurs="1"/> <xsd:element name="disposition" type="ffprobe:streamDispositionType" minOccurs="0" maxOccurs="1"/>
<xsd:element name="tag" type="ffprobe:tagType" minOccurs="0" maxOccurs="unbounded"/> <xsd:element name="tag" type="ffprobe:tagType" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="side_data_list" type="ffprobe:packetSideDataListType" minOccurs="0" maxOccurs="1" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="index" type="xsd:int" use="required"/> <xsd:attribute name="index" type="xsd:int" use="required"/>
@ -189,8 +171,6 @@
<!-- video attributes --> <!-- video attributes -->
<xsd:attribute name="width" type="xsd:int"/> <xsd:attribute name="width" type="xsd:int"/>
<xsd:attribute name="height" type="xsd:int"/> <xsd:attribute name="height" type="xsd:int"/>
<xsd:attribute name="coded_width" type="xsd:int"/>
<xsd:attribute name="coded_height" type="xsd:int"/>
<xsd:attribute name="has_b_frames" type="xsd:int"/> <xsd:attribute name="has_b_frames" type="xsd:int"/>
<xsd:attribute name="sample_aspect_ratio" type="xsd:string"/> <xsd:attribute name="sample_aspect_ratio" type="xsd:string"/>
<xsd:attribute name="display_aspect_ratio" type="xsd:string"/> <xsd:attribute name="display_aspect_ratio" type="xsd:string"/>
@ -202,7 +182,6 @@
<xsd:attribute name="color_primaries" type="xsd:string"/> <xsd:attribute name="color_primaries" type="xsd:string"/>
<xsd:attribute name="chroma_location" type="xsd:string"/> <xsd:attribute name="chroma_location" type="xsd:string"/>
<xsd:attribute name="timecode" type="xsd:string"/> <xsd:attribute name="timecode" type="xsd:string"/>
<xsd:attribute name="refs" type="xsd:int"/>
<!-- audio attributes --> <!-- audio attributes -->
<xsd:attribute name="sample_fmt" type="xsd:string"/> <xsd:attribute name="sample_fmt" type="xsd:string"/>
@ -274,8 +253,8 @@
<xsd:complexType name="programVersionType"> <xsd:complexType name="programVersionType">
<xsd:attribute name="version" type="xsd:string" use="required"/> <xsd:attribute name="version" type="xsd:string" use="required"/>
<xsd:attribute name="copyright" type="xsd:string" use="required"/> <xsd:attribute name="copyright" type="xsd:string" use="required"/>
<xsd:attribute name="build_date" type="xsd:string"/> <xsd:attribute name="build_date" type="xsd:string" use="required"/>
<xsd:attribute name="build_time" type="xsd:string"/> <xsd:attribute name="build_time" type="xsd:string" use="required"/>
<xsd:attribute name="compiler_ident" type="xsd:string" use="required"/> <xsd:attribute name="compiler_ident" type="xsd:string" use="required"/>
<xsd:attribute name="configuration" type="xsd:string" use="required"/> <xsd:attribute name="configuration" type="xsd:string" use="required"/>
</xsd:complexType> </xsd:complexType>

View File

@ -82,7 +82,6 @@ Feed feed1.ffm
# ra : RealNetworks-compatible stream. Audio only. # ra : RealNetworks-compatible stream. Audio only.
# mpjpeg : Multipart JPEG (works with Netscape without any plugin) # mpjpeg : Multipart JPEG (works with Netscape without any plugin)
# jpeg : Generate a single JPEG image. # jpeg : Generate a single JPEG image.
# mjpeg : Generate a M-JPEG stream.
# asf : ASF compatible streaming (Windows Media Player format). # asf : ASF compatible streaming (Windows Media Player format).
# swf : Macromedia Flash compatible stream # swf : Macromedia Flash compatible stream
# avi : AVI format (MPEG-4 video, MPEG audio sound) # avi : AVI format (MPEG-4 video, MPEG audio sound)

View File

@ -1,5 +1,4 @@
\input texinfo @c -*- texinfo -*- \input texinfo @c -*- texinfo -*-
@documentencoding UTF-8
@settitle ffserver Documentation @settitle ffserver Documentation
@titlepage @titlepage
@ -118,8 +117,7 @@ Multiple streams can be connected to the same feed.
For example, you can have a situation described by the following For example, you can have a situation described by the following
graph: graph:
@example
@verbatim
_________ __________ _________ __________
| | | | | | | |
ffmpeg 1 -----| feed 1 |-----| stream 1 | ffmpeg 1 -----| feed 1 |-----| stream 1 |
@ -144,8 +142,7 @@ ffmpeg 2 -----| feed 3 |-----| stream 4 |
| | | | | | | |
| file 1 |-----| stream 5 | | file 1 |-----| stream 5 |
|_________| |__________| |_________| |__________|
@end example
@end verbatim
@anchor{FFM} @anchor{FFM}
@section FFM, FFM2 formats @section FFM, FFM2 formats

View File

@ -36,10 +36,8 @@ Possible forms of stream specifiers are:
Matches the stream with this index. E.g. @code{-threads:1 4} would set the Matches the stream with this index. E.g. @code{-threads:1 4} would set the
thread count for the second stream to 4. thread count for the second stream to 4.
@item @var{stream_type}[:@var{stream_index}] @item @var{stream_type}[:@var{stream_index}]
@var{stream_type} is one of following: 'v' or 'V' for video, 'a' for audio, 's' @var{stream_type} is one of following: 'v' for video, 'a' for audio, 's' for subtitle,
for subtitle, 'd' for data, and 't' for attachments. 'v' matches all video 'd' for data, and 't' for attachments. If @var{stream_index} is given, then it matches
streams, 'V' only matches video streams which are not attached pictures, video
thumbnails or cover arts. If @var{stream_index} is given, then it matches
stream number @var{stream_index} of this type. Otherwise, it matches all stream number @var{stream_index} of this type. Otherwise, it matches all
streams of this type. streams of this type.
@item p:@var{program_id}[:@var{stream_index}] @item p:@var{program_id}[:@var{stream_index}]
@ -52,9 +50,6 @@ Match the stream by stream id (e.g. PID in MPEG-TS container).
Matches streams with the metadata tag @var{key} having the specified value. If Matches streams with the metadata tag @var{key} having the specified value. If
@var{value} is not given, matches streams that contain the given tag with any @var{value} is not given, matches streams that contain the given tag with any
value. value.
@item u
Matches streams with usable configuration, the codec must be defined and the
essential information such as video dimension or audio sample rate must be present.
Note that in @command{ffmpeg}, matching by metadata will only work properly for Note that in @command{ffmpeg}, matching by metadata will only work properly for
input files. input files.
@ -170,29 +165,28 @@ omitted. "repeat" can also be used alone.
If "repeat" is used alone, and with no prior loglevel set, the default If "repeat" is used alone, and with no prior loglevel set, the default
loglevel will be used. If multiple loglevel parameters are given, using loglevel will be used. If multiple loglevel parameters are given, using
'repeat' will not change the loglevel. 'repeat' will not change the loglevel.
@var{loglevel} is a string or a number containing one of the following values: @var{loglevel} is a number or a string containing one of the following values:
@table @samp @table @samp
@item quiet, -8 @item quiet
Show nothing at all; be silent. Show nothing at all; be silent.
@item panic, 0 @item panic
Only show fatal errors which could lead the process to crash, such as Only show fatal errors which could lead the process to crash, such as
and assert failure. This is not currently used for anything. and assert failure. This is not currently used for anything.
@item fatal, 8 @item fatal
Only show fatal errors. These are errors after which the process absolutely Only show fatal errors. These are errors after which the process absolutely
cannot continue after. cannot continue after.
@item error, 16 @item error
Show all errors, including ones which can be recovered from. Show all errors, including ones which can be recovered from.
@item warning, 24 @item warning
Show all warnings and errors. Any message related to possibly Show all warnings and errors. Any message related to possibly
incorrect or unexpected events will be shown. incorrect or unexpected events will be shown.
@item info, 32 @item info
Show informative messages during processing. This is in addition to Show informative messages during processing. This is in addition to
warnings and errors. This is the default value. warnings and errors. This is the default value.
@item verbose, 40 @item verbose
Same as @code{info}, except more verbose. Same as @code{info}, except more verbose.
@item debug, 48 @item debug
Show everything, including debugging information. Show everything, including debugging information.
@item trace, 56
@end table @end table
By default the program logs to stderr, if coloring is supported by the By default the program logs to stderr, if coloring is supported by the
@ -210,29 +204,21 @@ directory.
This file can be useful for bug reports. This file can be useful for bug reports.
It also implies @code{-loglevel verbose}. It also implies @code{-loglevel verbose}.
Setting the environment variable @env{FFREPORT} to any value has the Setting the environment variable @code{FFREPORT} to any value has the
same effect. If the value is a ':'-separated key=value sequence, these same effect. If the value is a ':'-separated key=value sequence, these
options will affect the report; option values must be escaped if they options will affect the report; options values must be escaped if they
contain special characters or the options delimiter ':' (see the contain special characters or the options delimiter ':' (see the
``Quoting and escaping'' section in the ffmpeg-utils manual). ``Quoting and escaping'' section in the ffmpeg-utils manual). The
following option is recognized:
The following options are recognized:
@table @option @table @option
@item file @item file
set the file name to use for the report; @code{%p} is expanded to the name set the file name to use for the report; @code{%p} is expanded to the name
of the program, @code{%t} is expanded to a timestamp, @code{%%} is expanded of the program, @code{%t} is expanded to a timestamp, @code{%%} is expanded
to a plain @code{%} to a plain @code{%}
@item level @item level
set the log verbosity level using a numerical value (see @code{-loglevel}). set the log level
@end table @end table
For example, to output a report to a file named @file{ffreport.log}
using a log level of @code{32} (alias for log level @code{info}):
@example
FFREPORT=file=ffreport.log:level=32 ffmpeg -i input output
@end example
Errors in parsing the environment variable are not fatal, and will not Errors in parsing the environment variable are not fatal, and will not
appear in the report. appear in the report.
@ -311,41 +297,8 @@ Possible flags for this option are:
@end table @end table
@item -opencl_bench @item -opencl_bench
This option is used to benchmark all available OpenCL devices and print the Benchmark all available OpenCL devices and show the results. This option
results. This option is only available when FFmpeg has been compiled with is only available when FFmpeg has been compiled with @code{--enable-opencl}.
@code{--enable-opencl}.
When FFmpeg is configured with @code{--enable-opencl}, the options for the
global OpenCL context are set via @option{-opencl_options}. See the
"OpenCL Options" section in the ffmpeg-utils manual for the complete list of
supported options. Amongst others, these options include the ability to select
a specific platform and device to run the OpenCL code on. By default, FFmpeg
will run on the first device of the first platform. While the options for the
global OpenCL context provide flexibility to the user in selecting the OpenCL
device of their choice, most users would probably want to select the fastest
OpenCL device for their system.
This option assists the selection of the most efficient configuration by
identifying the appropriate device for the user's system. The built-in
benchmark is run on all the OpenCL devices and the performance is measured for
each device. The devices in the results list are sorted based on their
performance with the fastest device listed first. The user can subsequently
invoke @command{ffmpeg} using the device deemed most appropriate via
@option{-opencl_options} to obtain the best performance for the OpenCL
accelerated code.
Typical usage to use the fastest OpenCL device involve the following steps.
Run the command:
@example
ffmpeg -opencl_bench
@end example
Note down the platform ID (@var{pidx}) and device ID (@var{didx}) of the first
i.e. fastest device in the list.
Select the platform and device using the command:
@example
ffmpeg -opencl_options platform_idx=@var{pidx}:device_idx=@var{didx} ...
@end example
@item -opencl_options options (@emph{global}) @item -opencl_options options (@emph{global})
Set OpenCL environment options. This option is only available when Set OpenCL environment options. This option is only available when

View File

@ -98,7 +98,7 @@ Buffer references ownership and permissions
The AVFilterLink structure has a few AVFilterBufferRef fields. The The AVFilterLink structure has a few AVFilterBufferRef fields. The
cur_buf and out_buf were used with the deprecated cur_buf and out_buf were used with the deprecated
start_frame/draw_slice/end_frame API and should no longer be used. start_frame/draw_slice/end_frame API and should no longer be used.
src_buf and partial_buf are used by libavfilter internally src_buf, cur_buf_copy and partial_buf are used by libavfilter internally
and must not be accessed by filters. and must not be accessed by filters.
Reference permissions Reference permissions
@ -232,8 +232,7 @@ Frame scheduling
one of its inputs, repeatedly until at least one frame has been pushed. one of its inputs, repeatedly until at least one frame has been pushed.
Return values: Return values:
if request_frame could produce a frame, or at least make progress if request_frame could produce a frame, it should return 0;
towards producing a frame, it should return 0;
if it could not for temporary reasons, it should return AVERROR(EAGAIN); if it could not for temporary reasons, it should return AVERROR(EAGAIN);
if it could not because there are no more frames, it should return if it could not because there are no more frames, it should return
AVERROR_EOF. AVERROR_EOF.
@ -245,18 +244,20 @@ Frame scheduling
push_one_frame(); push_one_frame();
return 0; return 0;
} }
input = input_where_a_frame_is_most_needed(); while (!frame_pushed) {
ret = ff_request_frame(input); input = input_where_a_frame_is_most_needed();
if (ret == AVERROR_EOF) { ret = ff_request_frame(input);
process_eof_on_input(); if (ret == AVERROR_EOF) {
} else if (ret < 0) { process_eof_on_input();
return ret; } else if (ret < 0) {
return ret;
}
} }
return 0; return 0;
Note that, except for filters that can have queued frames, request_frame Note that, except for filters that can have queued frames, request_frame
does not push frames: it requests them to its input, and as a reaction, does not push frames: it requests them to its input, and as a reaction,
the filter_frame method possibly will be called and do the work. the filter_frame method will be called and do the work.
Legacy API Legacy API
========== ==========

File diff suppressed because it is too large Load Diff

View File

@ -37,8 +37,6 @@ Possible values:
@table @samp @table @samp
@item ignidx @item ignidx
Ignore index. Ignore index.
@item fastseek
Enable fast, but inaccurate seeks for some formats.
@item genpts @item genpts
Generate PTS. Generate PTS.
@item nofillin @item nofillin
@ -127,27 +125,8 @@ Consider all spec non compliancies as errors.
Consider things that a sane encoder should not do as an error. Consider things that a sane encoder should not do as an error.
@end table @end table
@item max_interleave_delta @var{integer} (@emph{output})
Set maximum buffering duration for interleaving. The duration is
expressed in microseconds, and defaults to 1000000 (1 second).
To ensure all the streams are interleaved correctly, libavformat will
wait until it has at least one packet for each stream before actually
writing any packets to the output file. When some streams are
"sparse" (i.e. there are large gaps between successive packets), this
can result in excessive buffering.
This field specifies the maximum difference between the timestamps of the
first and the last packet in the muxing queue, above which libavformat
will output a packet regardless of whether it has queued a packet for all
the streams.
If set to 0, libavformat will continue buffering packets until it has
a packet for each stream, regardless of the maximum timestamp
difference between the buffered packets.
@item use_wallclock_as_timestamps @var{integer} (@emph{input}) @item use_wallclock_as_timestamps @var{integer} (@emph{input})
Use wallclock as timestamps if set to 1. Default is 0. Use wallclock as timestamps.
@item avoid_negative_ts @var{integer} (@emph{output}) @item avoid_negative_ts @var{integer} (@emph{output})

View File

@ -1,5 +1,4 @@
\input texinfo @c -*- texinfo -*- \input texinfo @c -*- texinfo -*-
@documentencoding UTF-8
@settitle General Documentation @settitle General Documentation
@titlepage @titlepage
@ -53,6 +52,14 @@ instructions for installing the libraries.
Then pass @code{--enable-libopencore-amrnb} and/or Then pass @code{--enable-libopencore-amrnb} and/or
@code{--enable-libopencore-amrwb} to configure to enable them. @code{--enable-libopencore-amrwb} to configure to enable them.
@subsection VisualOn AAC encoder library
FFmpeg can make use of the VisualOn AACenc library for AAC encoding.
Go to @url{http://sourceforge.net/projects/opencore-amr/} and follow the
instructions for installing the library.
Then pass @code{--enable-libvo-aacenc} to configure to enable it.
@subsection VisualOn AMR-WB encoder library @subsection VisualOn AMR-WB encoder library
FFmpeg can make use of the VisualOn AMR-WBenc library for AMR-WB encoding. FFmpeg can make use of the VisualOn AMR-WBenc library for AMR-WB encoding.
@ -101,21 +108,6 @@ Go to @url{http://www.wavpack.com/} and follow the instructions for
installing the library. Then pass @code{--enable-libwavpack} to configure to installing the library. Then pass @code{--enable-libwavpack} to configure to
enable it. enable it.
@section OpenH264
FFmpeg can make use of the OpenH264 library for H.264 encoding and decoding.
Go to @url{http://www.openh264.org/} and follow the instructions for
installing the library. Then pass @code{--enable-libopenh264} to configure to
enable it.
For decoding, this library is much more limited than the built-in decoder
in libavcodec; currently, this library lacks support for decoding B-frames
and some other main/high profile features. (It currently only supports
constrained baseline profile and CABAC.) Using it is mostly useful for
testing and for taking advantage of Cisco's patent portfolio license
(@url{http://www.openh264.org/BINARY_LICENSE.txt}).
@section x264 @section x264
FFmpeg can make use of the x264 library for H.264 encoding. FFmpeg can make use of the x264 library for H.264 encoding.
@ -144,14 +136,6 @@ x265 is under the GNU Public License Version 2 or later
details), you must upgrade FFmpeg's license to GPL in order to use it. details), you must upgrade FFmpeg's license to GPL in order to use it.
@end float @end float
@section kvazaar
FFmpeg can make use of the kvazaar library for HEVC encoding.
Go to @url{https://github.com/ultravideo/kvazaar} and follow the
instructions for installing the library. Then pass
@code{--enable-libkvazaar} to configure to enable it.
@section libilbc @section libilbc
iLBC is a narrowband speech codec that has been made freely available iLBC is a narrowband speech codec that has been made freely available
@ -159,7 +143,7 @@ by Google as part of the WebRTC project. libilbc is a packaging friendly
copy of the iLBC codec. FFmpeg can make use of the libilbc library for copy of the iLBC codec. FFmpeg can make use of the libilbc library for
iLBC encoding and decoding. iLBC encoding and decoding.
Go to @url{https://github.com/TimothyGu/libilbc} and follow the instructions for Go to @url{https://github.com/dekkers/libilbc} and follow the instructions for
installing the library. Then pass @code{--enable-libilbc} to configure to installing the library. Then pass @code{--enable-libilbc} to configure to
enable it. enable it.
@ -172,6 +156,12 @@ Go to @url{http://sourceforge.net/projects/zapping/} and follow the instructions
installing the library. Then pass @code{--enable-libzvbi} to configure to installing the library. Then pass @code{--enable-libzvbi} to configure to
enable it. enable it.
@float NOTE
libzvbi is licensed under the GNU General Public License Version 2 or later
(see @url{http://www.gnu.org/licenses/old-licenses/gpl-2.0.html} for details),
you must upgrade FFmpeg's license to GPL in order to use it.
@end float
@section AviSynth @section AviSynth
FFmpeg can read AviSynth scripts as input. To enable support, pass FFmpeg can read AviSynth scripts as input. To enable support, pass
@ -180,8 +170,8 @@ included in compat/avisynth/, which allows the user to enable support
without needing to search for these headers themselves. without needing to search for these headers themselves.
For Windows, supported AviSynth variants are For Windows, supported AviSynth variants are
@url{http://avisynth.nl, AviSynth 2.6 RC1 or higher} for 32-bit builds and @url{http://avisynth.nl, AviSynth 2.5 or 2.6} for 32-bit builds and
@url{http://avs-plus.net, AviSynth+ r1718 or higher} for 32-bit and 64-bit builds. @url{http://avs-plus.net, AviSynth+ 0.1} for 32-bit and 64-bit builds.
For Linux and OS X, the supported AviSynth variant is For Linux and OS X, the supported AviSynth variant is
@url{https://github.com/avxsynth/avxsynth, AvxSynth}. @url{https://github.com/avxsynth/avxsynth, AvxSynth}.
@ -193,17 +183,6 @@ end user having AviSynth or AvxSynth installed - they'll only need to be
installed to use AviSynth scripts (obviously). installed to use AviSynth scripts (obviously).
@end float @end float
@section Intel QuickSync Video
FFmpeg can use Intel QuickSync Video (QSV) for accelerated encoding and decoding
of multiple codecs. To use QSV, FFmpeg must be linked against the @code{libmfx}
dispatcher, which loads the actual decoding libraries.
The dispatcher is open source and can be downloaded from
@url{https://github.com/lu-zero/mfx_dispatch.git}. FFmpeg needs to be configured
with the @code{--enable-libmfx} option and @code{pkg-config} needs to be able to
locate the dispatcher's @code{.pc} files.
@chapter Supported File Formats, Codecs or Features @chapter Supported File Formats, Codecs or Features
@ -216,14 +195,9 @@ library:
@multitable @columnfractions .4 .1 .1 .4 @multitable @columnfractions .4 .1 .1 .4
@item Name @tab Encoding @tab Decoding @tab Comments @item Name @tab Encoding @tab Decoding @tab Comments
@item 3dostr @tab @tab X
@item 4xm @tab @tab X @item 4xm @tab @tab X
@tab 4X Technologies format, used in some games. @tab 4X Technologies format, used in some games.
@item 8088flex TMV @tab @tab X @item 8088flex TMV @tab @tab X
@item AAX @tab @tab X
@tab Audible Enhanced Audio format, used in audiobooks.
@item AA @tab @tab X
@tab Audible Format 2, 3, and 4, used in audiobooks.
@item ACT Voice @tab @tab X @item ACT Voice @tab @tab X
@tab contains G.729 audio @tab contains G.729 audio
@item Adobe Filmstrip @tab X @tab X @item Adobe Filmstrip @tab X @tab X
@ -235,15 +209,10 @@ library:
@tab Multimedia format used in game Heart Of Darkness. @tab Multimedia format used in game Heart Of Darkness.
@item Apple HTTP Live Streaming @tab @tab X @item Apple HTTP Live Streaming @tab @tab X
@item Artworx Data Format @tab @tab X @item Artworx Data Format @tab @tab X
@item Interplay ACM @tab @tab X
@tab Audio only format used in some Interplay games.
@item ADP @tab @tab X @item ADP @tab @tab X
@tab Audio format used on the Nintendo Gamecube. @tab Audio format used on the Nintendo Gamecube.
@item AFC @tab @tab X @item AFC @tab @tab X
@tab Audio format used on the Nintendo Gamecube. @tab Audio format used on the Nintendo Gamecube.
@item ADS/SS2 @tab @tab X
@tab Audio format used on the PS2.
@item APNG @tab X @tab X
@item ASF @tab X @tab X @item ASF @tab X @tab X
@item AST @tab X @tab X @item AST @tab X @tab X
@tab Audio format used on the Nintendo Wii. @tab Audio format used on the Nintendo Wii.
@ -264,8 +233,6 @@ library:
@tab Used in Z and Z95 games. @tab Used in Z and Z95 games.
@item Brute Force & Ignorance @tab @tab X @item Brute Force & Ignorance @tab @tab X
@tab Used in the game Flash Traffic: City of Angels. @tab Used in the game Flash Traffic: City of Angels.
@item BFSTM @tab @tab X
@tab Audio format used on the Nintendo WiiU (based on BRSTM).
@item BRSTM @tab @tab X @item BRSTM @tab @tab X
@tab Audio format used on the Nintendo Wii. @tab Audio format used on the Nintendo Wii.
@item BWF @tab X @tab X @item BWF @tab X @tab X
@ -276,14 +243,9 @@ library:
@tab Used in the game Cyberia from Interplay. @tab Used in the game Cyberia from Interplay.
@item Delphine Software International CIN @tab @tab X @item Delphine Software International CIN @tab @tab X
@tab Multimedia format used by Delphine Software games. @tab Multimedia format used by Delphine Software games.
@item Digital Speech Standard (DSS) @tab @tab X
@item Canopus HQ @tab @tab X
@item Canopus HQA @tab @tab X
@item Canopus HQX @tab @tab X
@item CD+G @tab @tab X @item CD+G @tab @tab X
@tab Video format used by CD+G karaoke disks @tab Video format used by CD+G karaoke disks
@item Phantom Cine @tab @tab X @item Phantom Cine @tab @tab X
@item Cineform HD @tab @tab X
@item Commodore CDXL @tab @tab X @item Commodore CDXL @tab @tab X
@tab Amiga CD video format @tab Amiga CD video format
@item Core Audio Format @tab X @tab X @item Core Audio Format @tab X @tab X
@ -295,10 +257,8 @@ library:
@tab Audio format used in some games by CRYO Interactive Entertainment. @tab Audio format used in some games by CRYO Interactive Entertainment.
@item D-Cinema audio @tab X @tab X @item D-Cinema audio @tab X @tab X
@item Deluxe Paint Animation @tab @tab X @item Deluxe Paint Animation @tab @tab X
@item DCSTR @tab @tab X
@item DFA @tab @tab X @item DFA @tab @tab X
@tab This format is used in Chronomaster game @tab This format is used in Chronomaster game
@item DirectDraw Surface @tab @tab X
@item DSD Stream File (DSF) @tab @tab X @item DSD Stream File (DSF) @tab @tab X
@item DV video @tab X @tab X @item DV video @tab X @tab X
@item DXA @tab @tab X @item DXA @tab @tab X
@ -322,8 +282,6 @@ library:
@item G.723.1 @tab X @tab X @item G.723.1 @tab X @tab X
@item G.729 BIT @tab X @tab X @item G.729 BIT @tab X @tab X
@item G.729 raw @tab @tab X @item G.729 raw @tab @tab X
@item GENH @tab @tab X
@tab Audio format for various games.
@item GIF Animation @tab X @tab X @item GIF Animation @tab X @tab X
@item GXF @tab X @tab X @item GXF @tab X @tab X
@tab General eXchange Format SMPTE 360M, used by Thomson Grass Valley @tab General eXchange Format SMPTE 360M, used by Thomson Grass Valley
@ -346,7 +304,6 @@ library:
@tab A format generated by IndigoVision 8000 video server. @tab A format generated by IndigoVision 8000 video server.
@item IVF (On2) @tab X @tab X @item IVF (On2) @tab X @tab X
@tab A format used by libvpx @tab A format used by libvpx
@item Internet Video Recording @tab @tab X
@item IRCAM @tab X @tab X @item IRCAM @tab X @tab X
@item LATM @tab X @tab X @item LATM @tab X @tab X
@item LMLM4 @tab @tab X @item LMLM4 @tab @tab X
@ -383,8 +340,6 @@ library:
@tab also known as DVB Transport Stream @tab also known as DVB Transport Stream
@item MPEG-4 @tab X @tab X @item MPEG-4 @tab X @tab X
@tab MPEG-4 is a variant of QuickTime. @tab MPEG-4 is a variant of QuickTime.
@item MSF @tab @tab X
@tab Audio format used on the PS3.
@item Mirillis FIC video @tab @tab X @item Mirillis FIC video @tab @tab X
@tab No cursor rendering. @tab No cursor rendering.
@item MIME multipart JPEG @tab X @tab @item MIME multipart JPEG @tab X @tab
@ -468,7 +423,6 @@ library:
@item Redirector @tab @tab X @item Redirector @tab @tab X
@item RedSpark @tab @tab X @item RedSpark @tab @tab X
@item Renderware TeXture Dictionary @tab @tab X @item Renderware TeXture Dictionary @tab @tab X
@item Resolume DXV @tab @tab X
@item RL2 @tab @tab X @item RL2 @tab @tab X
@tab Audio and video format used in some games by Entertainment Software Partners. @tab Audio and video format used in some games by Entertainment Software Partners.
@item RPL/ARMovie @tab @tab X @item RPL/ARMovie @tab @tab X
@ -501,22 +455,14 @@ library:
@item SoX native format @tab X @tab X @item SoX native format @tab X @tab X
@item SUN AU format @tab X @tab X @item SUN AU format @tab X @tab X
@item SUP raw PGS subtitles @tab @tab X @item SUP raw PGS subtitles @tab @tab X
@item SVAG @tab @tab X
@tab Audio format used in Konami PS2 games.
@item TDSC @tab @tab X
@item Text files @tab @tab X @item Text files @tab @tab X
@item THP @tab @tab X @item THP @tab @tab X
@tab Used on the Nintendo GameCube. @tab Used on the Nintendo GameCube.
@item Tiertex Limited SEQ @tab @tab X @item Tiertex Limited SEQ @tab @tab X
@tab Tiertex .seq files used in the DOS CD-ROM version of the game Flashback. @tab Tiertex .seq files used in the DOS CD-ROM version of the game Flashback.
@item True Audio @tab @tab X @item True Audio @tab @tab X
@item VAG @tab @tab X
@tab Audio format used in many Sony PS2 games.
@item VC-1 test bitstream @tab X @tab X @item VC-1 test bitstream @tab X @tab X
@item Vidvox Hap @tab X @tab X
@item Vivo @tab @tab X @item Vivo @tab @tab X
@item VPK @tab @tab X
@tab Audio format used in Sony PS games.
@item WAV @tab X @tab X @item WAV @tab X @tab X
@item WavPack @tab X @tab X @item WavPack @tab X @tab X
@item WebM @tab X @tab X @item WebM @tab X @tab X
@ -527,12 +473,8 @@ library:
@tab Multimedia format used in Westwood Studios games. @tab Multimedia format used in Westwood Studios games.
@item Westwood Studios VQA @tab @tab X @item Westwood Studios VQA @tab @tab X
@tab Multimedia format used in Westwood Studios games. @tab Multimedia format used in Westwood Studios games.
@item Wideband Single-bit Data (WSD) @tab @tab X
@item WVE @tab @tab X
@item XMV @tab @tab X @item XMV @tab @tab X
@tab Microsoft video container used in Xbox games. @tab Microsoft video container used in Xbox games.
@item XVAG @tab @tab X
@tab Audio format used on the PS3.
@item xWMA @tab @tab X @item xWMA @tab @tab X
@tab Microsoft audio container used by XAudio 2. @tab Microsoft audio container used by XAudio 2.
@item eXtended BINary text (XBIN) @tab @tab X @item eXtended BINary text (XBIN) @tab @tab X
@ -554,7 +496,6 @@ following image formats are supported:
@item Alias PIX @tab X @tab X @item Alias PIX @tab X @tab X
@tab Alias/Wavefront PIX image format @tab Alias/Wavefront PIX image format
@item animated GIF @tab X @tab X @item animated GIF @tab X @tab X
@item APNG @tab X @tab X
@item BMP @tab X @tab X @item BMP @tab X @tab X
@tab Microsoft BMP image @tab Microsoft BMP image
@item BRender PIX @tab @tab X @item BRender PIX @tab @tab X
@ -651,7 +592,6 @@ following image formats are supported:
@item Bethesda VID video @tab @tab X @item Bethesda VID video @tab @tab X
@tab Used in some games from Bethesda Softworks. @tab Used in some games from Bethesda Softworks.
@item Bink Video @tab @tab X @item Bink Video @tab @tab X
@item BitJazz SheerVideo @tab @tab X
@item Bitmap Brothers JV video @tab @tab X @item Bitmap Brothers JV video @tab @tab X
@item y41p Brooktree uncompressed 4:1:1 12-bit @tab X @tab X @item y41p Brooktree uncompressed 4:1:1 12-bit @tab X @tab X
@item Brute Force & Ignorance @tab @tab X @item Brute Force & Ignorance @tab @tab X
@ -686,8 +626,6 @@ following image formats are supported:
@tab fourcc: DUCK @tab fourcc: DUCK
@item Duck TrueMotion 2.0 @tab @tab X @item Duck TrueMotion 2.0 @tab @tab X
@tab fourcc: TM20 @tab fourcc: TM20
@item Duck TrueMotion 2.0 RT @tab @tab X
@tab fourcc: TR20
@item DV (Digital Video) @tab X @tab X @item DV (Digital Video) @tab X @tab X
@item Dxtory capture format @tab @tab X @item Dxtory capture format @tab @tab X
@item Feeble Files/ScummVM DXA @tab @tab X @item Feeble Files/ScummVM DXA @tab @tab X
@ -709,17 +647,15 @@ following image formats are supported:
@tab Sorenson H.263 used in Flash @tab Sorenson H.263 used in Flash
@item Forward Uncompressed @tab @tab X @item Forward Uncompressed @tab @tab X
@item Fraps @tab @tab X @item Fraps @tab @tab X
@item Go2Meeting @tab @tab X
@tab fourcc: G2M2, G2M3
@item Go2Webinar @tab @tab X @item Go2Webinar @tab @tab X
@tab fourcc: G2M4 @tab fourcc: G2M4
@item H.261 @tab X @tab X @item H.261 @tab X @tab X
@item H.263 / H.263-1996 @tab X @tab X @item H.263 / H.263-1996 @tab X @tab X
@item H.263+ / H.263-1998 / H.263 version 2 @tab X @tab X @item H.263+ / H.263-1998 / H.263 version 2 @tab X @tab X
@item H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 @tab E @tab X @item H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 @tab E @tab X
@tab encoding supported through external library libx264 and OpenH264 @tab encoding supported through external library libx264
@item HEVC @tab X @tab X @item HEVC @tab X @tab X
@tab encoding supported through external library libx265 and libkvazaar @tab encoding supported through the external library libx265
@item HNM version 4 @tab @tab X @item HNM version 4 @tab @tab X
@item HuffYUV @tab X @tab X @item HuffYUV @tab X @tab X
@item HuffYUV FFmpeg variant @tab X @tab X @item HuffYUV FFmpeg variant @tab X @tab X
@ -754,7 +690,6 @@ following image formats are supported:
@item LucasArts SANM/Smush @tab @tab X @item LucasArts SANM/Smush @tab @tab X
@tab Used in LucasArts games / SMUSH animations. @tab Used in LucasArts games / SMUSH animations.
@item lossless MJPEG @tab X @tab X @item lossless MJPEG @tab X @tab X
@item MagicYUV Video @tab @tab X
@item Microsoft ATC Screen @tab @tab X @item Microsoft ATC Screen @tab @tab X
@tab Also known as Microsoft Screen 3. @tab Also known as Microsoft Screen 3.
@item Microsoft Expression Encoder Screen @tab @tab X @item Microsoft Expression Encoder Screen @tab @tab X
@ -819,7 +754,6 @@ following image formats are supported:
@tab Texture dictionaries used by the Renderware Engine. @tab Texture dictionaries used by the Renderware Engine.
@item RL2 video @tab @tab X @item RL2 video @tab @tab X
@tab used in some games by Entertainment Software Partners @tab used in some games by Entertainment Software Partners
@item Screenpresso @tab @tab X
@item Sierra VMD video @tab @tab X @item Sierra VMD video @tab @tab X
@tab Used in Sierra VMD files. @tab Used in Sierra VMD files.
@item Silicon Graphics Motion Video Compressor 1 (MVC1) @tab @tab X @item Silicon Graphics Motion Video Compressor 1 (MVC1) @tab @tab X
@ -886,13 +820,12 @@ following image formats are supported:
@item Name @tab Encoding @tab Decoding @tab Comments @item Name @tab Encoding @tab Decoding @tab Comments
@item 8SVX exponential @tab @tab X @item 8SVX exponential @tab @tab X
@item 8SVX fibonacci @tab @tab X @item 8SVX fibonacci @tab @tab X
@item AAC @tab EX @tab X @item AAC+ @tab E @tab X
@tab encoding supported through internal encoder and external libraries libfaac and libfdk-aac @tab encoding supported through external library libaacplus
@item AAC+ @tab E @tab IX @item AAC @tab E @tab X
@tab encoding supported through external library libfdk-aac @tab encoding supported through external library libfaac and libvo-aacenc
@item AC-3 @tab IX @tab IX @item AC-3 @tab IX @tab IX
@item ADPCM 4X Movie @tab @tab X @item ADPCM 4X Movie @tab @tab X
@item APDCM Yamaha AICA @tab @tab X
@item ADPCM CDROM XA @tab @tab X @item ADPCM CDROM XA @tab @tab X
@item ADPCM Creative Technology @tab @tab X @item ADPCM Creative Technology @tab @tab X
@tab 16 -> 4, 8 -> 4, 8 -> 3, 8 -> 2 @tab 16 -> 4, 8 -> 4, 8 -> 3, 8 -> 2
@ -927,8 +860,7 @@ following image formats are supported:
@item ADPCM MS IMA @tab X @tab X @item ADPCM MS IMA @tab X @tab X
@item ADPCM Nintendo Gamecube AFC @tab @tab X @item ADPCM Nintendo Gamecube AFC @tab @tab X
@item ADPCM Nintendo Gamecube DTK @tab @tab X @item ADPCM Nintendo Gamecube DTK @tab @tab X
@item ADPCM Nintendo THP @tab @tab X @item ADPCM Nintendo Gamecube THP @tab @tab X
@item APDCM Playstation @tab @tab X
@item ADPCM QT IMA @tab X @tab X @item ADPCM QT IMA @tab X @tab X
@item ADPCM SEGA CRI ADX @tab X @tab X @item ADPCM SEGA CRI ADX @tab X @tab X
@tab Used in Sega Dreamcast games. @tab Used in Sega Dreamcast games.
@ -936,7 +868,7 @@ following image formats are supported:
@item ADPCM Sound Blaster Pro 2-bit @tab @tab X @item ADPCM Sound Blaster Pro 2-bit @tab @tab X
@item ADPCM Sound Blaster Pro 2.6-bit @tab @tab X @item ADPCM Sound Blaster Pro 2.6-bit @tab @tab X
@item ADPCM Sound Blaster Pro 4-bit @tab @tab X @item ADPCM Sound Blaster Pro 4-bit @tab @tab X
@item ADPCM VIMA @tab @tab X @item ADPCM VIMA
@tab Used in LucasArts SMUSH animations. @tab Used in LucasArts SMUSH animations.
@item ADPCM Westwood Studios IMA @tab @tab X @item ADPCM Westwood Studios IMA @tab @tab X
@tab Used in Westwood Studios games like Command and Conquer. @tab Used in Westwood Studios games like Command and Conquer.
@ -957,18 +889,14 @@ following image formats are supported:
@tab decoding supported through external library libcelt @tab decoding supported through external library libcelt
@item Delphine Software International CIN audio @tab @tab X @item Delphine Software International CIN audio @tab @tab X
@tab Codec used in Delphine Software International games. @tab Codec used in Delphine Software International games.
@item Digital Speech Standard - Standard Play mode (DSS SP) @tab @tab X
@item Discworld II BMV Audio @tab @tab X @item Discworld II BMV Audio @tab @tab X
@item COOK @tab @tab X @item COOK @tab @tab X
@tab All versions except 5.1 are supported. @tab All versions except 5.1 are supported.
@item DCA (DTS Coherent Acoustics) @tab X @tab X @item DCA (DTS Coherent Acoustics) @tab X @tab X
@tab supported extensions: XCh, XXCH, X96, XBR, XLL, LBR (partially)
@item DPCM id RoQ @tab X @tab X @item DPCM id RoQ @tab X @tab X
@tab Used in Quake III, Jedi Knight 2 and other computer games. @tab Used in Quake III, Jedi Knight 2 and other computer games.
@item DPCM Interplay @tab @tab X @item DPCM Interplay @tab @tab X
@tab Used in various Interplay computer games. @tab Used in various Interplay computer games.
@item DPCM Squareroot-Delta-Exact @tab @tab X
@tab Used in various games.
@item DPCM Sierra Online @tab @tab X @item DPCM Sierra Online @tab @tab X
@tab Used in Sierra Online game audio files. @tab Used in Sierra Online game audio files.
@item DPCM Sol @tab @tab X @item DPCM Sol @tab @tab X
@ -979,12 +907,11 @@ following image formats are supported:
@item DSD (Direct Stream Digitial), least significant bit first, planar @tab @tab X @item DSD (Direct Stream Digitial), least significant bit first, planar @tab @tab X
@item DSD (Direct Stream Digitial), most significant bit first, planar @tab @tab X @item DSD (Direct Stream Digitial), most significant bit first, planar @tab @tab X
@item DSP Group TrueSpeech @tab @tab X @item DSP Group TrueSpeech @tab @tab X
@item DST (Direct Stream Transfer) @tab @tab X
@item DV audio @tab @tab X @item DV audio @tab @tab X
@item Enhanced AC-3 @tab X @tab X @item Enhanced AC-3 @tab X @tab X
@item EVRC (Enhanced Variable Rate Codec) @tab @tab X @item EVRC (Enhanced Variable Rate Codec) @tab @tab X
@item FLAC (Free Lossless Audio Codec) @tab X @tab IX @item FLAC (Free Lossless Audio Codec) @tab X @tab IX
@item G.723.1 @tab X @tab X @item G.723.1 @tab X @tab X
@item G.729 @tab @tab X @item G.729 @tab @tab X
@item GSM @tab E @tab X @item GSM @tab E @tab X
@tab encoding supported through external library libgsm @tab encoding supported through external library libgsm
@ -994,7 +921,6 @@ following image formats are supported:
@item iLBC (Internet Low Bitrate Codec) @tab E @tab E @item iLBC (Internet Low Bitrate Codec) @tab E @tab E
@tab encoding and decoding supported through external library libilbc @tab encoding and decoding supported through external library libilbc
@item IMC (Intel Music Coder) @tab @tab X @item IMC (Intel Music Coder) @tab @tab X
@item Interplay ACM @tab @tab X
@item MACE (Macintosh Audio Compression/Expansion) 3:1 @tab @tab X @item MACE (Macintosh Audio Compression/Expansion) 3:1 @tab @tab X
@item MACE (Macintosh Audio Compression/Expansion) 6:1 @tab @tab X @item MACE (Macintosh Audio Compression/Expansion) 6:1 @tab @tab X
@item MLP (Meridian Lossless Packing) @tab @tab X @item MLP (Meridian Lossless Packing) @tab @tab X
@ -1079,8 +1005,6 @@ following image formats are supported:
@item Windows Media Audio Lossless @tab @tab X @item Windows Media Audio Lossless @tab @tab X
@item Windows Media Audio Pro @tab @tab X @item Windows Media Audio Pro @tab @tab X
@item Windows Media Audio Voice @tab @tab X @item Windows Media Audio Voice @tab @tab X
@item Xbox Media Audio 1 @tab @tab X
@item Xbox Media Audio 2 @tab @tab X
@end multitable @end multitable
@code{X} means that encoding (resp. decoding) is supported. @code{X} means that encoding (resp. decoding) is supported.

View File

@ -1,10 +1,9 @@
\input texinfo @c -*- texinfo -*- \input texinfo @c -*- texinfo -*-
@documentencoding UTF-8
@settitle Using Git to develop FFmpeg @settitle Using git to develop FFmpeg
@titlepage @titlepage
@center @titlefont{Using Git to develop FFmpeg} @center @titlefont{Using git to develop FFmpeg}
@end titlepage @end titlepage
@top @top
@ -13,9 +12,9 @@
@chapter Introduction @chapter Introduction
This document aims in giving some quick references on a set of useful Git This document aims in giving some quick references on a set of useful git
commands. You should always use the extensive and detailed documentation commands. You should always use the extensive and detailed documentation
provided directly by Git: provided directly by git:
@example @example
git --help git --help
@ -32,21 +31,22 @@ man git-<command>
shows information about the subcommand <command>. shows information about the subcommand <command>.
Additional information could be found on the Additional information could be found on the
@url{http://gitref.org, Git Reference} website. @url{http://gitref.org, Git Reference} website
For more information about the Git project, visit the For more information about the Git project, visit the
@url{http://git-scm.com/, Git website}.
@url{http://git-scm.com/, Git website}
Consult these resources whenever you have problems, they are quite exhaustive. Consult these resources whenever you have problems, they are quite exhaustive.
What follows now is a basic introduction to Git and some FFmpeg-specific What follows now is a basic introduction to Git and some FFmpeg-specific
guidelines to ease the contribution to the project. guidelines to ease the contribution to the project
@chapter Basics Usage @chapter Basics Usage
@section Get Git @section Get GIT
You can get Git from @url{http://git-scm.com/} You can get git from @url{http://git-scm.com/}
Most distribution and operating system provide a package for it. Most distribution and operating system provide a package for it.
@ -65,21 +65,6 @@ git clone git@@source.ffmpeg.org:ffmpeg <target>
This will put the FFmpeg sources into the directory @var{<target>} and let This will put the FFmpeg sources into the directory @var{<target>} and let
you push back your changes to the remote repository. you push back your changes to the remote repository.
@example
git clone gil@@ffmpeg.org:ffmpeg-web <target>
@end example
This will put the source of the FFmpeg website into the directory
@var{<target>} and let you push back your changes to the remote repository.
(Note that @var{gil} stands for GItoLite and is not a typo of @var{git}.)
If you don't have write-access to the ffmpeg-web repository, you can
create patches after making a read-only ffmpeg-web clone:
@example
git clone git://ffmpeg.org/ffmpeg-web <target>
@end example
Make sure that you do not have Windows line endings in your checkouts, Make sure that you do not have Windows line endings in your checkouts,
otherwise you may experience spurious compilation failures. One way to otherwise you may experience spurious compilation failures. One way to
achieve this is to run achieve this is to run
@ -89,7 +74,6 @@ git config --global core.autocrlf false
@end example @end example
@anchor{Updating the source tree to the latest revision}
@section Updating the source tree to the latest revision @section Updating the source tree to the latest revision
@example @example
@ -122,7 +106,7 @@ git add [-A] <filename/dirname>
git rm [-r] <filename/dirname> git rm [-r] <filename/dirname>
@end example @end example
Git needs to get notified of all changes you make to your working GIT needs to get notified of all changes you make to your working
directory that makes files appear or disappear. directory that makes files appear or disappear.
Line moves across files are automatically tracked. Line moves across files are automatically tracked.
@ -142,8 +126,8 @@ will show all local modifications in your working directory as unified diff.
git log <filename(s)> git log <filename(s)>
@end example @end example
You may also use the graphical tools like @command{gitview} or @command{gitk} You may also use the graphical tools like gitview or gitk or the web
or the web interface available at @url{http://source.ffmpeg.org/}. interface available at http://source.ffmpeg.org/
@section Checking source tree status @section Checking source tree status
@ -164,7 +148,6 @@ git diff --check
to double check your changes before committing them to avoid trouble later 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 on. All experienced developers do this on each and every commit, no matter
how small. how small.
Every one of them has been saved from looking like a fool by this many times. 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, It's very easy for stray debug output or cosmetic modifications to slip in,
please avoid problems through this extra level of scrutiny. please avoid problems through this extra level of scrutiny.
@ -187,14 +170,14 @@ to make sure you don't have untracked files or deletions.
git add [-i|-p|-A] <filenames/dirnames> git add [-i|-p|-A] <filenames/dirnames>
@end example @end example
Make sure you have told Git your name and email address Make sure you have told git your name and email address
@example @example
git config --global user.name "My Name" git config --global user.name "My Name"
git config --global user.email my@@email.invalid git config --global user.email my@@email.invalid
@end example @end example
Use @option{--global} to set the global configuration for all your Git checkouts. Use @var{--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 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 the interactive or the patch mode to select hunk by hunk what should be
@ -225,7 +208,7 @@ include filenames in log messages, Git provides that information.
Possibly make the commit message have a terse, descriptive first line, an 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 empty line and then a full description. The first line will be used to name
the patch by @command{git format-patch}. the patch by git format-patch.
@section Preparing a patchset @section Preparing a patchset
@ -341,14 +324,12 @@ faulty commit disappear from the history.
@section Pushing changes to remote trees @section Pushing changes to remote trees
@example @example
git push origin master --dry-run git push
@end example @end example
Will simulate a push of the local master branch to the default remote Will push the changes to the default remote (@var{origin}).
(@var{origin}). And list which branches and ranges or commits would have been
pushed.
Git will prevent you from pushing changes if the local and remote trees are Git will prevent you from pushing changes if the local and remote trees are
out of sync. Refer to @ref{Updating the source tree to the latest revision}. out of sync. Refer to and to sync the local tree.
@example @example
git remote add <name> <url> git remote add <name> <url>
@ -367,24 +348,23 @@ branches matching the local ones.
@section Finding a specific svn revision @section Finding a specific svn revision
Since version 1.7.1 Git supports @samp{:/foo} syntax for specifying commits Since version 1.7.1 git supports @var{:/foo} syntax for specifying commits
based on a regular expression. see man gitrevisions based on a regular expression. see man gitrevisions
@example @example
git show :/'as revision 23456' git show :/'as revision 23456'
@end example @end example
will show the svn changeset @samp{r23456}. With older Git versions searching in will show the svn changeset @var{r23456}. With older git versions searching in
the @command{git log} output is the easiest option (especially if a pager with the @command{git log} output is the easiest option (especially if a pager with
search capabilities is used). search capabilities is used).
This commit can be checked out with This commit can be checked out with
@example @example
git checkout -b svn_23456 :/'as revision 23456' git checkout -b svn_23456 :/'as revision 23456'
@end example @end example
or for Git < 1.7.1 with or for git < 1.7.1 with
@example @example
git checkout -b svn_23456 $SHA1 git checkout -b svn_23456 $SHA1
@ -393,7 +373,7 @@ git checkout -b svn_23456 $SHA1
where @var{$SHA1} is the commit hash from the @command{git log} output. where @var{$SHA1} is the commit hash from the @command{git log} output.
@chapter Pre-push checklist @chapter pre-push checklist
Once you have a set of commits that you feel are ready for pushing, Once you have a set of commits that you feel are ready for pushing,
work through the following checklist to doublecheck everything is in work through the following checklist to doublecheck everything is in
@ -404,21 +384,21 @@ Apply your common sense, but if in doubt, err on the side of caution.
First, make sure that the commits and branches you are going to push First, make sure that the commits and branches you are going to push
match what you want pushed and that nothing is missing, extraneous or match what you want pushed and that nothing is missing, extraneous or
wrong. You can see what will be pushed by running the git push command wrong. You can see what will be pushed by running the git push command
with @option{--dry-run} first. And then inspecting the commits listed with with --dry-run first. And then inspecting the commits listed with
@command{git log -p 1234567..987654}. The @command{git status} command @command{git log -p 1234567..987654}. The @command{git status} command
may help in finding local changes that have been forgotten to be added. may help in finding local changes that have been forgotten to be added.
Next let the code pass through a full run of our test suite. Next let the code pass through a full run of our testsuite.
@itemize @itemize
@item @command{make distclean} @item @command{make distclean}
@item @command{/path/to/ffmpeg/configure} @item @command{/path/to/ffmpeg/configure}
@item @command{make fate} @item @command{make check}
@item if fate fails due to missing samples run @command{make fate-rsync} and retry @item if fate fails due to missing samples run @command{make fate-rsync} and retry
@end itemize @end itemize
Make sure all your changes have been checked before pushing them, the Make sure all your changes have been checked before pushing them, the
test suite only checks against regressions and that only to some extend. It does testsuite only checks against regressions and that only to some extend. It does
obviously not check newly added features/code to be working unless you have obviously not check newly added features/code to be working unless you have
added a test for that (which is recommended). added a test for that (which is recommended).
@ -431,5 +411,5 @@ recommended.
@chapter Server Issues @chapter Server Issues
Contact the project admins at @email{root@@ffmpeg.org} if you have technical Contact the project admins @email{root@@ffmpeg.org} if you have technical
problems with the Git server. problems with the GIT server.

View File

@ -51,18 +51,6 @@ ffmpeg -f alsa -i hw:0 alsaout.wav
For more information see: For more information see:
@url{http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html} @url{http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html}
@subsection Options
@table @option
@item sample_rate
Set the sample rate in Hz. Default is 48000.
@item channels
Set the number of channels. Default is 2.
@end table
@section avfoundation @section avfoundation
AVFoundation input device. AVFoundation input device.
@ -121,24 +109,11 @@ Specify the audio device by its index. Overrides anything given in the input fil
@item -pixel_format <FORMAT> @item -pixel_format <FORMAT>
Request the video device to use a specific pixel format. Request the video device to use a specific pixel format.
If the specified format is not supported, a list of available formats is given If the specified format is not supported, a list of available formats is given
and the first one in this list is used instead. Available pixel formats are: und the first one in this list is used instead. Available pixel formats are:
@code{monob, rgb555be, rgb555le, rgb565be, rgb565le, rgb24, bgr24, 0rgb, bgr0, 0bgr, rgb0, @code{monob, rgb555be, rgb555le, rgb565be, rgb565le, rgb24, bgr24, 0rgb, bgr0, 0bgr, rgb0,
bgr48be, uyvy422, yuva444p, yuva444p16le, yuv444p, yuv422p16, yuv422p10, yuv444p10, bgr48be, uyvy422, yuva444p, yuva444p16le, yuv444p, yuv422p16, yuv422p10, yuv444p10,
yuv420p, nv12, yuyv422, gray} yuv420p, nv12, yuyv422, gray}
@item -framerate
Set the grabbing frame rate. Default is @code{ntsc}, corresponding to a
frame rate of @code{30000/1001}.
@item -video_size
Set the video frame size.
@item -capture_cursor
Capture the mouse pointer. Default is 0.
@item -capture_mouse_clicks
Capture the screen mouse clicks. Default is 0.
@end table @end table
@subsection Examples @subsection Examples
@ -175,142 +150,6 @@ $ ffmpeg -f avfoundation -pixel_format bgr0 -i "default:none" out.avi
BSD video input device. BSD video input device.
@subsection Options
@table @option
@item framerate
Set the frame rate.
@item video_size
Set the video frame size. Default is @code{vga}.
@item standard
Available values are:
@table @samp
@item pal
@item ntsc
@item secam
@item paln
@item palm
@item ntscj
@end table
@end table
@section decklink
The decklink input device provides capture capabilities for Blackmagic
DeckLink devices.
To enable this input device, you need the Blackmagic DeckLink SDK and you
need to configure with the appropriate @code{--extra-cflags}
and @code{--extra-ldflags}.
On Windows, you need to run the IDL files through @command{widl}.
DeckLink is very picky about the formats it supports. Pixel format is
uyvy422 or v210, framerate and video size must be determined for your device with
@command{-list_formats 1}. Audio sample rate is always 48 kHz and the number
of channels can be 2, 8 or 16. Note that all audio channels are bundled in one single
audio track.
@subsection Options
@table @option
@item list_devices
If set to @option{true}, print a list of devices and exit.
Defaults to @option{false}.
@item list_formats
If set to @option{true}, print a list of supported formats and exit.
Defaults to @option{false}.
@item bm_v210
If set to @samp{1}, video is captured in 10 bit v210 instead
of uyvy422. Not all Blackmagic devices support this option.
@item teletext_lines
If set to nonzero, an additional teletext stream will be captured from the
vertical ancillary data. This option is a bitmask of the VBI lines checked,
specifically lines 6 to 22, and lines 318 to 335. Line 6 is the LSB in the mask.
Selected lines which do not contain teletext information will be ignored. You
can use the special @option{all} constant to select all possible lines, or
@option{standard} to skip lines 6, 318 and 319, which are not compatible with all
receivers. Capturing teletext only works for SD PAL sources in 8 bit mode.
To use this option, ffmpeg needs to be compiled with @code{--enable-libzvbi}.
@item channels
Defines number of audio channels to capture. Must be @samp{2}, @samp{8} or @samp{16}.
Defaults to @samp{2}.
@item duplex_mode
Sets the decklink device duplex mode. Must be @samp{unset}, @samp{half} or @samp{full}.
Defaults to @samp{unset}.
@item video_input
Sets the video input source. Must be @samp{unset}, @samp{sdi}, @samp{hdmi},
@samp{optical_sdi}, @samp{component}, @samp{composite} or @samp{s_video}.
Defaults to @samp{unset}.
@item audio_input
Sets the audio input source. Must be @samp{unset}, @samp{embedded},
@samp{aes_ebu}, @samp{analog}, @samp{analog_xlr}, @samp{analog_rca} or
@samp{microphone}. Defaults to @samp{unset}.
@item video_pts
Sets the video packet timestamp source. Must be @samp{video}, @samp{audio},
@samp{reference} or @samp{wallclock}. Defaults to @samp{video}.
@item audio_pts
Sets the audio packet timestamp source. Must be @samp{video}, @samp{audio},
@samp{reference} or @samp{wallclock}. Defaults to @samp{audio}.
@end table
@subsection Examples
@itemize
@item
List input devices:
@example
ffmpeg -f decklink -list_devices 1 -i dummy
@end example
@item
List supported formats:
@example
ffmpeg -f decklink -list_formats 1 -i 'Intensity Pro'
@end example
@item
Capture video clip at 1080i50 (format 11):
@example
ffmpeg -f decklink -i 'Intensity Pro@@11' -acodec copy -vcodec copy output.avi
@end example
@item
Capture video clip at 1080i50 10 bit:
@example
ffmpeg -bm_v210 1 -f decklink -i 'UltraStudio Mini Recorder@@11' -acodec copy -vcodec copy output.avi
@end example
@item
Capture video clip at 1080i50 with 16 audio channels:
@example
ffmpeg -channels 16 -f decklink -i 'UltraStudio Mini Recorder@@11' -acodec copy -vcodec copy output.avi
@end example
@end itemize
@section dshow @section dshow
Windows DirectShow input device. Windows DirectShow input device.
@ -328,7 +167,7 @@ The input name should be in the format:
@end example @end example
where @var{TYPE} can be either @var{audio} or @var{video}, where @var{TYPE} can be either @var{audio} or @var{video},
and @var{NAME} is the device's name or alternative name.. and @var{NAME} is the device's name.
@subsection Options @subsection Options
@ -361,11 +200,11 @@ If set to @option{true}, print a list of selected device's options
and exit. and exit.
@item video_device_number @item video_device_number
Set video device number for devices with the same name (starts at 0, Set video device number for devices with same name (starts at 0,
defaults to 0). defaults to 0).
@item audio_device_number @item audio_device_number
Set audio device number for devices with the same name (starts at 0, Set audio device number for devices with same name (starts at 0,
defaults to 0). defaults to 0).
@item pixel_format @item pixel_format
@ -381,85 +220,6 @@ Setting this value too low can degrade performance.
See also See also
@url{http://msdn.microsoft.com/en-us/library/windows/desktop/dd377582(v=vs.85).aspx} @url{http://msdn.microsoft.com/en-us/library/windows/desktop/dd377582(v=vs.85).aspx}
@item video_pin_name
Select video capture pin to use by name or alternative name.
@item audio_pin_name
Select audio capture pin to use by name or alternative name.
@item crossbar_video_input_pin_number
Select video input pin number for crossbar device. This will be
routed to the crossbar device's Video Decoder output pin.
Note that changing this value can affect future invocations
(sets a new default) until system reboot occurs.
@item crossbar_audio_input_pin_number
Select audio input pin number for crossbar device. This will be
routed to the crossbar device's Audio Decoder output pin.
Note that changing this value can affect future invocations
(sets a new default) until system reboot occurs.
@item show_video_device_dialog
If set to @option{true}, before capture starts, popup a display dialog
to the end user, allowing them to change video filter properties
and configurations manually.
Note that for crossbar devices, adjusting values in this dialog
may be needed at times to toggle between PAL (25 fps) and NTSC (29.97)
input frame rates, sizes, interlacing, etc. Changing these values can
enable different scan rates/frame rates and avoiding green bars at
the bottom, flickering scan lines, etc.
Note that with some devices, changing these properties can also affect future
invocations (sets new defaults) until system reboot occurs.
@item show_audio_device_dialog
If set to @option{true}, before capture starts, popup a display dialog
to the end user, allowing them to change audio filter properties
and configurations manually.
@item show_video_crossbar_connection_dialog
If set to @option{true}, before capture starts, popup a display
dialog to the end user, allowing them to manually
modify crossbar pin routings, when it opens a video device.
@item show_audio_crossbar_connection_dialog
If set to @option{true}, before capture starts, popup a display
dialog to the end user, allowing them to manually
modify crossbar pin routings, when it opens an audio device.
@item show_analog_tv_tuner_dialog
If set to @option{true}, before capture starts, popup a display
dialog to the end user, allowing them to manually
modify TV channels and frequencies.
@item show_analog_tv_tuner_audio_dialog
If set to @option{true}, before capture starts, popup a display
dialog to the end user, allowing them to manually
modify TV audio (like mono vs. stereo, Language A,B or C).
@item audio_device_load
Load an audio capture filter device from file instead of searching
it by name. It may load additional parameters too, if the filter
supports the serialization of its properties to.
To use this an audio capture source has to be specified, but it can
be anything even fake one.
@item audio_device_save
Save the currently used audio capture filter device and its
parameters (if the filter supports it) to a file.
If a file with the same name exists it will be overwritten.
@item video_device_load
Load a video capture filter device from file instead of searching
it by name. It may load additional parameters too, if the filter
supports the serialization of its properties to.
To use this a video capture source has to be specified, but it can
be anything even fake one.
@item video_device_save
Save the currently used video capture filter device and its
parameters (if the filter supports it) to a file.
If a file with the same name exists it will be overwritten.
@end table @end table
@subsection Examples @subsection Examples
@ -496,46 +256,12 @@ Print the list of supported options in selected device and exit:
$ ffmpeg -list_options true -f dshow -i video="Camera" $ ffmpeg -list_options true -f dshow -i video="Camera"
@end example @end example
@item
Specify pin names to capture by name or alternative name, specify alternative device name:
@example
$ ffmpeg -f dshow -audio_pin_name "Audio Out" -video_pin_name 2 -i video=video="@@device_pnp_\\?\pci#ven_1a0a&dev_6200&subsys_62021461&rev_01#4&e2c7dd6&0&00e1#@{65e8773d-8f56-11d0-a3b9-00a0c9223196@}\@{ca465100-deb0-4d59-818f-8c477184adf6@}":audio="Microphone"
@end example
@item
Configure a crossbar device, specifying crossbar pins, allow user to adjust video capture properties at startup:
@example
$ ffmpeg -f dshow -show_video_device_dialog true -crossbar_video_input_pin_number 0
-crossbar_audio_input_pin_number 3 -i video="AVerMedia BDA Analog Capture":audio="AVerMedia BDA Analog Capture"
@end example
@end itemize @end itemize
@section dv1394 @section dv1394
Linux DV 1394 input device. Linux DV 1394 input device.
@subsection Options
@table @option
@item framerate
Set the frame rate. Default is 25.
@item standard
Available values are:
@table @samp
@item pal
@item ntsc
@end table
Default value is @code{ntsc}.
@end table
@section fbdev @section fbdev
Linux framebuffer input device. Linux framebuffer input device.
@ -548,27 +274,18 @@ console. It is accessed through a file device node, usually
For more detailed information read the file For more detailed information read the file
Documentation/fb/framebuffer.txt included in the Linux source tree. Documentation/fb/framebuffer.txt included in the Linux source tree.
See also @url{http://linux-fbdev.sourceforge.net/}, and fbset(1).
To record from the framebuffer device @file{/dev/fb0} with To record from the framebuffer device @file{/dev/fb0} with
@command{ffmpeg}: @command{ffmpeg}:
@example @example
ffmpeg -f fbdev -framerate 10 -i /dev/fb0 out.avi ffmpeg -f fbdev -r 10 -i /dev/fb0 out.avi
@end example @end example
You can take a single screenshot image with the command: You can take a single screenshot image with the command:
@example @example
ffmpeg -f fbdev -framerate 1 -i /dev/fb0 -frames:v 1 screenshot.jpeg ffmpeg -f fbdev -frames:v 1 -r 1 -i /dev/fb0 screenshot.jpeg
@end example @end example
@subsection Options See also @url{http://linux-fbdev.sourceforge.net/}, and fbset(1).
@table @option
@item framerate
Set the frame rate. Default is 25.
@end table
@section gdigrab @section gdigrab
@ -673,7 +390,7 @@ not work and result in undefined behavior.
The values @option{auto}, @option{dv} and @option{hdv} are supported. The values @option{auto}, @option{dv} and @option{hdv} are supported.
@item dvbuffer @item dvbuffer
Set maximum size of buffer for incoming data, in frames. For DV, this Set maxiumum size of buffer for incoming data, in frames. For DV, this
is an exact value. For HDV, it is not frame exact, since HDV does is an exact value. For HDV, it is not frame exact, since HDV does
not have a fixed frame size. not have a fixed frame size.
@ -754,15 +471,6 @@ $ jack_connect metro:120_bpm ffmpeg:input_1
For more information read: For more information read:
@url{http://jackaudio.org/} @url{http://jackaudio.org/}
@subsection Options
@table @option
@item channels
Set the number of channels. Default is 2.
@end table
@section lavfi @section lavfi
Libavfilter input virtual device. Libavfilter input virtual device.
@ -787,14 +495,6 @@ generated by the device.
The first unlabelled output is automatically assigned to the "out0" The first unlabelled output is automatically assigned to the "out0"
label, but all the others need to be specified explicitly. label, but all the others need to be specified explicitly.
The suffix "+subcc" can be appended to the output label to create an extra
stream with the closed captions packets attached to that output
(experimental; only for EIA-608 / CEA-708 for now).
The subcc streams are created after all the normal streams, in the order of
the corresponding stream.
For example, if there is "out19+subcc", "out7+subcc" and up to "out42", the
stream #43 is subcc for stream #7 and stream #44 is subcc for stream #19.
If not specified defaults to the filename specified for the input If not specified defaults to the filename specified for the input
device. device.
@ -803,9 +503,6 @@ Set the filename of the filtergraph to be read and sent to the other
filters. Syntax of the filtergraph is the same as the one specified by filters. Syntax of the filtergraph is the same as the one specified by
the option @var{graph}. the option @var{graph}.
@item dumpgraph
Dump graph to stderr.
@end table @end table
@subsection Examples @subsection Examples
@ -844,57 +541,24 @@ Read an audio stream and a video stream and play it back with
ffplay -f lavfi "movie=test.avi[out0];amovie=test.wav[out1]" ffplay -f lavfi "movie=test.avi[out0];amovie=test.wav[out1]"
@end example @end example
@item
Dump decoded frames to images and closed captions to a file (experimental):
@example
ffmpeg -f lavfi -i "movie=test.ts[out0+subcc]" -map v frame%08d.png -map s -c copy -f rawvideo subcc.bin
@end example
@end itemize @end itemize
@section libcdio @section libcdio
Audio-CD input device based on libcdio. Audio-CD input device based on cdio.
To enable this input device during configuration you need libcdio To enable this input device during configuration you need libcdio
installed on your system. It requires the configure option installed on your system. Requires the configure option
@code{--enable-libcdio}. @code{--enable-libcdio}.
This device allows playing and grabbing from an Audio-CD. This device allows playing and grabbing from an Audio-CD.
For example to copy with @command{ffmpeg} the entire Audio-CD in @file{/dev/sr0}, For example to copy with @command{ffmpeg} the entire Audio-CD in /dev/sr0,
you may run the command: you may run the command:
@example @example
ffmpeg -f libcdio -i /dev/sr0 cd.wav ffmpeg -f libcdio -i /dev/sr0 cd.wav
@end example @end example
@subsection Options
@table @option
@item speed
Set drive reading speed. Default value is 0.
The speed is specified CD-ROM speed units. The speed is set through
the libcdio @code{cdio_cddap_speed_set} function. On many CD-ROM
drives, specifying a value too large will result in using the fastest
speed.
@item paranoia_mode
Set paranoia recovery mode flags. It accepts one of the following values:
@table @samp
@item disable
@item verify
@item overlap
@item neverskip
@item full
@end table
Default value is @samp{disable}.
For more information about the available recovery modes, consult the
paranoia project documentation.
@end table
@section libdc1394 @section libdc1394
IIDC1394 input device, based on libdc1394 and libraw1394. IIDC1394 input device, based on libdc1394 and libraw1394.
@ -1007,19 +671,6 @@ ffmpeg -f oss -i /dev/dsp /tmp/oss.wav
For more information about OSS see: For more information about OSS see:
@url{http://manuals.opensound.com/usersguide/dsp.html} @url{http://manuals.opensound.com/usersguide/dsp.html}
@subsection Options
@table @option
@item sample_rate
Set the sample rate in Hz. Default is 48000.
@item channels
Set the number of channels. Default is 2.
@end table
@section pulse @section pulse
PulseAudio input device. PulseAudio input device.
@ -1060,10 +711,6 @@ Specify the number of bytes per frame, by default it is set to 1024.
@item fragment_size @item fragment_size
Specify the minimal buffering fragment in PulseAudio, it will affect the Specify the minimal buffering fragment in PulseAudio, it will affect the
audio latency. By default it is unset. audio latency. By default it is unset.
@item wallclock
Set the initial PTS using the current time. Default is 1.
@end table @end table
@subsection Examples @subsection Examples
@ -1099,22 +746,6 @@ ffmpeg -f qtkit -i "default" out.mpg
ffmpeg -f qtkit -list_devices true -i "" ffmpeg -f qtkit -list_devices true -i ""
@end example @end example
@subsection Options
@table @option
@item frame_rate
Set frame rate. Default is 30.
@item list_devices
If set to @code{true}, print a list of devices and exit. Default is
@code{false}.
@item video_device_index
Select the video device by index for devices with the same name (starts at 0).
@end table
@section sndio @section sndio
sndio input device. sndio input device.
@ -1132,18 +763,6 @@ command:
ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav ffmpeg -f sndio -i /dev/audio0 /tmp/oss.wav
@end example @end example
@subsection Options
@table @option
@item sample_rate
Set the sample rate in Hz. Default is 48000.
@item channels
Set the number of channels. Default is 2.
@end table
@section video4linux2, v4l2 @section video4linux2, v4l2
Video4Linux2 input video device. Video4Linux2 input video device.
@ -1176,12 +795,6 @@ conversion into the real time clock.
Some usage examples of the video4linux2 device with @command{ffmpeg} Some usage examples of the video4linux2 device with @command{ffmpeg}
and @command{ffplay}: and @command{ffplay}:
@itemize @itemize
@item
List supported formats for a video4linux2 device:
@example
ffplay -f video4linux2 -list_formats all /dev/video0
@end example
@item @item
Grab and show the input of a video4linux2 device: Grab and show the input of a video4linux2 device:
@example @example
@ -1266,10 +879,6 @@ Force conversion from monotonic to absolute timestamps.
@end table @end table
Default value is @code{default}. Default value is @code{default}.
@item use_libv4l2
Use libv4l2 (v4l-utils) conversion functions. Default is 0.
@end table @end table
@section vfwcap @section vfwcap
@ -1280,29 +889,12 @@ 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 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. other filename will be interpreted as device number 0.
@subsection Options
@table @option
@item video_size
Set the video frame size.
@item framerate
Set the grabbing frame rate. Default value is @code{ntsc},
corresponding to a frame rate of @code{30000/1001}.
@end table
@section x11grab @section x11grab
X11 video input device. X11 video input device.
To enable this input device during configuration you need libxcb Depends on X11, Xext, and Xfixes. Requires the configure option
installed on your system. It will be automatically detected during @code{--enable-x11grab}.
configuration.
Alternatively, the configure option @option{--enable-x11grab} exists
for legacy Xlib users.
This device allows one to capture a region of an X11 display. This device allows one to capture a region of an X11 display.
@ -1320,12 +912,10 @@ omitted, and defaults to "localhost". The environment variable
area with respect to the top-left border of the X11 screen. They area with respect to the top-left border of the X11 screen. They
default to 0. default to 0.
Check the X11 documentation (e.g. @command{man X}) for more detailed Check the X11 documentation (e.g. man X) for more detailed information.
information.
Use the @command{xdpyinfo} program for getting basic information about Use the @command{dpyinfo} program for getting basic information about the
the properties of your X11 display (e.g. grep for "name" or properties of your X11 display (e.g. grep for "name" or "dimensions").
"dimensions").
For example to grab from @file{:0.0} using @command{ffmpeg}: For example to grab from @file{:0.0} using @command{ffmpeg}:
@example @example
@ -1374,10 +964,6 @@ If @var{show_region} is specified with @code{1}, then the grabbing
region will be indicated on screen. With this option, it is easy to region will be indicated on screen. With this option, it is easy to
know what is being grabbed if only a portion of the screen is grabbed. know what is being grabbed if only a portion of the screen is grabbed.
@item region_border
Set the region border thickness if @option{-show_region 1} is used.
Range is 1 to 128 and default is 3 (XCB-based x11grab only).
For example: For example:
@example @example
ffmpeg -f x11grab -show_region 1 -framerate 25 -video_size cif -i :0.0+10,20 out.mpg ffmpeg -f x11grab -show_region 1 -framerate 25 -video_size cif -i :0.0+10,20 out.mpg
@ -1393,15 +979,61 @@ Set the video frame size. Default value is @code{vga}.
@item use_shm @item use_shm
Use the MIT-SHM extension for shared memory. Default value is @code{1}. Use the MIT-SHM extension for shared memory. Default value is @code{1}.
It may be necessary to disable it for remote displays (legacy x11grab It may be necessary to disable it for remote displays.
only).
@item grab_x
@item grab_y
Set the grabbing region coordinates. They are expressed as offset from
the top left corner of the X11 window and correspond to the
@var{x_offset} and @var{y_offset} parameters in the device name. The
default value for both options is 0.
@end table @end table
@section decklink
The decklink input device provides capture capabilities for Blackmagic
DeckLink devices.
To enable this input device, you need the Blackmagic DeckLink SDK and you
need to configure with the appropriate @code{--extra-cflags}
and @code{--extra-ldflags}.
On Windows, you need to run the IDL files through @command{widl}.
DeckLink is very picky about the formats it supports. Pixel format is always
uyvy422, framerate and video size must be determined for your device with
@command{-list_formats 1}. Audio sample rate is always 48 kHz and the number
of channels currently is limited to 2 (stereo).
@subsection Options
@table @option
@item list_devices
If set to @option{true}, print a list of devices and exit.
Defaults to @option{false}.
@item list_formats
If set to @option{true}, print a list of supported formats and exit.
Defaults to @option{false}.
@end table
@subsection Examples
@itemize
@item
List input devices:
@example
ffmpeg -f decklink -list_devices 1 -i dummy
@end example
@item
List supported formats:
@example
ffmpeg -f decklink -list_formats 1 -i 'Intensity Pro'
@end example
@item
Capture video clip at 1080i50 (format 11):
@example
ffmpeg -f decklink -i 'Intensity Pro@@11' -acodec copy -vcodec copy output.avi
@end example
@end itemize
@c man end INPUT DEVICES @c man end INPUT DEVICES

View File

@ -1,6 +1,8 @@
FFmpeg's bug/feature request tracker manual FFmpeg's bug/feature request tracker manual
================================================= =================================================
NOTE: This is a draft.
Overview: Overview:
--------- ---------
@ -20,9 +22,9 @@ a mail for every change to every issue.
(the above does all work already after light testing) (the above does all work already after light testing)
The subscription URL for the ffmpeg-trac list is: The subscription URL for the ffmpeg-trac list is:
https://lists.ffmpeg.org/mailman/listinfo/ffmpeg-trac http(s)://lists.ffmpeg.org/mailman/listinfo/ffmpeg-trac
The URL of the webinterface of the tracker is: The URL of the webinterface of the tracker is:
https://trac.ffmpeg.org http(s)://trac.ffmpeg.org
Type: Type:
----- -----
@ -40,16 +42,12 @@ feature request / enhancement
where the current implementation cannot be considered wrong. where the current implementation cannot be considered wrong.
license violation license violation
Ticket to keep track of (L)GPL violations of ffmpeg by others. ticket to keep track of (L)GPL violations of ffmpeg by others
sponsoring request sponsoring request
Developer requests for hardware, software, specifications, money, Developer requests for hardware, software, specifications, money,
refunds, etc. refunds, etc.
task
A task/reminder such as setting up a FATE client, adding filters to
Trac, etc.
Priority: Priority:
--------- ---------
critical critical
@ -68,8 +66,7 @@ important
don't exist in a past revision or another branch. don't exist in a past revision or another branch.
normal normal
Default setting. Use this if the bug does not match the other
priorities or if you are unsure of what priority to choose.
minor minor
Bugs about things like spelling errors, "mp2" instead of Bugs about things like spelling errors, "mp2" instead of
@ -166,23 +163,14 @@ Component:
avcodec avcodec
issues in libavcodec/* issues in libavcodec/*
avdevice
issues in libavdevice/*
avfilter
issues in libavfilter/*
avformat avformat
issues in libavformat/* issues in libavformat/*
avutil avutil
issues in libavutil/* issues in libavutil/*
build system regression test
issues in or related to configure/Makefile issues in tests/*
documentation
issues in or related to doc/*
ffmpeg ffmpeg
issues in or related to ffmpeg.c issues in or related to ffmpeg.c
@ -196,23 +184,11 @@ ffprobe
ffserver ffserver
issues in or related to ffserver.c issues in or related to ffserver.c
postproc build system
issues in libpostproc/* issues in or related to configure/Makefile
swresample regression
issues in libswresample/* bugs which were not present in a past revision
swscale
issues in libswscale/*
trac trac
issues related to our issue tracker issues related to our issue tracker
undetermined
default component; choose this if unsure
website
issues related to the website
wiki
issues related to the wiki

View File

@ -1,5 +1,4 @@
\input texinfo @c -*- texinfo -*- \input texinfo @c -*- texinfo -*-
@documentencoding UTF-8
@settitle Libavcodec Documentation @settitle Libavcodec Documentation
@titlepage @titlepage

View File

@ -1,5 +1,4 @@
\input texinfo @c -*- texinfo -*- \input texinfo @c -*- texinfo -*-
@documentencoding UTF-8
@settitle Libavdevice Documentation @settitle Libavdevice Documentation
@titlepage @titlepage

View File

@ -1,5 +1,4 @@
\input texinfo @c -*- texinfo -*- \input texinfo @c -*- texinfo -*-
@documentencoding UTF-8
@settitle Libavfilter Documentation @settitle Libavfilter Documentation
@titlepage @titlepage

View File

@ -1,5 +1,4 @@
\input texinfo @c -*- texinfo -*- \input texinfo @c -*- texinfo -*-
@documentencoding UTF-8
@settitle Libavformat Documentation @settitle Libavformat Documentation
@titlepage @titlepage

View File

@ -1,5 +1,4 @@
\input texinfo @c -*- texinfo -*- \input texinfo @c -*- texinfo -*-
@documentencoding UTF-8
@settitle Libavutil Documentation @settitle Libavutil Documentation
@titlepage @titlepage

View File

@ -1,5 +1,4 @@
\input texinfo @c -*- texinfo -*- \input texinfo @c -*- texinfo -*-
@documentencoding UTF-8
@settitle Libswresample Documentation @settitle Libswresample Documentation
@titlepage @titlepage

View File

@ -1,5 +1,4 @@
\input texinfo @c -*- texinfo -*- \input texinfo @c -*- texinfo -*-
@documentencoding UTF-8
@settitle Libswscale Documentation @settitle Libswscale Documentation
@titlepage @titlepage

View File

@ -12,10 +12,10 @@ A file consists of a header and a number of metadata tags divided into sections,
each on its own line. each on its own line.
@item @item
The header is a @samp{;FFMETADATA} string, followed by a version number (now 1). The header is a ';FFMETADATA' string, followed by a version number (now 1).
@item @item
Metadata tags are of the form @samp{key=value} Metadata tags are of the form 'key=value'
@item @item
Immediately after header follows global metadata Immediately after header follows global metadata
@ -26,30 +26,26 @@ metadata.
@item @item
A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in A section starts with the section name in uppercase (i.e. STREAM or CHAPTER) in
brackets (@samp{[}, @samp{]}) and ends with next section or end of file. brackets ('[', ']') and ends with next section or end of file.
@item @item
At the beginning of a chapter section there may be an optional timebase to be 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 used for start/end values. It must be in form 'TIMEBASE=num/den', where num and
@samp{TIMEBASE=@var{num}/@var{den}}, where @var{num} and @var{den} are den are integers. If the timebase is missing then start/end times are assumed to
integers. If the timebase is missing then start/end times are assumed to
be in milliseconds. be in milliseconds.
Next a chapter section must contain chapter start and end times in form Next a chapter section must contain chapter start and end times in form
@samp{START=@var{num}}, @samp{END=@var{num}}, where @var{num} is a positive 'START=num', 'END=num', where num is a positive integer.
integer.
@item @item
Empty lines and lines starting with @samp{;} or @samp{#} are ignored. Empty lines and lines starting with ';' or '#' are ignored.
@item @item
Metadata keys or values containing special characters (@samp{=}, @samp{;}, Metadata keys or values containing special characters ('=', ';', '#', '\' and a
@samp{#}, @samp{\} and a newline) must be escaped with a backslash @samp{\}. newline) must be escaped with a backslash '\'.
@item @item
Note that whitespace in metadata (e.g. @samp{foo = bar}) is considered to be Note that whitespace in metadata (e.g. foo = bar) is considered to be a part of
a part of the tag (in the example above key is @samp{foo }, value is the tag (in the example above key is 'foo ', value is ' bar').
@samp{ bar}).
@end enumerate @end enumerate
A ffmetadata file might look like this: A ffmetadata file might look like this:

View File

@ -47,16 +47,12 @@ Files that have MIPS copyright notice in them:
* libavutil/mips/ * libavutil/mips/
float_dsp_mips.c float_dsp_mips.c
libm_mips.h libm_mips.h
softfloat_tables.h
* libavcodec/ * libavcodec/
fft_fixed_32.c fft_fixed_32.c
fft_init_table.c fft_init_table.c
fft_table.h fft_table.h
mdct_fixed_32.c mdct_fixed_32.c
* libavcodec/mips/ * libavcodec/mips/
aacdec_fixed.c
aacsbr_fixed.c
aacsbr_template.c
aaccoder_mips.c aaccoder_mips.c
aacpsy_mips.h aacpsy_mips.h
ac3dsp_mips.c ac3dsp_mips.c

View File

@ -54,7 +54,7 @@ thread.
If the codec allocates writable tables in its init(), add an init_thread_copy() If the codec allocates writable tables in its init(), add an init_thread_copy()
which re-allocates them for other threads. which re-allocates them for other threads.
Add AV_CODEC_CAP_FRAME_THREADS to the codec capabilities. There will be very little Add CODEC_CAP_FRAME_THREADS to the codec capabilities. There will be very little
speed gain at this point but it should work. speed gain at this point but it should work.
If there are inter-frame dependencies, so the codec calls If there are inter-frame dependencies, so the codec calls

View File

@ -37,61 +37,6 @@ ID3v2.3 and ID3v2.4) are supported. The default is version 4.
@end table @end table
@anchor{asf}
@section asf
Advanced Systems Format muxer.
Note that Windows Media Audio (wma) and Windows Media Video (wmv) use this
muxer too.
@subsection Options
It accepts the following options:
@table @option
@item packet_size
Set the muxer packet size. By tuning this setting you may reduce data
fragmentation or muxer overhead depending on your source. Default value is
3200, minimum is 100, maximum is 64k.
@end table
@anchor{chromaprint}
@section chromaprint
Chromaprint fingerprinter
This muxer feeds audio data to the Chromaprint library, which generates
a fingerprint for the provided audio data. It takes a single signed
native-endian 16-bit raw audio stream.
@subsection Options
@table @option
@item silence_threshold
Threshold for detecting silence, ranges from 0 to 32767. -1 for default
(required for use with the AcoustID service).
@item algorithm
Algorithm index to fingerprint with.
@item fp_format
Format to output the fingerprint as. Accepts the following options:
@table @samp
@item raw
Binary raw fingerprint
@item compressed
Binary compressed fingerprint
@item base64
Base64 compressed fingerprint
@end table
@end table
@anchor{crc} @anchor{crc}
@section crc @section crc
@ -174,70 +119,30 @@ ffmpeg -i INPUT -c:a pcm_u8 -c:v mpeg2video -f framecrc -
See also the @ref{crc} muxer. See also the @ref{crc} muxer.
@anchor{framehash}
@section framehash
Per-packet hash testing format.
This muxer computes and prints a cryptographic hash for each audio
and video packet. This can be used for packet-by-packet equality
checks without having to individually do a binary comparison on each.
By default audio frames are converted to signed 16-bit raw audio and
video frames to raw video before computing the hash, but the output
of explicit conversions to other codecs can also be used. It uses the
SHA-256 cryptographic hash function by default, but supports several
other algorithms.
The output of the muxer consists of a line for each audio and video
packet of the form:
@example
@var{stream_index}, @var{packet_dts}, @var{packet_pts}, @var{packet_duration}, @var{packet_size}, @var{hash}
@end example
@var{hash} is a hexadecimal number representing the computed hash
for the packet.
@table @option
@item hash @var{algorithm}
Use the cryptographic hash function specified by the string @var{algorithm}.
Supported values include @code{MD5}, @code{murmur3}, @code{RIPEMD128},
@code{RIPEMD160}, @code{RIPEMD256}, @code{RIPEMD320}, @code{SHA160},
@code{SHA224}, @code{SHA256} (default), @code{SHA512/224}, @code{SHA512/256},
@code{SHA384}, @code{SHA512}, @code{CRC32} and @code{adler32}.
@end table
@subsection Examples
To compute the SHA-256 hash of the audio and video frames in @file{INPUT},
converted to raw audio and video packets, and store it in the file
@file{out.sha256}:
@example
ffmpeg -i INPUT -f framehash out.sha256
@end example
To print the information to stdout, using the MD5 hash function, use
the command:
@example
ffmpeg -i INPUT -f framehash -hash md5 -
@end example
See also the @ref{hash} muxer.
@anchor{framemd5} @anchor{framemd5}
@section framemd5 @section framemd5
Per-packet MD5 testing format. Per-packet MD5 testing format.
This is a variant of the @ref{framehash} muxer. Unlike that muxer, This muxer computes and prints the MD5 hash for each audio
it defaults to using the MD5 hash function. and video packet. By default audio frames are converted to signed
16-bit raw audio and video frames to raw video before computing the
hash.
The output of the muxer consists of a line for each audio and video
packet of the form:
@example
@var{stream_index}, @var{packet_dts}, @var{packet_pts}, @var{packet_duration}, @var{packet_size}, @var{MD5}
@end example
@var{MD5} is a hexadecimal number representing the computed MD5 hash
for the packet.
@subsection Examples @subsection Examples
To compute the MD5 hash of the audio and video frames in @file{INPUT}, For example to compute the MD5 of the audio and video frames in
converted to raw audio and video packets, and store it in the file @file{INPUT}, converted to raw audio and video packets, and store it
@file{out.md5}: in the file @file{out.md5}:
@example @example
ffmpeg -i INPUT -f framemd5 out.md5 ffmpeg -i INPUT -f framemd5 out.md5
@end example @end example
@ -247,7 +152,7 @@ To print the information to stdout, use the command:
ffmpeg -i INPUT -f framemd5 - ffmpeg -i INPUT -f framemd5 -
@end example @end example
See also the @ref{framehash} and @ref{md5} muxers. See also the @ref{md5} muxer.
@anchor{gif} @anchor{gif}
@section gif @section gif
@ -283,51 +188,6 @@ ffmpeg -i INPUT -c:v gif -f image2 "out%d.gif"
Note 2: the GIF format has a very small time base: the delay between two frames Note 2: the GIF format has a very small time base: the delay between two frames
can not be smaller than one centi second. can not be smaller than one centi second.
@anchor{hash}
@section hash
Hash testing format.
This muxer computes and prints a cryptographic hash of all the input
audio and video frames. This can be used for equality checks without
having to do a complete binary comparison.
By default audio frames are converted to signed 16-bit raw audio and
video frames to raw video before computing the hash, but the output
of explicit conversions to other codecs can also be used. Timestamps
are ignored. It uses the SHA-256 cryptographic hash function by default,
but supports several other algorithms.
The output of the muxer consists of a single line of the form:
@var{algo}=@var{hash}, where @var{algo} is a short string representing
the hash function used, and @var{hash} is a hexadecimal number
representing the computed hash.
@table @option
@item hash @var{algorithm}
Use the cryptographic hash function specified by the string @var{algorithm}.
Supported values include @code{MD5}, @code{murmur3}, @code{RIPEMD128},
@code{RIPEMD160}, @code{RIPEMD256}, @code{RIPEMD320}, @code{SHA160},
@code{SHA224}, @code{SHA256} (default), @code{SHA512/224}, @code{SHA512/256},
@code{SHA384}, @code{SHA512}, @code{CRC32} and @code{adler32}.
@end table
@subsection Examples
To compute the SHA-256 hash of the input converted to raw audio and
video, and store it in the file @file{out.sha256}:
@example
ffmpeg -i INPUT -f hash out.sha256
@end example
To print an MD5 hash to stdout use the command:
@example
ffmpeg -i INPUT -f hash -hash md5 -
@end example
See also the @ref{framehash} muxer.
@anchor{hls} @anchor{hls}
@section hls @section hls
@ -358,8 +218,7 @@ This muxer supports the following options:
@table @option @table @option
@item hls_time @var{seconds} @item hls_time @var{seconds}
Set the target segment length in seconds. Default value is 2. Set the segment length in seconds. Default value is 2.
Segment will be cut on the next key frame after this time has passed.
@item hls_list_size @var{size} @item hls_list_size @var{size}
Set the maximum number of playlist entries. If set to 0 the list file Set the maximum number of playlist entries. If set to 0 the list file
@ -395,91 +254,6 @@ and it is not to be confused with the segment filename sequence number
which can be cyclic, for example if the @option{wrap} option is which can be cyclic, for example if the @option{wrap} option is
specified. specified.
@item hls_segment_filename @var{filename}
Set the segment filename. Unless @code{hls_flags single_file} is set,
@var{filename} is used as a string format with the segment number:
@example
ffmpeg in.nut -hls_segment_filename 'file%03d.ts' out.m3u8
@end example
This example will produce the playlist, @file{out.m3u8}, and segment files:
@file{file000.ts}, @file{file001.ts}, @file{file002.ts}, etc.
@item use_localtime
Use strftime on @var{filename} to expand the segment filename with localtime.
The segment number (%d) is not available in this mode.
@example
ffmpeg in.nut -use_localtime 1 -hls_segment_filename 'file-%Y%m%d-%s.ts' out.m3u8
@end example
This example will produce the playlist, @file{out.m3u8}, and segment files:
@file{file-20160215-1455569023.ts}, @file{file-20160215-1455569024.ts}, etc.
@item use_localtime_mkdir
Used together with -use_localtime, it will create up to one subdirectory which
is expanded in @var{filename}.
@example
ffmpeg in.nut -use_localtime 1 -use_localtime_mkdir 1 -hls_segment_filename '%Y%m%d/file-%Y%m%d-%s.ts' out.m3u8
@end example
This example will create a directory 201560215 (if it does not exist), and then
produce the playlist, @file{out.m3u8}, and segment files:
@file{201560215/file-20160215-1455569023.ts}, @file{201560215/file-20160215-1455569024.ts}, etc.
@item hls_key_info_file @var{key_info_file}
Use the information in @var{key_info_file} for segment encryption. The first
line of @var{key_info_file} specifies the key URI written to the playlist. The
key URL is used to access the encryption key during playback. The second line
specifies the path to the key file used to obtain the key during the encryption
process. The key file is read as a single packed array of 16 octets in binary
format. The optional third line specifies the initialization vector (IV) as a
hexadecimal string to be used instead of the segment sequence number (default)
for encryption. Changes to @var{key_info_file} will result in segment
encryption with the new key/IV and an entry in the playlist for the new key
URI/IV.
Key info file format:
@example
@var{key URI}
@var{key file path}
@var{IV} (optional)
@end example
Example key URIs:
@example
http://server/file.key
/path/to/file.key
file.key
@end example
Example key file paths:
@example
file.key
/path/to/file.key
@end example
Example IV:
@example
0123456789ABCDEF0123456789ABCDEF
@end example
Key info file example:
@example
http://server/file.key
/path/to/file.key
0123456789ABCDEF0123456789ABCDEF
@end example
Example shell script:
@example
#!/bin/sh
BASE_URL=$@{1:-'.'@}
openssl rand 16 > file.key
echo $BASE_URL/file.key > file.keyinfo
echo file.key >> file.keyinfo
echo $(openssl rand -hex 16) >> file.keyinfo
ffmpeg -f lavfi -re -i testsrc -c:v h264 -hls_flags delete_segments \
-hls_key_info_file file.keyinfo out.m3u8
@end example
@item hls_flags single_file @item hls_flags single_file
If this flag is set, the muxer will store all segments in a single MPEG-TS If this flag is set, the muxer will store all segments in a single MPEG-TS
file, and will use byte ranges in the playlist. HLS playlists generated with file, and will use byte ranges in the playlist. HLS playlists generated with
@ -490,46 +264,6 @@ ffmpeg -i in.nut -hls_flags single_file out.m3u8
@end example @end example
Will produce the playlist, @file{out.m3u8}, and a single segment file, Will produce the playlist, @file{out.m3u8}, and a single segment file,
@file{out.ts}. @file{out.ts}.
@item hls_flags delete_segments
Segment files removed from the playlist are deleted after a period of time
equal to the duration of the segment plus the duration of the playlist.
@item hls_flags round_durations
Round the duration info in the playlist file segment info to integer
values, instead of using floating point.
@item hls_flags discont_starts
Add the @code{#EXT-X-DISCONTINUITY} tag to the playlist, before the
first segment's information.
@item hls_flags omit_endlist
Do not append the @code{EXT-X-ENDLIST} tag at the end of the playlist.
@item hls_flags split_by_time
Allow segments to start on frames other than keyframes. This improves
behavior on some players when the time between keyframes is inconsistent,
but may make things worse on others, and can cause some oddities during
seeking. This flag should be used with the @code{hls_time} option.
@item hls_playlist_type event
Emit @code{#EXT-X-PLAYLIST-TYPE:EVENT} in the m3u8 header. Forces
@option{hls_list_size} to 0; the playlist can only be appended to.
@item hls_playlist_type vod
Emit @code{#EXT-X-PLAYLIST-TYPE:VOD} in the m3u8 header. Forces
@option{hls_list_size} to 0; the playlist must not change.
@item method
Use the given HTTP method to create the hls files.
@example
ffmpeg -re -i in.ts -f hls -method PUT http://example.com/live/out.m3u8
@end example
This example will upload all the mpegts segment files to the HTTP
server using the HTTP PUT method, and update the m3u8 files every
@code{refresh} times using the same method.
Note that the HTTP server must support the given method for uploading
files.
@end table @end table
@anchor{ico} @anchor{ico}
@ -634,7 +368,8 @@ ffmpeg -f v4l2 -r 1 -i /dev/video0 -f image2 -strftime 1 "%Y-%m-%d_%H-%M-%S.jpg"
@table @option @table @option
@item start_number @item start_number
Start the sequence from the specified number. Default value is 0. Start the sequence from the specified number. Default value is 1. Must
be a non-negative number.
@item update @item update
If set to 1, the filename will always be interpreted as just a If set to 1, the filename will always be interpreted as just a
@ -743,12 +478,16 @@ have no effect if it is not.
MD5 testing format. MD5 testing format.
This is a variant of the @ref{hash} muxer. Unlike that muxer, it This muxer computes and prints the MD5 hash of all the input audio
defaults to using the MD5 hash function. and video frames. By default audio frames are converted to signed
16-bit raw audio and video frames to raw video before computing the
hash.
@subsection Examples The output of the muxer consists of a single line of the form:
MD5=@var{MD5}, where @var{MD5} is a hexadecimal number representing
the computed MD5 hash.
To compute the MD5 hash of the input converted to raw For example to compute the MD5 hash of the input converted to raw
audio and video, and store it in the file @file{out.md5}: audio and video, and store it in the file @file{out.md5}:
@example @example
ffmpeg -i INPUT -f md5 out.md5 ffmpeg -i INPUT -f md5 out.md5
@ -759,7 +498,7 @@ You can print the MD5 to stdout with the command:
ffmpeg -i INPUT -f md5 - ffmpeg -i INPUT -f md5 -
@end example @end example
See also the @ref{hash} and @ref{framemd5} muxers. See also the @ref{framemd5} muxer.
@section mov, mp4, ismv @section mov, mp4, ismv
@ -860,13 +599,6 @@ point on IIS with this muxer. Example:
ffmpeg -re @var{<normal input/transcoding options>} -movflags isml+frag_keyframe -f ismv http://server/publishingpoint.isml/Streams(Encoder1) ffmpeg -re @var{<normal input/transcoding options>} -movflags isml+frag_keyframe -f ismv http://server/publishingpoint.isml/Streams(Encoder1)
@end example @end example
@subsection Audible AAX
Audible AAX files are encrypted M4B files, and they can be decrypted by specifying a 4 byte activation secret.
@example
ffmpeg -activation_bytes 1CEB00DA -i test.aax -vn -c:a copy output.mp4
@end example
@section mp3 @section mp3
The MP3 muxer writes a raw MP3 stream with the following optional features: The MP3 muxer writes a raw MP3 stream with the following optional features:
@ -936,41 +668,34 @@ and @code{service_name}. If they are not set the default for
The muxer options are: The muxer options are:
@table @option @table @option
@item mpegts_original_network_id @var{number} @item -mpegts_original_network_id @var{number}
Set the original_network_id (default 0x0001). This is unique identifier 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 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. service through the path Original_Network_ID, Transport_Stream_ID.
@item mpegts_transport_stream_id @var{number} @item -mpegts_transport_stream_id @var{number}
Set the transport_stream_id (default 0x0001). This identifies a Set the transport_stream_id (default 0x0001). This identifies a
transponder in DVB. transponder in DVB.
@item mpegts_service_id @var{number} @item -mpegts_service_id @var{number}
Set the service_id (default 0x0001) also known as program in DVB. Set the service_id (default 0x0001) also known as program in DVB.
@item mpegts_service_type @var{number} @item -mpegts_pmt_start_pid @var{number}
Set the program service_type (default @var{digital_tv}), see below
a list of pre defined values.
@item mpegts_pmt_start_pid @var{number}
Set the first PID for PMT (default 0x1000, max 0x1f00). Set the first PID for PMT (default 0x1000, max 0x1f00).
@item mpegts_start_pid @var{number} @item -mpegts_start_pid @var{number}
Set the first PID for data packets (default 0x0100, max 0x0f00). Set the first PID for data packets (default 0x0100, max 0x0f00).
@item mpegts_m2ts_mode @var{number} @item -mpegts_m2ts_mode @var{number}
Enable m2ts mode if set to 1. Default value is -1 which disables m2ts mode. Enable m2ts mode if set to 1. Default value is -1 which disables m2ts mode.
@item muxrate @var{number} @item -muxrate @var{number}
Set a constant muxrate (default VBR). Set a constant muxrate (default VBR).
@item pcr_period @var{numer} @item -pcr_period @var{numer}
Override the default PCR retransmission time (default 20ms), ignored Override the default PCR retransmission time (default 20ms), ignored
if variable muxrate is selected. if variable muxrate is selected.
@item pat_period @var{number} @item -pes_payload_size @var{number}
Maximal time in seconds between PAT/PMT tables.
@item sdt_period @var{number}
Maximal time in seconds between SDT tables.
@item pes_payload_size @var{number}
Set minimum PES packet payload in bytes. Set minimum PES packet payload in bytes.
@item mpegts_flags @var{flags} @item -mpegts_flags @var{flags}
Set flags (see below). Set flags (see below).
@item mpegts_copyts @var{number} @item -mpegts_copyts @var{number}
Preserve original timestamps, if value is set to 1. Default value is -1, which Preserve original timestamps, if value is set to 1. Default value is -1, which
results in shifting timestamps so that they start from 0. results in shifting timestamps so that they start from 0.
@item tables_version @var{number} @item -tables_version @var{number}
Set PAT, PMT and SDT version (default 0, valid values are from 0 to 31, inclusively). Set PAT, PMT and SDT version (default 0, valid values are from 0 to 31, inclusively).
This option allows updating stream structure so that standard consumer may This option allows updating stream structure so that standard consumer may
detect the change. To do so, reopen output AVFormatContext (in case of API detect the change. To do so, reopen output AVFormatContext (in case of API
@ -986,38 +711,13 @@ ffmpeg -i source2.ts -codec copy -f mpegts -tables_version 1 udp://1.1.1.1:1111
@end example @end example
@end table @end table
Option @option{mpegts_service_type} accepts the following values: Option mpegts_flags may take a set of such flags:
@table @option
@item hex_value
Any hexdecimal value between 0x01 to 0xff as defined in ETSI 300 468.
@item digital_tv
Digital TV service.
@item digital_radio
Digital Radio service.
@item teletext
Teletext service.
@item advanced_codec_digital_radio
Advanced Codec Digital Radio service.
@item mpeg2_digital_hdtv
MPEG2 Digital HDTV service.
@item advanced_codec_digital_sdtv
Advanced Codec Digital SDTV service.
@item advanced_codec_digital_hdtv
Advanced Codec Digital HDTV service.
@end table
Option @option{mpegts_flags} may take a set of such flags:
@table @option @table @option
@item resend_headers @item resend_headers
Reemit PAT/PMT before writing the next packet. Reemit PAT/PMT before writing the next packet.
@item latm @item latm
Use LATM packetization for AAC. Use LATM packetization for AAC.
@item pat_pmt_at_frames
Reemit PAT and PMT at each video frame.
@item system_b
Conform to System B (DVB) instead of System A (ATSC).
@end table @end table
@subsection Example @subsection Example
@ -1034,21 +734,6 @@ ffmpeg -i file.mpg -c copy \
-y out.ts -y out.ts
@end example @end example
@section mxf, mxf_d10
MXF muxer.
@subsection Options
The muxer options are:
@table @option
@item store_user_comments @var{bool}
Set if user comments should be stored if available or never.
IRT D-10 does not allow user comments. The default is thus to write them for
mxf but not for mxf_d10
@end table
@section null @section null
Null muxer. Null muxer.
@ -1083,7 +768,7 @@ Change the syncpoint usage in nut:
sensitive and seeking is not possible. Also in general the overhead from sensitive and seeking is not possible. Also in general the overhead from
syncpoints is negligible. Note, -@code{write_index} 0 can be used to disable syncpoints is negligible. Note, -@code{write_index} 0 can be used to disable
all growing data tables, allowing to mux endless streams with limited memory all growing data tables, allowing to mux endless streams with limited memory
and without these disadvantages. and wihout these disadvantages.
@item @var{timestamped} extend the syncpoint with a wallclock field. @item @var{timestamped} extend the syncpoint with a wallclock field.
@end table @end table
The @var{none} and @var{timestamped} flags are experimental. The @var{none} and @var{timestamped} flags are experimental.
@ -1108,11 +793,6 @@ is 1 second. A value of 0 will fill all segments, making pages as large as
possible. A value of 1 will effectively use 1 packet-per-page in most possible. A value of 1 will effectively use 1 packet-per-page in most
situations, giving a small seek granularity at the cost of additional container situations, giving a small seek granularity at the cost of additional container
overhead. overhead.
@item -serial_offset @var{value}
Serial value from which to set the streams serial number.
Setting it to different and sufficiently large values ensures that the produced
ogg files can be safely chained.
@end table @end table
@anchor{segment} @anchor{segment}
@ -1121,9 +801,8 @@ ogg files can be safely chained.
Basic stream segmenter. Basic stream segmenter.
This muxer outputs streams to a number of separate files of nearly This muxer outputs streams to a number of separate files of nearly
fixed duration. Output filename pattern can be set in a fashion fixed duration. Output filename pattern can be set in a fashion similar to
similar to @ref{image2}, or by using a @code{strftime} template if @ref{image2}.
the @option{strftime} option is enabled.
@code{stream_segment} is a variant of the muxer used to write to @code{stream_segment} is a variant of the muxer used to write to
streaming output formats, i.e. which do not require global headers, streaming output formats, i.e. which do not require global headers,
@ -1155,12 +834,6 @@ implementation for HLS segmentation.
The segment muxer supports the following options: The segment muxer supports the following options:
@table @option @table @option
@item increment_tc @var{1|0}
if set to @code{1}, increment timecode between each segment
If this is selected, the input need to have
a timecode in the first video stream. Default value is
@code{0}.
@item reference_stream @var{specifier} @item reference_stream @var{specifier}
Set the reference stream, as specified by the string @var{specifier}. Set the reference stream, as specified by the string @var{specifier}.
If @var{specifier} is set to @code{auto}, the reference is chosen If @var{specifier} is set to @code{auto}, the reference is chosen
@ -1193,6 +866,13 @@ Allow caching (only affects M3U8 list files).
Allow live-friendly file generation. Allow live-friendly file generation.
@end table @end table
@item segment_list_type @var{type}
Select the listing format.
@table @option
@item @var{flat} use a simple flat list of entries.
@item @var{hls} use a m3u8-like structure.
@end table
@item segment_list_size @var{size} @item segment_list_size @var{size}
Update the list file so that it contains at most @var{size} Update the list file so that it contains at most @var{size}
segments. If 0 the list file will contain all the segments. Default segments. If 0 the list file will contain all the segments. Default
@ -1202,9 +882,6 @@ value is 0.
Prepend @var{prefix} to each entry. Useful to generate absolute paths. Prepend @var{prefix} to each entry. Useful to generate absolute paths.
By default no prefix is applied. By default no prefix is applied.
@item segment_list_type @var{type}
Select the listing format.
The following values are recognized: The following values are recognized:
@table @samp @table @samp
@item flat @item flat
@ -1264,28 +941,6 @@ to create files at 12:00 o'clock, 12:15, 12:30, etc.
Default value is "0". Default value is "0".
@item segment_clocktime_offset @var{duration}
Delay the segment splitting times with the specified duration when using
@option{segment_atclocktime}.
For example with @option{segment_time} set to "900" and
@option{segment_clocktime_offset} set to "300" this makes it possible to
create files at 12:05, 12:20, 12:35, etc.
Default value is "0".
@item segment_clocktime_wrap_duration @var{duration}
Force the segmenter to only start a new segment if a packet reaches the muxer
within the specified duration after the segmenting clock time. This way you
can make the segmenter more resilient to backward local time jumps, such as
leap seconds or transition to standard time from daylight savings time.
Assuming that the delay between the packets of your source is less than 0.5
second you can detect a leap second by specifying 0.5 as the duration.
Default is the maximum possible duration which means starting a new segment
regardless of the elapsed time since the last clock time.
@item segment_time_delta @var{delta} @item segment_time_delta @var{delta}
Specify the accuracy time when selecting the start time for a Specify the accuracy time when selecting the start time for a
segment, expressed as a duration specification. Default value is "0". segment, expressed as a duration specification. Default value is "0".
@ -1327,18 +982,6 @@ Wrap around segment index once it reaches @var{limit}.
@item segment_start_number @var{number} @item segment_start_number @var{number}
Set the sequence number of the first segment. Defaults to @code{0}. Set the sequence number of the first segment. Defaults to @code{0}.
@item strftime @var{1|0}
Use the @code{strftime} function to define the name of the new
segments to write. If this is selected, the output segment name must
contain a @code{strftime} function template. Default value is
@code{0}.
@item break_non_keyframes @var{1|0}
If enabled, allow segments to start on frames other than keyframes. This
improves behavior on some players when the time between keyframes is
inconsistent, but may make things worse on others, and can cause some oddities
during seeking. Defaults to @code{0}.
@item reset_timestamps @var{1|0} @item reset_timestamps @var{1|0}
Reset timestamps at the begin of each segment, so that each segment Reset timestamps at the begin of each segment, so that each segment
will start with near-zero timestamps. It is meant to ease the playback will start with near-zero timestamps. It is meant to ease the playback
@ -1348,11 +991,6 @@ muxers/codecs. It is set to @code{0} by default.
@item initial_offset @var{offset} @item initial_offset @var{offset}
Specify timestamp offset to apply to the output packet timestamps. The Specify timestamp offset to apply to the output packet timestamps. The
argument must be a time duration specification, and defaults to 0. argument must be a time duration specification, and defaults to 0.
@item write_empty_segments @var{1|0}
If enabled, write an empty segment if there are no packets during the period a
segment would usually span. Otherwise, the segment will be filled with the next
packet written. Defaults to @code{0}.
@end table @end table
@subsection Examples @subsection Examples
@ -1480,14 +1118,7 @@ Several bitstream filters can be specified, separated by ",".
@item select @item select
Select the streams that should be mapped to the slave output, Select the streams that should be mapped to the slave output,
specified by a stream specifier. If not specified, this defaults to specified by a stream specifier. If not specified, this defaults to
all the input streams. You may use multiple stream specifiers all the input streams.
separated by commas (@code{,}) e.g.: @code{a:0,v}
@item onfail
Specify behaviour on output failure. This can be set to either @code{abort} (which is
default) or @code{ignore}. @code{abort} will cause whole process to fail in case of failure
on this slave output. @code{ignore} will ignore failure on this output, so other outputs
will continue without being affected.
@end table @end table
@subsection Examples @subsection Examples
@ -1501,14 +1132,6 @@ ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
"archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/" "archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/"
@end example @end example
@item
As above, but continue streaming even if output to local file fails
(for example local drive fills up):
@example
ffmpeg -i ... -c:v libx264 -c:a mp2 -f tee -map 0:v -map 0:a
"[onfail=ignore]archive-20121107.mkv|[f=mpegts]udp://10.0.1.255:1234/"
@end example
@item @item
Use @command{ffmpeg} to encode the input, and send the output Use @command{ffmpeg} to encode the input, and send the output
to three different destinations. The @code{dump_extra} bitstream to three different destinations. The @code{dump_extra} bitstream
@ -1539,17 +1162,7 @@ is the @option{global_header} flag.
WebM DASH Manifest muxer. WebM DASH Manifest muxer.
This muxer implements the WebM DASH Manifest specification to generate the DASH This muxer implements the WebM DASH Manifest specification to generate the DASH manifest XML.
manifest XML. It also supports manifest generation for DASH live streams.
For more information see:
@itemize @bullet
@item
WebM DASH Specification: @url{https://sites.google.com/a/webmproject.org/wiki/adaptive-streaming/webm-dash-specification}
@item
ISO DASH Specification: @url{http://standards.iso.org/ittf/PubliclyAvailableStandards/c065274_ISO_IEC_23009-1_2014.zip}
@end itemize
@subsection Options @subsection Options
@ -1560,32 +1173,6 @@ This muxer supports the following options:
This option has the following syntax: "id=x,streams=a,b,c id=y,streams=d,e" where x and y are the This option has the following syntax: "id=x,streams=a,b,c id=y,streams=d,e" where x and y are the
unique identifiers of the adaptation sets and a,b,c,d and e are the indices of the corresponding unique identifiers of the adaptation sets and a,b,c,d and e are the indices of the corresponding
audio and video streams. Any number of adaptation sets can be added using this option. audio and video streams. Any number of adaptation sets can be added using this option.
@item live
Set this to 1 to create a live stream DASH Manifest. Default: 0.
@item chunk_start_index
Start index of the first chunk. This will go in the @samp{startNumber} attribute
of the @samp{SegmentTemplate} element in the manifest. Default: 0.
@item chunk_duration_ms
Duration of each chunk in milliseconds. This will go in the @samp{duration}
attribute of the @samp{SegmentTemplate} element in the manifest. Default: 1000.
@item utc_timing_url
URL of the page that will return the UTC timestamp in ISO format. This will go
in the @samp{value} attribute of the @samp{UTCTiming} element in the manifest.
Default: None.
@item time_shift_buffer_depth
Smallest time (in seconds) shifting buffer for which any Representation is
guaranteed to be available. This will go in the @samp{timeShiftBufferDepth}
attribute of the @samp{MPD} element. Default: 60.
@item minimum_update_period
Minimum update period (in seconds) of the manifest. This will go in the
@samp{minimumUpdatePeriod} attribute of the @samp{MPD} element. Default: 0.
@end table @end table
@subsection Example @subsection Example
@ -1601,47 +1188,4 @@ ffmpeg -f webm_dash_manifest -i video1.webm \
manifest.xml manifest.xml
@end example @end example
@section webm_chunk
WebM Live Chunk Muxer.
This muxer writes out WebM headers and chunks as separate files which can be
consumed by clients that support WebM Live streams via DASH.
@subsection Options
This muxer supports the following options:
@table @option
@item chunk_start_index
Index of the first chunk (defaults to 0).
@item header
Filename of the header where the initialization data will be written.
@item audio_chunk_duration
Duration of each audio chunk in milliseconds (defaults to 5000).
@end table
@subsection Example
@example
ffmpeg -f v4l2 -i /dev/video0 \
-f alsa -i hw:0 \
-map 0:0 \
-c:v libvpx-vp9 \
-s 640x360 -keyint_min 30 -g 30 \
-f webm_chunk \
-header webm_live_video_360.hdr \
-chunk_start_index 1 \
webm_live_video_360_%d.chk \
-map 1:0 \
-c:a libvorbis \
-b:a 128k \
-f webm_chunk \
-header webm_live_audio_128.hdr \
-chunk_start_index 1 \
-audio_chunk_duration 1000 \
webm_live_audio_128_%d.chk
@end example
@c man end MUXERS @c man end MUXERS

View File

@ -1,5 +1,4 @@
\input texinfo @c -*- texinfo -*- \input texinfo @c -*- texinfo -*-
@documentencoding UTF-8
@settitle NUT @settitle NUT
@ -34,7 +33,7 @@ NUT has some variants signaled by using the flags field in its main header.
The BROADCAST variant provides a secondary time reference to facilitate The BROADCAST variant provides a secondary time reference to facilitate
detecting endpoint latency and network delays. detecting endpoint latency and network delays.
It assumes all the endpoint clocks are synchronized. It assumes all the endpoint clocks are syncronized.
To be used in real-time scenarios. To be used in real-time scenarios.
@section PIPE @section PIPE

View File

@ -7,7 +7,7 @@ If you plan to do non-x86 architecture specific optimizations (SIMD normally),
then take a look in the x86/ directory, as most important functions are then take a look in the x86/ directory, as most important functions are
already optimized for MMX. already optimized for MMX.
If you want to do x86 optimizations then you can either try to fine-tune the If you want to do x86 optimizations then you can either try to finetune the
stuff in the x86 directory or find some other functions in the C source to stuff in the x86 directory or find some other functions in the C source to
optimize, but there aren't many left. optimize, but there aren't many left.
@ -163,7 +163,7 @@ 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 particularly important on Win64, where xmm6-15 are callee-save, and not
restoring their contents leads to undefined results. In external asm (e.g. restoring their contents leads to undefined results. In external asm (e.g.
yasm), you do this by using: yasm), you do this by using:
cglobal function_name, num_args, num_regs, num_xmm_regs cglobal functon_name, num_args, num_regs, num_xmm_regs
In inline asm, you specify clobbered registers at the end of your asm: In inline asm, you specify clobbered registers at the end of your asm:
__asm__(".." ::: "%eax"). __asm__(".." ::: "%eax").
If gcc is not set to support sse (-msse) it will not accept xmm registers If gcc is not set to support sse (-msse) it will not accept xmm registers
@ -191,11 +191,6 @@ __asm__() block.
Use external asm (nasm/yasm) or inline asm (__asm__()), do not use intrinsics. Use external asm (nasm/yasm) or inline asm (__asm__()), do not use intrinsics.
The latter requires a good optimizing compiler which gcc is not. The latter requires a good optimizing compiler which gcc is not.
When debugging a x86 external asm compilation issue, if lost in the macro
expansions, add DBG=1 to your make command-line: the input file will be
preprocessed, stripped of the debug/empty lines, then compiled, showing the
actual lines causing issues.
Inline asm vs. external asm Inline asm vs. external asm
--------------------------- ---------------------------
Both inline asm (__asm__("..") in a .c file, handled by a compiler such as gcc) Both inline asm (__asm__("..") in a .c file, handled by a compiler such as gcc)

View File

@ -1,5 +1,4 @@
\input texinfo @c -*- texinfo -*- \input texinfo @c -*- texinfo -*-
@documentencoding UTF-8
@settitle Platform Specific Information @settitle Platform Specific Information
@titlepage @titlepage
@ -63,7 +62,7 @@ bash ./configure
@section Darwin (Mac OS X, iPhone) @section Darwin (Mac OS X, iPhone)
The toolchain provided with Xcode is sufficient to build the basic The toolchain provided with Xcode is sufficient to build the basic
unaccelerated code. unacelerated code.
Mac OS X on PowerPC or ARM (iPhone) requires a preprocessor from Mac OS X on PowerPC or ARM (iPhone) requires a preprocessor from
@url{https://github.com/FFmpeg/gas-preprocessor} or @url{https://github.com/FFmpeg/gas-preprocessor} or
@ -97,9 +96,9 @@ the FFmpeg Windows Help Forum at @url{http://ffmpeg.zeranoe.com/forum/}.
@section Native Windows compilation using MinGW or MinGW-w64 @section Native Windows compilation using MinGW or MinGW-w64
FFmpeg can be built to run natively on Windows using the MinGW-w64 FFmpeg can be built to run natively on Windows using the MinGW or MinGW-w64
toolchain. Install the latest versions of MSYS2 and MinGW-w64 from toolchains. Install the latest versions of MSYS and MinGW or MinGW-w64 from
@url{http://msys2.github.io/} and/or @url{http://mingw-w64.sourceforge.net/}. @url{http://www.mingw.org/} or @url{http://mingw-w64.sourceforge.net/}.
You can find detailed installation instructions in the download section and You can find detailed installation instructions in the download section and
the FAQ. the FAQ.
@ -107,13 +106,8 @@ Notes:
@itemize @itemize
@item Building for the MSYS environment is discouraged, MSYS2 provides a full @item Building natively using MSYS can be sped up by disabling implicit rules
MinGW-w64 environment through @file{mingw64_shell.bat} or in the Makefile by calling @code{make -r} instead of plain @code{make}. This
@file{mingw32_shell.bat} that should be used instead of the environment
provided by @file{msys2_shell.bat}.
@item Building using MSYS2 can be sped up by disabling implicit rules in the
Makefile by calling @code{make -r} instead of plain @code{make}. This
speed up is close to non-existent for normal one-off builds and is only speed up is close to non-existent for normal one-off builds and is only
noticeable when running make for a second time (for example during noticeable when running make for a second time (for example during
@code{make install}). @code{make install}).
@ -127,25 +121,6 @@ libavformat) as DLLs.
@end itemize @end itemize
@subsection Native Windows compilation using MSYS2
The MSYS2 MinGW-w64 environment provides ready to use toolchains and dependencies
through @command{pacman}.
Make sure to use @file{mingw64_shell.bat} or @file{mingw32_shell.bat} to have
the correct MinGW-w64 environment. The default install provides shortcuts to
them under @command{MinGW-w64 Win64 Shell} and @command{MinGW-w64 Win32 Shell}.
@example
# normal msys2 packages
pacman -S make pkgconf diffutils
# mingw-w64 packages and toolchains
pacman -S mingw-w64-x86_64-yasm mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL
@end example
To target 32 bits replace @code{x86_64} with @code{i686} in the command above.
@section Microsoft Visual C++ or Intel C++ Compiler for Windows @section Microsoft Visual C++ or Intel C++ Compiler for Windows
FFmpeg can be built with MSVC 2012 or earlier using a C99-to-C89 conversion utility FFmpeg can be built with MSVC 2012 or earlier using a C99-to-C89 conversion utility
@ -158,12 +133,11 @@ You will need the following prerequisites:
(if using MSVC 2012 or earlier) (if using MSVC 2012 or earlier)
@item @uref{http://code.google.com/p/msinttypes/, msinttypes} @item @uref{http://code.google.com/p/msinttypes/, msinttypes}
(if using MSVC 2012 or earlier) (if using MSVC 2012 or earlier)
@item @uref{http://msys2.github.io/, MSYS2} @item @uref{http://www.mingw.org/, MSYS}
@item @uref{http://yasm.tortall.net/, YASM} @item @uref{http://yasm.tortall.net/, YASM}
(Also available via MSYS2's package manager.)
@end itemize @end itemize
To set up a proper environment in MSYS2, you need to run @code{msys_shell.bat} from To set up a proper environment in MSYS, you need to run @code{msys.bat} from
the Visual Studio or Intel Compiler command prompt. the Visual Studio or Intel Compiler command prompt.
Place @code{yasm.exe} somewhere in your @code{PATH}. If using MSVC 2012 or Place @code{yasm.exe} somewhere in your @code{PATH}. If using MSVC 2012 or
@ -199,6 +173,12 @@ Notes:
@itemize @itemize
@item It is possible that coreutils' @code{link.exe} conflicts with MSVC's linker.
You can find out by running @code{which link} to see which @code{link.exe} you
are using. If it is located at @code{/bin/link.exe}, then you have the wrong one
in your @code{PATH}. Either move or remove that copy, or make sure MSVC's
@code{link.exe} takes precedence in your @code{PATH} over coreutils'.
@item If you wish to build with zlib support, you will have to grab a compatible @item If you wish to build with zlib support, you will have to grab a compatible
zlib binary from somewhere, with an MSVC import lib, or if you wish to link zlib binary from somewhere, with an MSVC import lib, or if you wish to link
statically, you can follow the instructions below to build a compatible statically, you can follow the instructions below to build a compatible
@ -314,7 +294,7 @@ These library packages are only available from
@uref{http://sourceware.org/cygwinports/, Cygwin Ports}: @uref{http://sourceware.org/cygwinports/, Cygwin Ports}:
@example @example
yasm, libSDL-devel, libfaac-devel, libgsm-devel, libmp3lame-devel, yasm, libSDL-devel, libfaac-devel, libaacplus-devel, libgsm-devel, libmp3lame-devel,
libschroedinger1.0-devel, speex-devel, libtheora-devel, libxvidcore-devel libschroedinger1.0-devel, speex-devel, libtheora-devel, libxvidcore-devel
@end example @end example

View File

@ -1,22 +1,3 @@
@chapter Protocol Options
@c man begin PROTOCOL OPTIONS
The libavformat library provides some generic global options, which
can be set on all the protocols. In addition each protocol may support
so-called private options, which are specific for that component.
The list of supported options follows:
@table @option
@item protocol_whitelist @var{list} (@emph{input})
Set a ","-separated list of allowed protocols. "ALL" matches all protocols. Protocols
prefixed by "-" are disabled.
All protocols are allowed by default but protocols used by an another
protocol (nested protocols) are restricted to a per protocol subset.
@end table
@c man end PROTOCOL OPTIONS
@chapter Protocols @chapter Protocols
@c man begin PROTOCOLS @c man begin PROTOCOLS
@ -36,28 +17,8 @@ particular protocol using the option
The option "-protocols" of the ff* tools will display the list of The option "-protocols" of the ff* tools will display the list of
supported protocols. supported protocols.
All protocols accept the following options:
@table @option
@item rw_timeout
Maximum time to wait for (network) read/write operations to complete,
in microseconds.
@end table
A description of the currently available protocols follows. A description of the currently available protocols follows.
@section async
Asynchronous data filling wrapper for input stream.
Fill data in a background thread, to decouple I/O operation from demux thread.
@example
async:@var{URL}
async:http://host/resource
async:cache:http://host/resource
@end example
@section bluray @section bluray
Read BluRay playlist. Read BluRay playlist.
@ -102,7 +63,7 @@ cache:@var{URL}
Physical concatenation protocol. Physical concatenation protocol.
Read and seek from many resources in sequence as if they were Allow to read and seek from many resource in sequence as if they were
a unique resource. a unique resource.
A URL accepted by this protocol has the syntax: A URL accepted by this protocol has the syntax:
@ -156,7 +117,7 @@ ffmpeg -i "data:image/gif;base64,R0lGODdhCAAIAMIEAAAAAAAA//8AAP//AP/////////////
File access protocol. File access protocol.
Read from or write to a file. Allow to read from or write to a file.
A file URL can have the form: A file URL can have the form:
@example @example
@ -194,7 +155,7 @@ time, which is valuable for files on slow medium.
FTP (File Transfer Protocol). FTP (File Transfer Protocol).
Read from or write to remote resources using FTP protocol. Allow to read from or write to remote resources using FTP protocol.
Following syntax is required. Following syntax is required.
@example @example
@ -224,17 +185,6 @@ it, unless special care is taken (tests, customized server configuration
etc.). Different FTP servers behave in different way during seek etc.). Different FTP servers behave in different way during seek
operation. ff* tools may produce incomplete content due to server limitations. operation. ff* tools may produce incomplete content due to server limitations.
This protocol accepts the following options:
@table @option
@item follow
If set to 1, the protocol will retry reading at the end of the file, allowing
reading files that still are being written. In order for this to terminate,
you either need to use the rw_timeout option, or use the interrupt callback
(for API users).
@end table
@section gopher @section gopher
Gopher protocol. Gopher protocol.
@ -278,9 +228,6 @@ If set to 1 use chunked Transfer-Encoding for posts, default is 1.
@item content_type @item content_type
Set a specific content type for the POST messages. Set a specific content type for the POST messages.
@item http_proxy
set HTTP proxy to tunnel through e.g. http://example.com:1234
@item headers @item headers
Set custom HTTP headers, can override built in default headers. The Set custom HTTP headers, can override built in default headers. The
value must be a string encoding the headers. value must be a string encoding the headers.
@ -301,16 +248,6 @@ Set timeout in microseconds of socket I/O operations used by the underlying low
operation. By default it is set to -1, which means that the timeout is operation. By default it is set to -1, which means that the timeout is
not specified. not specified.
@item reconnect_at_eof
If set then eof is treated like an error and causes reconnection, this is useful
for live / endless streams.
@item reconnect_streamed
If set then even streamed/non seekable streams will be reconnected on errors.
@item reconnect_delay_max
Sets the maximum delay in seconds after which to give up reconnecting
@item mime_type @item mime_type
Export the MIME type. Export the MIME type.
@ -340,43 +277,6 @@ Set initial byte offset.
@item end_offset @item end_offset
Try to limit the request to bytes preceding this offset. Try to limit the request to bytes preceding this offset.
@item method
When used as a client option it sets the HTTP method for the request.
When used as a server option it sets the HTTP method that is going to be
expected from the client(s).
If the expected and the received HTTP method do not match the client will
be given a Bad Request response.
When unset the HTTP method is not checked for now. This will be replaced by
autodetection in the future.
@item listen
If set to 1 enables experimental HTTP server. This can be used to send data when
used as an output option, or read data from a client with HTTP POST when used as
an input option.
If set to 2 enables experimental mutli-client HTTP server. This is not yet implemented
in ffmpeg.c or ffserver.c and thus must not be used as a command line option.
@example
# Server side (sending):
ffmpeg -i somefile.ogg -c copy -listen 1 -f ogg http://@var{server}:@var{port}
# Client side (receiving):
ffmpeg -i http://@var{server}:@var{port} -c copy somefile.ogg
# Client can also be done with wget:
wget http://@var{server}:@var{port} -O somefile.ogg
# Server side (receiving):
ffmpeg -listen 1 -i http://@var{server}:@var{port} -c copy somefile.ogg
# Client side (sending):
ffmpeg -i somefile.ogg -chunked_post 0 -c copy -f ogg http://@var{server}:@var{port}
# Client can also be done with wget:
wget --post-file=somefile.ogg http://@var{server}:@var{port}
@end example
@end table @end table
@subsection HTTP Cookies @subsection HTTP Cookies
@ -474,7 +374,7 @@ be seekable, so they will fail with the MD5 output protocol.
UNIX pipe access protocol. UNIX pipe access protocol.
Read and write from UNIX pipes. Allow to read and write from UNIX pipes.
The accepted syntax is: The accepted syntax is:
@example @example
@ -695,7 +595,7 @@ This protocol accepts the following options.
@table @option @table @option
@item timeout @item timeout
Set timeout in milliseconds of socket I/O operations used by the underlying Set timeout in miliseconds of socket I/O operations used by the underlying
low level operation. By default it is set to -1, which means that the timeout low level operation. By default it is set to -1, which means that the timeout
is not specified. is not specified.
@ -714,7 +614,7 @@ For more information see: @url{http://www.samba.org/}.
Secure File Transfer Protocol via libssh Secure File Transfer Protocol via libssh
Read from or write to remote resources using SFTP protocol. Allow to read from or write to remote resources using SFTP protocol.
Following syntax is required. Following syntax is required.
@ -1155,18 +1055,7 @@ subfile,,start,153391104,end,268142592,,:/media/dvd/VIDEO_TS/VTS_08_1.VOB
@end example @end example
Play an AVI file directly from a TAR archive: Play an AVI file directly from a TAR archive:
@example
subfile,,start,183241728,end,366490624,,:archive.tar subfile,,start,183241728,end,366490624,,:archive.tar
@end example
@section tee
Writes the output to multiple protocols. The individual outputs are separated
by |
@example
tee:file://path/to/local/this.avi|file://path/to/local/that.avi
@end example
@section tcp @section tcp
@ -1194,12 +1083,6 @@ than this time interval, raise error.
@item listen_timeout=@var{milliseconds} @item listen_timeout=@var{milliseconds}
Set listen timeout, expressed in milliseconds. Set listen timeout, expressed in milliseconds.
@item recv_buffer_size=@var{bytes}
Set receive buffer size, expressed bytes.
@item send_buffer_size=@var{bytes}
Set send buffer size, expressed bytes.
@end table @end table
The following example shows how to setup a listening TCP connection The following example shows how to setup a listening TCP connection
@ -1294,14 +1177,6 @@ Set the UDP maximum socket buffer size in bytes. This is used to set either
the receive or send buffer size, depending on what the socket is used for. the receive or send buffer size, depending on what the socket is used for.
Default is 64KB. See also @var{fifo_size}. Default is 64KB. See also @var{fifo_size}.
@item bitrate=@var{bitrate}
If set to nonzero, the output will have the specified constant bitrate if the
input has enough packets to sustain it.
@item burst_bits=@var{bits}
When using @var{bitrate} this specifies the maximum number of bits in
packet bursts.
@item localport=@var{port} @item localport=@var{port}
Override the local UDP port to bind with. Override the local UDP port to bind with.

Some files were not shown because too many files have changed in this diff Show More