Commit Graph

103015 Commits

Author SHA1 Message Date
Gyan Doshi cd7043131f avformat/gifdec: log loop count 2021-07-20 11:20:04 +05:30
Thilo Borgmann 05c9f6f4ef fftools/ffmpeg: Fix runlength for strncmp() 2021-07-19 21:23:02 +02:00
Steven Liu b67263e0e8 avdevice/avfoundation: remove first_audio_pts and first_pts
Because these two member of AVFContext not be used.

Signed-off-by: Steven Liu <liuqi05@kuaishou.com>
2021-07-19 14:10:06 +02:00
Gyan Doshi 6f20685228 ffmpeg: delay readrate enforcement for decoded streams
Read rate enforcement delayed till first decoded frame is obtained, to
speed up init of output streams.

Thanks to Linjie Fu <linjie.justin.fu@gmail.com> for the initial patch.
2021-07-19 12:54:55 +05:30
Zane van Iperen 981d49e373
avformat/argo_brp: use bits_per_coded_sample instead of bits_per_raw_sample
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-07-19 14:14:39 +10:00
Zane van Iperen f687f8e0d3
avcodec/argo: use bits_per_coded_sample instead of bits_per_raw_sample
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-07-19 14:14:35 +10:00
Zane van Iperen 55801421b3
avformat/pp_bnk: don't set bits_per_raw_sample
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-07-19 10:47:25 +10:00
Zane van Iperen 5783bae9e5
avformat/kvag: don't set bits_per_raw_sample
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-07-19 10:47:25 +10:00
Zane van Iperen 5362fa2b75
avformat/apm: don't set bits_per_raw_sample
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-07-19 10:47:25 +10:00
Zane van Iperen 0c538ce30d
avformat/alp: don't set bits_per_raw_sample
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-07-19 10:47:24 +10:00
Zane van Iperen b28a3135af
avformat/argo_asf: don't set bits_per_raw_sample
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-07-19 10:47:24 +10:00
Zane van Iperen 9f502d8c8d
avformat/argo_cvg: don't set bits_per_raw_sample
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
2021-07-19 10:47:18 +10:00
Andreas Rheinhardt 1c2d8ff92b avcodec/dsd_tablegen: Merge header into dsd.c
Since b492fbcc6e, the DSD tables are
always initialized at runtime, so merge the dsd_tablegen.h header
into dsd.c.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-19 00:21:42 +02:00
Andreas Rheinhardt b76f9bcfd0 avfilter/internal: Mark ff_filter_get_nb_threads() as av_pure
It does not modify anything; it only returns a value, so it fulfills
the requirements for av_pure.
The deeper rationale behind this change is that this function is called
quite often inside arguments to FFMIN which may lead to two calls to it;
declaring this function as av_pure allows the compiler to optimize the
second call away.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-18 22:33:34 +02:00
Andreas Rheinhardt f9136d6026 Avoid calling functions repeatedly via FFMIN
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-18 22:06:20 +02:00
Andreas Rheinhardt e1836b191b avcodec/libavcodec.v: Tighten export whitelist
Currently every symbol (with external linkage) that starts with "av" is
exported. Yet libaom-av1 has lots of functions that are not meant to be
exported and start with "av1_" (I counted 1236); and libvpx has
average_split_mvs. These functions are exported if one links these
libraries statically into a shared libavcodec.so.

Solve this by tightening the whitelist to "av_", "avcodec_", "avpriv_"
and (as a special-case) "avsubtitle_free".

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-18 21:50:52 +02:00
Andreas Rheinhardt 3ccfd27f1d fftools/ffmpeg: Fix declaration-after-statement warning
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-18 21:09:02 +02:00
Aman Karmani 504c60660d avutil/hwcontext_videotoolbox: implement hwupload to convert AVFrame to CVPixelBuffer
Teach AV_HWDEVICE_TYPE_VIDEOTOOLBOX to be able to create AVFrames of type
AV_PIX_FMT_VIDEOTOOLBOX. This can be used to hwupload a regular AVFrame
into its CVPixelBuffer equivalent.

    ffmpeg -init_hw_device videotoolbox -f lavfi -i color=black:640x480 -vf hwupload -c:v h264_videotoolbox -f null -y /dev/null

