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

110635 Commits

Author SHA1 Message Date
Anton Khirnov
c5d77dcbf1 fftools/ffmpeg_demux: move InputFile.ts_offset_discont,last_ts to private data
They are no longer used outside of ffmpeg_demux.
2023-05-15 13:32:02 +02:00
Anton Khirnov
ab223a4d8c fftools/ffmpeg: stop accessing input format from decoding code
Export the corresponding flag in InputFile instead. This will allow
making the demuxer AVFormatContext private in future commits, similarly
to what was previously done for muxers.
2023-05-15 13:32:02 +02:00
Anton Khirnov
2ab9f247f7 fftools/ffmpeg: log corrupt-frame errors to the appropriate context 2023-05-15 13:32:02 +02:00
Anton Khirnov
a1002bc39c fftools/ffmpeg: replace print_error() by more meaningful messages 2023-05-15 13:32:01 +02:00
Anton Khirnov
fd980b2615 fftools/ffmpeg_demux: reindent after previous commit 2023-05-15 13:32:01 +02:00
Anton Khirnov
9429624a76 fftools/ffmpeg: move discarding unused programs to ffmpeg_demux
This is a more appropriate place for this code.
2023-05-15 13:32:01 +02:00
Anton Khirnov
f9657b7443 fftools/ffmpeg: simplify tracking -readrate start time
There is no point in having a per-stream wallclock start time, since
they are all computed at the same instant. Keep a per-file start time
instead, initialized when the demuxer thread starts.
2023-05-15 13:32:01 +02:00
Anton Khirnov
6b0c984f0d fftools/ffmpeg_demux: move InputStream.streamcopy_needed to private data
It is no longer used outside of ffmpeg_demux.
2023-05-15 13:32:01 +02:00
Anton Khirnov
7df3253c5a fftools/ffmpeg_demux: move InputStream.wrap_correction_done to private data
It is no longer used outside of ffmpeg_demux.
2023-05-15 13:32:01 +02:00
Anton Khirnov
df25e21ce7 fftools/ffmpeg_demux: move InputStream.[next_]dts to private data
They are no longer used outside of ffmpeg_demux.
2023-05-15 13:32:01 +02:00
Anton Khirnov
6d7b43ed44 fftools/ffmpeg_demux: move InputStream.[saw_]first_d?ts to private data
They are no longer used outside of ffmpeg_demux.
2023-05-15 13:32:01 +02:00
Anton Khirnov
57a2b2f886 fftools/ffmpeg_demux: move InputStream.{nb_packets,data_size} to private data
They are no longer used outside of ffmpeg_demux.
2023-05-15 13:32:01 +02:00
Anton Khirnov
6fcfe4307c fftools/ffmpeg: drop unused decode_video() parameter 2023-05-15 13:32:01 +02:00
Anton Khirnov
bfd5e7ef5d fftools/ffmpeg_demux: reindent after previous commit 2023-05-15 13:32:01 +02:00
Anton Khirnov
2b99c6bfd5 fftools/ffmpeg: move post-demux packet processing to ffmpeg_demux
That is a more appropriate place for this code and will allow hiding
more of InputStream.

The value of repeat_pict extracted from libavformat internal parser no
longer needs to be trasmitted outside of the demuxing thread.

