]> git.sesse.net Git - ffmpeg/log
ffmpeg
6 years agoavcodec/mpeg4_unpack_bframes: cache input packets directly
James Almer [Wed, 21 Mar 2018 00:59:10 +0000 (21:59 -0300)]
avcodec/mpeg4_unpack_bframes: cache input packets directly

Avoids unnecessary allocs+copies and makes the code slightly simpler.

Signed-off-by: James Almer <jamrial@gmail.com>
6 years agoavcodec/mediacodecdec: refactor pts handling
Aman Gupta [Tue, 24 Apr 2018 20:51:15 +0000 (13:51 -0700)]
avcodec/mediacodecdec: refactor pts handling

Also fixes a bug where EOS buffer was sent with incorrect
pts when not using surface generation.

Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
Signed-off-by: Aman Gupta <aman@tmm1.net>
6 years agoavcodec/mediacodecdec: use AV_TIME_BASE_Q
Aman Gupta [Tue, 24 Apr 2018 20:45:30 +0000 (13:45 -0700)]
avcodec/mediacodecdec: use AV_TIME_BASE_Q

Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
Signed-off-by: Jan Ekström <jeebjp@gmail.com>
Signed-off-by: Aman Gupta <aman@tmm1.net>
6 years agoavcodec/mediacodecdec: clarify delay_flush specific code
Aman Gupta [Tue, 24 Apr 2018 02:21:19 +0000 (19:21 -0700)]
avcodec/mediacodecdec: clarify delay_flush specific code

As of 2a0eb8685, ff_mediacodec_dec_is_flushing() only returns
true in delay_flush mode. Make this more obvious by adding
delay_flush to the if statement.

Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com>
Signed-off-by: Aman Gupta <aman@tmm1.net>
6 years agoavformat/yuv4mpegdec: fix seeking backwards
Paul B Mahol [Wed, 25 Apr 2018 16:30:46 +0000 (18:30 +0200)]
avformat/yuv4mpegdec: fix seeking backwards

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agoavfiler/vf_mix: fix crash with >8 bit depth
Paul B Mahol [Wed, 25 Apr 2018 12:08:21 +0000 (14:08 +0200)]
avfiler/vf_mix: fix crash with >8 bit depth

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agomake swresample optional for ffmpeg
Paul B Mahol [Thu, 12 Apr 2018 20:15:05 +0000 (22:15 +0200)]
make swresample optional for ffmpeg

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agoavcodec/vc1_block: simplify ac_val computation
Michael Niedermayer [Mon, 23 Apr 2018 00:08:10 +0000 (02:08 +0200)]
avcodec/vc1_block: simplify ac_val computation

also fixes: runtime error: index 1456 out of bounds for type 'int16_t [16]'

Found-by: durandal_1707
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/clearvideo: display warning if decoder overreads input
Paul B Mahol [Tue, 24 Apr 2018 15:20:26 +0000 (17:20 +0200)]
avcodec/clearvideo: display warning if decoder overreads input

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agoavcodec/clearvideo: do not try to return frame when it is same as previous one
Paul B Mahol [Tue, 24 Apr 2018 15:10:26 +0000 (17:10 +0200)]
avcodec/clearvideo: do not try to return frame when it is same as previous one

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agoavcodec/ffv1enc: Check that the crc + version combination is supported
Michael Niedermayer [Sat, 21 Apr 2018 20:19:31 +0000 (22:19 +0200)]
avcodec/ffv1enc: Check that the crc + version combination is supported

The crc flag is only stored since version 3 thus before this crcs do not
work. We increase the version as needed same as we do with pix_fmts

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/vaapi: do not parse MVMODE for VC-1 interlaced frame pictures
Jerome Borsboom [Thu, 29 Mar 2018 11:43:34 +0000 (13:43 +0200)]
avcodec/vaapi: do not parse MVMODE for VC-1 interlaced frame pictures

Interlaced frame pictures do not contain the MVMODE or MVMODE2 bitstream
element. Trying to parse this element and passing a nonzero value to the
hardware decoder results in small inaccuracies in the decoded picture.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
6 years agoavcodec/vc1: check return value of bitplane_decoding()
Paul B Mahol [Sun, 22 Apr 2018 22:05:20 +0000 (00:05 +0200)]
avcodec/vc1: check return value of bitplane_decoding()

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agoavfilter/vf_interlace: remove duplicate code with same funcionality
Vasile Toncu [Tue, 17 Apr 2018 10:48:28 +0000 (13:48 +0300)]
avfilter/vf_interlace: remove duplicate code with same funcionality

6 years agoRevert "libavformat: add mbedTLS based TLS"
Rostislav Pehlivanov [Mon, 23 Apr 2018 19:28:50 +0000 (20:28 +0100)]
Revert "libavformat: add mbedTLS based TLS"

