ffmpeg.git
6 months agoavdevice/xcbgrab: check if frame size fits in INT_MAX
Marton Balint [Tue, 31 Dec 2019 00:24:32 +0000 (01:24 +0100)]
avdevice/xcbgrab: check if frame size fits in INT_MAX

Also fixes a possible overflow and sets stream bitrate.

Signed-off-by: Marton Balint <cus@passwd.hu>
6 months agoavdevice/xcbgrab: move some initialization code from pixfmt_from_pixmap_format to...
Marton Balint [Mon, 30 Dec 2019 23:43:49 +0000 (00:43 +0100)]
avdevice/xcbgrab: move some initialization code from pixfmt_from_pixmap_format to create_stream

Signed-off-by: Marton Balint <cus@passwd.hu>
6 months agoavformat/libsrt: add missing SRT_VERSION_VALUE check
Marton Balint [Tue, 21 Jan 2020 22:01:31 +0000 (23:01 +0100)]
avformat/libsrt: add missing SRT_VERSION_VALUE check

This was missed in d7e2a2bb35e394287b3e3dc27744830bf0b7ca99.

Signed-off-by: Marton Balint <cus@passwd.hu>
6 months agolibavutil: x86: Include stdlib.h before using _byteswap_ulong
Martin Storsjö [Tue, 21 Jan 2020 19:54:22 +0000 (21:54 +0200)]
libavutil: x86: Include stdlib.h before using _byteswap_ulong

When clang works in MSVC mode, it does have the _byteswap_ulong
builtin, but one has to include stdlib.h before using it.

Signed-off-by: Martin Storsjö <martin@martin.st>
6 months agoconfigure: Check for GetStdHandle in addition to SetConsoleTextAttribute
Martin Storsjö [Tue, 21 Jan 2020 12:47:57 +0000 (14:47 +0200)]
configure: Check for GetStdHandle in addition to SetConsoleTextAttribute

SetConsoleTextAttribute used to be unavailable for Windows Store apps,
but is available to them now. But GetStdHandle still is unavailable,
thus make sure to check for both functions before using code that
requires both.

Signed-off-by: Martin Storsjö <martin@martin.st>
6 months agoavcodec/ra144enc: Fix invalid left shift of negative number
Andreas Rheinhardt [Wed, 22 Jan 2020 14:52:10 +0000 (15:52 +0100)]
avcodec/ra144enc: Fix invalid left shift of negative number

by replacing it with a multiplication. Said multiplication can't
overflow an int32_t because lpc_coefs is limited to 16 bit precision.

Fixes the FACE-test acodec-ra144 as well as part of #8217.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 months agoavfilter/vf_v360: support input flips for tetrahedron format
Paul B Mahol [Thu, 23 Jan 2020 10:16:13 +0000 (11:16 +0100)]
avfilter/vf_v360: support input flips for tetrahedron format

6 months agoavfilter/vf_v360: fix small artifacts with tetrahedron inputs
Paul B Mahol [Thu, 23 Jan 2020 09:31:22 +0000 (10:31 +0100)]
avfilter/vf_v360: fix small artifacts with tetrahedron inputs

6 months agoavformat/utils: log corrupt packets
Gyan Doshi [Wed, 18 Sep 2019 05:07:16 +0000 (10:37 +0530)]
avformat/utils: log corrupt packets

6 months agoavfilter/vf_v360: add tetrahedron format
Paul B Mahol [Wed, 22 Jan 2020 21:21:32 +0000 (22:21 +0100)]
avfilter/vf_v360: add tetrahedron format

6 months agotools/target_dec_fuzzer: Use codec_tags list
Michael Niedermayer [Sun, 29 Dec 2019 21:09:35 +0000 (22:09 +0100)]
tools/target_dec_fuzzer: Use codec_tags list

This should make it much quicker for the fuzzer to test
real relevant codec_tags

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 months agoavcodec/hapdec: Add codec_tags list
Michael Niedermayer [Sun, 29 Dec 2019 20:24:01 +0000 (21:24 +0100)]
avcodec/hapdec: Add codec_tags list

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 months agoavcodec/avcodec: Add codec_tags array to AVCodec
Michael Niedermayer [Sun, 29 Dec 2019 20:22:05 +0000 (21:22 +0100)]
avcodec/avcodec: Add codec_tags array to AVCodec

