1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-12 19:18:44 +02:00
Commit Graph

109574 Commits

Author SHA1 Message Date
Zhao Zhili
5ab429d8df avcodec/videotoolboxenc: log when get_cv_pixel_format failed
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-01-11 18:57:20 +08:00
Zhao Zhili
52eb2396d7 fftools/ffmpeg_demux: prefer fd over pipe for seek support
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-01-11 18:50:36 +08:00
Zhao Zhili
244f3cfbe3 fftools/ffprobe: prefer fd over pipe for seek support
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-01-11 18:50:36 +08:00
Zhao Zhili
c926140558 fftools/ffplay: prefer fd over pipe for seek support
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-01-11 18:50:36 +08:00
Zhao Zhili
195ccf7ea8 fftools/ffmpeg_demux: disable stdin interaction for fd protocol
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-01-11 18:50:36 +08:00
Zhao Zhili
6e7c006e40 avformat/file: add fd protocol
Unlike the pipe protocol, fd protocol has seek support if it
corresponding to a regular file.

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-01-11 18:50:36 +08:00
Zhao Zhili
e9fe1634d4 avformat/file: dup file descriptor for pipe
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-01-11 18:50:36 +08:00
Zhao Zhili
8d91a8faab avformat/file: reindent after the previous commit
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-01-11 18:50:36 +08:00
Zhao Zhili
49b8f043ca avformat/file: add fd option for pipe
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-01-11 18:50:36 +08:00
Lukas Rusak
0d7c452d84 avcodec/v4l2m2m: allow lower minimum buffer values
There is no reason to enforce a high minimum. In the context
of streaming only a few output buffers and capture buffers
are even needed for continuous playback. This also helps
alleviate memory pressure when decoding 4K media.

Signed-off-by: Aman Karmani <aman@tmm1.net>
2023-01-10 14:49:53 -08:00
Aman Karmani
18d9959fd9 avcodec/v4l2_m2m: log both v4l2 and av pixel formats during negotiation
Signed-off-by: Aman Karmani <aman@tmm1.net>
2023-01-10 14:47:24 -08:00
James Almer
0431f9805e avcodec/av1_parser: export timing information when present
Signed-off-by: James Almer <jamrial@gmail.com>
2023-01-10 09:08:09 -03:00
Anton Khirnov
54c0e72b42 lavfi/graphparser: drop a redundant label 2023-01-10 11:52:02 +01:00
Anton Khirnov
ca67a783ab lavfi/graphparser: improve applying graph-level sws options
The current code will apply them if the options string does not contain
a 'flags' substring, and will do so by appending the graph-level option
string to the filter option string (with the standard ':' separator).
This is flawed in at least the following ways:
- naive substring matching without actually parsing the options string
  may lead to false positives (e.g. flags are specified by shorthand)
  and false negatives (e.g. the 'flags' substring is not actually the
  option name)
- graph-level sws options are not limited to flags, but may set
  arbitrary sws options

This commit simply applies the graph-level options with
av_set_options_string() and lets them be overridden as desired by the
user-specified filter options (if any). This is also shorter and avoids
extra string handling.
2023-01-10 11:52:02 +01:00
Anton Khirnov
1c18530e93 lavfi/avfilter: process options for filters without a private class
It still makes sense to apply AVFilterContext-level options to such
filters.
2023-01-10 11:52:02 +01:00
Anton Khirnov
d234b4b193 lavfi/avfilter: simplify process_options()
This function currently treats AVFilterContext options and
filter-private options differently: the former are immediately applied,
while the latter are stored in a dictionary to be applied later.

There is no good reason for having two branches - storing all options in
the dictionary is simpler and achieves the same effect (since it is
later applied with av_opt_set_dict()).

This will also be useful in future commits.
2023-01-10 11:52:02 +01:00
Anton Khirnov
b6ba764552 lavfi/avfilter: export a multikey dict from process_options()
This way the function does not need to be able to match keys to
AVOptions, which will be useful in future commits.
2023-01-10 11:52:02 +01:00
Anton Khirnov
bd7c07c26a lavfi/avfilter: avoid a redundant av_opt_set_dict2() call
Current code first sets AVFilterContext-level options, then aplies the
leftover on the filter's private data. This is unnecessary, applying the
options to AVFilterContext with the AV_OPT_SEARCH_CHILDREN flag
accomplishes the same effect.
2023-01-10 11:52:02 +01:00
Anton Khirnov
a7b1b4bc23 lavfi: remove AVFilter.init_dict()
Nothing uses it anymore.

