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

4 years agoavfilter/f_ebur128: check if frame clone is set
Paul B Mahol [Tue, 14 Jan 2020 15:43:45 +0000 (16:43 +0100)]
avfilter/f_ebur128: check if frame clone is set

4 years agoavfilter/avf_aphasemeter: check if clone frame is set
Paul B Mahol [Tue, 14 Jan 2020 15:41:15 +0000 (16:41 +0100)]
avfilter/avf_aphasemeter: check if clone frame is set

4 years agoavfilter/avf_ahistogram: check if frame clone is set
Paul B Mahol [Tue, 14 Jan 2020 15:38:49 +0000 (16:38 +0100)]
avfilter/avf_ahistogram: check if frame clone is set

4 years agoavfilter/asr_anullsrc: remove pointless frame cloning
Paul B Mahol [Tue, 14 Jan 2020 15:24:07 +0000 (16:24 +0100)]
avfilter/asr_anullsrc: remove pointless frame cloning

4 years agoavfilter/af_anequalizer: check if frame clone is set
Paul B Mahol [Tue, 14 Jan 2020 15:14:46 +0000 (16:14 +0100)]
avfilter/af_anequalizer: check if frame clone is set

4 years agoavfilter/af_aiir: check if frame clone is set
Paul B Mahol [Tue, 14 Jan 2020 15:11:45 +0000 (16:11 +0100)]
avfilter/af_aiir: check if frame clone is set

4 years agoavfilter/af_afir: check if frame clone is set
Paul B Mahol [Tue, 14 Jan 2020 15:07:35 +0000 (16:07 +0100)]
avfilter/af_afir: check if frame clone is set

4 years agoavfilter/avf_avectorscope: check if clone frame is set
Paul B Mahol [Tue, 14 Jan 2020 13:22:17 +0000 (14:22 +0100)]
avfilter/avf_avectorscope: check if clone frame is set

4 years agolavfi/dnn_processing: refine code to use function av_image_copy_plane for data copy
Guo, Yejun [Mon, 13 Jan 2020 11:37:56 +0000 (19:37 +0800)]
lavfi/dnn_processing: refine code to use function av_image_copy_plane for data copy

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
4 years agofate/filter-video: add two tests for dnn_processing with frame format rgb24 and grayf32
Guo, Yejun [Wed, 8 Jan 2020 06:43:59 +0000 (14:43 +0800)]
fate/filter-video: add two tests for dnn_processing with frame format rgb24 and grayf32

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
4 years agoavfilter/f_drawgraph: add rate/r option
Paul B Mahol [Tue, 14 Jan 2020 08:52:02 +0000 (09:52 +0100)]
avfilter/f_drawgraph: add rate/r option

4 years agotiffdec: support embedded ICC profiles
Lynne [Fri, 10 Jan 2020 21:55:19 +0000 (21:55 +0000)]
tiffdec: support embedded ICC profiles

4 years agolavfi/volume: enable runtime change flag
Jun Zhao [Sat, 11 Jan 2020 01:28:33 +0000 (09:28 +0800)]
lavfi/volume: enable runtime change flag

 enable runtime change flag.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agolavfi/zscale: enable runtime change flag
Jun Zhao [Sat, 11 Jan 2020 02:28:50 +0000 (10:28 +0800)]
lavfi/zscale: enable runtime change flag

enable runtime change flag

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agolavfi/firequalizer: enable runtime change flag
Jun Zhao [Sat, 11 Jan 2020 02:28:11 +0000 (10:28 +0800)]
lavfi/firequalizer: enable runtime change flag

enable runtime change flag

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agolavfi/eq: enable runtime change flag
Jun Zhao [Sat, 11 Jan 2020 02:14:57 +0000 (10:14 +0800)]
lavfi/eq: enable runtime change flag

enable runtime change flag

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agolavfi/rotate: enable runtime change flag
Jun Zhao [Sat, 11 Jan 2020 02:14:25 +0000 (10:14 +0800)]
lavfi/rotate: enable runtime change flag