Signed-off-by: Aman Karmani <aman@tmm1.net>
2021-07-18 12:01:16 -07:00
Lynne 997f9bdb99
x86/tx_float: correctly load the transform length
The field is a standard field, yet we were loading it as if it was
a quadword. This worked for forward transforms by chance, but broke
when the transform was inverse.
checkasm couldn't catch that because we only test forward transforms,
which are identical to inverse transforms but with a different revtab.
2021-07-18 15:04:57 +02:00
Shiwang.Xie 694545b6d5 fftools/ffmpeg: fix -t inaccurate recording time
if input start time is not 0 -t is inaccurate doing stream copy,
will record extra duration according to input start time.
it should base on following cases:

input video start time from 60s, duration is 300s,
1. stream copy:
       ffmpeg -ss 40 -t 60 -i in.mp4 -c copy -y out.mp4
   open_input_file() will seek to 100 and set ts_offset to -100,
   process_input() will offset pkt->pts with ts_offset to make it 0,
   so when do_streamcopy() with -t, exits when ist->pts >= recording_time.

2. stream copy with -copyts:
       ffmpeg -ss 40 -t 60 -copyts -i in.mp4 -c copy -y out.mp4
   open_input_file() will seek to 100 and set ts_offset to 0,
   process_input() will keep raw pkt->pts as ts_offset is 0,
   so when do_streamcopy() with -t, exits when
   ist->pts >= (recording_time+f->start_time+f->ctx->start_time).

3. stream copy with -copyts -start_at_zero:
       ffmpeg -ss 40 -t 60 -copyts -start_at_zero -i in.mp4 -c copy -y out.mp4
   open_input_file() will seek to 120 and set ts_offset to -60 as start_to_zero option,
   process_input() will offset pkt->pts with input file start time,
   so when do_streamcopy() with -t, exits when ist->pts >= (recording_time+f->start_time).

0      60     40      60                     360
|_______|_____|_______|_______________________|
      start   -ss     -t

This fixes ticket #9141.

Signed-off-by: Shiwang.Xie <shiwang.xie666@outlook.com>
2021-07-18 09:59:02 +05:30
Andreas Rheinhardt ea5bdc8893 avformat/subtitles: Deduplicate subtitles' read_(packet|seek|close)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
2021-07-18 04:26:35 +02:00
James Almer ef1302db2d avformat/utils: remove AVStreamInternal.orig_codec_id
It's a write only field.

Reviewed-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-07-17 19:41:45 -03:00
Paul B Mahol 305be41374 avfilter/vf_v360: avoid doubles in fov_from_dfov() 2021-07-17 23:27:51 +02:00
Gyan Doshi c320b78e95 ffmpeg: add option readrate
Allows to read inputs at arbitrary rates.
-re is equivalent to -readrate 1

