Commit Graph

6527 Commits

Author SHA1 Message Date
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
Michael Niedermayer
b706ddbae3 doc/developer: Add terse documentation of assumed C implementation defined behavior
Suggested-by: "Ronald S. Bultje" <rsbultje@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2017-05-01 17:59:10 +02:00
Paul B Mahol
399c7ab9c6 avfilter: add video oscilloscope filter
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-04-29 19:12:34 +02:00
Paul B Mahol
8341d0dd0e avfilter: add pixscope filter
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-04-29 18:47:41 +02:00
Paul B Mahol
b8b0cece79 doc/filters: add one lowpass filter example
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-04-29 11:44:21 +02:00
James Zern
1bee78a019 libvpxenc: allow aq-mode 4 (equator360)
this was added in 1.6.0

Reviewed-by: Ronald S. Bultje <rsbultje@gmail.com>
Signed-off-by: James Zern <jzern@google.com>
2017-04-28 17:56:09 -07:00
Clément Bœsch
d417e95af7 Merge commit 'fa1749dd34c55fb997c97dfc4da9383c9976ab91'
* commit 'fa1749dd34c55fb997c97dfc4da9383c9976ab91':
  vp9: split superframes in the filtering stage before actual decoding

This commit is a noop.

2017-04-24 20:45:04     @ubitux BBB: btw, do you think you can get the bsf thing this week or we should skip it to give you more time and go on with the merges?
2017-04-24 20:45:20     @BBB    I’m not sure I’ll finish it that soon
2017-04-24 20:45:26     @BBB    I’d skip it and leave it for later
2017-04-24 20:45:35     @BBB    I’ll do it, I promise, but I Can’t guarantee it’ll be done by $date

Merged-by: Clément Bœsch <u@pkh.me>
2017-04-25 19:02:47 +02:00
Paul B Mahol
9d08c7bd42 avfilter/af_biquads: allow filtering only selected channels
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-04-25 18:08:26 +02:00
Paul B Mahol
dfc4ce5f5d avfilter: add lumakey filter
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-04-24 20:37:30 +02:00
Paul B Mahol
710c97d5f6 avfilter/vf_premultiply: add planes option
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-04-23 18:21:51 +02:00
Muhammad Faiz
327a1c0dee examples: do not use AVFrame accessor
Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Muhammad Faiz <mfcc64@gmail.com>
2017-04-23 14:43:51 +07:00
James Almer
fdeab95a82 Merge commit '03a80925effc2698d21dc0b00290eecf42dd9e68'
* commit '03a80925effc2698d21dc0b00290eecf42dd9e68':
  lavc: add a bitstream filter for splitting VP9 superframes

Merged-by: James Almer <jamrial@gmail.com>
2017-04-22 23:27:05 -03:00
Paul B Mahol
01729f77dd avfilter: add doubleweave filter
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2017-04-22 13:18:59 +02:00
Lou Logan
0b8c159a93 doc/filters: deflicker size option value is in frames
Signed-off-by: Lou Logan <lou@lrcd.com>
Signed-off-by: Paul B Mahol <onemda@gmail.com> (in #ffmpeg-devel IRC)
2017-04-20 13:34:56 -08:00