Move readrate handling to the demuxer thread. This has to be done in the
same commit, since it reads InputStream.dts,nb_packets, which are now
set in the demuxer thread.
2023-05-15 11:03:15 +02:00
Anton Khirnov
09c686788e fftools/ffmpeg: attach InputStream.dts to demuxed packets when needed
This way computing it and using it for streamcopy does not need to
happen in sync. Will be useful in following commits, where updating
InputStream.dts will be moved to the demuxing thread.
2023-05-15 10:57:19 +02:00
Anton Khirnov
abf9532bda fftools/ffmpeg_demux: move preparing DemuxMsg to separate function
Will be useful in following commits, which will move more code into this
function.
2023-05-15 10:57:19 +02:00
Anton Khirnov
989e87b03c fftools/ffmpeg: stop using decoder properties in ist_dts_update()
This code runs post-demuxing and is not synchronized with the decoder
output (which may be delayed with respect to its input by arbitrary and
unknowable amounts), so accessing any decoder properties is incorrect.
2023-05-15 10:57:19 +02:00
Anton Khirnov
0d25b404d4 fftools/ffmpeg: reindent after previous commit 2023-05-15 10:57:19 +02:00
Anton Khirnov
702ff2d281 fftools/ffmpeg: consolidate InputStream.[next_]dts updates
Move them to a separate function called right after timestamp
discontinuity processing. This is now possible, since these values have
no interaction with decoding anymore.
2023-05-15 10:57:19 +02:00
Anton Khirnov
a238ba9c3c fftools/ffmpeg: stop using deprecated ticks_per_frame 2023-05-15 10:56:48 +02:00
Anton Khirnov
7d1d61cc5f lavc: deprecate AVCodecContext.ticks_per_frame
For encoding, this field is entirely redundant with
AVCodecContext.framerate.

For decoding, this field is entirely redundant with
AV_CODEC_PROP_FIELDS.
2023-05-15 10:56:18 +02:00
Anton Khirnov
2953ebe7b6 tests/fate: add a simple test for libx264
Since this is an external encoder not under our control, we cannot test
the encoded output exactly as is done for internal encoders. We can
still test however that the output is decodable and produces the
expected number of frames with expected dimensions, pixel formats, and
timestamps.
2023-05-15 10:39:02 +02:00
Anton Khirnov
f618004bc1 lavc/libvpxenc: send frame durations to the encoder
Adapt similar code from libaomenc - stop using ticks_per_frame except as
a last resort.
2023-05-15 10:32:05 +02:00
Anton Khirnov
2ad468ed1f lavc/libkvazaar,libopenh264enc: drop redundant checks
The same check is present in encode_preinit_video().
2023-05-15 10:32:05 +02:00
Anton Khirnov
aa3b0f4376 libaomenc: use AVCodecContext.framerate when available 2023-05-15 10:32:05 +02:00
Anton Khirnov
3fabf71207 lavc/msmpeg4enc: use AVCodecContext.framerate when available 2023-05-15 10:32:05 +02:00
Anton Khirnov
dc20baa049 lavc/ratecontrol: use AVCodecContext.framerate when available 2023-05-15 10:32:05 +02:00
Anton Khirnov
e930b834a9 lavf: use AV_CODEC_PROP_FIELDS where appropriate
H.264 and mpeg12 parsers need to be adjusted at the same time to stop
using the value of AVCodecContext.ticks_per_frame, because it is not set
correctly unless the codec has been opened. Previously this would result
in both the parser and lavf seeing the same incorrect value, which would
cancel out.
Updating lavf and not the parsers would result in correct value in lavf,
but the wrong one in parsers, which would break some tests.
2023-05-15 10:31:55 +02:00
Anton Khirnov
70433abf7f lavc/codec_desc: add a property for codecs that support field coding
Multiple places currently use AVCodecContext.ticks_per_frame > 1 to
identify such codecs, which
* requires a codec context
* requires it to be open
2023-05-15 10:31:55 +02:00
Anton Khirnov
78e84c054a fftools/ffmpeg: fix computing video frame duration from repeat_pict
This field contains the number of _field_ durations by which the
standard frame duration should be extended.
2023-05-15 10:31:55 +02:00
Anton Khirnov
d45a296732 lavu/frame: extend AVFrame.repeat_pict documentation 2023-05-15 10:31:55 +02:00
Anton Khirnov
02823210d7 fftools/opt_common: stop printing deprecated AV_CODEC_CAP_SUBFRAMES 2023-05-15 10:24:54 +02:00
Anton Khirnov
8b20d0dcb5 lavc: deprecate AV_CODEC_CAP_SUBFRAMES
There is nothing meaningful the caller can do with it.
2023-05-15 10:24:54 +02:00
Anton Khirnov
51d6ae099f lavc/decode: drop a useless warning
Decoders will currently warn if an audio decoder not marked with
AV_CODEC_CAP_SUBFRAMES consumes less than the whole packet, but
* this happens for regular files
* this has no negative consequences
* there is no meeaningful action that can or should be taken in response