This allows the fuzzer to target meaningfull codec tags instead
of hunting the 4gb space, which it seems to have problems with.

Suggested-by: James
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 months agoswscale/input: Fix several invalid shifts related to rgb2yuv constants
Michael Niedermayer [Tue, 21 Jan 2020 21:52:19 +0000 (22:52 +0100)]
swscale/input: Fix several invalid shifts related to rgb2yuv constants

Fixes: Invalid shifts
Fixes: #8140
Fixes: #8146

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 months agoavfilter/vf_stack: add fill option for xstack
Paul B Mahol [Wed, 22 Jan 2020 18:11:38 +0000 (19:11 +0100)]
avfilter/vf_stack: add fill option for xstack

6 months agoavutil/log: Move log_level_offset_offset code from av_log() to v_log()
Michael Niedermayer [Tue, 21 Jan 2020 14:32:24 +0000 (15:32 +0100)]
avutil/log: Move log_level_offset_offset code from av_log() to v_log()

Suggested-by: Anton
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 months agoswscale/output: Fix several invalid shifts in yuv2rgb_full_1_c_template()
Michael Niedermayer [Tue, 21 Jan 2020 21:52:19 +0000 (22:52 +0100)]
swscale/output: Fix several invalid shifts in yuv2rgb_full_1_c_template()

Fixes: Invalid shifts
Fixes: #8320

Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 months agoswscale/swscale: Fix several invalid shifts related to vChrDrop
Michael Niedermayer [Tue, 21 Jan 2020 21:52:19 +0000 (22:52 +0100)]
swscale/swscale: Fix several invalid shifts related to vChrDrop

Fixes: Invalid shifts
Fixes: #8166
Fixes: filter-crop_scale_vflip FATE-test

Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 months agoavfilter/vf_v360: improve fisheye input format
Paul B Mahol [Wed, 22 Jan 2020 11:23:58 +0000 (12:23 +0100)]
avfilter/vf_v360: improve fisheye input format

6 months agoavcodec/exr: fix some small cosmetics nits
Paul B Mahol [Wed, 22 Jan 2020 09:42:57 +0000 (10:42 +0100)]
avcodec/exr: fix some small cosmetics nits

6 months agoavcodec/exr.c: make channel name comparisons case insensitive
Gonzalo Garramuño [Mon, 20 Jan 2020 17:25:50 +0000 (14:25 -0300)]
avcodec/exr.c: make channel name comparisons case insensitive

Allow matching channel names in lowercase, like Diffuse.r in addition to Diffuse.R

6 months agoavutil/thread: Add pthread_cond_timedwait function
Matt Oliver [Wed, 7 Dec 2016 05:55:35 +0000 (16:55 +1100)]
avutil/thread: Add pthread_cond_timedwait function

v2: fix calculating milisecond times and use SleepConditionVariableSRW.

Signed-off-by: Matt Oliver <protogonoi@gmail.com>
6 months agotools/target_dec_fuzzer: Also Fuzz with CPU optimizations disabled
Michael Niedermayer [Sun, 29 Dec 2019 16:13:21 +0000 (17:13 +0100)]
tools/target_dec_fuzzer: Also Fuzz with CPU optimizations disabled

This should improve coverage of *_c()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 months agotools/target_dec_fuzzer: Fuzz private options of AC3/E-AC3
Michael Niedermayer [Sun, 29 Dec 2019 16:09:44 +0000 (17:09 +0100)]
tools/target_dec_fuzzer: Fuzz private options of AC3/E-AC3

This should improve AC-3 coverage

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 months agotools/target_dec_fuzzer: Fuzz idct_algo value
Michael Niedermayer [Sat, 28 Dec 2019 22:20:37 +0000 (23:20 +0100)]
tools/target_dec_fuzzer: Fuzz idct_algo value

This should improve coverage

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 months agoavfilter/vf_v360: add support for fisheye input format
Paul B Mahol [Tue, 21 Jan 2020 17:42:46 +0000 (18:42 +0100)]
avfilter/vf_v360: add support for fisheye input format

6 months agoavcodec/j2kenc: Fix undefined shifts of negative numbers
Andreas Rheinhardt [Tue, 21 Jan 2020 00:23:47 +0000 (01:23 +0100)]
avcodec/j2kenc: Fix undefined shifts of negative numbers

Also add parentheses to some lines to make the operator precedence
clearer.

