Commit Graph

110564 Commits

Author SHA1 Message Date
Pierre-Anthony Lemieux 23d968d55a
avformat/imf: fix invalid resource handling 2023-05-11 09:04:37 -07:00
Devin Heitmueller 9f4df9a535 avdevice/decklink_enc: add support for playout of 608 captions in MOV files
Unlike other cases where the closed captions are embedded in the
video stream as MPEG-2 userdata or H.264 SEI data, with MOV files
the captions are often found on a separate "e608" subtitle track.

Add support for playout of such files, leveraging the new ccfifo
mechanism to ensure that they are embedded into VANC at the correct
rate (since e608 packets often contain batches of multiple 608 pairs).

Note this patch includes a new file named libavdevice/ccfifo.c, which
allows the ccfifo functionality in libavfilter to be reused even if
doing shared builds.  This is the same approach used for log2_tab.c.

Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2023-05-11 22:06:20 +08:00
Devin Heitmueller 0e12cdc69c avfilter/vf_ccrepack: Add new filter to repack CEA-708 side data
THis filter can correct certain issues seen from upstream sources
where the cc_count is not properly set or the CEA-608 tuples are
not at the start of the payload as expected.

Make use of the ccfifo to extract and immediately repack the CEA-708
side data, thereby removing any extra padding and ensuring the 608
tuples are at the front of the payload.

Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2023-05-11 22:06:20 +08:00
Devin Heitmueller f304c3a729 avfilter/tinterlace: Properly preserve CEA-708 closed captions
Because the interlacing filter halves the effective framerate, we
need to ensure that no CEA-708 data is lost as frames are merged.

Make use of the new ccfifo mechanism to ensure that caption data
is properly preserved as frames pass through the filter.

Thanks to Thomas Mundt for review and noticing a couple of
missed codepaths for injection on output.  Thanks to Lance Wang
for pointing out a memory leak.

Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2023-05-11 22:06:20 +08:00
Devin Heitmueller cecf35ae3e avfilter/yadif: Properly preserve CEA-708 closed captions
Various deinterlacing modes have the effect of doubling the
framerate, and we need to ensure that the caption data isn't
duplicated (or else you get double captions on-screen).

Use the new ccfifo mechanism for yadif (and yadif_cuda and bwdif
since they use the same yadif core) so that CEA-708 data is
properly preserved through this filter.

Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2023-05-11 22:06:20 +08:00
Devin Heitmueller 61a9f3c0ce avfilter/vf_fps: properly preserve CEA-708 captions
The existing implementation made an attempt to remove duplicate
captions if increasing the framerate, but made no attempt to
handle reducing the framerate, nor did it rewrite the caption
payloads to have the appropriate cc_count (e.g. the cc_count needs
to change from 20 to 10 when going from 1080i59 to 720p59 and
vice-versa).

Make use of the new ccfifo mechanism to ensure that caption data
is properly preserved.

Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2023-05-11 22:06:20 +08:00
Devin Heitmueller 2b0e794ffc avfilter/ccfifo: Properly handle CEA-708 captions through framerate conversion
When transcoding video that contains 708 closed captions, the
caption data is tied to the frames as side data.  Simply dropping
or adding frames to change the framerate will result in loss of
data, so the caption data needs to be preserved and reformatted.

For example, without this patch converting 720p59 to 1080i59
would result in loss of 50% of the caption bytes, resulting in
garbled 608 captions and 708 probably wouldn't render at all.
Further, the frames that are there will have an illegal
cc_count for the target framerate, so some decoders may ignore
the packets entirely.

Extract the 608 and 708 tuples and insert them onto queues.  Then
after dropping/adding frames, re-write the tuples back into the
resulting frames at the appropriate rate given the target
framerate.  This includes both having the correct cc_count as
well as clocking out the 608 pairs at the appropriate rate.

Thanks to Lance Wang <lance.lmwang@gmail.com>, Anton
Khirnov <anton@khirnov.net>, and Michael Niedermayer <michael@niedermayer.cc>
for providing review/feedback.

Signed-off-by: Devin Heitmueller <dheitmueller@ltnglobal.com>
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
2023-05-11 22:06:20 +08:00
Christopher Degawa 7958325a83 libavcodec/libsvtav1: Allow -1 for preset option
Currently, the -1 (MR) preset is disallowed as it's taken as the preset
option not set, and the only way to access it was through svtav1-params.