All options on all filters can now be set with normal AVOptions
mechanisms, such as av_opt_set*().
2023-01-10 11:52:02 +01:00
Anton Khirnov
018a8b9dc3 lavfi/vf_scale: allow passing options to swscale directly
Avoid using the dictionary mechanism, which is non-introspectable. As
this is the only user of AVFilter.init_dict(), this callback can now be
removed.
2023-01-10 11:52:02 +01:00
Anton Khirnov
260f391893 fftools/ffmpeg: always generate CFR output when -r is used
Current code may, depending on the muxer, decide to use VSYNC_VFR tagged
with the specified framerate, without actually performing framerate
conversion. This is clearly wrong and against the documentation, which
states unambiguously that -r should produce CFR output for video
encoding.

FATE test changes:
* nuv-rtjpeg: replace -r with '-enc_time_base -1', which keeps the
  original timebase. Output frames are now produced with proper
  durations.
* filter-mpdecimate: just drop the -r option, it is unnecessary
* filter-fps-r: remove, this test makes no sense and actually
  produces broken VFR output (with incorrect frame durations).
2023-01-10 11:49:28 +01:00
Anton Khirnov
e884360e91 doc/ffmpeg: improve -r documentation
Explain different behavior for encoding and streamcopy.
2023-01-10 11:49:28 +01:00
Anton Khirnov
7655249f72 fftools/ffmpeg: reindent after previous commit 2023-01-10 11:49:28 +01:00
Anton Khirnov
a848a5a223 fftools/ffmpeg: move video frame dup/drop logic into its own function 2023-01-10 11:49:28 +01:00
Anton Khirnov
5874ca3650 fftools/ffmpeg: rename a variable to be more descriptive 2023-01-10 11:49:28 +01:00
Anton Khirnov
3b21f10639 fftools/ffmpeg: fix stream id in an error message.
Broken in 7ef7a22251
2023-01-10 11:49:28 +01:00
Anton Khirnov
c60941dfaf fftools/ffmpeg: stop using AVCodecContext.sample_rate in decode_audio()
Use the decoded frame's sample_rate instead, which is the authoritative
value.

Drop a now-obsolete check validating AVCodecContext.sample_rate.
2023-01-10 11:49:28 +01:00
Anton Khirnov
1a6ba73ff7 doc/ffmpeg.texi: drop a non-existent option
-ilme has not existed for 17 years, since
637b5326f3
2023-01-10 11:49:28 +01:00
Anton Khirnov
f566032bfd lavc/decode: validate frames output by decoders
Make sure no frames with invalid parameters will be seen by the caller.
2023-01-10 11:47:29 +01:00
Anton Khirnov
a1eec66867 lavc/decode: deduplicate cleanup in ff_decode_receive_frame() 2023-01-10 11:47:29 +01:00
Anton Khirnov
5bf8f29135 lavc/qsvdec: check ff_decode_frame_props() return value 2023-01-10 11:47:29 +01:00
Anton Khirnov
3dc7a9f623 lavc/ac3dec: fail when the sample rate is unset 2023-01-10 11:47:29 +01:00
Derek Buitenhuis
94aa70d757 avformat: Rename IPFS to IPFS gateway
It is a URL rewriter for IPFS gateways, not an actual implementation of
IPFS, and naming it as such was both incorrect and misleading.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2023-01-09 12:14:47 -05:00
Paul B Mahol
5d3f0226ad avfilter/avf_avectorscope: add anti-aliased line drawing mode 2023-01-09 18:07:05 +01:00
Derek Buitenhuis
dae3679a9b mov: Disable advanced_editlist for fragmented MP4 input
Advanced edit list support is entirely broken for fragmented MP4s,
currently. mov_fix_index is never run in mov_build_index, since
in fragmented MP4s the stco, stsz, stts, and stsc boxes have zero
entries, with the index being filled in as each fragment's trun
box is seen.

The result of this is that the skip samples is never set properly,
since half the code thinks it doesn't need to, as advanced_editlist
is enabled, but as mov_fix_index is never called, it doesnt get set.
This means that any edits for e.g. priming are not properly applied
as skip samples side data.

This also means remuxing to fragmented MP4 from progressive MP4 with
lavf will quietly drop the edit list, currently.