enable runtime change flag

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agolavfi/streamselect: enable runtime change flag
Jun Zhao [Sat, 11 Jan 2020 01:56:46 +0000 (09:56 +0800)]
lavfi/streamselect: enable runtime change flag

enable runtime change flag.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agolavfi/scale: enable runtime change flag
Jun Zhao [Sat, 11 Jan 2020 01:31:40 +0000 (09:31 +0800)]
lavfi/scale: enable runtime change flag

enable runtime change flag.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agolavfi/hue: enable runtime change flag
Jun Zhao [Sat, 11 Jan 2020 01:30:46 +0000 (09:30 +0800)]
lavfi/hue: enable runtime change flag

enable runtime change flag.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agolavfi/crop: enable runtime change flag
Jun Zhao [Sat, 11 Jan 2020 01:29:46 +0000 (09:29 +0800)]
lavfi/crop: enable runtime change flag

enable runtime change flag.

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agolavfi/spp: enable runtime change flag
Jun Zhao [Sat, 11 Jan 2020 01:56:10 +0000 (09:56 +0800)]
lavfi/spp: enable runtime change flag

enable runtime change flag.

Reviewe-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agolavfi/spp: add "quality" option in runtime change path
Jun Zhao [Fri, 10 Jan 2020 11:48:02 +0000 (19:48 +0800)]
lavfi/spp: add "quality" option in runtime change path

it's stranage to use option "level" in runtime change path but used
"quality" in option, add "quality" in runtime change path, it's more
intuitive and keep the "level" for compatibility.

Reviewe-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agotools/target_dec_fuzzer: Adjust threshold for RASC
Michael Niedermayer [Wed, 11 Dec 2019 21:03:52 +0000 (22:03 +0100)]
tools/target_dec_fuzzer: Adjust threshold for RASC

Fixes: Timeout(35sec -> 4sec)
Fixes: 19289/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RASC_fuzzer-5676526398078976
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_h2645: Skip all 0 NAL units
Michael Niedermayer [Wed, 11 Dec 2019 18:19:49 +0000 (19:19 +0100)]
avcodec/cbs_h2645: Skip all 0 NAL units

Fixes: assertion failure
Fixes: 19286/clusterfuzz-testcase-minimized-ffmpeg_BSF_H264_REDUNDANT_PPS_fuzzer-5707990724509696
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/adpcm: Fix overflow in FFABS() IMA_EA_EACS
Michael Niedermayer [Fri, 6 Dec 2019 23:14:16 +0000 (00:14 +0100)]
avcodec/adpcm: Fix overflow in FFABS() IMA_EA_EACS

Fixes: negation of -2147483648 cannot be represented in type 'int'; cast to an unsigned type to negate this value to itself
Fixes: 19235/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_IMA_EA_EACS_fuzzer-5680878952382464
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/alac: Fix integer overflow in LPC coefficient adaption
Michael Niedermayer [Sat, 7 Dec 2019 19:42:54 +0000 (20:42 +0100)]
avcodec/alac: Fix integer overflow in LPC coefficient adaption

Fixes: signed integer overflow: 267693597 * 10 cannot be represented in type 'int'
Fixes: 19237/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-5755407700328448
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/g729postfilter: Optimize out overflowing multiplication from apply_tilt_comp()
Michael Niedermayer [Sat, 7 Dec 2019 19:38:13 +0000 (20:38 +0100)]
avcodec/g729postfilter: Optimize out overflowing multiplication from apply_tilt_comp()

Fixes: signed integer overflow: -1114392282 * 2 cannot be represented in type 'int'
Fixes: 19236/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_G729_fuzzer-5741678938030080
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 agolibavcodec/vc1: Remove bits variable
Michael Niedermayer [Sun, 8 Dec 2019 21:16:14 +0000 (22:16 +0100)]
libavcodec/vc1: Remove bits variable

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/vc1dec: Check field_mode for sprites
Michael Niedermayer [Sun, 8 Dec 2019 19:18:07 +0000 (20:18 +0100)]
avcodec/vc1dec: Check field_mode for sprites

