Commit Graph

6540 Commits

Author SHA1 Message Date
Paul B Mahol
a23a56e77c libavfilter/af_biquads: add shorter option for width_type
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-18 17:31:03 +02:00
Mark Thompson
5de38188f8 doc: Document hwupload, hwdownload and hwmap filters
(cherry picked from commit 66aa9b94da)
2017-06-14 22:27:34 +01:00
Mark Thompson
d59c6a3aeb hwcontext: Improve allocation in derived contexts
Use the flags argument of av_hwframe_ctx_create_derived() to pass the
mapping flags which will be used on allocation.  Also, set the format
and hardware context on the allocated frame automatically - the user
should not be required to do this themselves.

(cherry picked from commit c5714b51aa)
2017-06-14 22:27:32 +01:00
Mark Thompson
7ce47090ce ffmpeg: Support setting the hardware device to use when filtering
This only supports one device globally, but more can be used by
passing them with input streams in hw_frames_ctx or by deriving new
devices inside a filter graph with hwmap.

(cherry picked from commit e669db7610)
2017-06-14 22:27:07 +01:00
Mark Thompson
49ae8a5e87 lavc: Add flag to allow profile mismatch with hardware decoding
(cherry picked from commit 64a5260c69)
2017-06-14 22:27:04 +01:00
Mark Thompson
527a1e2131 ffmpeg: Document the -init_hw_device option
(cherry picked from commit 303fadf596)
2017-06-14 22:26:32 +01:00
Mark Thompson
0b1794a43e hwcontext: Make it easier to work with device types
Adds functions to convert to/from strings and a function to iterate
over all supported device types.  Also adds a new invalid type
AV_HWDEVICE_TYPE_NONE, which acts as a sentinel value.

(cherry picked from commit b7487f4f3c)
2017-06-14 22:26:29 +01:00
Mark Thompson
b22172f6f3 hwcontext: Add device derivation
Creates a new device context from another of a different type which
refers to the same underlying hardware.

(cherry picked from commit b266ad56fe)
2017-06-14 22:25:57 +01:00
Paul B Mahol
d4d1fc823f avfilter: add native headphone spatialization filter
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-12 18:08:52 +02:00
Paul B Mahol
2336c76b22 avfilter/af_sofalizer: switch to libmysofa
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-08 22:02:26 +02:00
Vittorio Giovara
f7f60749e0 vf_colorspace: Add support for jedec p22 primaries
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
2017-06-07 23:39:31 -04:00
Kevin Mark
482566ccc3 libavutil/eval: Add round function to expression parser
We have floor, ceil, and trunc. Let's add round.

Signed-off-by: Kevin Mark <kmark937@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-06-06 18:31:47 +02:00
Paul B Mahol
fab1863917 avfilter/af_surround: add support for some upmixing of 3.0, 2.1 and 5.1 channel layout
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-04 16:37:47 +02:00
Kevin Mark
3385989b98 libavfilter/scale2ref: Add constants for the primary input
Variables pertaining to the main video are now available when
using the scale2ref filter. This allows, as an example, scaling a
video with another as a reference point while maintaining the
original aspect ratio of the primary/non-reference video.

Consider the following graph: scale2ref=iw/6:-1 [main][ref]
This will scale [main] to 1/6 the width of [ref] while maintaining
the aspect ratio. This works well when the AR of [ref] is equal to
the AR of [main] only. What the above filter really does is
maintain the AR of [ref] when scaling [main]. So in all non-same-AR
situations [main] will appear stretched or compressed to conform to
the same AR of the reference video. Without doing this calculation
externally there is no way to scale in reference to another input
while maintaining AR in libavfilter.

To make this possible, we introduce eight new constants to be used
in the w and h expressions only in the scale2ref filter:

 * main_w/main_h: width/height of the main input video
 * main_a: aspect ratio of the main input video
 * main_sar: sample aspect ratio of the main input video
 * main_dar: display aspect ratio of the main input video
 * main_hsub/main_vsub: horiz/vert chroma subsample vals of main
 * mdar: a shorthand alias of main_dar

Of course, not all of these constants are needed for maintaining the
AR, but adding additional constants in line of what is available for
in/out allows for other scaling possibilities I have not imagined.

So to now scale a video to 1/6 the size of another video using the
width and maintaining its own aspect ratio you can do this:

scale2ref=iw/6:ow/mdar [main][ref]

This is ideal for picture-in-picture configurations where you could
have a square or 4:3 video overlaid on a corner of a larger 16:9
feed all while keeping the scaled video in the corner at its correct
aspect ratio and always the same size relative to the larger video.

