]> git.sesse.net Git - ffmpeg/log
ffmpeg
4 years 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>
4 years 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>
4 years 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

4 years 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

4 years 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

4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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

4 years 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>
4 years 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>
4 years 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>
4 years 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.

4 years 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

4 years 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

4 years 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>
4 years 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>
4 years 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>
4 years 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

4 years 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

4 years 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()

4 years 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.

4 years 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

4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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()

4 years 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

4 years 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

4 years 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

4 years 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.

4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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

4 years 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

4 years 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

4 years 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

4 years 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

4 years 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

4 years 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>
4 years 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>
4 years 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

4 years 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

4 years 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

4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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.

4 years 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

4 years 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>
4 years 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>
4 years 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

4 years 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

4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years 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>
4 years agoavcodec/wmalosslessdec: Replace negative channel check by assert
Michael Niedermayer [Tue, 14 Jan 2020 23:46:53 +0000 (00:46 +0100)]
avcodec/wmalosslessdec: Replace negative channel check by assert

It is already checked by common code in git/master

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/wmalosslessdec: move channel check up
Michael Niedermayer [Tue, 14 Jan 2020 23:32:55 +0000 (00:32 +0100)]
avcodec/wmalosslessdec: move channel check up

Fixes: out of array access
Fixes: 2nd part of 18429/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-6210814364614656
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavfilter/swaprect: correct assignment of VAR_POS
Gyan Doshi [Wed, 15 Jan 2020 08:39:07 +0000 (14:09 +0530)]
avfilter/swaprect: correct assignment of VAR_POS

Revert regression introduced in 6af050d7d0

4 years agoavfilter/scale: add animation support
Gyan Doshi [Sun, 15 Dec 2019 13:26:06 +0000 (18:56 +0530)]
avfilter/scale: add animation support

Width and height expressions in scale and scale2ref filters can now
reference frame index, timestamp and packet position.

4 years agoavfilter/scale: add function to check expressions
Gyan Doshi [Tue, 31 Dec 2019 11:45:01 +0000 (17:15 +0530)]
avfilter/scale: add function to check expressions

Allows finer identification and logging of invalid expressions and use
of a single list for symbols and their index for both scale and
scale2ref.

4 years agoavfilter/scale: separate exprs parse and eval
Gyan Doshi [Tue, 31 Dec 2019 11:40:58 +0000 (17:10 +0530)]
avfilter/scale: separate exprs parse and eval

Retains parsed expressions which allows for better
error-checking and adding animation support.

4 years agoavfilter/scale2ref: update links and re-eval expr upon ref frame change
Gyan Doshi [Sun, 8 Dec 2019 10:24:28 +0000 (15:54 +0530)]
avfilter/scale2ref: update links and re-eval expr upon ref frame change

Needed when filtergraph reinit is disabled for the ref input.

4 years agoavfilter/scale: store frame change eval
Gyan Doshi [Sun, 8 Dec 2019 10:13:42 +0000 (15:43 +0530)]
avfilter/scale: store frame change eval

Better readability and allows reuse

4 years agoavformat/avformat: Update AVInputFormat.read_packet documentation
Andreas Rheinhardt [Tue, 7 Jan 2020 13:55:39 +0000 (14:55 +0100)]
avformat/avformat: Update AVInputFormat.read_packet documentation

Since bae8844e351, the packet is automatically unreferenced in
ff_read_packet() when an error is returned; but the documentation of
this of AVInputFormat.read_packet has not been updated accordingly.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/segafilmenc: Check early whether video is allowed
Andreas Rheinhardt [Tue, 14 Jan 2020 03:13:32 +0000 (04:13 +0100)]
avformat/segafilmenc: Check early whether video is allowed

The current code only checks when writing the trailer whether the video
format and Codec ID are actually compatible with the container. At this
point, a lot of data will already have been written (in vain, of
course), so check during the init function instead.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/segafilmenc: Postpone check for existence of video stream
Andreas Rheinhardt [Tue, 14 Jan 2020 03:13:31 +0000 (04:13 +0100)]
avformat/segafilmenc: Postpone check for existence of video stream

Up until now, the Sega FILM muxer complained if the first stream wasn't a
video stream that there is no video stream at all which is of course
nonsense. So postpone this check.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/segafilmenc: Fix undefined left shift of 1 by 31 places
Andreas Rheinhardt [Tue, 14 Jan 2020 03:13:30 +0000 (04:13 +0100)]
avformat/segafilmenc: Fix undefined left shift of 1 by 31 places

by changing the type to unsigned.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavutil/avstring: Fix warning: ISO C90 forbids mixed declarations and code
Limin Wang [Mon, 13 Jan 2020 13:44:49 +0000 (21:44 +0800)]
avutil/avstring: Fix warning: ISO C90 forbids mixed declarations and code

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavfilter/vf_eq: cosmetics
Limin Wang [Mon, 13 Jan 2020 13:49:43 +0000 (21:49 +0800)]
avfilter/vf_eq: cosmetics

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/v4l2_context: Use AVERROR macro
Andriy Gelman [Mon, 13 Jan 2020 04:11:28 +0000 (23:11 -0500)]
avcodec/v4l2_context: Use AVERROR macro

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavfilter/avf_showspectrum: check if frame clone is set
Paul B Mahol [Tue, 14 Jan 2020 15:46:50 +0000 (16:46 +0100)]
avfilter/avf_showspectrum: check if frame clone is set