This reverts commit 62f5c9d68bf6e0f2c1a47cf002629a70a82274fc,
which was pushed a bit prematurely.

6 years agolibavformat: add mbedTLS based TLS
Thomas Volkert [Sat, 21 Apr 2018 13:53:31 +0000 (15:53 +0200)]
libavformat: add mbedTLS based TLS

6 years agolavf/os_support: Only compile inet_aton() if getaddrinfo() is needed.
Carl Eugen Hoyos [Sun, 15 Apr 2018 23:28:47 +0000 (01:28 +0200)]
lavf/os_support: Only compile inet_aton() if getaddrinfo() is needed.

Silences a warning:
libavformat/os_support.c:49:12: warning: 'inet_aton' defined but not used

Reported-by: Reino Wijnsma
6 years agoavformat/vpcc: add ff_isom_get_vpcc_features()
James Almer [Sat, 13 Jan 2018 19:04:55 +0000 (16:04 -0300)]
avformat/vpcc: add ff_isom_get_vpcc_features()

Should be useful for muxers that require values as defined in the
vpcc atom but don't need to write the atom itself.

Signed-off-by: James Almer <jamrial@gmail.com>
6 years agoswscale/swscale_unscaled : add X86_64 (SSE2 and AVX) for uyvyto422
Martin Vignali [Sun, 22 Apr 2018 17:14:23 +0000 (19:14 +0200)]
swscale/swscale_unscaled : add X86_64 (SSE2 and AVX) for uyvyto422

and checkasm test