I've tried to re-use as much code as possible. I could not find a way
to avoid duplication of the var_names array. It must now be kept in
sync with the other (the normal one and the scale2ref one) for
everything to work which does not seem ideal. For every new variable
introduced/removed into/from the normal scale filter one must be
added/removed to/from the scale2ref version. Suggestions on how to
avoid var_names duplication are welcome.

var_values has been increased to always be large enough for the
additional scale2ref variables. I do not forsee this being a problem
as the names variable will always be the correct size. From my
understanding of av_expr_parse_and_eval it will stop processing
variables when it runs out of names even though there may be
additional (potentially uninitialized) entries in the values array.
The ideal solution here would be using a variable-length array but
that is unsupported in C90.

This patch does not remove any functionality and is strictly a
feature patch. There are no API changes. Behavior does not change for
any previously valid inputs.

The applicable documentation has also been updated.

Signed-off-by: Kevin Mark <kmark937@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-06-01 22:56:08 +02:00
Paul B Mahol
dc72d1dde9 avfilter: add audio surround upmixer
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-06-01 21:25:36 +02:00
Stefano Sabatini
ddae679458 examples/encode_video: slightly improve error reporting 2017-05-31 15:46:19 +02:00
Stefano Sabatini
002dbc5a1f examples/encode_video: add log
This helps to visualize how the send/receive API works.
2017-05-31 15:46:14 +02:00
Rostislav Pehlivanov
220b24c7c9 lavc: remove libschroedinger encoding and decoding wrappers
The library has stopped being developed and Debian has removed it
from its repositories citing security issues.
The native Dirac decoder supports everything the library has and basic
encoding support is still provided via the native vc2 (Dirac Pro, intra
only version of Dirac) encoder. Hence, there's no reason to still support
linking to the library and potentially leading users into security issues.
2017-05-29 20:15:58 +01:00
Kevin Mark
114e871621 doc/filters: Clarify scale2ref example
Signed-off-by: Kevin Mark <kmark937@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-28 02:39:08 +02:00
James Almer
5213c6d175 doc/libav-merge: remove lines about AVFrame crop fields 2017-05-26 11:22:23 -03:00
James Almer
94ec89eb67 doc/libav-merge: remove line about aac_adtstoasc
Signed-off-by: James Almer <jamrial@gmail.com>
2017-05-24 20:28:01 -03:00
Paul B Mahol
e8ae23db27 avfilter/af_sidechaincompress: change default makeup gain to 1
This avoids producing out of range or clipped samples.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-05-20 12:43:11 +02:00
Muhammad Faiz
162414cefe avfilter/graphparser: allow specifying filter@id as filter instance
See http://lists.ffmpeg.org/pipermail/ffmpeg-user/2017-April/035975.html
Parsed_filter_X could remain and user can override it with custom one.

Example:
ffplay -f lavfi "nullsrc=s=640x360,
sendcmd='1 drawtext@top reinit text=Hello; 2 drawtext@bottom reinit text=World',
drawtext@top=x=16:y=16:fontsize=20:fontcolor=Red:text='',
drawtext@bottom=x=16:y=340:fontsize=16:fontcolor=Blue:text=''"

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2017-05-19 20:21:47 +07:00
Paul B Mahol
f5e5c53117 avfilter/af_sofalizer: make lfe gain user configurable
Default settings have it too low.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-05-18 23:13:52 +02:00
Paul B Mahol
5c9e12bc6d doc/filters: add more ladspa examples
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-05-18 18:01:09 +02:00
Paul B Mahol
deaab31d61 avfilter: add audio crossfeed filter
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-05-17 20:18:39 +02:00
Leo Izen
f810c46922 doc/filters: Added line to the af_bs2b filter docs mentioning --enable-libbs2b
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-16 23:14:28 +02:00
Paul B Mahol
4c55144ee9 avfilter/vf_deflicker: add bypass option
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-05-15 21:32:44 +02:00
Paul B Mahol
9bebad86c7 avfilter/af_stereotools: introduce different balance modes
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-05-15 19:58:15 +02:00
wm4
532b23f079 videotoolbox: add hwcontext support
This adds tons of code for no other benefit than making VideoToolbox
support conform with the new hwaccel API (using hw_device_ctx and
hw_frames_ctx).

Since VideoToolbox decoding does not actually require the user to
allocate frames, the new code does mostly nothing.

One benefit is that ffmpeg_videotoolbox.c can be dropped once generic
hwaccel support for ffmpeg.c is merged from Libav.

Does not consider VDA or VideoToolbox encoding.

