1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-09-30 00:30:24 +02:00
Commit Graph

94660 Commits

Author SHA1 Message Date
Steven Liu
6d1009cb9d doc/examples/decode_video: add input file format information for usage
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-08-26 11:09:13 +08:00
Steven Liu
7c2ff06b6e doc/examples/decode_audio: print message about how to play the output file
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-08-26 11:08:52 +08:00
Steven Liu
17576fda65 avformat/hlsenc: remove unused value
CID: 1452644
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-08-26 11:06:48 +08:00
Steven Liu
80d2a7f5c6 avformat/hlsenc: fix memleak of filename
CID: 1452445
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-08-26 11:06:36 +08:00
Steven Liu
4ba82ecc12 avformat/hlsenc: fix memleak in hls_write_trailer
fix CID: 1426931

Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
2019-08-26 11:06:24 +08:00
Xuewei Meng
f0c97d613e libavfilter: Add dehaze-filter option in existing derain.
Add the support of dehaze filter in existing derain filter source
code. As the processing procedure in FFmpeg is the same for current
derain and dehaze, we reuse the derain filter source code. The
model training and generation scripts are in repo
https://github.com/XueweiMeng/derain_filter.git

Reviewed-by: Steven Liu <lq@onvideo.cn>
Signed-off-by: Xuewei Meng <xwmeng96@gmail.com>
2019-08-26 10:59:01 +08:00
Carl Eugen Hoyos
434588596f lavc/x264: Also clean-up libx264rgb after init errors.
Missed in c180f0f6
2019-08-25 16:09:40 +02:00
James Almer
808a6717e0 avformat/movenc: add muxing support for Dolby TrueHD streams
Signed-off-by: James Almer <jamrial@gmail.com>
2019-08-24 22:42:34 -03:00
James Almer
d1409fe952 avformat/mov: add demuxing support for Dolby TrueHD streams
Signed-off-by: James Almer <jamrial@gmail.com>
2019-08-24 22:41:58 -03:00
James Almer
c300fe13b6 avcodec/mlp_parser: export AVCodecContext frame_size
Signed-off-by: James Almer <jamrial@gmail.com>
2019-08-24 22:41:52 -03:00
James Almer
21d7eeafc1 avcodec/mlp_parse: move TrueHD channel layout and sample rate related code to the header
It will be needed by the next commit.

Signed-off-by: James Almer <jamrial@gmail.com>
2019-08-24 20:16:00 -03:00
Paul B Mahol
45cefca1e7 avformat/dhav: handle files missing data at start
Try to seek to end of file and if signature is found seek backwards until
last valid chunk is found.
2019-08-24 20:34:22 +01:00
Paul B Mahol
96fd07351a avformat/dhav: gracefully handle corrupted files
Try to find next valid chunk in offsets of 0x8000 from last good one.
2019-08-24 20:34:05 +01:00
Thilo Borgmann
1cfba7fc75 fate/als: Add test for conformance file with 512 channels. 2019-08-24 09:33:44 +02:00
Pavel Koshevoy
22a14ee753 avcodec/videotoolbox_hevc: avoid leaking cached_hw_frames_ctx
vtctx->cached_hw_frames_ctx is unref'd in videotoolbox_uninit,
but videotoolbox_hevc used ff_videotoolbox_uninit which
doesn't unref cache_hw_frames_ctx.

Signed-off-by: Pavel Koshevoy <pkoshevoy@gmail.com>
2019-08-23 23:54:27 -06:00
Dave Stevenson
3d857f219e avcodec/omx: Fix handling of fragmented buffers
See https://trac.ffmpeg.org/ticket/7687

If an encoded frame is returned split over two or more
IL buffers due to the size, then there is a race between
whether get_buffer will fail, return NULL, and a truncated
frame is passed on, or IL will return the remaining part
of the encoded frame.
If get_buffer returns NULL, part of the frame is left behind
in the codec, and will be collected on the next call. That
then leaves a frame stuck in the codec. Repeat enough times
and the codec FIFO is full, and the pipeline stalls.

A performance improvement in the Raspberry Pi firmware means
that the timing has changed, and now frequently drops into the
case where get_buffer returns NULL.

Add code such that should a buffer be received without
OMX_BUFFERFLAG_ENDOFFRAME that get_buffer is called with wait
set, so we wait for the remainder of the frame.
This code has been made conditional on the Pi build in case
other IL implementations don't handle ENDOFFRAME correctly.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Martin Storsjö <martin@martin.st>
2019-08-23 17:07:58 -07:00
Aman Gupta
23a3e1460a avcodec/omx: ensure zerocopy mode can be disabled on rpi builds
fixes https://trac.ffmpeg.org/ticket/6586