This affected the FATE-tests vsynth*-jpeg2000 and vsynth*-jpeg2000-97
(where * ranges over { 1, 2, 3, _lena }) as well as ticket #7983.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 months agoavformat/libzmq: Replace fail statements with goto
Andriy Gelman [Sat, 11 Jan 2020 04:25:26 +0000 (23:25 -0500)]
avformat/libzmq: Replace fail statements with goto

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 months agoavformat/libzmq: Check return of zmq_setsockopt
Andriy Gelman [Sat, 11 Jan 2020 04:25:25 +0000 (23:25 -0500)]
avformat/libzmq: Check return of zmq_setsockopt

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 months agolavc/mjpegenc: Fix not writing RST tag after final slice.
Carl Eugen Hoyos [Mon, 20 Jan 2020 22:57:38 +0000 (23:57 +0100)]
lavc/mjpegenc: Fix not writing RST tag after final slice.

Fixes ticket #8412.

6 months agoavfilter/vf_v360: add support for input fov to input sg format
Paul B Mahol [Tue, 21 Jan 2020 10:23:00 +0000 (11:23 +0100)]
avfilter/vf_v360: add support for input fov to input sg format

6 months agodoc/filters: v360: cylindrical supports input
Paul B Mahol [Tue, 21 Jan 2020 08:52:23 +0000 (09:52 +0100)]
doc/filters: v360: cylindrical supports input

6 months agoavcodec/adxdec: Remove unnecessary left-shift
Andreas Rheinhardt [Mon, 20 Jan 2020 19:20:43 +0000 (20:20 +0100)]
avcodec/adxdec: Remove unnecessary left-shift

Replace "(a * (1 << shift) * b + c) >> shift" by "a * b + (c >> shift)".
It is equivalent to the old code because a is in the range of uint16_t,
shift is 12 and b is effectively a signed 4-bit number, so that no
overflow/truncation of high bits happens during the multiplication
(overflow would be undefined anyway).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 months agoavcodec/adxenc: Avoid undefined left shift of negative numbers
Andreas Rheinhardt [Mon, 20 Jan 2020 19:20:42 +0000 (20:20 +0100)]
avcodec/adxenc: Avoid undefined left shift of negative numbers

Replace "((a << shift) + b) >> shift" by "a + (b >> shift)". This avoids
a left shift which also happens to trigger undefined behaviour in case "a"
is negative. This affected the FATE-tests acodec-adpcm-adx and
acodec-adpcm-adx-trellis; it also fixes ticket #8008.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 months agoavcodec/adpcm: Fix undefined left shifts of negative numbers
Andreas Rheinhardt [Mon, 20 Jan 2020 15:56:55 +0000 (16:56 +0100)]
avcodec/adpcm: Fix undefined left shifts of negative numbers

Affected the adpcm-afc, adpcm-ea-1, adpcm-ea-2, adpcm-ea-maxis-xa,
adpcm-thp and ea-cdata FATE-tests. Also fixes ticket #8487.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 months agoavfilter/vf_v360: add support for cylindrical input format
Paul B Mahol [Mon, 20 Jan 2020 22:29:14 +0000 (23:29 +0100)]
avfilter/vf_v360: add support for cylindrical input format

6 months agoavfilter/vf_v360: add support for flat input format
Paul B Mahol [Mon, 20 Jan 2020 13:50:54 +0000 (14:50 +0100)]
avfilter/vf_v360: add support for flat input format

6 months agoavfilter/vf_v360: rewrite fov_from_dfov()
Paul B Mahol [Mon, 20 Jan 2020 12:45:07 +0000 (13:45 +0100)]
avfilter/vf_v360: rewrite fov_from_dfov()

6 months agodoc/fftools-common-opts: small fix to -report documentation.
Nicolas George [Mon, 20 Jan 2020 16:05:53 +0000 (17:05 +0100)]
doc/fftools-common-opts: small fix to -report documentation.

6 months agodoc/filters: clarify resampling and linear mode in loudnorm
Gyan Doshi [Mon, 20 Jan 2020 11:54:11 +0000 (17:24 +0530)]
doc/filters: clarify resampling and linear mode in loudnorm

6 months agoavformat/hlsenc: fix default AES key file url with variant streams
Bela Bodecs [Sun, 19 Jan 2020 22:01:32 +0000 (23:01 +0100)]
avformat/hlsenc: fix default AES key file url with variant streams