Fixes: Out of array read
Fixes: 19263/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-5389219325542400
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/vc1dec: Limit bits by the actual bitstream size
Michael Niedermayer [Sun, 8 Dec 2019 18:37:46 +0000 (19:37 +0100)]
avcodec/vc1dec: Limit bits by the actual bitstream size

Fixes: Timeout (350 ->19sec)
Fixes: 19249/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_VC1IMAGE_fuzzer-6566896438870016
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/wavpack: simplify the code
Limin Wang [Sat, 11 Jan 2020 05:31:06 +0000 (13:31 +0800)]
avcodec/wavpack: simplify the code

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavfilter: add freezeframes video filter
Paul B Mahol [Tue, 31 Dec 2019 11:00:30 +0000 (12:00 +0100)]
avfilter: add freezeframes video filter

4 years agoavformat/matroskaenc: Fix ReferenceBlock timestamp
Andreas Rheinhardt [Wed, 1 Jan 2020 00:58:18 +0000 (01:58 +0100)]
avformat/matroskaenc: Fix ReferenceBlock timestamp

In order to indicate that the frames in a BlockGroup are not keyframes,
one has to add a ReferenceBlock element containing the timestamp of a
referenced Block that has already been written. The timestamp ought to be
relative to the timestamp of the Block it is attached to. Yet the
Matroska muxer used the relative timestamp of the preceding Block of the
track, i.e. the timestamp of the preceding block relative to the
timestamp of the Cluster containing said block (that need not be the
Cluster containing the current Block). This has been fixed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavfilter/af_dynaudnorm: use better limits for maximal amplification
Paul B Mahol [Sat, 11 Jan 2020 13:08:52 +0000 (14:08 +0100)]
avfilter/af_dynaudnorm: use better limits for maximal amplification

Fixes regression in smoothness of amplification.

4 years agoavfilter/af_amix: change the max range of the number of inputs
Limin Wang [Mon, 6 Jan 2020 13:48:38 +0000 (21:48 +0800)]
avfilter/af_amix: change the max range of the number of inputs

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agoavfilter/vf_mix: change the max range of the number of inputs
Limin Wang [Mon, 6 Jan 2020 13:48:39 +0000 (21:48 +0800)]
avfilter/vf_mix: change the max range of the number of inputs

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
4 years agodoc/general: update table AV1 entry for librav1e
Gyan Doshi [Sat, 11 Jan 2020 05:31:17 +0000 (11:01 +0530)]
doc/general: update table AV1 entry for librav1e

4 years agodoc/general: Add avs2 decoder/encoder entry
Jun Zhao [Sat, 11 Jan 2020 04:12:24 +0000 (12:12 +0800)]
doc/general: Add avs2 decoder/encoder entry

Add avs2 decoder/encoder entry

Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
4 years agoavformat/img2dec: add option to provide metadata fields related to input path
Alexandre Heitor Schmidt [Wed, 1 Jan 2020 16:57:02 +0000 (16:57 +0000)]
avformat/img2dec: add option to provide metadata fields related to input path

libavformat/img2.h: New field export_path_metadata to
VideoDemuxData to only allow the use of the extra metadata
upon explicit user request, for security reasons.

libavformat/img2dec.c: Modify image2 demuxer to make available
two special metadata entries called lavf.image2dec.source_path
and lavf.image2dec.source_basename, which represents, respectively,
the complete path to the source image for the current frame and
the basename i.e. the file name related to the current frame.
These can then be used by filters like drawtext and others. The
metadata fields will only be available when explicitly enabled
with image2 option -export_path_metadata 1.

doc/demuxers.texi: Documented the new metadata fields available
for image2 and how to use them.

doc/filters.texi: Added an example on how to use the new metadata
fields with drawtext filter, in order to plot the input file path
to each output frame.

Usage example:

ffmpeg -f image2 -export_path_metadata 1 -pattern_type glob
 -framerate 18 -i '/path/to/input/files/*.jpg'
 -filter_complex drawtext="fontsize=40:fontcolor=white:
 fontfile=FreeSans.ttf:borderw=2:bordercolor=black:
 text='%{metadata\:lavf.image2dec.source_basename\:NA}':x=5:y=50"
 output.avi

Fixes #2874.

Signed-off-by: Alexandre Heitor Schmidt <alexandre.schmidt@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat/mov: Use AV_DICT_DONT_STRDUP_VAL to avoid av_strdup
Andreas Rheinhardt [Sun, 10 Nov 2019 04:07:33 +0000 (05:07 +0100)]
avformat/mov: Use AV_DICT_DONT_STRDUP_VAL to avoid av_strdup

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

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavfilter/vf_showinfo: fix the integer handling issues
Limin Wang [Thu, 9 Jan 2020 01:02:11 +0000 (09:02 +0800)]
avfilter/vf_showinfo: fix the integer handling issues

Fixes CID 1457606 and 1457607

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/utils: replace avctx->internal with avci for better readability
Limin Wang [Thu, 9 Jan 2020 01:04:33 +0000 (09:04 +0800)]
avcodec/utils: replace avctx->internal with avci for better readability

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavfilter/f_metadata: allow direct flushing when printing to file
Gyan Doshi [Tue, 7 Jan 2020 12:00:34 +0000 (17:30 +0530)]
avfilter/f_metadata: allow direct flushing when printing to file

Useful for monitoring sparse data in realtime

4 years agofate: Don't use depreceated keepside option
Andreas Rheinhardt [Mon, 30 Dec 2019 12:43:27 +0000 (13:43 +0100)]
fate: Don't use depreceated keepside option

The tests for concat use this option which is scheduled for removal and
does nothing any more. So remove it; otherwise, these tests would fail
at the next major version bump.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavfilter/af_afir: add support for switching impulse response streams at runtime
Paul B Mahol [Thu, 9 Jan 2020 19:06:57 +0000 (20:06 +0100)]
avfilter/af_afir: add support for switching impulse response streams at runtime

Currently, switching is not free of artifacts, to be resolved later.

4 years agoavfilter/af_afir: add support for even smaller partition sizes
Paul B Mahol [Thu, 9 Jan 2020 17:32:11 +0000 (18:32 +0100)]
avfilter/af_afir: add support for even smaller partition sizes

4 years agoavfilter/af_afir: split input frames from impulse response frames
Paul B Mahol [Wed, 8 Jan 2020 18:23:45 +0000 (19:23 +0100)]
avfilter/af_afir: split input frames from impulse response frames

4 years agoavformat/id3v2enc: fix bad ID3v2 tag length
Gilles Bouthenot [Wed, 8 Jan 2020 18:47:55 +0000 (19:47 +0100)]
avformat/id3v2enc: fix bad ID3v2 tag length

4 years agomovenc: Write durations based on pts into mvhd/mdhd/tkhd/elst
Martin Storsjö [Fri, 13 Dec 2019 23:00:20 +0000 (01:00 +0200)]
movenc: Write durations based on pts into mvhd/mdhd/tkhd/elst

Keep all the existing data fields as they are (there's lots and
lots of nontrivial calculation and heuristics based on them in
their current form), but derive the duration as the difference
between the pts of the first packet to the maximum pts+duration
(not necessarily the last packet); use this duration in any box
where the actual presentation duration is supposed to be.

Fixes: 8420
Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agonvenc: implement flush to help allow an encoder to be re-used
Philip Langdale [Fri, 20 Dec 2019 23:34:33 +0000 (15:34 -0800)]
nvenc: implement flush to help allow an encoder to be re-used

It can be useful to re-use an encoder instance when doing segmented
encodings, and this requires flushing the encoder at the start of
each segment.