Signed-off-by: Christopher Degawa <ccom@randomderp.com>
Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-11 10:59:33 -03:00
Andriy Utkin ceb050427c doc/filters/crop: drop unmatched quote in example
Commit 55b81528a9 ("doc/filters: itemize crop examples") dropped the
quotation marks from these examples, but this one remained. Quotes are
actually needed to put the example into a command line or a program, but
removing it here makes the example consistent with the document.
2023-05-11 15:54:15 +05:30
Paul B Mahol 0412e1dc80 avfilter/vsrc_testsrc: mark zoneplate as full range 2023-05-10 16:42:00 +02:00
Paul B Mahol 5b300b69a6 avfilter/af_pan: free input frame once unneeded 2023-05-10 14:01:49 +02:00
Paul B Mahol 2de30e7f8c avfilter/af_join: fix leak on error 2023-05-10 13:56:34 +02:00
Paul B Mahol ffd275a7e0 avfilter/af_pan: fix leaks on error case 2023-05-10 13:56:34 +02:00
Dai, Jianhui J a4abe37fb5 vcodec/vp8data: Move ff_vp8_dct_cat_prob to vp8data.c
Avoid compiling error if included by multiple sources.

Signed-off-by: Jianhui Dai <jianhui.j.dai@intel.com>
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
2023-05-10 07:11:40 -04:00
Paul B Mahol 5ce76506de avdevice/lavfi: check that pointer is set
Fixes NULL pointer dereference later.
2023-05-10 12:55:22 +02:00
Paul B Mahol dc1d4a8ece avfilter/src_avsynctest: add support for commands 2023-05-10 12:55:22 +02:00
Paul B Mahol 5e7042fa31 avfilter/src_avsynctest: fix beep amplitude scaling 2023-05-10 12:55:21 +02:00
Lukáš Lalinský b5af451901 avcodec/libmp3lame: make it possible to set copyright/original flags 2023-05-10 09:42:35 +02:00
Paul B Mahol 512bba3d1b avfilter/vf_varblur: add float format support 2023-05-09 21:46:38 +02:00
Paul B Mahol 57f264e78c avfilter/vf_estdif: simplify finding minimum score 2023-05-09 12:12:46 +02:00
Paul B Mahol 16a86b443d avfilter/vf_estdif: remove float usage 2023-05-09 12:12:46 +02:00
Paul B Mahol 54353ce88e avfilter/vf_estdif: fix recently introduced regression 2023-05-09 12:10:04 +02:00
Paul B Mahol 3475c8342c avfilter: add zoneplate video test source 2023-05-09 08:48:44 +02:00
Paul B Mahol 086a0f3e5e avfilter/asrc_anoisesrc: improve velvet noise output 2023-05-09 00:42:36 +02:00
Paul B Mahol 90096dd042 avfilter/vf_feedback: fix artifacts with subsampled chroma 2023-05-09 00:42:18 +02:00
Thilo Borgmann 21a0b6bca8 avfilter/vf_mpdecimate: Add option to keep the first N similar frames before dropping
This allows for decimating large similar portions of a video while preserving small ones.
2023-05-08 21:55:53 +02:00
Paul B Mahol 1eed7f6562 avfilter/vf_morpho: add slice threading support 2023-05-08 17:48:43 +02:00
Paul B Mahol df886171a6 avfilter/vf_morpho: remove unused function's argument 2023-05-08 17:48:43 +02:00
Paul B Mahol bbe410a7fd avfilter/vf_morpho: move structure processing in separate loop 2023-05-08 17:48:43 +02:00
James Almer 63d7ea38c7 fftools/ffprobe: print exported stream AVOptions
Similar to the decoder AVOptions, this is useful to show values from options
exported by the demuxer.