Currently when hls_enc is active and there are multiple variant stream
outputs, default key file url construction does not work, because it is
based on the FormatContext' url field. But in case of multiple variant
streams, it contains the variant m3u8 output playlist url that contains
the %v placeholder. So the result key file url will hold the %v
placeholder causing run time error message about "could not write the
key file".
This patch correct this behaviour, and use the master playlist url for
constructing the output key file url when master playlist is vailable.

Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
6 months agoavformat/hlsenc: program_date_time and append_list flags conflict
Bela Bodecs [Sat, 18 Jan 2020 16:41:55 +0000 (17:41 +0100)]
avformat/hlsenc: program_date_time and append_list flags conflict

When program_date_time flag is present, in m3u8 playlist file each
segment has a corresponding EXT-X-PROGRAM-DATE-TIME value. The intial
program-date-time value is the actual current time at init and
each new segment increments this value by its duration. When append_list
flags is also present, existing playlist parsing by hls_append_segment
treats existing segments as new segments regarding the program-date-time
calculation. But it should not do that, because this way all real the
new segments' EXT-X-PROGRAM-DATE-TIME values will be shifted erroneously
by the sum duration of existing segments. Instead it should have
decremented the initial program-date-time value by its duration. This
would ensure that
the first new segment's program-date-time value had the current time as
it is expected.
This patch corrects this behaviour and prevent existing segments to
increment the value of initial_prog_date_time variable but decrements
it.

Reviewed-by: Steven Liu <lq@onvideo.cn>
Signed-off-by: Bela Bodecs <bodecsb@vivanet.hu>
6 months agoavformat/udp: modify the not write-only to read-only mode.
Xuchen Su [Tue, 26 Nov 2019 07:02:06 +0000 (15:02 +0800)]
avformat/udp: modify the not write-only to read-only mode.

not write-only include read-write pseudo flag. so make the flag read-only

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
6 months agoavformat/hlsenc: compare without the last directory separator in get_relative_url
Steven Liu [Fri, 10 Jan 2020 14:51:22 +0000 (22:51 +0800)]
avformat/hlsenc: compare without the last directory separator in get_relative_url

fix ticket: 8461
there is no problem before commit 75aea52a1051a22bdebd0b7a8098ac6479a529a0

Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
6 months agoavformat/dashenc: use ff_rename instead of avpriv_io_move
Marton Balint [Sun, 5 Jan 2020 15:54:08 +0000 (16:54 +0100)]
avformat/dashenc: use ff_rename instead of avpriv_io_move

ff_rename always logs the error message.

Signed-off-by: Marton Balint <cus@passwd.hu>
6 months agoavformat/avio: fix ff_rename to respect used protocol
Marton Balint [Sun, 5 Jan 2020 15:32:51 +0000 (16:32 +0100)]
avformat/avio: fix ff_rename to respect used protocol

Also simplify it and make it always log the error.

This fixes for example the image2 muxer when used with an URL which also
contains the protocol:

ffmpeg -f lavfi -i testsrc -vframes 10 -atomic_writing 1 file:out%d.png

Signed-off-by: Marton Balint <cus@passwd.hu>
6 months agoavformat/avio: move ff_rename implementation from internal.h to avio.c
Marton Balint [Wed, 8 Jan 2020 22:50:41 +0000 (23:50 +0100)]
avformat/avio: move ff_rename implementation from internal.h to avio.c

Signed-off-by: Marton Balint <cus@passwd.hu>
6 months agoavfilter/vf_v360: replace rest of roundf() with lrintf()
Paul B Mahol [Sun, 19 Jan 2020 17:30:29 +0000 (18:30 +0100)]
avfilter/vf_v360: replace rest of roundf() with lrintf()

6 months agoavfilter/vf_v360: change remaps to int16_t type
Paul B Mahol [Sun, 19 Jan 2020 09:46:07 +0000 (10:46 +0100)]
avfilter/vf_v360: change remaps to int16_t type

6 months agoavfilter/vf_v360: move map variable up
Paul B Mahol [Sat, 18 Jan 2020 18:44:03 +0000 (19:44 +0100)]
avfilter/vf_v360: move map variable up

6 months agoavfilter/vf_v360: make more stuff const
Paul B Mahol [Sat, 18 Jan 2020 17:48:02 +0000 (18:48 +0100)]
avfilter/vf_v360: make more stuff const