Fun fact: the frame transfer functions are copied from vaapi, as the
mapping makes copying generic boilerplate. Mapping itself is not
exported by the VT code, because I don't know how to test.
2017-05-15 11:30:36 +02:00
Paul B Mahol
69b83f5992 avfilter/af_compand: fix default companding to avoid clipping
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-05-14 11:59:04 +02:00
Paul B Mahol
e312ed0504 avfilter/af_astats: add RMS difference too
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-05-12 18:14:45 +02:00
Paul B Mahol
eaf644e120 avfilter: add acopy filter
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-05-12 10:48:13 +02:00
James Almer
602ac48720 doc/libav-merge: mention the skipped AVFrame crop fields usage commits 2017-05-11 14:03:41 -03:00
erankor
2b06f2d2e2 ffmpeg: add enc_time_base option
add a per-stream option for setting the encoder timebase.
the following values are allowed:
0 - for video, use 1/frame_rate, for audio use 1/sample_rate (this is
  the default)
-1 - match the input timebase (when possible)
>0 - set the timebase to provided number

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-10 14:00:20 +02:00
Michael Niedermayer
014d47ed74 doc/codecs: Change common boolean parameters listed to "bool"
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-10 14:00:20 +02:00
Michael Niedermayer
ec1f869f0f doc/codecs: Add missing documentation for apply_cropping
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-10 14:00:20 +02:00
Paul B Mahol
49bbfb9d13 avfilter: add arbitrary audio FIR filter
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-05-09 20:47:52 +02:00
Paul B Mahol
66be242626 avfilter/vf_histogram: actually add parade display mode
Rename previous parade mode to stack, what it really was from start.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-05-09 16:17:49 +02:00
James Almer
f089e02fa2 Merge commit '019ab88a95cb31b698506d90e8ce56695a7f1cc5'
* commit '019ab88a95cb31b698506d90e8ce56695a7f1cc5':
  lavc: add an option for exporting cropping information to the caller

Merged-by: James Almer <jamrial@gmail.com>
2017-05-08 14:22:43 -03:00
James Almer
a47bd5d77e Merge commit '52627248e49e58eb4b78e4fcda90a64f4c476ea3'
* commit '52627248e49e58eb4b78e4fcda90a64f4c476ea3':
  frame: add a cropping rectangle to AVFrame

Merged-by: James Almer <jamrial@gmail.com>
2017-05-08 13:08:02 -03:00
Michael Niedermayer
8ef2c791c9 doc/build_system: Document how to build decoder fuzzer
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-08 17:02:02 +02:00
Michael Niedermayer
3c3d4ce4fd doc: fix bistream typo
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-08 03:25:17 +02:00
James Almer
470ad23a55 doc/libav_merge: remove line about ADVANCED_PARSER
It's been addressed.

Reviewed-by: Hendrik Leppkes <h.leppkes@gmail.com>
Reviewed-by: Aaron Levinson <alevinsn@aracnet.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-05-05 17:30:38 -03:00
Clément Bœsch
fcc4ed1efa lavu/sha512: update length argument following sha+md5 changes 2017-05-05 13:24:35 +02:00
Clément Bœsch
651ee93461 Merge commit 'e435beb1ea5380a90774dbf51fdc8c941e486551'
* commit 'e435beb1ea5380a90774dbf51fdc8c941e486551':
  crypto: consistently use size_t as type for length parameters

Merged-by: Clément Bœsch <cboesch@gopro.com>
2017-05-05 13:04:38 +02:00
Clément Bœsch
f5218b27c4 Merge commit '35d1f726eb9fdd376ab900587fb02122b72f2b9a'
* commit '35d1f726eb9fdd376ab900587fb02122b72f2b9a':
  fate: Add --ignore-tests configure option for omitting specific FATE tests

Merged-by: Clément Bœsch <cboesch@gopro.com>
2017-05-05 09:27:18 +02:00
wm4
c0f17a905f cuvid: support AVCodecContext.hw_device_ctx API
This is a newer API that is intended for decoders like the cuvid
wrapper. Until now, the wrapper required to set an awkward
"incomplete" hw_frames_ctx to set the device. Now the device
can be set directly, and the user can get AV_PIX_FMT_CUDA output
for a specific device simply by setting hw_device_ctx.

This still does a dummy ff_get_format() call at init time, and should
be fully backward compatible.
2017-05-05 00:17:41 +02:00
Clément Bœsch
3f17751eeb Merge commit '11a9320de54759340531177c9f2b1e31e6112cc2'
* commit '11a9320de54759340531177c9f2b1e31e6112cc2':
  build: Move build-system-related helper files to a separate subdirectory

"ffbuild" directory name is used instead of "avbuild".

Merged-by: Clément Bœsch <u@pkh.me>
2017-05-03 16:49:12 +02:00
Thomas Mundt
2da5bf4c2f avfilter/interlace: add complex vertical low-pass filter
This complex (-1 2 6 2 -1) filter slightly less reduces interlace 'twitter' but better retain detail and subjective sharpness impression compared to the linear (1 2 1) filter.

Signed-off-by: Thomas Mundt <tmundt75@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2017-05-02 14:09:50 -03:00