The warning is thus useless noise.
2023-05-15 10:24:54 +02:00
Michael Niedermayer
954d16fa3f
avformat/hls: Try to implement RFC8216 playlist refusal
This should fix the regression since 6b1f68ccb0

Should fix Ticket10353 (please test and report cases that still fail)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-05-15 03:02:28 +02:00
Michael Niedermayer
a7b06bfc5d
avformat: add ff_match_url_ext()
Match url against a list of extensions similar to av_match_ext()

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2023-05-15 03:02:28 +02:00
Paul B Mahol
2a74826b02 avfilter/*xfade: reduce memory consumption
There is no always need for new buffers.
2023-05-14 23:35:50 +02:00
James Almer
6759983bdc avcodec/cbs_av1: add valid range of values for num_units_in_decoding_tick
The spec states "num_units_in_decoding_tick shall be greater than 0".

Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-14 17:09:38 -03:00
Paul B Mahol
66175c2dca avfilter/f_graphmonitor: set output frame duration 2023-05-14 20:58:08 +02:00
Paul B Mahol
932ccf9e7d avfilter/f_loop: free video frames once not needed 2023-05-14 20:58:08 +02:00
Paul B Mahol
c27895bb98 avfilter/f_graphmonitor: add nozero display mode 2023-05-14 20:58:08 +02:00
Paul B Mahol
6eecfc577b avfilter/f_graphmonitor: rename enums 2023-05-14 20:58:08 +02:00
Paul B Mahol
8041d00271 avfilter/f_loop: fix looping for aloop 2023-05-14 20:58:07 +02:00
Paul B Mahol
7a63add0ea avfilter/f_loop: add time option, for loop start in seconds 2023-05-14 20:58:07 +02:00
Niklas Haas
30c71ef98e lavfi/vf_libplacebo: add frame_mixer option
Fairly straightforward. We just need to modify the scaler handling code
slightly to support looking at a different list of filter presets.
2023-05-14 11:21:43 +02:00
Niklas Haas
02f3b9312a lavfi/vf_libplacebo: allow fps conversion
This exposes libplacebo's frame mixing functionality to vf_libplacebo,
by allowing users to specify a desired target fps to output at. Incoming
frames will be smoothly resampled (in a manner determined by the
`frame_mixer` option, to be added in the next commit).

To generate a consistently timed output stream, we directly use the
desired framerate as the timebase, and simply output frames in
sequential order (tracked by the number of frames output so far).
2023-05-14 11:21:43 +02:00
Niklas Haas
83b1f3f54e lavfi/vf_libplacebo: switch to activate()
To present compatibility with the current behavior, we keep track of a
FIFO of exact frame timestamps that we want to output to the user. In
practice, this is essentially equivalent to the current filter_frame()
code, but this design allows us to scale to more complicated use cases
in the future - for example, insertion of intermediate frames
(deinterlacing, frame doubling, conversion to fixed fps, ...)
2023-05-14 11:21:43 +02:00
Niklas Haas
9e802a47cc lavfi/vf_libplacebo: switch to pl_queue-based design
This does not leverage any immediate benefits, but refactors and
prepares the codebase for upcoming changes, which will include the
ability to do deinterlacing and resampling (frame mixing).
2023-05-14 11:21:43 +02:00
Niklas Haas
2d5e137207 lavfi/vf_libplacebo: split and refactor logic
This commit contains no functional change. The goal is merely to
separate the highly intertwined `filter_frame` and `process_frames`
functions into their separate concerns, specifically to separate frame
uploading (which is now done directly in `filter_frame`) from emitting a
frame (which is now done by a dedicated function `output_frame`).

The overall idea here is to be able to ultimately call `output_frame`
multiple times, to e.g. emit several output frames for a single input
frame.
2023-05-14 11:21:43 +02:00