4 years agoavformat/utils: Remove redundant save+restore
Andreas Rheinhardt [Tue, 8 Oct 2019 05:41:15 +0000 (07:41 +0200)]
avformat/utils: Remove redundant save+restore

If the size of the input packet is zero, av_grow_packet() used to call
av_new_packet() which would initialize the packet and (in particular)
reset the pos field. This behaviour (which was never documented and
arguably always contradicted the documented behaviour) was changed in
2fe04630. This means that it is unnecessary to save and restore the
packet's position in append_packet_chunked().

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavcodec/proresenc_anatoliy: Fix invalid left shift of negative number
Andreas Rheinhardt [Wed, 8 Jan 2020 18:29:13 +0000 (19:29 +0100)]
avcodec/proresenc_anatoliy: Fix invalid left shift of negative number

This fixes ticket #7997 as well as the vsynth*-prores_# FATE-tests
(where * ranges over { 1, 2, 3, _lena } and # over { , _int, _444,
_444_int }).

(Given that prev_dc is in the range -0xC000..0x3FFF, no overflow can
happen upon multiplication with 2.)

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agocmdutils: Fix compilation on cygwin wrt SetDllDirectory and GetModuleHandle
Martin Storsjö [Wed, 8 Jan 2020 11:29:07 +0000 (13:29 +0200)]
cmdutils: Fix compilation on cygwin wrt SetDllDirectory and GetModuleHandle