Signed-off-by: James Almer <jamrial@gmail.com>
2023-05-08 11:04:37 -03:00
Anton Khirnov 2d43c23b81 fftools/ffmpeg: discard packets for unused streams in demuxing thread
Avoids the pointless overhead of transferring them to the main thread.
2023-05-08 10:38:59 +02:00
Anton Khirnov a0174a235b fftools/ffmpeg_filter: use InputFilterPriv.eof instead of InputFile.eof_reached
The two checks using eof_reached are testing whether more input can
possibly appear on this filtergraph input. InputFilterPriv.eof is the
more authoritative source for this information.
2023-05-08 10:38:59 +02:00
Anton Khirnov dd1c67d539 fftools/ffmpeg: move unconfigured graph handling to ffmpeg_filter
This code more properly belongs there.
2023-05-08 10:38:59 +02:00
Anton Khirnov c26a6c5a52 fftools/ffmpeg_filter: use av_buffer_replace() to improve code
It is shorter and more efficient.
2023-05-08 10:38:59 +02:00
Anton Khirnov 5356f5ed23 fftools/ffmpeg_filter: move InputFilter.hw_frames_ctx to private data
It is not used outside of ffmpeg_filter.
2023-05-08 10:38:59 +02:00
Anton Khirnov 71d7e9bbec fftools/ffmpeg_filter: move InputFilter.displaymatrix to private data
It is not used outside of ffmpeg_filter.
2023-05-08 10:38:59 +02:00
Anton Khirnov e8df737cb2 fftools/ffmpeg_filter: move InputFilter.eof to private data
It is not used outside of ffmpeg_filter.
2023-05-08 10:38:59 +02:00
Anton Khirnov c7c73a3250 fftools/ffmpeg_filter: take fallback parameters from decoder, not demuxer
When an input stream terminates and no frames were successfully decoded,
filtering code will currently configure the filtergraph using demuxer
stream parameters. Use decoder parameters instead, which should be more
reliable. Also, initialize them immediately when an input stream is
bound to a filtergraph input, so that these parameters are always
available (if at all) and filtering code does not need to reach into the
decoder at some arbitrary later point.
2023-05-08 10:38:59 +02:00
Anton Khirnov 48d8d3549a fftools/ffmpeg_enc: stop configuring filter inputs from encoder flush
When no frames are ever seen by an encoder, encoder flush will do a
last-ditch attempt to configure its source filtergraph in order to at
least get the stream parameters. This involves extracting demuxer
parameters from filtergraph source inputs, which is
* a bad layering violation
* probably unreachable, because decoders are flushed before encoders,
  which should call ifilter_send_eof(), which will also set these
  parameters; however due to complex control flow it is hard to be
  entirely sure this code can never be triggered

Even if this code can actually be reached, it is probably better to
return an error as the comment above it says.
2023-05-08 10:38:59 +02:00
Anton Khirnov f5cfb2c5df fftools/ffmpeg: eliminate need_output()
Replace it by simply calling choose_output() earlier.
2023-05-08 10:38:58 +02:00
Anton Khirnov 5673da4797 fftools/ffmpeg: merge choose_output() and got_eagain()
These two functions are a part of a single logical action - determining
which, if any, output stream needs to be processed next. Keeping them
separate is a historical artifact that obscures what is actually being
done.
2023-05-08 10:38:58 +02:00
Jonathan Gilbert f009f84961 doc/filters/colorcorrect: fix bh option description 2023-05-07 23:23:48 +02:00
metamuffin 2dd9b4071c avdevice/lavfi: update documentation
lavfi not only supports video but also audio by now.
2023-05-07 17:29:00 +02:00
Paul B Mahol 1c8bf697ee avfilter/f_ebur128: export results into read-only options 2023-05-07 17:28:25 +02:00
Paul B Mahol 7153642992 avfilter/af_replaygain: export results into read-only options 2023-05-07 17:25:57 +02:00
Paul B Mahol 782ea8b2e5 avfilter/af_asetnsamples: add timeline support 2023-05-07 17:25:07 +02:00
Paul B Mahol 03800bcaf3 avfilter/af_asetnsamples: add commands support 2023-05-07 17:25:02 +02:00
Anton Khirnov 0e00d23510 fftools/ffmpeg: reduce -re to -readrate 1
They are exactly equivalent, so there is no point in maintaining a
separate flag for -re.
2023-05-07 15:49:27 +02:00
Anton Khirnov 007ec49db8 fftools/ffmpeg: use a non-zero default for -readrate_initial_burst
Use it to replace a hack added in 6f20685228.
2023-05-07 15:49:21 +02:00
Davy Durham 2ae16b05d6 fftools/ffmpeg: add ability to set a input burst time before readrate is enforced
Signed-off-by: Anton Khirnov <anton@khirnov.net>
2023-05-07 15:48:15 +02:00