Commit Graph

90793 Commits

Author SHA1 Message Date
Steven Liu
002e45b407 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>
2018-04-20 13:31:05 +08:00
Stephan Holljes
7b6b8c9265 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>
2018-04-20 01:46:32 +02:00
Michael Niedermayer
13b77af2f0 avdevice/android_camera: Fix AVClass.version
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-04-19 23:44:33 +02:00
Michael Niedermayer
c0bce367e4 avcodec: Fix AVClass .version
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-04-19 23:44:13 +02:00
Michael Niedermayer
3dfe3436ac avcodec/sheervideodata: Fix libavutil include
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-04-19 23:34:11 +02:00
Michael Niedermayer
9f1b99e7d0 avcodec/sbc: Fix non static function prefix
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-04-19 23:32:07 +02:00
Michael Niedermayer
f8b17fe332 avcodec/opusenc_psy: Fix warning: ISO C90 forbids mixed declarations and code
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-04-19 23:28:26 +02:00
Michael Niedermayer
5549488bbf 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>
2018-04-19 22:59:40 +02:00
Michael Niedermayer
942217b153 avcodec/dsicinvideo: Propagate errors from cin_decode_rle()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-04-19 22:59:40 +02:00
Michael Niedermayer
9d5a4fcfbb 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>
2018-04-19 22:59:40 +02:00
Michael Niedermayer
9033920bec 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>
2018-04-19 22:59:40 +02:00
Michael Niedermayer
2324ef1ff3 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>
2018-04-19 22:59:40 +02:00
Richard Shaffer
c705476c47 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.
2018-04-19 22:01:51 +02:00
Rahul Chaudhry
b22db4f465 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:
41556c4157

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-04-19 21:49:47 +02:00
Jacob Trimble
baf9c0bd99 avformat/mov: Remove old encryption info methods.
Signed-off-by: Jacob Trimble <modmaker@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-04-19 21:49:47 +02:00
Jacob Trimble
606c5c7f3a avformat/mov: Fix memory leak in encryption info.
Signed-off-by: Jacob Trimble <modmaker@google.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2018-04-19 21:49:47 +02:00
Vittorio Giovara
fbfee6adea 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
2018-04-19 10:49:06 -04:00
Gyan Doshi
424836505f doc/muxers: tee muxer - rearrange, add notes and general tidy-up 2018-04-19 17:43:42 +05:30
Matthieu Bouron
67d0911f27 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.
2018-04-19 13:55:30 +02:00
Hendrik Leppkes
5c6365af45 avformat/tls_schannel: fix handling of EOF after avio changes 2018-04-19 13:26:53 +02:00
Hendrik Leppkes
638575cd0b 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.
2018-04-19 09:57:11 +02:00
James Almer
5079e96bcc avdevice/iec61883: free the private context at the end
Fixes part of ticket #7146.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-18 22:45:09 -03:00
James Almer
b8629654c6 avdevice/iec61883: return reference counted packets
Fixes part of ticket #7146, dealing with leaks of packet data since
commit 87c8812270.

Signed-off-by: James Almer <jamrial@gmail.com>
2018-04-18 22:45:09 -03:00
Jacob Trimble
f7221d8e67 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>
2018-04-19 03:15:32 +02:00
Stephan Holljes
3717512282 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>
2018-04-19 03:15:32 +02:00
Marton Balint
768c0774d8 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>
2018-04-18 22:20:17 +02:00
Carl Eugen Hoyos
3027056160 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
2018-04-18 20:28:25 +02:00
Carl Eugen Hoyos
9d6c168764 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
2018-04-18 20:26:44 +02:00
Paul B Mahol
396c019795 avfilter/avf_avectorscope: disable mirroring
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2018-04-18 18:14:35 +02:00
Matt Oliver
6be690685a 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>
2018-04-18 18:57:07 +10:00
Steven Liu
223f3dff8c avformat/hls: remove redundant code
Suggested-by: Richard Shaffer <rshaffer@tunein.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2018-04-18 11:22:23 +08:00
Paul B Mahol
3c6f701524 avcodec/proresdec_lgpl: pass return values instead of discarding them
Signed-off-by: Paul B Mahol <onemda@gmail.com>
2018-04-18 00:05:33 +02:00
Richard Shaffer
9a8811f478 libavformat/http: Fix memory leak in get_cookies. 2018-04-17 22:00:54 +02:00
Timo Teräs
9af71b326f 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✌️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>
2018-04-17 20:11:34 +01:00
Timo Teräs
c663dce031 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>
2018-04-17 20:11:31 +01:00
Paul B Mahol
2fc12f4971 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>
2018-04-17 12:40:27 +02:00
Vishwanath Dixit
d10cefbfe5 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.
2018-04-17 14:35:40 +05:30
Vishwanath Dixit
2c51e33bc1 avformat/dashenc: addition of muxer overhead for @bandwidth param in MPD 2018-04-17 14:35:16 +05:30
Vishwanath Dixit
af6058d03b avformat/dashenc: constructing MPD's bandwidth string locally 2018-04-17 14:34:52 +05:30
Vishwanath Dixit
0c7bc7eb47 avformat/dashenc: addition of muxer overhead in master playlist's bandwidth 2018-04-17 14:34:25 +05:30
Vishwanath Dixit
85ae55eca3 avformat/dashenc: logic to compute muxer overhead 2018-04-17 14:34:03 +05:30
Vishwanath Dixit
990380367b 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.
2018-04-17 14:33:37 +05:30
Vishwanath Dixit
3e75057a1d 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.
2018-04-17 14:32:50 +05:30
Vishwanath Dixit
1263d91198 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.
2018-04-17 14:32:24 +05:30
Vishwanath Dixit
51888c85d4 avformat/dashenc: writing average segment duration for @duration in template mode 2018-04-17 14:32:01 +05:30
Vishwanath Dixit
ab789e184c 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.
2018-04-17 14:31:22 +05:30
Vishwanath Dixit
01ba52852d 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.
2018-04-17 14:30:47 +05:30
Richard Shaffer
c116221d90 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>
2018-04-17 14:40:06 +08:00
Richard Shaffer
6a1be7561c 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>
2018-04-17 14:39:26 +08:00
sanilraut
9e2b4c7ecc 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>
2018-04-17 14:36:45 +08:00