After 06ec9c4746ebc1d3b613c1847e434bbd0b4407b4 we check for these
functions in configure (which will succeed in cygwin), but cmdutils.c
only includes windows.h if _WIN32 is defined (which it isn't in cygwin).

Retain the old intent from before 06ec9c4746ebc1d3b613c1847e434bbd0b4407b4,
that these functions only would be used when _WIN32 is defined, while
only using them if configure has agreed that they do exist.

Signed-off-by: Martin Storsjö <martin@martin.st>
4 years agoavfilter/aformat: add shorthand names for options
Gyan Doshi [Tue, 7 Jan 2020 10:20:09 +0000 (15:50 +0530)]
avfilter/aformat: add shorthand names for options

4 years agoavformat/wtvdec: Cosmetics
Andreas Rheinhardt [Tue, 7 Jan 2020 13:55:49 +0000 (14:55 +0100)]
avformat/wtvdec: Cosmetics

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavformat/wtvdec: Fix memleak when reading header fails
Andreas Rheinhardt [Tue, 7 Jan 2020 13:55:48 +0000 (14:55 +0100)]
avformat/wtvdec: Fix memleak when reading header fails

Fixes #8314.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: James Almer <jamrial@gmail.com>
4 years agoavcodec/h264_metadata_bsf: Fix for the incorrect user data with hyphens
Limin Wang [Tue, 7 Jan 2020 05:03:52 +0000 (13:03 +0800)]
avcodec/h264_metadata_bsf: Fix for the incorrect user data with hyphens

How to reproduce:
./ffmpeg -f lavfi -i testsrc -c:v libx264 -g 25 -bsf:v h264_metadata=sei_user_data=186f3693-b7b3-4f2c-9653-21492feee5b8+hello -frames:v 1 h264.mp4

master:
[Parsed_showinfo_0 @ 0x7fc8a0703180] UUID=186f3693-7030-4f2c-6030-21492feee5b8
[Parsed_showinfo_0 @ 0x7fc8a0703180] User Data=hello

Applied the patch:
[Parsed_showinfo_0 @ 0x7f969d408e00] UUID=186f3693-b7b3-4f2c-9653-21492feee5b8
[Parsed_showinfo_0 @ 0x7f969d408e00] User Data=hello

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agolavf/libsrt: Fix typo
Anthony Delannoy [Mon, 6 Jan 2020 17:36:18 +0000 (18:36 +0100)]
lavf/libsrt: Fix typo

Reviewed-by: "mypopy@gmail.com" <mypopy@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/dashenc: Fix leak of AVFormatContext on error
Andreas Rheinhardt [Tue, 7 Jan 2020 13:55:46 +0000 (14:55 +0100)]
avformat/dashenc: Fix leak of AVFormatContext on error

The Dash muxer uses submuxers and when one such submuxer has been allocated,
it is initially only stored in a temporary variable. Therefore it leaks
if an error happens between the allocation and storing it permanently.
This commit changes this.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: "Jeyapal, Karthick" <kjeyapal@akamai.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/mpjpeg: Remove mpjpeg_write_trailer
Andreas Rheinhardt [Tue, 7 Jan 2020 13:55:45 +0000 (14:55 +0100)]
avformat/mpjpeg: Remove mpjpeg_write_trailer

It does nothing.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat: Improve returned error codes
Andreas Rheinhardt [Tue, 7 Jan 2020 13:55:44 +0000 (14:55 +0100)]
avformat: Improve returned error codes

This commit improves returned error codes by forwarding error codes. In
some instances, the hardcoded returned error codes made no sense at all:
The normal error code for failure of av_new_packet() is AVERROR(ENOMEM),
yet there were instances where AVERROR(EIO) was returned.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/fitsdec: Fix potential leak of string in AVBPrint
Andreas Rheinhardt [Tue, 7 Jan 2020 13:55:42 +0000 (14:55 +0100)]
avformat/fitsdec: Fix potential leak of string in AVBPrint

by freeing it a bit earlier.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat/avs: Remove avs_read_close()
Andreas Rheinhardt [Tue, 7 Jan 2020 13:55:41 +0000 (14:55 +0100)]
avformat/avs: Remove avs_read_close()

It did nothing.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
4 years agoavformat: convert some avio_flush() calls to avio_write_marker(AVIO_DATA_MARKER_FLUSH...
Marton Balint [Fri, 27 Dec 2019 12:53:00 +0000 (13:53 +0100)]
avformat: convert some avio_flush() calls to avio_write_marker(AVIO_DATA_MARKER_FLUSH_POINT)

Converting explicit avio_flush() calls helps us to buffer more data and avoid
flushing the IO context too often which causes reduced IO throughput for
non-streamed file output.

The user can control FLUSH_POINT flushing behaviour using the -flush_packets
option, the default typically means to flush unless a non-streamed file output
is used, so this change should have no adverse effect on streaming even if it
is assumed that after an avio_flush() the output buffer is clean so small
seekbacks within the output buffer will work even when the IO context is not
seekable.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat: remove more unneeded avio_flush() calls
Marton Balint [Sat, 4 Jan 2020 20:14:46 +0000 (21:14 +0100)]
avformat: remove more unneeded avio_flush() calls

These instances are simply redundant or present because avio_flush() used to be
required before doing a seekback. That is no longer the case, aviobuf code does
the flush automatically on seek.

This only affects code which is either disabled for streaming IO contexts or
does no seekbacks after the flush, so this change should have no adverse effect
on streaming.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat: remove avio_flush() calls from the end of write_packet functions
Marton Balint [Sat, 4 Jan 2020 19:32:26 +0000 (20:32 +0100)]
avformat: remove avio_flush() calls from the end of write_packet functions

Removing explicit avio_flush() calls helps us to buffer more data and avoid
flushing the IO context too often which causes reduced IO throughput for
non-streamed file output.

The user can control flushing behaviour at the end of every packet using the
-flush_packets option, the default typically means to flush unless a
non-streamed file output is used.

Therefore this change should have no adverse effect on streaming, even if it is
assumed that a new packet has a clean buffer so small seekbacks within the
output buffer work even when the IO context is not seekable.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat: remove unneeded avio_flush() calls from the end of write_trailer functions
Marton Balint [Sat, 4 Jan 2020 18:31:14 +0000 (19:31 +0100)]
avformat: remove unneeded avio_flush() calls from the end of write_trailer functions

The IO context is always flushed by libavformat/mux.c after write_trailer is
called, so this change should have no effect at all.

4 years agoavformat: remove avio_flush() calls from the end of write_header functions
Marton Balint [Sat, 4 Jan 2020 18:03:24 +0000 (19:03 +0100)]
avformat: remove avio_flush() calls from the end of write_header functions

To make it consistent with other muxers.

The user can still control the generic flushing behaviour after write_header
(same way as after packets) using the -flush_packets option, the default
typically means to flush unless a non-streamed file output is used.

Therefore this change should have no adverse effect on streaming, even if it is
assumed that the first packet has a clean buffer, so small seekbacks within the
output buffer work even when the IO context is not seekable.

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agoavformat: remove unneeded avio_flush() calls before calling avio_close_dyn_buf()
Marton Balint [Fri, 27 Dec 2019 13:18:20 +0000 (14:18 +0100)]
avformat: remove unneeded avio_flush() calls before calling avio_close_dyn_buf()

avio_close_dyn_buf() also does avio_flush().

Signed-off-by: Marton Balint <cus@passwd.hu>
4 years agovf_dnn_processing: add support for more formats gray8 and grayf32
Guo, Yejun [Fri, 27 Dec 2019 08:34:20 +0000 (16:34 +0800)]
vf_dnn_processing: add support for more formats gray8 and grayf32

The following is a python script to halve the value of the gray
image. It demos how to setup and execute dnn model with python+tensorflow.
It also generates .pb file which will be used by ffmpeg.

import tensorflow as tf
import numpy as np
from skimage import color
from skimage import io
in_img = io.imread('input.jpg')
in_img = color.rgb2gray(in_img)
io.imsave('ori_gray.jpg', np.squeeze(in_img))
in_data = np.expand_dims(in_img, axis=0)
in_data = np.expand_dims(in_data, axis=3)
filter_data = np.array([0.5]).reshape(1,1,1,1).astype(np.float32)
filter = tf.Variable(filter_data)
x = tf.placeholder(tf.float32, shape=[1, None, None, 1], name='dnn_in')
y = tf.nn.conv2d(x, filter, strides=[1, 1, 1, 1], padding='VALID', name='dnn_out')
sess=tf.Session()
sess.run(tf.global_variables_initializer())
graph_def = tf.graph_util.convert_variables_to_constants(sess, sess.graph_def, ['dnn_out'])
tf.train.write_graph(graph_def, '.', 'halve_gray_float.pb', as_text=False)
print("halve_gray_float.pb generated, please use \
path_to_ffmpeg/tools/python/convert.py to generate halve_gray_float.model\n")
output = sess.run(y, feed_dict={x: in_data})
output = output * 255.0
output = output.astype(np.uint8)
io.imsave("out.jpg", np.squeeze(output))

To do the same thing with ffmpeg:
- generate halve_gray_float.pb with the above script
- generate halve_gray_float.model with tools/python/convert.py
- try with following commands
  ./ffmpeg -i input.jpg -vf format=grayf32,dnn_processing=model=halve_gray_float.model:input=dnn_in:output=dnn_out:dnn_backend=native out.native.png
  ./ffmpeg -i input.jpg -vf format=grayf32,dnn_processing=model=halve_gray_float.pb:input=dnn_in:output=dnn_out:dnn_backend=tensorflow out.tf.png

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>
4 years agovf_dnn_processing: remove parameter 'fmt'
Guo, Yejun [Fri, 27 Dec 2019 08:34:15 +0000 (16:34 +0800)]
vf_dnn_processing: remove parameter 'fmt'

do not request AVFrame's format in vf_ddn_processing with 'fmt',
but to add another filter for the format.

command examples:
./ffmpeg -i input.jpg -vf format=bgr24,dnn_processing=model=halve_first_channel.model:input=dnn_in:output=dnn_out:dnn_backend=native -y out.native.png
./ffmpeg -i input.jpg -vf format=rgb24,dnn_processing=model=halve_first_channel.model:input=dnn_in:output=dnn_out:dnn_backend=native -y out.native.png

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
Signed-off-by: Pedro Arthur <bygrandao@gmail.com>