Signed-off-by: Aman Gupta <aman@tmm1.net>
2019-08-23 17:07:57 -07:00
Aman Gupta
76c82843cc avcodec/omx: add support for -force_key_frames
Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Martin Storsjö <martin@martin.st>
2019-08-23 17:07:54 -07:00
Aman Gupta
c62a1db0ac MAINTAINERS: add myself to OMX
Signed-off-by: Aman Gupta <aman@tmm1.net>
Signed-off-by: Martin Storsjö <martin@martin.st>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-08-23 17:07:05 -07:00
Marton Balint
2fb550893f avformat/mpegtsenc: get rid of packet counting for sdt/pat/pmt
The packet counting based approach caused excessive sdt/pat/pmt for VBR, so
let's use a timestamp based approach instead similar to how we emit PCRs.
SDT/PAT/PMT period should be consistent for both VBR and CBR from now on.

Also change the type of sdt_period and pat_period to AV_OPT_TYPE_DURATION so no
floating point math is necessary.

Fixes ticket #3714.

Signed-off-by: Marton Balint <cus@passwd.hu>
2019-08-23 22:49:01 +02:00
Marton Balint
5c119bf189 avformat/mpegtsenc: move some code around and simplify a bit
PCR does not need to be recalcualted for CBR when inserting a NULL or PCR only
packet.

Signed-off-by: Marton Balint <cus@passwd.hu>
2019-08-23 22:49:01 +02:00
Marton Balint
8bf732cda6 avformat/mpegtsenc: add support for setting PCR interval for VBR streams
Also document the algorithm for the default PCR interval.

Fixes ticket #8061.

Signed-off-by: Marton Balint <cus@passwd.hu>
2019-08-23 22:49:01 +02:00
Marton Balint
6f499ae390 avformat/mpegtsenc: rename pcr_period variable to pcr_period_ms
Signed-off-by: Marton Balint <cus@passwd.hu>
2019-08-23 22:49:01 +02:00
Michael Niedermayer
ae3d6a337a avcodec/alac: Fix multiple integer overflows in lpc_prediction()
Fixes: signed integer overflow: 2088795537 + 2147254401 cannot be represented in type 'int'
Fixes: signed integer overflow: -1500363496 + -1295351808 cannot be represented in type 'int'
Fixes: signed integer overflow: -79560 * 32640 cannot be represented in type 'int'
Fixes: signed integer overflow: 2088910005 + 2088796058 cannot be represented in type 'int'
Fixes: signed integer overflow: -117258064 - 2088725225 cannot be represented in type 'int'
Fixes: signed integer overflow: 2088725225 - -117258064 cannot be represented in type 'int'
Fixes: 15739/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALAC_fuzzer-5630664122040320

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-08-23 22:26:50 +02:00
Michael Niedermayer
1c9a56b139 avcodec/smacker: Check that not all tables are skiped
If all tables are skipped it would be impossible to encode any
"non black" video.

Fixes: Timeout (78sec -> 1ms)
Fixes: 15821/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SMACKER_fuzzer-5652598838788096

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-08-23 22:26:50 +02:00
Michael Niedermayer
5231e89eb9 avcodec/pictordec: Optimize picmemset() for single plane full lines
Fixes: Timeout (72sec -> 1sec)
Fixes: 15512/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PICTOR_fuzzer-5663942342344704

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-08-23 22:26:50 +02:00
Michael Niedermayer
34f6d1a7d7 avcodec/pnm_parser: Use memmove() to handle "overread"
This is significantly faster

Fixes: Timeout (1sec after this and the previous commit)
Fixes: 15558/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PPM_fuzzer-5705273643106304

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-08-23 22:26:50 +02:00
Michael Niedermayer
8a24d2cc30 avcodec/parser: Optimize ff_combine_frame() with massivly negative next
Fixes: Timeout
Fixes: 15558/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PPM_fuzzer-5705273643106304

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-08-23 22:26:50 +02:00
Michael Niedermayer
68f30567df avcodec/pnm: skip reading trailing bytes in get_pnm()
None of the keys we support is that long and other keys
lead to decoder failure. None of the values is expected
to be longer, they are all numbers or short keywords.

This simplifies the code

Fixes: Timeout (9sec->43ms)
Fixes: 15177/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PAM_fuzzer-5080556716425216

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-08-23 22:26:50 +02:00
Michael Niedermayer
1a0f106232 avcodec/pnm: Check magic bytes directly without pnm_get()
Fixes: Timeout (10sec -> 30ms) (case 15089)
Fixes: 15089/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PBM_fuzzer-5767535057698816
Fixes: 16001/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PGM_fuzzer-5199169645445120
Fixes: 16003/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_PGMYUV_fuzzer-5076443270217728

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-08-23 22:26:50 +02:00
Michael Niedermayer
77abf31453 avformat/mpsubdec: Check pts / duration before cast
Fixes: 3e+47 is outside the range of representable values of type 'int'
Fixes: 16057/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5691111307214848

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-08-23 22:26:50 +02:00
Michael Niedermayer
4d4734bdc8 avcodec/lcldec: Check mthread_inlen instead of cliping
Clipping was added in 2009 to avoid crashes.
The clipped case would produce a 2nd slice with 0 input
thus also producing 0 output.
Subsequent checks will cause decoder failure unless both
slices have the same output length. thus the only way this
would not already fail is if the output from both slices
was 0 bytes.