Tested with -copyts {+ start_at_zero}, -ss, streamcopied & decoded streams.
2021-07-17 20:34:21 +05:30
Paul B Mahol 075157ec86 avfilter/vf_chromanr: add also euclidean distance for calculations 2021-07-17 15:18:30 +02:00
Daniel Playfair Cal 7f6d20931b avfilter/vf_v360: fix visibility test for fisheye projection
Previously the visibility test referred to a circle in the input. This
changes it so that it refers accurately to the entire area in the input.
2021-07-17 11:28:56 +02:00
Michael Niedermayer 748c3fa52a tools/target_dec_fuzzer: Fuzz FF_DEBUG_*
This should increase coverage

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-07-17 10:48:27 +02:00
Michael Niedermayer 9fa30cf855 tools/target_dec_fuzzer: Fuzz AV_CODEC_FLAG2_EXPORT_MVS
This should increase coverage

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-07-17 10:48:27 +02:00
Michael Niedermayer a0fd56f55e tools/target_dec_fuzzer: Set extradata for the parser
This should improve coverage

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-07-17 10:48:27 +02:00
Michael Niedermayer 9c8df64a70 tools/target_dec_fuzzer: Fuzz skip_frame
Should allow coverage of related code

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-07-17 10:48:27 +02:00
Michael Niedermayer c52c99a18f avformat/mov: do not ignore errors in mov_metadata_hmmt()
Fixes: Timeout
Fixes: 35637/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-6311060272447488

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-07-17 10:48:27 +02:00
Michael Niedermayer 65b862ab59 avformat/mxfdec: Check size for shrinking
av_shrink_packet() takes int size, so size must fit in int
Fixes: out of array access
Fixes: 35607/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-4875541323841536

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-07-17 10:48:27 +02:00
Michael Niedermayer adae546f24 avcodec/exr: Check uncompressed_size against max_pixels
Fixes: Timeout
Fixes: 35286/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-6557139802914816
Fixes: 31253/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_EXR_fuzzer-4901782326214656

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2021-07-17 10:48:27 +02:00
Thilo Borgmann cf12a478b2 fftools/cmdutils.c: Add cmd line option to override detection of cpu count. 2021-07-16 10:06:23 +02:00
Thilo Borgmann 87951dcbe7 lavu/cpu.c: Add av_force_cpu_count() to override auto-detection. 2021-07-16 10:06:10 +02:00
Keyun Tong b7266302a4 fftools/ffmpeg: Add new variant source_no_drop to the force_key_frames option
Suggested-By: ffmpeg@fb.com
2021-07-16 09:50:19 +02:00
Kacper Michajłow b7e350af3e avfilter/[vf_nnedi, vf_estdif]: check interlaced flag on correct frame
Fixes regression in vf_nnedi after
24dc6d386c and vf_estdif while at it.

Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
2021-07-16 09:22:36 +02:00
Paul B Mahol 03a8d9c7fd avfilter/vf_nnedi: fix time base for large denominators 2021-07-16 09:10:08 +02:00
Paul B Mahol ca94d52f2e avfilter/vf_estdif: fix time base for large denominators 2021-07-16 09:10:03 +02:00
Paul B Mahol c4e51af5e7 avfilter/vf_w3fdif: fix time base for large denominators 2021-07-16 09:09:58 +02:00
James Almer 022e50c002 ffprobe: use quotation marks in the xml header output
xmllint (silently) replaces the ' with " when fixing and validating the output
of ffprobe in fate-ffprobe_xsd.

Reviewed-by: Tobias Rapp <t.rapp@noa-archive.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2021-07-15 23:46:40 -03:00
James Almer cdbf2fc3e4 configure: use the correct header for the fallback libxext check
Signed-off-by: James Almer <jamrial@gmail.com>
2021-07-15 16:53:56 -03:00
James Almer 395d9ad00a configure: clean up and fix xlib checks
Split them into separate checks per library.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-07-15 15:44:46 -03:00
Martin Storsjö 13ec6624b3 mov: Don't export unknown/unhandled metadata types as if they were UTF8
They can be other incompatible text encodings (such as UTF-16),
or even binary data.

Signed-off-by: Martin Storsjö <martin@martin.st>
2021-07-15 10:25:39 +03:00
Martin Storsjö a99dd5f6a4 mov: Pick up "com.apple.quicktime.artwork" as cover art
Signed-off-by: Martin Storsjö <martin@martin.st>
2021-07-15 10:25:35 +03:00
Timo Rothenpieler 7ec7e6aa2d configure: use pkg-config for xlib/Xv 2021-07-14 23:58:24 +02:00
James Almer 1349de10b2 avcodec/libdav1d: parse sequence headers in extradata if available
This allows the decoder context to be initialized with all stream parameters
before a packet is parsed.

Signed-off-by: James Almer <jamrial@gmail.com>
2021-07-14 13:11:51 -03:00
Kevin LaFlamme 3f5d5c1c2d Fix double write of DASH manifest in streaming mode
When streaming mode is enabled, the DASH manifest is written on the
first packet for the segment so that the segment can be advertised
immediately to clients. It was also still writing the manifest at the
end of the segment leading to two duplicate writes.
2021-07-14 19:54:14 +05:30
Tobias Rapp ca56299fb3 avfilter/af_astats: Only print header lines when values are to be printed
Avoids empty "Channel" or "Overall" header lines added to log output
when measurement is restricted to one scope using
"measure_perchannel=none" or "measure_overall=none".

Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
2021-07-14 10:31:33 +02:00
Tobias Rapp f531a1a4e8 fate/ffprobe: Verify ffprobe XML output against schema file
Adds schema validation for ffprobe XML output so that updating the
ffprobe.xsd file upon changes to ffprobe is not forgotten. This was
suggested by Marton Balint in:
http://ffmpeg.org/pipermail/ffmpeg-devel/2021-March/278428.html

The schema FATE test is only run if xmllint command is available.

Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com>
2021-07-13 08:57:23 +02:00