Example:

    $ ffmpeg -loglevel quiet -advanced_editlist 1 -i non_fragmented.mp4 -f md5 -
    MD5=d02d929f8eb4edef624758a298d5f7c6
    $ ffmpeg -loglevel quiet -advanced_editlist 0 -i non_fragmented.mp4 -f md5 -
    MD5=d02d929f8eb4edef624758a298d5f7c6
    $ ffmpeg -loglevel quiet -advanced_editlist 1 -i fragmented.mp4 -f md5 -
    MD5=e38b110f586fa886ff94e0ca98a95d59 <-- wrong, extra samples are output instead of being skipped
    $ ffmpeg -loglevel quiet -advanced_editlist 0 -i fragmented.mp4 -f md5 -
    MD5=d02d929f8eb4edef624758a298d5f7c6

We cannot call mov_fix_index after reading a trun box
since mov_fix_index seems to assume it is only called once, on a
fully complete index, an multiple calls to it don't seem like
they'd work, so the "best" option seems to be disabling advanced
edit list support entirely for the time being, as it is broken
for these types of files.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
2023-01-09 15:23:41 +00:00
Wenbin Chen
13d04e30d7 libavcodec/qsvenc_av1: Add max_frame_size support to av1_qsv encoder
Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
2023-01-09 13:56:03 +08:00
Wenbin Chen
c8e73558fe libavcodec/qsvenc_av1: Add low_delay_brc support to av1_qsv encoder
Signed-off-by: Wenbin Chen <wenbin.chen@intel.com>
2023-01-09 13:56:03 +08:00
Zhao Zhili
a598be44df avcodec/mediacodecenc: enable B frames only with -strict experimental
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
2023-01-09 19:21:57 +08:00
Anton Khirnov
fcd557a2c2 lavc/get_bits: add a compat wrapper for the cached bitstream reader
Use that instead of the merged version.
2023-01-06 11:04:10 +01:00
Anton Khirnov
b6742259bf lavc/tests: add a cached bitstream reader test 2023-01-06 11:01:00 +01:00
Anton Khirnov
9177970bca lavc/bitstream: templatize for BE/LE
Allows using both BE and LE bitstream readers in the same file.
2023-01-06 10:49:42 +01:00
Alexandra Hájková
8fe551eca0 lavc: add standalone cached bitstream reader
The cached bitstream reader was originally written by Alexandra Hájková
for Libav, with significant input from Kostya Shishkov and Luca Barbato.
It was then committed to FFmpeg in ca079b0954, by merging it with the
implementation of the current bitstream reader.

This merge makes the code of get_bits.h significantly harder to read,
since it now contains two different bitstream readers interleaved with
 #ifdefs. Additionally, the code was committed without proper authorship
attribution.

This commit re-adds the cached bitstream reader as a standalone header,
as it was originally developed. It will be made useful in following
commits.

Integration by Anton Khirnov.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
2023-01-06 10:48:56 +01:00
Aman Karmani
4b2b9a6604 avcodec/mpeg12dec: flush a53 data
Signed-off-by: Aman Karmani <aman@tmm1.net>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2023-01-06 10:47:53 +01:00
James Almer
4a80db5fc2 avcodec/mpeg12dec: use init_get_bits8 and check the return value in all remaining cases
Signed-off-by: James Almer <jamrial@gmail.com>
2023-01-04 20:48:06 -03:00
Thierry Foucu
efbe84eb1b avcodec/mpeg12dec: use init_get_bits8 and check the return value
Signed-off-by: James Almer <jamrial@gmail.com>
2023-01-04 16:18:21 -03:00
Paul B Mahol
99bd2dbc91 swresample/swresample_frame: fix regression in detecting changes
Do not overwrite return variable values, instead use different
one for checking results.
2023-01-04 18:19:07 +01:00
Anton Khirnov
a0b5aaceca lavc/libx265: restructure handling reordered_opaque
Current code stores a pointer to allocated data in libx265 and frees it
when the encoded packet is retrieved. This will leak if the packet is
never retrieved, e.g. if the encoder is closed without being flushed.

Restructure the code such that only indices to an array stored in our
private data are given to libx265. This ensures no allocated memory can
be lost.
2023-01-04 11:48:17 +01:00
Anton Khirnov
7399e5305c lavc/libx264: do not leave an invalid array size on alloc error 2023-01-04 11:48:17 +01:00
Anton Khirnov
a4a81be1a8 lavc/libx264: zero reordered opaque on alloc
This is safer.
2023-01-04 11:48:17 +01:00
Anton Khirnov
141303f323 lavc/libx264: print an error on invalid opaque pointer 2023-01-04 11:48:17 +01:00