6 months agoavfilter/pad: improve error check for w and h
Gyan Doshi [Wed, 15 Jan 2020 15:39:38 +0000 (21:09 +0530)]
avfilter/pad: improve error check for w and h

Target dimensions have to cover entire input.

6 months agoavformat/libsrt: fix enabling nonblocking mode
Anthony Delannoy [Thu, 16 Jan 2020 10:18:35 +0000 (11:18 +0100)]
avformat/libsrt: fix enabling nonblocking mode

As written in https://github.com/Haivision/srt/blob/v1.4.1/docs/API.md,
the nonblock mode is activated if SRTO_SNDSYN and SRTO_RCVSYN, for
sending and receiving respectively, are set to 0.

Signed-off-by: Marton Balint <cus@passwd.hu>
6 months agoavformat/img2enc: add support for specifying protocol options
Marton Balint [Fri, 27 Dec 2019 00:19:17 +0000 (01:19 +0100)]
avformat/img2enc: add support for specifying protocol options

v2: simplified example

Signed-off-by: Marton Balint <cus@passwd.hu>
6 months agoavcodec/hevc_mp4toannexb_bsf: check that nalu size doesnt overflow
Michael Niedermayer [Thu, 12 Dec 2019 23:50:21 +0000 (00:50 +0100)]
avcodec/hevc_mp4toannexb_bsf: check that nalu size doesnt overflow

Fixes: Out of array access
Fixes: 19299/clusterfuzz-testcase-minimized-ffmpeg_BSF_HEVC_MP4TOANNEXB_fuzzer-5169193398042624

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 months agoavcodec/hevc_mp4toannexb_bsf: Avoid NULL memcpy()
Michael Niedermayer [Thu, 12 Dec 2019 23:38:29 +0000 (00:38 +0100)]
avcodec/hevc_mp4toannexb_bsf: Avoid NULL memcpy()

Fixes: invalid memcpy use
Fixes: 19299/clusterfuzz-testcase-minimized-ffmpeg_BSF_HEVC_MP4TOANNEXB_fuzzer-5169193398042624

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 months agoavcodec/cbs_av1: Check leb128 values read
Michael Niedermayer [Thu, 12 Dec 2019 22:50:27 +0000 (23:50 +0100)]
avcodec/cbs_av1: Check leb128 values read

"It is a requirement of bitstream conformance that the value returned from the leb128 parsing process is less than or equal
to (1 << 32) - 1."

Fixes: assertion failure
Fixes: 19293/clusterfuzz-testcase-minimized-ffmpeg_BSF_TRACE_HEADERS_fuzzer-5749508361420800

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 months agoavcodec/iff: Check input space before loop in decode_delta_d()
Michael Niedermayer [Thu, 12 Dec 2019 22:13:02 +0000 (23:13 +0100)]
avcodec/iff: Check input space before loop in decode_delta_d()

Fixes: Timeout (114sec ->108ms)
Fixes: 19290/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IFF_ILBM_fuzzer-5740598116220928

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 months agoavformat/dtsdec: make S16LE discrimination sharper
Michael Niedermayer [Tue, 31 Dec 2019 13:05:28 +0000 (14:05 +0100)]
avformat/dtsdec: make S16LE discrimination sharper

Both S16LE as well as DTS can have lots of 0 bytes in silent segments
Using these results in error. Thus this patch skips 0 bytes in
comparission.

Fixes Ticket6561

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 months agoavcodec/vc1dec: Allocate only as much space as is unescaped
Michael Niedermayer [Sat, 12 Oct 2019 15:54:29 +0000 (17:54 +0200)]
avcodec/vc1dec: Allocate only as much space as is unescaped

Fixes: OOM
Fixes: 18137/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-5723834900021248
Fixes: 20037/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-5683758976204800

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 months agoavfilter/vf_normalize: add support for >8 depth
Paul B Mahol [Sun, 12 Jan 2020 19:47:35 +0000 (20:47 +0100)]
avfilter/vf_normalize: add support for >8 depth

6 months agoavfilter/vf_normalize: add support for planar rgb
Paul B Mahol [Sun, 12 Jan 2020 19:00:33 +0000 (20:00 +0100)]
avfilter/vf_normalize: add support for planar rgb

6 months agoavfilter/vf_normalize: factor code dealing with AVFrame pixels out
Paul B Mahol [Sun, 12 Jan 2020 18:46:00 +0000 (19:46 +0100)]
avfilter/vf_normalize: factor code dealing with AVFrame pixels out