6 years agoavcodec/prores_ks : use official quant_matrix (for proxy and xq codec luma and chroma...
Martin Vignali [Fri, 13 Apr 2018 18:50:18 +0000 (20:50 +0200)]
avcodec/prores_ks : use official quant_matrix (for proxy and xq codec luma and chroma quant matrix is not the same)

disable the use of the official luma xq matrix for now (output
appear to be desaturate)

6 years agoavformat/dsfdec: fix calculation of size of data chunk
Paul B Mahol [Sun, 22 Apr 2018 11:14:26 +0000 (13:14 +0200)]
avformat/dsfdec: fix calculation of size of data chunk

Ignore extra 12 bytes that belong to tag and size.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agoavformat/dsfdec: properly handle padded last packet
Paul B Mahol [Sun, 22 Apr 2018 09:52:32 +0000 (11:52 +0200)]
avformat/dsfdec: properly handle padded last packet

Fixes #5489.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agodoc/examples/filtering_audio: Remove setting deprecated refcounted_frames
Jun Zhao [Sat, 21 Apr 2018 07:36:59 +0000 (15:36 +0800)]
doc/examples/filtering_audio: Remove setting deprecated refcounted_frames

When use new decode APIs(avcodec_send_packet/avcodec_receive_frame),
don't need to setting the deprecated field refcounted_frames.

Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Jun Zhao <mypopydev@gmail.com>
6 years agodoc/examples/filtering_video: Remove setting deprecated refcounted_frames
Jun Zhao [Sat, 21 Apr 2018 07:34:23 +0000 (15:34 +0800)]
doc/examples/filtering_video: Remove setting deprecated refcounted_frames

When use new decode APIs(avcodec_send_packet/avcodec_receive_frame),
don't need to setting the deprecated field refcounted_frames.

Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Jun Zhao <mypopydev@gmail.com>
6 years agodoc/examples/hw_decode: Remove setting deprecated refcounted_frames
Jun Zhao [Sat, 21 Apr 2018 07:28:27 +0000 (15:28 +0800)]
doc/examples/hw_decode: Remove setting deprecated refcounted_frames

When use new decode APIs(avcodec_send_packet/avcodec_receive_frame),
don't need to setting the deprecated field refcounted_frames.

Reviewed-by: wm4 <nfxjfg@googlemail.com>
Signed-off-by: Jun Zhao <mypopydev@gmail.com>
6 years agoavformat/segafilm - revert keyframe detection
Gyan Doshi [Sat, 21 Apr 2018 07:14:12 +0000 (12:44 +0530)]
avformat/segafilm - revert keyframe detection

Keyframe detection was inverted in cfe1a9d311 in order to fix keyframe
flags set for the sample attached to trac #7091. However, that sample is
errantly muxed.

As noted at
https://web.archive.org/web/20020803104640/http://www.pcisys.net:80/~melanson/codecs/film-format.txt,
the original keyframe detection logic is correct, and this patch
restores it.

Signed-off-by: James Almer <jamrial@gmail.com>
6 years agoavcodec/vc1_pred: set ref_field_type earlier
Jerome Borsboom [Sat, 21 Apr 2018 19:05:28 +0000 (21:05 +0200)]
avcodec/vc1_pred: set ref_field_type earlier

scaleforsame_y references ref_field_type. Therefore, it needs to be set
before scaleforsame is called.

Fixes #2557.

Signed-off-by: Jerome Borsboom <jerome.borsboom@carpalis.nl>
6 years agolavf/dashdec: Do not use memcpy() to copy a struct.
Carl Eugen Hoyos [Wed, 18 Apr 2018 17:42:57 +0000 (19:42 +0200)]
lavf/dashdec: Do not use memcpy() to copy a struct.

Fixes a warning:
libavformat/dashdec.c:1900:65: warning: argument to 'sizeof' in 'memcpy' call is the same pointer type 'struct fragment *' as the destination; expected 'struct fragment' or an explicit length

6 years agolavf/qsv: clone the frame which may be managed by framework
Ruiling Song [Tue, 3 Apr 2018 01:50:20 +0000 (09:50 +0800)]
lavf/qsv: clone the frame which may be managed by framework

For filters based on framesync, the input frame was managed
by framesync, so we should not directly keep and destroy it,
instead we make a clone of it here, or else double-free will occur.
But for other filters not based on framesync, we still need to
free the input frame inside filter_frame.

Signed-off-by: Ruiling Song <ruiling.song@intel.com>
6 years agolavf: make overlay_qsv work based on framesync
Ruiling Song [Tue, 3 Apr 2018 01:50:19 +0000 (09:50 +0800)]
lavf: make overlay_qsv work based on framesync

The existing version which was cherry-picked from Libav does not work
with FFmpeg framework, because ff_request_frame() was totally
different between Libav (recursive) and FFmpeg (non-recursive).
The existing overlay_qsv implementation depends on the recursive version
of ff_request_frame to trigger immediate call to request_frame() on input pad.
But this has been removed in FFmpeg since "lavfi: make request_frame() non-recursive."
Now that we have handy framesync support in FFmpeg, so I make it work
based on framesync. Some other fixing which is also needed to make
overlay_qsv work are put in a separate patch.

Signed-off-by: Ruiling Song <ruiling.song@intel.com>
6 years agoavfilter: add deblock filter
Paul B Mahol [Tue, 17 Apr 2018 15:33:00 +0000 (17:33 +0200)]
avfilter: add deblock filter

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agoavformat/mov: Fix parsing of saio/siaz atoms in encrypted content.
Jacob Trimble [Thu, 7 Dec 2017 00:17:54 +0000 (16:17 -0800)]
avformat/mov: Fix parsing of saio/siaz atoms in encrypted content.

This doesn't support saio atoms with more than one offset.

Signed-off-by: Jacob Trimble <modmaker@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavformat/utils: refactor upstream_stream_timings
Aman Gupta [Thu, 19 Apr 2018 23:50:43 +0000 (16:50 -0700)]
avformat/utils: refactor upstream_stream_timings

Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavformat/utils: ignore outlier durations on subtitle/data streams as well
Aman Gupta [Thu, 19 Apr 2018 20:29:24 +0000 (13:29 -0700)]
avformat/utils: ignore outlier durations on subtitle/data streams as well

Similar to 4c9c4fe8b21, but for durations. This fixes #7151, where
the report duration and bitrate on a mpegts stream is wildly off
due to the dvb_teletext stream's timings.

Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavformat/http: flushing tcp receive buffer when it is write only mode
Vishwanath Dixit [Wed, 4 Apr 2018 11:08:18 +0000 (16:38 +0530)]
avformat/http: flushing tcp receive buffer when it is write only mode

In write only mode, the TCP receive buffer's data keeps growing with
http response messages and the buffer eventually becomes full.
This results in zero tcp window size, which in turn causes unwanted
issues, like, terminated tcp connection. The issue is apparent when
http persistent connection is enabled in hls/dash live streaming use
cases. To overcome this issue, the logic here reads the buffer data
when a file transfer is completed, so that any accumulated data in
the recieve buffer gets flushed out.

6 years agoavformat/dashenc: change the hls version from 6 to 7
Steven Liu [Fri, 20 Apr 2018 03:29:35 +0000 (11:29 +0800)]
avformat/dashenc: change the hls version from 6 to 7

reference hls support fmp4 file from  draft-pantos-http-live-streaming-20
the spec describes version 7 of hls protocol

Suggested-by: Ronak <ronak2121@yahoo.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
6 years agolavf/http.c: Free allocated client URLContext in case of error.
Stephan Holljes [Fri, 12 Jan 2018 18:16:29 +0000 (19:16 +0100)]
lavf/http.c: Free allocated client URLContext in case of error.

Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavdevice/android_camera: Fix AVClass.version
Michael Niedermayer [Thu, 19 Apr 2018 21:44:33 +0000 (23:44 +0200)]
avdevice/android_camera: Fix AVClass.version

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec: Fix AVClass .version
Michael Niedermayer [Thu, 19 Apr 2018 21:44:13 +0000 (23:44 +0200)]
avcodec: Fix AVClass .version

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/sheervideodata: Fix libavutil include
Michael Niedermayer [Thu, 19 Apr 2018 21:34:11 +0000 (23:34 +0200)]
avcodec/sheervideodata: Fix libavutil include

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/sbc: Fix non static function prefix
Michael Niedermayer [Thu, 19 Apr 2018 21:32:07 +0000 (23:32 +0200)]
avcodec/sbc: Fix non static function prefix

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/opusenc_psy: Fix warning: ISO C90 forbids mixed declarations and code
Michael Niedermayer [Thu, 19 Apr 2018 21:28:26 +0000 (23:28 +0200)]
avcodec/opusenc_psy: Fix warning: ISO C90 forbids mixed declarations and code

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/dsicinvideo: Fail if there is only a small fraction of the data available...
Michael Niedermayer [Mon, 16 Apr 2018 20:29:09 +0000 (22:29 +0200)]
avcodec/dsicinvideo: Fail if there is only a small fraction of the data available that comprises a full frame

Fixes: Timeout
Fixes: 6306/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DSICINVIDEO_fuzzer-5079253549842432
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/dsicinvideo: Propagate errors from cin_decode_rle()
Michael Niedermayer [Mon, 16 Apr 2018 20:28:23 +0000 (22:28 +0200)]
avcodec/dsicinvideo: Propagate errors from cin_decode_rle()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/dfa: Check dimension against maximum
Michael Niedermayer [Mon, 16 Apr 2018 20:04:53 +0000 (22:04 +0200)]
avcodec/dfa: Check dimension against maximum

The headers from where the dimensions are read in actual files
are limited to 16bit per component.

Fixes: Timeout
Fixes: 6305/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DFA_fuzzer-4824270749302784
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/cinepak: Skip empty frames
Michael Niedermayer [Tue, 17 Apr 2018 00:13:43 +0000 (02:13 +0200)]
avcodec/cinepak: Skip empty frames

Speeds up decoding from 3 to 0.1 seconds for 6302/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CINEPAK_fuzzer-5626371985375232
Fixes: Timeout
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavcodec/cinepak: move some checks prior to frame allocation
Michael Niedermayer [Tue, 17 Apr 2018 00:13:42 +0000 (02:13 +0200)]
avcodec/cinepak: move some checks prior to frame allocation

Speeds up decoding from 8 to 3 seconds for 6302/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CINEPAK_fuzzer-5626371985375232
Fixes: Timeout
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agolibavformat/http: Refactor and fix additional leaks in get_cookies.
Richard Shaffer [Thu, 19 Apr 2018 19:55:00 +0000 (12:55 -0700)]
libavformat/http: Refactor and fix additional leaks in get_cookies.

This refactors get_cookies to simplify some code paths, specifically for
skipping logic in the while loop or exiting it. It also simplifies the logic
for appending additional values to *cookies by replacing strlen/malloc/snprintf
with one call av_asnprintf.

This refactor fixes a bug where the cookie_params AVDictionary would get leaked
if we failed to allocate a new buffer for writing to *cookies.

6 years agoswresample/arm: remove unintentional relocation.
Rahul Chaudhry [Wed, 18 Apr 2018 23:29:39 +0000 (16:29 -0700)]
swresample/arm: remove unintentional relocation.

Branch to global symbol results in reference to PLT, and when compiling
for THUMB-2 - in a R_ARM_THM_JUMP19 relocation. Some linkers don't
support this relocation (ld.gold), while others can end up truncating
the relocation to fit (ld.bfd).

Convert this branch through PLT into a direct branch that the assembler
can resolve locally.

See https://github.com/android-ndk/ndk/issues/337 for background.

The current workaround is to disable neon during gstreamer build,
which is not optimal and can be reverted after this patch:
https://github.com/freedesktop/gstreamer-cerbero/commit/41556c415739fbc3a72c7eaee7e70a565b719b2f

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavformat/mov: Remove old encryption info methods.
Jacob Trimble [Tue, 30 Jan 2018 19:14:35 +0000 (11:14 -0800)]
avformat/mov: Remove old encryption info methods.

Signed-off-by: Jacob Trimble <modmaker@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavformat/mov: Fix memory leak in encryption info.
Jacob Trimble [Thu, 19 Apr 2018 16:35:22 +0000 (09:35 -0700)]
avformat/mov: Fix memory leak in encryption info.

Signed-off-by: Jacob Trimble <modmaker@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoaac: Rework extradata parsing code
Vittorio Giovara [Thu, 12 Apr 2018 21:39:50 +0000 (17:39 -0400)]
aac: Rework extradata parsing code

- enable the parsing code
- use the new buffer instead of replacing the context one
- do not push/pop configuration, just discard the exiting one
- propagate errors correctly

6 years agodoc/muxers: tee muxer - rearrange, add notes and general tidy-up
Gyan Doshi [Thu, 19 Apr 2018 12:07:20 +0000 (17:37 +0530)]
doc/muxers: tee muxer - rearrange, add notes and general tidy-up

6 years agoavcodec/mediacodecdec_common: make stride and slice-height non-mandatory fields
Matthieu Bouron [Wed, 11 Apr 2018 08:28:56 +0000 (10:28 +0200)]
avcodec/mediacodecdec_common: make stride and slice-height non-mandatory fields

Fixes decoding on the Samsung Chromebook Pro which do not set the codec
output format stride and slice-height fields.

6 years agoavformat/tls_schannel: fix handling of EOF after avio changes
Hendrik Leppkes [Wed, 18 Apr 2018 12:09:19 +0000 (14:09 +0200)]
avformat/tls_schannel: fix handling of EOF after avio changes

6 years agoconfigure: fix clang-cl check in the MSVC section
Hendrik Leppkes [Wed, 18 Apr 2018 14:33:13 +0000 (16:33 +0200)]
configure: fix clang-cl check in the MSVC section

Without properly grouping the checks, the second test would execute for
MSVC cl.exe, which results in configure getting stuck since cl.exe -? is
an interactive paginated help screen, waiting for input.

6 years agoavdevice/iec61883: free the private context at the end
James Almer [Wed, 18 Apr 2018 18:32:10 +0000 (15:32 -0300)]
avdevice/iec61883: free the private context at the end

Fixes part of ticket #7146.

Signed-off-by: James Almer <jamrial@gmail.com>
6 years agoavdevice/iec61883: return reference counted packets
James Almer [Wed, 18 Apr 2018 18:19:40 +0000 (15:19 -0300)]
avdevice/iec61883: return reference counted packets

Fixes part of ticket #7146, dealing with leaks of packet data since
commit 87c88122703f2befcf96383d05bdf14373c22df9.

Signed-off-by: James Almer <jamrial@gmail.com>
6 years agoavformat/mov: Increase support for common encryption.
Jacob Trimble [Thu, 7 Dec 2017 00:17:54 +0000 (16:17 -0800)]
avformat/mov: Increase support for common encryption.

- Parse schm atom to get different encryption schemes.
- Allow senc atom to appear in track fragments.
- Allow 16-byte IVs.
- Allow constant IVs (specified in tenc).
- Allow only tenc to specify encryption (i.e. no senc/saiz/saio).
- Use sample descriptor to detect clear fragments.

This doesn't support:
- Different sample descriptor holding different encryption info.
  - Only first sample descriptor can be encrypted.
- Encrypted sample groups (i.e. seig).
- Non-'cenc' encryption scheme when using -decryption_key.

Signed-off-by: Jacob Trimble <modmaker@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agolavf/tcp.c: Free allocated client URLContext in case of error.
Stephan Holljes [Fri, 12 Jan 2018 18:16:30 +0000 (19:16 +0100)]
lavf/tcp.c: Free allocated client URLContext in case of error.

Signed-off-by: Stephan Holljes <klaxa1337@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavdevice/decklink_commmon: enhance error messages when iterator creation fails
Marton Balint [Sat, 14 Apr 2018 22:06:59 +0000 (00:06 +0200)]
avdevice/decklink_commmon: enhance error messages when iterator creation fails

Show a more useful error message which specifies the required driver version
for the build, and use the correct context in the error message for WIN32.

Signed-off-by: Marton Balint <cus@passwd.hu>
6 years agolavc/dxva2_internal: Cast the dxva2 and d3d11 decoders and cfgs to (void *).
Carl Eugen Hoyos [Sun, 15 Apr 2018 21:57:24 +0000 (23:57 +0200)]
lavc/dxva2_internal: Cast the dxva2 and d3d11 decoders and cfgs to (void *).

Silences several warnings:
libavcodec/dxva2_internal.h:107:98: warning: pointer type mismatch in conditional expression
libavcodec/dxva2_internal.h:109:94: warning: pointer type mismatch in conditional expression

Reported-by: Reino Wijnsma
6 years agolavd/vfwcap: Pass pointers to int instead of long to av_parse_video_size().
Carl Eugen Hoyos [Sun, 15 Apr 2018 21:40:19 +0000 (23:40 +0200)]
lavd/vfwcap: Pass pointers to int instead of long to av_parse_video_size().

Fixes the following warnings:
libavdevice/vfwcap.c:331:35: warning: passing argument 1 of 'av_parse_video_size' from incompatible pointer type
libavdevice/vfwcap.c:331:59: warning: passing argument 2 of 'av_parse_video_size' from incompatible pointer type

Reported-by: Reino Wijnsma
6 years agoavfilter/avf_avectorscope: disable mirroring
Paul B Mahol [Wed, 18 Apr 2018 16:14:35 +0000 (18:14 +0200)]
avfilter/avf_avectorscope: disable mirroring

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agoffplay: Fix realloc_texture when input texture is NULL.
Matt Oliver [Tue, 10 Apr 2018 13:01:18 +0000 (23:01 +1000)]
ffplay: Fix realloc_texture when input texture is NULL.

SDL_QueryTexture and SDL_DestroyTexture require that the input texture
pointer be non-null. Debug builds of SDL will correctly check for this
and break program execution. This patch fixes this by checking the
status of the texture pointer.

Signed-off-by: Matt Oliver <protogonoi@gmail.com>
6 years agoavformat/hls: remove redundant code
Steven Liu [Wed, 18 Apr 2018 03:22:23 +0000 (11:22 +0800)]
avformat/hls: remove redundant code

Suggested-by: Richard Shaffer <rshaffer@tunein.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
6 years agoavcodec/proresdec_lgpl: pass return values instead of discarding them
Paul B Mahol [Tue, 17 Apr 2018 22:05:33 +0000 (00:05 +0200)]
avcodec/proresdec_lgpl: pass return values instead of discarding them

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agolibavformat/http: Fix memory leak in get_cookies.
Richard Shaffer [Fri, 13 Apr 2018 23:42:32 +0000 (16:42 -0700)]
libavformat/http: Fix memory leak in get_cookies.

6 years agoavformat/movenc: support writing iTunes cover image
Timo Teräs [Sat, 14 Apr 2018 18:32:11 +0000 (21:32 +0300)]
avformat/movenc: support writing iTunes cover image

Fixes https://trac.ffmpeg.org/ticket/2798

This makes movenc handle AV_DISPOSITION_ATTACHED_PIC and write
the associated pictures in iTunes cover atom. This corresponds
to how 'mov' demuxer parses and exposes the cover images when
reading.

Most of the existing track handling loops properly ignore
these 'virtual streams' as MOVTrack->entry is never incremented
for them. However, additional tests are added as needed to ignore
them.

Tested to produce valid output with:
  ffmpeg -i movie.mp4 -i thumb.jpg -disposition:v:1 attached_pic \
         -map 0 -map 1 -c copy movie-with-cover.mp4

The cover image is also copied correctly with:
  ffmpeg -i movie-with-cover.mp4 -map 0 -c copy out.mp4

AtomicParseley says that the attached_pic stream is properly
not visible in the main tracks of the file.

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
6 years agoffprobe: report unavailable SAR correctly in stream info
Timo Teräs [Thu, 12 Apr 2018 08:07:36 +0000 (11:07 +0300)]
ffprobe: report unavailable SAR correctly in stream info

av_guess_sample_aspect_ratio() will return undefined or missing
value as {0,1}. This fixes show_stream() to check numerator to
display 'N/A' when appropriate. show_frame() does this already
correctly.

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
6 years agoavfilter: add lowshelf and highshelf filters
Paul B Mahol [Tue, 17 Apr 2018 09:31:34 +0000 (11:31 +0200)]
avfilter: add lowshelf and highshelf filters

These are old bass and treble filters.
Make bass and treble filters better at boosting.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agoavformat/dashenc: addition of segment index correction logic
Vishwanath Dixit [Wed, 11 Apr 2018 07:02:25 +0000 (12:32 +0530)]
avformat/dashenc: addition of segment index correction logic

The logic is applicable only when use_template is enabled and use_timeline
is disabled. The logic monitors the flow of segment indexes. If a streams's
segment index value is not at the expected real time position, then
the logic corrects that index value.

Typically this logic is needed in live streaming use cases. The network
bandwidth fluctuations are common during long run streaming. Each
fluctuation can cause the segment indexes fall behind the expected real
time position. Without this logic, players will not be able to consume
the content, even after encoder's network condition comes back to
normal state.

6 years agoavformat/dashenc: addition of muxer overhead for @bandwidth param in MPD
Vishwanath Dixit [Wed, 11 Apr 2018 07:02:19 +0000 (12:32 +0530)]
avformat/dashenc: addition of muxer overhead for @bandwidth param in MPD

6 years agoavformat/dashenc: constructing MPD's bandwidth string locally
Vishwanath Dixit [Wed, 11 Apr 2018 07:02:11 +0000 (12:32 +0530)]
avformat/dashenc: constructing MPD's bandwidth string locally

6 years agoavformat/dashenc: addition of muxer overhead in master playlist's bandwidth
Vishwanath Dixit [Wed, 11 Apr 2018 07:02:03 +0000 (12:32 +0530)]
avformat/dashenc: addition of muxer overhead in master playlist's bandwidth

6 years agoavformat/dashenc: logic to compute muxer overhead
Vishwanath Dixit [Wed, 11 Apr 2018 07:01:55 +0000 (12:31 +0530)]
avformat/dashenc: logic to compute muxer overhead

6 years agoavformat/dashenc: addition of @availabilityTimeOffset in MPD
Vishwanath Dixit [Wed, 11 Apr 2018 07:01:47 +0000 (12:31 +0530)]
avformat/dashenc: addition of @availabilityTimeOffset in MPD

availability time of Nth segment = availabilityStartTime + (N*segment duration) - availabilityTimeOffset.
This field helps to reduce the latency by about a segment duration in streaming mode.

6 years agoavformat/dashenc: setting @availabilityStartTime when the first frame is ready
Vishwanath Dixit [Wed, 11 Apr 2018 07:01:36 +0000 (12:31 +0530)]
avformat/dashenc: setting @availabilityStartTime when the first frame is ready

@availabilityStartTime specifies the anchor for the computation of the earliest
availability time (in UTC) for any Segment in the Media Presentation.

As per this requirement, the @AvailabilityStartTime should be set to the
wallclock time at which the first frame of the first segment begins encoding.
But, it was getting set only when the first segment was completely ready. Making
the required correction in this patch. This correction is mainly needed to reduce
the latency in live streaming use cases.

6 years agoavformat/dashenc: removed 'write_manifest' call from 'write_header'
Vishwanath Dixit [Wed, 11 Apr 2018 07:01:26 +0000 (12:31 +0530)]
avformat/dashenc: removed 'write_manifest' call from 'write_header'

Calling 'write_manifest' from 'write_header' was causing creation of
first MPD with invalid values. Ex: zero @duration param value. Also,
the manifest files (MPD or M3U8s) should be created when at-least
one media frame is ready for consumption.

6 years agoavformat/dashenc: writing average segment duration for @duration in template mode
Vishwanath Dixit [Wed, 11 Apr 2018 07:00:29 +0000 (12:30 +0530)]
avformat/dashenc: writing average segment duration for @duration in template mode

6 years agoavformat/dashenc: segmentation at the configured segment duration rate
Vishwanath Dixit [Wed, 11 Apr 2018 07:00:18 +0000 (12:30 +0530)]
avformat/dashenc: segmentation at the configured segment duration rate

When use_template is enabled and use_timeline is disabled, typically
it is required to generate the segments at the configured segment duration
rate on an average. This commit is particularly needed to handle the
segmentation when video frame rates are fractional like 29.97 or 59.94 fps.

6 years agoavformat/dashenc: replacing 'min_seg_duration' with 'seg_duration'
Vishwanath Dixit [Mon, 16 Apr 2018 05:25:45 +0000 (10:55 +0530)]
avformat/dashenc: replacing 'min_seg_duration' with 'seg_duration'

There are use cases where average segment duration needs to be configured
and muxer is expected to maintain the average segment duration. So, using
the name 'min_seg_duration' will be misleading. So, changing the parameter
name to 'seg_duration', where it can be minimum segment duration or average
segment duration based on the use-case. The additional updates needed for
this functinality are made the sub-sequent patches of this patch series.

6 years agoavformat/hls: clean up duplicate option fields
Richard Shaffer [Tue, 17 Apr 2018 06:40:06 +0000 (14:40 +0800)]
avformat/hls: clean up duplicate option fields

The HLSContext struct contains fields which duplicate the data stored in the
avio_opts field. This change removes those fields in favor of avio_opts, and
updates the code accordingly.
The original patch caused the buffer pointed to by new_cookies in open_url to be
leaked. The only thing that buffer is used for is to store the value until it
can be passed to av_dict_set. To fix the leak, v2 of the patch simply calls
av_dict_set with the AV_DICT_DONT_STRDUP_VAL flag, so that the dictionary takes
ownership of the memory instead of copying it again.

Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: Richard Shaffer <rshaffer@tunein.com>
6 years agoavformat/hls: copy rw_timeout from parent to child AVIOContexts.
Richard Shaffer [Tue, 17 Apr 2018 06:39:26 +0000 (14:39 +0800)]
avformat/hls: copy rw_timeout from parent to child AVIOContexts.

The rw_timeout option is currently not applied when opening media playlist,
segment, or encryption key URLs. This can cause the HLS demuxer to block
indefinitely, even when the rw_timeout option has been specified. This change
simply enables carrying over the rw_timeout option when the demuxer opens these
URLs.

Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: Richard Shaffer <rshaffer@tunein.com>
6 years agolibavformat/dashdec: Avoid multiple HTTP requests for initialization segment that...
sanilraut [Tue, 17 Apr 2018 06:36:45 +0000 (14:36 +0800)]
libavformat/dashdec: Avoid multiple HTTP requests for initialization segment that is common among all representations

Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: sanilraut <raut.sanil@gmail.com>
6 years agoRevert "avformat/hls: copy rw_timeout from parent to child AVIOContexts."
Steven Liu [Tue, 17 Apr 2018 06:33:36 +0000 (14:33 +0800)]
Revert "avformat/hls: copy rw_timeout from parent to child AVIOContexts."

This reverts commit 36deec010cc87c8990477e1703dbf785212992b5.

6 years agoRevert "avformat/dashdec: Avoid multiple HTTP requests for initialization segment...
Steven Liu [Tue, 17 Apr 2018 06:32:27 +0000 (14:32 +0800)]
Revert "avformat/dashdec: Avoid multiple HTTP requests for initialization segment that is common among all representations"

This reverts commit 4effd1c4a2c52a68c25ed0bc5474f6b4c64fd644.

6 years agoavformat/hls: copy rw_timeout from parent to child AVIOContexts.
Steven Liu [Tue, 17 Apr 2018 06:25:07 +0000 (14:25 +0800)]
avformat/hls: copy rw_timeout from parent to child AVIOContexts.

The rw_timeout option is currently not applied when opening media playlist,
segment, or encryption key URLs. This can cause the HLS demuxer to block
indefinitely, even when the rw_timeout option has been specified. This change
simply enables carrying over the rw_timeout option when the demuxer opens these
URLs.

Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: Richard Shaffer <rshaffer@tunein.com>
6 years agoavformat/dashdec: Avoid multiple HTTP requests for initialization segment that is...
Steven Liu [Tue, 17 Apr 2018 06:19:00 +0000 (14:19 +0800)]
avformat/dashdec: Avoid multiple HTTP requests for initialization segment that is common among all representations

Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: sanilraut <raut.sanil@gmail.com>
6 years agoavformat/hls: remove redundant code
Steven Liu [Tue, 17 Apr 2018 05:16:33 +0000 (13:16 +0800)]
avformat/hls: remove redundant code

Reviewed-by: Jun Zhao <mypopydev@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
6 years agoconfigure: add nvcc to CMDLINE_SET
Timo Rothenpieler [Mon, 16 Apr 2018 20:35:23 +0000 (22:35 +0200)]
configure: add nvcc to CMDLINE_SET

This was somehow forgotten and nobody noticed until now.

6 years agodoc/APIchanges: Fix typos in hashes
Michael Niedermayer [Mon, 16 Apr 2018 16:23:12 +0000 (18:23 +0200)]
doc/APIchanges: Fix typos in hashes

Thanks-to: Moritz Barsnick <barsnick@gmx.net> for finding the correct ones
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoavfilter/af_afir: make max IR length configurable
Paul B Mahol [Mon, 16 Apr 2018 17:06:09 +0000 (19:06 +0200)]
avfilter/af_afir: make max IR length configurable

Also increase max allowed dry/wet value.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agoavformat/flacenc: add flac_init()
James Almer [Mon, 16 Apr 2018 15:44:35 +0000 (12:44 -0300)]
avformat/flacenc: add flac_init()

Signed-off-by: James Almer <jamrial@gmail.com>
6 years agoavformat/flacenc: support writing attached pictures
Rodger Combs [Wed, 4 Apr 2018 04:17:24 +0000 (01:17 -0300)]
avformat/flacenc: support writing attached pictures

Usage of packet queueing API and some cleaning done by the committer.

Signed-off-by: James Almer <jamrial@gmail.com>
6 years agoavfilter/af_headphone: switch to activate
Paul B Mahol [Mon, 16 Apr 2018 14:08:55 +0000 (16:08 +0200)]
avfilter/af_headphone: switch to activate

Signed-off-by: Paul B Mahol <onemda@gmail.com>
6 years agoavformat/movenc: forbid muxing AV1 streams until the spec is finished
James Almer [Mon, 16 Apr 2018 00:33:44 +0000 (21:33 -0300)]
avformat/movenc: forbid muxing AV1 streams until the spec is finished

This prevents creating potentially broken files, as both the AV1 and
the AV1 in ISOMBFF specs are unfinished.

Signed-off-by: James Almer <jamrial@gmail.com>
6 years agoconfigure: extend the check for bcrypt
James Almer [Sun, 15 Apr 2018 23:33:37 +0000 (20:33 -0300)]
configure: extend the check for bcrypt

Some old mingw-w64 builds seem to provide an incomplete implementation
of the API. Add an extra check to make sure it's disabled for those.

Signed-off-by: James Almer <jamrial@gmail.com>
6 years agoBump minor versions after release/4.0 branching
Michael Niedermayer [Mon, 16 Apr 2018 09:57:36 +0000 (11:57 +0200)]
Bump minor versions after release/4.0 branching

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
6 years agoBump minor versions for branching release/4.0
Michael Niedermayer [Mon, 16 Apr 2018 09:47:03 +0000 (11:47 +0200)]
Bump minor versions for branching release/4.0

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>