Fixes: Timeout (134sec -> 241ms)
Fixes: 15599/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MSZH_fuzzer-5658127116009472

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-08-23 22:24:07 +02:00
Michael Niedermayer
965e766e48 avcodec/rl2: set dimensions
The dimensions are always 320x200 they are hardcoded in the demuxer.
Hardcode them instead in the decoder.

Fixes: Timeout (16sec -> 400ms)
Fixes: 15574/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RL2_fuzzer-5158614072819712

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-08-23 22:24:07 +02:00
leozhang
b2bb09bcc3 avformat/flvdec: delete unused code
Reviewed-by: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Signed-off-by: leozhang <leozhang@qiyi.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-08-23 22:24:07 +02:00
elliottk
711c59bc57 Change libaom default to crf=32.
Current default is 256kbps, which produces inconsistent
results (too high for low-res, too low for hi-res).
Use CRF instead, which will adapt.

Signed-off-by: James Zern <jzern@google.com>
2019-08-23 10:56:34 -07:00
Jun Li
0b34cdf424 avcodec/h264_parse: retry decoding SPS with complete NAL
Fix #6591
The content has no rbsp_stop_one_bit for ending the SPS, that
causes the decoding SPS failure, results decoding frame failure as well.

The patch is just adding a retry with complete NALU, copied from the retry in decode_nal_unit()

Signed-off-by: James Almer <jamrial@gmail.com>
2019-08-23 12:26:28 -03:00
James Almer
92c32b0f0c tools/target_dec_fuzzer: use refcounted packets
Should reduce allocations and data copying.

Signed-off-by: James Almer <jamrial@gmail.com>
2019-08-23 11:08:36 -03:00
Michael Niedermayer
48b86dd8a6 avcodec/aacdec: Add FF_CODEC_CAP_INIT_CLEANUP
Fixes: memleaks
Fixes: 16289/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-5200695692623872

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-08-23 14:38:42 +02:00
Michael Niedermayer
c9fcf881e6 avcodec/idcinvideo: Add 320x240 default maximum resolution
Fixes: Timeout (128sec -> 2ms)
Fixes: 16568/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IDCIN_fuzzer-5675004095627264

See: [FFmpeg-devel] [PATCH 4/4] tools/target_dec_fuzzer: Adjust max_pixels for IDCIN

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Tomas Härdin <tjoppen@acc.umu.se>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-08-23 14:38:42 +02:00
Michael Niedermayer
ac77c5492f tools/target_dec_fuzzer: Do not increase max_pixels
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-08-23 14:38:42 +02:00
Jarek Samic
b29c7bcbf6 lavfi: add deshake_opencl filter 2019-08-23 00:56:13 +01:00
Jarek Samic
5b5746b1e0 lavfi: modify avfilter_get_matrix to support separate scale factors 2019-08-22 23:11:27 +01:00
Jarek Samic
d3cd33ab1b lavfi: add utilities to reduce OpenCL boilerplate code 2019-08-22 23:11:25 +01:00
Marton Balint
3a09dbdb4a avcodec: remove some dead assignments
Signed-off-by: Marton Balint <cus@passwd.hu>
2019-08-22 21:38:41 +02:00
Marton Balint
b2e37e3eb2 avutil/imgutils: remove dead assignment
Signed-off-by: Marton Balint <cus@passwd.hu>
2019-08-22 21:38:41 +02:00
Marton Balint
6ee40dcb64 avformat/mxfdec: do not ignore bad size errors
The return value was unintentionally lost after
00a2652df3.

Signed-off-by: Marton Balint <cus@passwd.hu>
2019-08-22 21:38:41 +02:00
Michael Niedermayer
493438fafc avformat/realtextdec: free queue on error
Fixes: memleak
Fixes: 16277/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5696629440512000

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-08-22 18:35:44 +02:00
Michael Niedermayer
ab56e62e8f avcodec/vp5/6/8: use vpX_rac_is_end()
Reviewed-by: Peter Ross <pross@xvid.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-08-22 18:35:44 +02:00
Michael Niedermayer
5937f05503 avformat/vividas: Check av_xiphlacing() return value before use
Fixes: out of array access
Fixes: 16277/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5696629440512000

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2019-08-22 18:35:44 +02:00
Peter Collingbourne
9bcb1cb6ed Add assembly support for -fsanitize=hwaddress tagged globals.
As of LLVM r368102, Clang will set a pointer tag in bits 56-63 of the
address of a global when compiling with -fsanitize=hwaddress. This requires
an adjustment to assembly code that takes the address of such globals: the
code cannot use the regular R_AARCH64_ADR_PREL_PG_HI21 relocation to refer
to the global, since the tag would take the address out of range. Instead,
the code must use the non-checking (_NC) variant of the relocation (the
link-time check is substituted by a runtime check).

This change makes the necessary adjustment in the movrel macro, where it is
needed when compiling with -fsanitize=hwaddress.

Signed-off-by: Peter Collingbourne <pcc@google.com>
Reviewed-by: Martin Storsjö
Reviewed-by: Janne Grunau
2019-08-22 11:22:07 +02:00