6 months agoavfilter/vf_normalize: move luts into private context
Paul B Mahol [Sun, 12 Jan 2020 18:31:24 +0000 (19:31 +0100)]
avfilter/vf_normalize: move luts into private context

6 months agoavfilter/asrc_anoisesrc: add velvet noise
Paul B Mahol [Mon, 13 Jan 2020 16:56:19 +0000 (17:56 +0100)]
avfilter/asrc_anoisesrc: add velvet noise

6 months agoavfilter/vf_v360: add perspective output projection
Paul B Mahol [Sat, 18 Jan 2020 15:26:59 +0000 (16:26 +0100)]
avfilter/vf_v360: add perspective output projection

6 months agoavcodec/libx265: zero the padding bytes in extradata
James Almer [Sat, 18 Jan 2020 00:29:22 +0000 (21:29 -0300)]
avcodec/libx265: zero the padding bytes in extradata

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: James Almer <jamrial@gmail.com>
6 months agoavformat/hls: support data protocol in uri for EXT-X-MAP
Steven Liu [Tue, 24 Sep 2019 03:18:59 +0000 (11:18 +0800)]
avformat/hls: support data protocol in uri for EXT-X-MAP

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
6 months agoavfilter/vf_v360: add gaussian interpolation
Paul B Mahol [Sat, 18 Jan 2020 12:43:33 +0000 (13:43 +0100)]
avfilter/vf_v360: add gaussian interpolation

6 months agoavfilter/vf_v360: fix some small nits
Paul B Mahol [Sat, 18 Jan 2020 09:57:50 +0000 (10:57 +0100)]
avfilter/vf_v360: fix some small nits

6 months agoavfilter/vf_v360: add spline16 interpolation
Paul B Mahol [Fri, 17 Jan 2020 19:01:23 +0000 (20:01 +0100)]
avfilter/vf_v360: add spline16 interpolation

6 months agodoc/spp: Update spp command options docs
Jun Zhao [Sat, 18 Jan 2020 01:37:52 +0000 (09:37 +0800)]
doc/spp: Update spp command options docs

Update spp command options docs

Reviewed-by: Gyan Doshi <ffmpeg@gyani.pro>
Suggested-by: Moritz Barsnick <barsnick@gmx.net>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
6 months agoAdd a commandline option to control loop restoration for libaom
Wang Cao [Mon, 23 Dec 2019 20:16:24 +0000 (12:16 -0800)]
Add a commandline option to control loop restoration for libaom

Signed-off-by: Wang Cao <wangcao@google.com>
Signed-off-by: James Zern <jzern@google.com>
6 months agolavc/h2645_parse: Don't automatically remove nuh_layer_id > 0 packets
Andriy Gelman [Fri, 6 Dec 2019 03:15:41 +0000 (22:15 -0500)]
lavc/h2645_parse: Don't automatically remove nuh_layer_id > 0 packets

HEVC standard supports multi-layer streams (ITU-T H.265 02/2018 Annex
F). Each NAL unit belongs to a particular layer defined by nuh_layer_id
in the header.

Currently, all NAL units that do not belong to a base layer are
automatically removed in ff_h2645_packet_split(). Some data may
therefore be lost when future filters/decoders are designed to support
multi-layer streams.

A better approach is to forward nuh_layer_id > 0 packets and let blocks
down the chain decide how to process them. The condition to remove
packets has been moved to hevcdec and cbs.

Found-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
6 months agoavformat/oggparsevorbis: Use AV_DICT_DONT_STRDUP_VAL to avoid av_strdup
Andreas Rheinhardt [Mon, 11 Nov 2019 01:12:58 +0000 (02:12 +0100)]
avformat/oggparsevorbis: Use AV_DICT_DONT_STRDUP_VAL to avoid av_strdup

This will likely also fix CID 1452427, a false positive resulting from
Coverity thinking that av_dict_set() automatically frees its key and
value parameters (even without the AV_DICT_DONT_STRDUP_* flags).

(AV_DICT_APPEND and AV_DICT_DONT_STRDUP_VAL are compatible with each
other since a8c5b455, so we can reset this flag here. It has originally
been removed in 0dc66553 when appending was added.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 months agoconfigure: Increase minimum libx265 version
Andriy Gelman [Wed, 8 Jan 2020 22:21:03 +0000 (17:21 -0500)]
configure: Increase minimum libx265 version

libx265.c references a member x265_picture.quantOffsets (for ROI
support) which was added in X265_BUILD 70. Increase the minimum libx265
version to fix compilation.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
Reviewed-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 months agoavformat/flvenc: Avoid unnecessary seek
Andreas Rheinhardt [Thu, 16 Jan 2020 04:49:15 +0000 (05:49 +0100)]
avformat/flvenc: Avoid unnecessary seek

When shifting the already written data in order to write the keyframe
index, the flv muxer would first store the pre-shift size, then
calculate how big the index will be eventually, then perform some seeks
to update some size fields, then seek back to the end of the file to get
the new position, followed by a seek to the position where writing will
really start. Seeking back to the (already known) end position (that is
actually used to perform this seek) to get the end position is of course
unnecessary. It has been removed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 months agoavformat/movenc, segafilmenc: Remove unnecessary avio_tell()
Andreas Rheinhardt [Thu, 16 Jan 2020 04:49:14 +0000 (05:49 +0100)]
avformat/movenc, segafilmenc: Remove unnecessary avio_tell()

When the faststart option for the mov/mp4 muxer is used, the current
position (i.e. the size of the already written data pre-shifting) was
evaluated twice: First in an initialization and then again later,
overwriting the first value without having ever touched it. So remove
the initialization.

Also, the clone of this code in the Sega FILM muxer behaves the same and
has been treated the same.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 months agoavfilter/f_metadata: correct check for existing metadata
Gyan Doshi [Fri, 17 Jan 2020 10:09:51 +0000 (15:39 +0530)]
avfilter/f_metadata: correct check for existing metadata

When adding metadata, existing dictionary need not be present.

6 months agoavfilter/vf_v360: add cylindrical output projection
Paul B Mahol [Fri, 17 Jan 2020 09:46:31 +0000 (10:46 +0100)]
avfilter/vf_v360: add cylindrical output projection

6 months agoRevert "avformat/utils: make ff_ntp_time() accept a timestamp as input argument"
James Almer [Thu, 16 Jan 2020 19:25:26 +0000 (16:25 -0300)]
Revert "avformat/utils: make ff_ntp_time() accept a timestamp as input argument"

Signed-off-by: James Almer <jamrial@gmail.com>
6 months agoavformat/s337m: Use base AVClass for av_log usage
Nicolas Gaullier [Wed, 15 Jan 2020 10:55:55 +0000 (11:55 +0100)]
avformat/s337m: Use base AVClass for av_log usage

s337m_get_offset_and_codec does not make use of
AVFormatContext: AVClass is enough for logging.
Will facilitate further use from outside

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 months agoavfilter/vf_v360: add pannini output projection
Paul B Mahol [Thu, 16 Jan 2020 19:06:28 +0000 (20:06 +0100)]
avfilter/vf_v360: add pannini output projection

6 months agoavfilter/vf_v360: add fisheye output projection
Paul B Mahol [Thu, 16 Jan 2020 17:12:04 +0000 (18:12 +0100)]
avfilter/vf_v360: add fisheye output projection

6 months agoavformat/dashenc: document the new options
James Almer [Sat, 21 Dec 2019 17:32:48 +0000 (14:32 -0300)]
avformat/dashenc: document the new options

Signed-off-by: James Almer <jamrial@gmail.com>
6 months agoavformat/dashenc: add an option to write a Latency element
James Almer [Fri, 13 Dec 2019 01:13:13 +0000 (22:13 -0300)]
avformat/dashenc: add an option to write a Latency element

Allows to set an intended target latency while streaming that clients can use
to measure when using low latency mode.

Signed-off-by: James Almer <jamrial@gmail.com>
6 months agodashenc: support setting arbitrary HTTP protocol options
Anton Khirnov [Fri, 13 Dec 2019 17:14:05 +0000 (18:14 +0100)]
dashenc: support setting arbitrary HTTP protocol options

Signed-off-by: James Almer <jamrial@gmail.com>
6 months agoavformat/dashenc: allow setting custom movflags using format_options
James Almer [Wed, 20 Nov 2019 12:25:09 +0000 (09:25 -0300)]
avformat/dashenc: allow setting custom movflags using format_options

Signed-off-by: James Almer <jamrial@gmail.com>
6 months agoavformat/movenc: add a flag to enable CMAF compatability
James Almer [Mon, 25 Nov 2019 19:19:03 +0000 (16:19 -0300)]
avformat/movenc: add a flag to enable CMAF compatability

Sets some required constrains and reports compatability with the relevant
compatible brand.

Signed-off-by: James Almer <jamrial@gmail.com>
6 months agoavformat/dashenc: implement DVB-DASH profile
James Almer [Tue, 17 Sep 2019 20:36:55 +0000 (17:36 -0300)]
avformat/dashenc: implement DVB-DASH profile

Add new required elements and constrain presence and values for existing
ones based on the spec.

Signed-off-by: James Almer <jamrial@gmail.com>
6 months agoavformat/dashenc: add an option to enable low latency Dash manifest
James Almer [Fri, 4 Oct 2019 15:54:55 +0000 (12:54 -0300)]
avformat/dashenc: add an option to enable low latency Dash manifest

In combination with the streaming option it constrains the value of a few elements,
to prevet clients from buffering too much data before starting presentation.

Signed-off-by: James Almer <jamrial@gmail.com>
6 months agoavformat/dashenc: Write a Producer Reference Time element
James Almer [Tue, 6 Aug 2019 01:17:16 +0000 (22:17 -0300)]
avformat/dashenc: Write a Producer Reference Time element

Signed-off-by: James Almer <jamrial@gmail.com>
6 months agoavformat/movenc: use AVProducerReferenceTime side data to write the prft atom
James Almer [Fri, 4 Oct 2019 15:04:17 +0000 (12:04 -0300)]
avformat/movenc: use AVProducerReferenceTime side data to write the prft atom

If not available, set flags to 24 (bits 4 and 5), to signal the wallclock value
is read at the time of writing the atom.

Signed-off-by: James Almer <jamrial@gmail.com>
6 months agoavformat/utils: make ff_ntp_time() accept a timestamp as input argument
James Almer [Fri, 4 Oct 2019 14:58:29 +0000 (11:58 -0300)]
avformat/utils: make ff_ntp_time() accept a timestamp as input argument

Will be needed by the next patch.

Signed-off-by: James Almer <jamrial@gmail.com>
6 months agoavcodec/libx264: export Producer Reference Time as packet side data
James Almer [Fri, 4 Oct 2019 14:55:09 +0000 (11:55 -0300)]
avcodec/libx264: export Producer Reference Time as packet side data

Taken from Wallclock at the time the frame is submitted to the encoder.

Signed-off-by: James Almer <jamrial@gmail.com>
6 months agoavcodec: add a Producer Reference Time AVPacketSideData type
James Almer [Fri, 4 Oct 2019 14:54:28 +0000 (11:54 -0300)]
avcodec: add a Producer Reference Time AVPacketSideData type

Signed-off-by: James Almer <jamrial@gmail.com>
6 months agoavformat/dashenc: allow splitting fragments following P-Frame reordering
James Almer [Tue, 6 Aug 2019 00:35:42 +0000 (21:35 -0300)]
avformat/dashenc: allow splitting fragments following P-Frame reordering

Signed-off-by: James Almer <jamrial@gmail.com>
6 months agoavformat/dashenc: allow setting fragment durations
James Almer [Mon, 5 Aug 2019 23:49:59 +0000 (20:49 -0300)]
avformat/dashenc: allow setting fragment durations

Implemented as as a frag_duration muxer option and key=value entry in the
adaptation_sets muxer option. It has the same syntax as the seg_duration option.
A new frag_type option is also introduced to select the kind of fragmentation.

Signed-off-by: James Almer <jamrial@gmail.com>
6 months agoavformat/dashenc: allow setting segment durations per AdaptationSet
James Almer [Sun, 4 Aug 2019 17:51:03 +0000 (14:51 -0300)]
avformat/dashenc: allow setting segment durations per AdaptationSet

Implemented as as a seg_duration key=value entry in the adaptation_sets muxer
option.
It has the same syntax as the global seg_duration option, and has precedence
over it if set.

Signed-off-by: James Almer <jamrial@gmail.com>
6 months agoavcodec/wmalosslessdec: Use AV_STRINGIFY()
Michael Niedermayer [Wed, 15 Jan 2020 12:12:28 +0000 (13:12 +0100)]
avcodec/wmalosslessdec: Use AV_STRINGIFY()

Suggested-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>