Tags give the ability to mark specific points in history as being important
-
pr-ffstaging-28/softworkz/submit_long_filenames-v3
a5268800 · ·Support long file names on Windows This patchset adds support for long file and directory paths on Windows. The implementation follows the same logic that .NET is using internally, with the only exception that it doesn't expand short path components in 8.3 format. .NET does this as the same function is also used for other purposes, but in our case, that's not required. Short (8.3) paths are working as well with the extended path prefix, even when longer than 260. Successfully tested: * Regular paths wth drive letter * Regular UNC paths * Long paths wth drive letter * Long paths wth drive letter and forward slashes * Long UNC paths * Prefixed paths wth drive letter * Prefixed UNC paths I have kept the individual functions separate on purpose, to make it easy to compare with the .NET impl. (compilers should inlinie those anyway) v2 * wchar_filename: Improve comments and function documentation * os_support: adjust defines to use win32_stat v3 * removed length check in path_is_extended() * added path_is_device_path() check in add_extended_prefix() * add_extended_prefix(): clarified doc and add checks * clarified string allocation length calculation * replaced 260 with MAX_PATH * removed redundant checks after normalization softworkz (2): avutil/wchar_filename,file_open: Support long file names on Windows avformat/os_support: Support long file names on Windows libavformat/os_support.h | 26 ++++-- libavutil/file_open.c | 2 +- libavutil/wchar_filename.h | 166 +++++++++++++++++++++++++++++++++++++ 3 files changed, 188 insertions(+), 6 deletions(-) base-commit: e3580f60775c897c3b13b178c57ab191ecc4a031 Submitted-As: https://master.gitmailbox.com/ffmpegdev/pull.28.v3.ffstaging.FFmpeg.1652736203.ffmpegagent@gmail.com In-Reply-To: https://master.gitmailbox.com/ffmpegdev/pull.28.ffstaging.FFmpeg.1652435595.ffmpegagent@gmail.com In-Reply-To: https://master.gitmailbox.com/ffmpegdev/pull.28.v2.ffstaging.FFmpeg.1652653071.ffmpegagent@gmail.com
-
pr-ffstaging-28/softworkz/submit_long_filenames-v2
8ecbafe2 · ·Support long file names on Windows This patchset adds support for long file and directory paths on Windows. The implementation follows the same logic that .NET is using internally, with the only exception that it doesn't expand short path components in 8.3 format. .NET does this as the same function is also used for other purposes, but in our case, that's not required. Short (8.3) paths are working as well with the extended path prefix, even when longer than 260. Successfully tested: * Regular paths wth drive letter * Regular UNC paths * Long paths wth drive letter * Long paths wth drive letter and forward slashes * Long UNC paths * Prefixed paths wth drive letter * Prefixed UNC paths I have kept the individual functions separate on purpose, to make it easy to compare with the .NET impl. (compilers should inlinie those anyway) v2 * wchar_filename: Improve comments and function documentation * os_support: adjust defines to use win32_stat softworkz (2): avutil/wchar_filename,file_open: Support long file names on Windows avformat/os_support: Support long file names on Windows libavformat/os_support.h | 26 +++++-- libavutil/file_open.c | 2 +- libavutil/wchar_filename.h | 156 +++++++++++++++++++++++++++++++++++++ 3 files changed, 178 insertions(+), 6 deletions(-) base-commit: d2d8b9b972ba2df6b2a2ebe29f5307cbb7a69c33 Submitted-As: https://master.gitmailbox.com/ffmpegdev/pull.28.v2.ffstaging.FFmpeg.1652653071.ffmpegagent@gmail.com In-Reply-To: https://master.gitmailbox.com/ffmpegdev/pull.28.ffstaging.FFmpeg.1652435595.ffmpegagent@gmail.com
-
pr-ffstaging-27/softworkz/submit_version_include-v3
50b3db34 · ·fftools/opt_common: add includes of avf headers for clarity From: softworkz <softworkz@hotmail.com> Signed-off-by: softworkz <softworkz@hotmail.com> Submitted-As: https://master.gitmailbox.com/ffmpegdev/pull.27.v3.ffstaging.FFmpeg.1652642602645.ffmpegagent@gmail.com In-Reply-To: https://master.gitmailbox.com/ffmpegdev/pull.27.ffstaging.FFmpeg.1652435196848.ffmpegagent@gmail.com In-Reply-To: https://master.gitmailbox.com/ffmpegdev/pull.27.v2.ffstaging.FFmpeg.1652527083214.ffmpegagent@gmail.com
-
pr-ffstaging-12/softworkz/master-upstream_asf_4-v4
78ed5aeb · ·libavformat/asf: fix handling of byte array length values The spec allows attachment sizes of up to UINT32_MAX while we can handle only sizes up to INT32_MAX (in downstream code) The debug.assert in get_tag didn't really address this, and truncating the value_len in calling methods cannot be used because the length value is required in order to continue parsing. This adds a check with log message in ff_asf_handle_byte_array to handle those (rare) cases. v2: Rebased & PING v3: Adjustments suggested by Michael v4: 1 of 11 merged, 10 to go.. softworkz (10): libavformat/asf: fix handling of byte array length values libavformat/asfdec: fix get_value return type and add checks for libavformat/asfdec: fix type of value_len libavformat/asfdec: fixing get_tag libavformat/asfdec: implement parsing of GUID values libavformat/asfdec: fix macro definition and use libavformat/asfdec: remove variable redefinition in inner scope libavformat/asfdec: ensure variables are initialized libavformat/asfdec: fix parameter type in asf_read_stream_propertie() libavformat/asfdec: fix variable types and add checks for unsupported values libavformat/asf.c | 8 +- libavformat/asf.h | 2 +- libavformat/asfdec_f.c | 338 +++++++++++++++++++++++++++-------------- 3 files changed, 229 insertions(+), 119 deletions(-) base-commit: e6f0cec88041449475f37b82b76699d2f7b5b124 Submitted-As: https://master.gitmailbox.com/ffmpegdev/pull.12.v4.ffstaging.FFmpeg.1652561722.ffmpegagent@gmail.com In-Reply-To: https://master.gitmailbox.com/ffmpegdev/pull.12.ffstaging.FFmpeg.1640186030.ffmpegagent@gmail.com In-Reply-To: https://master.gitmailbox.com/ffmpegdev/pull.12.v2.ffstaging.FFmpeg.1651916204.ffmpegagent@gmail.com In-Reply-To: https://master.gitmailbox.com/ffmpegdev/pull.12.v3.ffstaging.FFmpeg.1651978882.ffmpegagent@gmail.com -
pr-ffstaging-27/softworkz/submit_version_include-v2
f011be10 · ·fftools/opt_common: add missing include of avf/version.h From: softworkz <softworkz@hotmail.com> required for PRINT_LIB_INFO(avfilter... Signed-off-by: softworkz <softworkz@hotmail.com> Submitted-As: https://master.gitmailbox.com/ffmpegdev/pull.27.v2.ffstaging.FFmpeg.1652527083214.ffmpegagent@gmail.com In-Reply-To: https://master.gitmailbox.com/ffmpegdev/pull.27.ffstaging.FFmpeg.1652435196848.ffmpegagent@gmail.com
-
pr-ffstaging-28/softworkz/submit_long_filenames-v1
acd81c61 · ·Support long file names on Windows This patchset adds support for long file and directory paths on Windows. The implementation follows the same logic that .NET is using internally, with the only exception that it doesn't expand short path components in 8.3 format. .NET does this as the same function is also used for other purposes, but in our case, that's not required. Short (8.3) paths are working as well with the extended path prefix, even when longer than 260. Successfully tested: * Regular paths wth drive letter * Regular UNC paths * Long paths wth drive letter * Long paths wth drive letter and forward slashes * Long UNC paths * Prefixed paths wth drive letter * Prefixed UNC paths I have kept the individual functions separate on purpose, to make it easy to compare with the .NET impl. (compilers should inlinie those anyway) softworkz (2): avutil/wchar_filename,file_open: Support long file names on Windows avformat/os_support: Support long file names on Windows libavformat/os_support.h | 8 +-- libavutil/file_open.c | 2 +- libavutil/wchar_filename.h | 123 +++++++++++++++++++++++++++++++++++++ 3 files changed, 128 insertions(+), 5 deletions(-) base-commit: d2d8b9b972ba2df6b2a2ebe29f5307cbb7a69c33 Submitted-As: https://master.gitmailbox.com/ffmpegdev/pull.28.ffstaging.FFmpeg.1652435595.ffmpegagent@gmail.com
-
pr-ffstaging-27/softworkz/submit_version_include-v1
db6ab867 · ·fftools/opt_common: add missing include of avf/version.h From: softworkz <softworkz@hotmail.com> required for PRINT_LIB_INFO(avfilter... Signed-off-by: softworkz <softworkz@hotmail.com> Submitted-As: https://master.gitmailbox.com/ffmpegdev/pull.27.ffstaging.FFmpeg.1652435196848.ffmpegagent@gmail.com
-
pr-ffstaging-26/softworkz/submit_replace_fopen-v2
e47287be · ·avfilter: use av_fopen_utf8() instead of plain fopen() From: softworkz <softworkz@hotmail.com> Signed-off-by: softworkz <softworkz@hotmail.com> Submitted-As: https://master.gitmailbox.com/ffmpegdev/pull.26.v2.ffstaging.FFmpeg.1652122322889.ffmpegagent@gmail.com In-Reply-To: https://master.gitmailbox.com/ffmpegdev/pull.26.ffstaging.FFmpeg.1651945149.ffmpegagent@gmail.com
-
pr-ffstaging-23/rcombs/vtdec-hevc-3byte-v1
bf15fa33 · ·lavc/videotoolboxdec: improve HEVC stream compatibility * Improve logging in error conditions * Improve NAL-escape function behavior * Fix some syntax issues in hvcc * Correctly escape NALs in hvcc * Make sure we expose the stop bits in H264 PS NALs These changes fix support for several samples I've found or generated locally. rcombs (6): lavc/videotoolboxdec: warn on nonzero status in the callback lavc/videotoolboxdec: fix escaping sequential zero sequences lavc/videotoolboxdec: fix generating HEVC general_profile_compatibility_flags lavc/videotoolboxdec: fix writing too many 1 bits for the reserved fields lavc/videotoolboxdec: insert emu-prevention bytes for HEVC as well lavc/h264_ps: always include the stop bit in [s|p]ps->data libavcodec/h264_ps.c | 8 ++++++++ libavcodec/videotoolbox.c | 32 ++++++++++++++++++++------------ 2 files changed, 28 insertions(+), 12 deletions(-) base-commit: f77ac5131cd1c623aa54ec432cba0d922e9aa470 Submitted-As: https://master.gitmailbox.com/ffmpegdev/pull.23.ffstaging.FFmpeg.1652120184.ffmpegagent@gmail.com -
pr-ffstaging-12/softworkz/master-upstream_asf_4-v3
bbeee5f2 · ·libavformat/asf: fix handling of byte array length values The spec allows attachment sizes of up to UINT32_MAX while we can handle only sizes up to INT32_MAX (in downstream code) The debug.assert in get_tag didn't really address this, and truncating the value_len in calling methods cannot be used because the length value is required in order to continue parsing. This adds a check with log message in ff_asf_handle_byte_array to handle those (rare) cases. v2: Rebased & PING v3: Adjustments suggested by Michael softworkz (11): libavformat/asf: fix handling of byte array length values libavformat/asfdec: fix get_value return type and add checks for libavformat/asfdec: fix type of value_len libavformat/asfdec: fixing get_tag libavformat/asfdec: implement parsing of GUID values libavformat/asfdec: remove unused parameters libavformat/asfdec: fix macro definition and use libavformat/asfdec: remove variable redefinition in inner scope libavformat/asfdec: ensure variables are initialized libavformat/asfdec: fix parameter type in asf_read_stream_propertie() libavformat/asfdec: fix variable types and add checks for unsupported values libavformat/asf.c | 8 +- libavformat/asf.h | 2 +- libavformat/asfdec_f.c | 368 ++++++++++++++++++++++++++--------------- 3 files changed, 244 insertions(+), 134 deletions(-) base-commit: f1c19867d72a14699277175101b2bcf1e333af88 Submitted-As: https://master.gitmailbox.com/ffmpegdev/pull.12.v3.ffstaging.FFmpeg.1651978882.ffmpegagent@gmail.com In-Reply-To: https://master.gitmailbox.com/ffmpegdev/pull.12.ffstaging.FFmpeg.1640186030.ffmpegagent@gmail.com In-Reply-To: https://master.gitmailbox.com/ffmpegdev/pull.12.v2.ffstaging.FFmpeg.1651916204.ffmpegagent@gmail.com -
pr-ffstaging-26/softworkz/submit_replace_fopen-v1
3266640a · ·use av_fopen_utf8() instead of plain fopen() Unify file access operations by replacing usages of direct calls to posix fopen() softworkz (2): fftools: use av_fopen_utf8() instead of plain fopen() avfilter: use av_fopen_utf8() instead of plain fopen() fftools/cmdutils.c | 6 +++--- fftools/ffmpeg.c | 4 ++-- fftools/opt_common.c | 2 +- libavfilter/af_firequalizer.c | 2 +- libavfilter/vf_deshake.c | 2 +- libavfilter/vf_signature.c | 4 ++-- libavfilter/vf_ssim.c | 2 +- libavfilter/vf_vmafmotion.c | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) base-commit: f3b7ba21ba49b32b4476a8c7c5a9bcdad15e3943 Submitted-As: https://master.gitmailbox.com/ffmpegdev/pull.26.ffstaging.FFmpeg.1651945149.ffmpegagent@gmail.com
-
pr-ffstaging-12/softworkz/master-upstream_asf_4-v2
f606f322 · ·libavformat/asf: fix handling of byte array length values The spec allows attachment sizes of up to UINT32_MAX while we can handle only sizes up to INT32_MAX (in downstream code) The debug.assert in get_tag didn't really address this, and truncating the value_len in calling methods cannot be used because the length value is required in order to continue parsing. This adds a check with log message in ff_asf_handle_byte_array to handle those (rare) cases. v2: Rebased & PING softworkz (11): libavformat/asf: fix handling of byte array length values libavformat/asfdec: fix get_value return type and add checks for libavformat/asfdec: fix type of value_len libavformat/asfdec: fixing get_tag libavformat/asfdec: implement parsing of GUID values libavformat/asfdec: remove unused parameters libavformat/asfdec: fix macro definition and use libavformat/asfdec: remove variable redefinition in inner scope libavformat/asfdec: ensure variables are initialized libavformat/asfdec: fix parameter type in asf_read_stream_propertie() libavformat/asfdec: fix variable types and add checks for unsupported values libavformat/asf.c | 12 +- libavformat/asf.h | 2 +- libavformat/asfdec_f.c | 349 ++++++++++++++++++++++++++--------------- 3 files changed, 232 insertions(+), 131 deletions(-) base-commit: f3b7ba21ba49b32b4476a8c7c5a9bcdad15e3943 Submitted-As: https://master.gitmailbox.com/ffmpegdev/pull.12.v2.ffstaging.FFmpeg.1651916204.ffmpegagent@gmail.com In-Reply-To: https://master.gitmailbox.com/ffmpegdev/pull.12.ffstaging.FFmpeg.1640186030.ffmpegagent@gmail.com -
pr-ffstaging-25/softworkz/derive_devices-v1
023597a5 · ·Add derive-device function which searches for existing devices in both directions This is an updated version of: [PATCH v4 1/1] avutils/hwcontext: When deriving a hwdevice, search for existing device in both directions There has been an objection that the earlier patchset would change API behavior, and that this change should be limited to ffmpeg cli. To achieve this, the API behavior is left unchanged now and a new function av_hwdevice_ctx_get_or_create_derived() is added and used by the hwupload and hwmap filters. softworkz (3): avutils/hwcontext: add derive-device function which searches for existing devices in both directions lavu: bump minor version and add doc/APIchanges entry for av_hwdevice_ctx_get_or_create_derived() avfilter/hwmap,hwupload: use new av_hwdevice_ctx_get_or_create_derived method doc/APIchanges | 3 ++ libavfilter/vf_hwmap.c | 4 +- libavfilter/vf_hwupload.c | 2 +- libavutil/hwcontext.c | 72 +++++++++++++++++++++++++++++++--- libavutil/hwcontext.h | 20 ++++++++++ libavutil/hwcontext_internal.h | 6 +++ libavutil/hwcontext_qsv.c | 13 ++++-- libavutil/version.h | 4 +- 8 files changed, 110 insertions(+), 14 deletions(-) base-commit: eef652ca9c893a84c6430fcdd53eed186c299d82 Submitted-As: https://master.gitmailbox.com/ffmpegdev/pull.25.ffstaging.FFmpeg.1651349262.ffmpegagent@gmail.com -
pr-ffstaging-22/softworkz/patch-2-v1
2696b164 · ·Update ReadMe.md for PR submission and reference Developer Documentation From: softworkz <softworkz@hotmail.com> Signed-off-by: softworkz <softworkz@hotmail.com> Submitted-As: https://master.gitmailbox.com/ffmpegdev/pull.22.ffstaging.FFmpeg.1643923701194.ffmpegagent@gmail.com
-
pr-ffstaging-21/brycechesternewman/patch-poster-time-tag-v1
ee3aac1d · ·[PATCH] libavformat/mov: Expose Quicktime poster_time value as metadata TAG. From: Bryce Chester Newman <bryce.newman@gettyimages.com> I need the ability to derive the poster time found in the mvhd, so I can use that value to create a thumbnail from ffmpeg. More details can be found here https://www.mail-archive.com/ffmpeg-user@ffmpeg.org/msg30003.html Signed-off-by: Bryce Chester Newman <bryce.newman@gettyimages.com> Submitted-As: https://master.gitmailbox.com/ffmpegdev/pull.21.ffstaging.FFmpeg.1643844144096.ffmpegagent@gmail.com
-
pr-ffstaging-20/softworkz/submit_md5-v3
e54769c6 · ·libavutil/tests/md5: Avoid warnings From: softworkz <softworkz@hotmail.com> Those are always showing up on Patchwork when FATE tests are failing, covering some possibly more useful information. Signed-off-by: softworkz <softworkz@hotmail.com> Submitted-As: https://master.gitmailbox.com/ffmpegdev/pull.20.v3.ffstaging.FFmpeg.1642729686725.ffmpegagent@gmail.com In-Reply-To: https://master.gitmailbox.com/ffmpegdev/pull.20.ffstaging.FFmpeg.1642727870274.ffmpegagent@gmail.com In-Reply-To: https://master.gitmailbox.com/ffmpegdev/pull.20.v2.ffstaging.FFmpeg.1642729284250.ffmpegagent@gmail.com
-
pr-ffstaging-20/softworkz/submit_md5-v2
47230544 · ·libavutil/tests/md5: Avoid warnings From: softworkz <softworkz@hotmail.com> Those are always showing up on Patchwork when FATE tests are failing, covering some possibly more useful information. Signed-off-by: softworkz <softworkz@hotmail.com> Submitted-As: https://master.gitmailbox.com/ffmpegdev/pull.20.v2.ffstaging.FFmpeg.1642729284250.ffmpegagent@gmail.com In-Reply-To: https://master.gitmailbox.com/ffmpegdev/pull.20.ffstaging.FFmpeg.1642727870274.ffmpegagent@gmail.com
-
pr-ffstaging-20/softworkz/submit_md5-v1
3910d81f · ·libavutil/tests/md5: Avoid warnings From: softworkz <softworkz@hotmail.com> Those are always showing up on Patchwork when FATE tests are failing, covering some possibly more useful information. Signed-off-by: softworkz <softworkz@hotmail.com> Submitted-As: https://master.gitmailbox.com/ffmpegdev/pull.20.ffstaging.FFmpeg.1642727870274.ffmpegagent@gmail.com
-
pr-ffstaging-18/softworkz/submit_subfiltering-v3
03e1a98e · ·Subtitle Filtering 2022 Subtitle Filtering 2022 ======================= This is a substantial update to the earlier subtitle filtering patch series. A primary goal has been to address others' concerns as much as possible on one side and to provide more clarity and control over the way things are working. Clarity is is specifically important to allow for a better understanding of the need for a subtitle start pts value that can be different from the frame's pts value. This is done by refactoring the subtitle timing fields in AVFrame, adding a frame field to indicate repeated subtitle frames, and finally the full removal of the heartbeat functionality, replaced by a new 'subfeed' filter that provides different modes for arbitrating subtitle frames in a filter graph. Finally, each subtitle filter's documentation has been amended by a section describing the filter's timeline behavior (in v3 update). The update also includes major improvements to graphicsub2text and lots of other details. Versioning is restarting at v1 due to the new submission procedure. v3 - Rebase =========== due to merge conflicts - apologies. Changes in v2 ============= * added .gitattributes file to enforce binary diffs for the test refs that cannot be applied when being sent via e-mail * perform filter graph re-init due to subtitle "frame size" change only when the size was unknown before and not set via -canvas_size * overlaytextsubs: Make sure to request frames on the subtitle input * avfilter/splitcc: Start parsing cc data on key frames only * avcodec/webvttenc: Don't encode ass drawing codes and empty lines * stripstyles: fix mem leak * gs2t: improve color detection * gs2t: empty frames must not be skipped * subfeed: fix name * textmod: preserve margins * added .gitattributes file to enforce binary diffs for the test refs that cannot be applied when being sent via e-mail * perform filter graph re-init due to subtitle "frame size" change only when the size was unknown before and not set via -canvas_size * avcodec/dvbsubdec: Fix conditions for fallback to default resolution * Made changes suggested by Andreas * Fixed failing command line reported by Michael Changes from previous version v24: AVFrame ======= * Removed sub_start_time The start time is now added to the subtitle start_pts during decoding The sub_end_time field is adjusted accordingly * Renamed sub_end_time to duration which it is effectively after removing the start_time * Added a sub-struct 'subtitle_timing' to av frame Contains subtitle_pts renamed to 'subtitle_timing.start_pts' and 'subtitle_timing.duration' * Change both fields to (fixed) time_base AV_TIMEBASE * add repeat_sub field provides a clear indication whether a subtitle frame is an actual subtitle event or a repeated subtitle frame in a filter graph Heartbeat Removal ================= * completely removed the earlier heartbeat implementation * filtering arbitration is now implemented in a new filter: 'subfeed' * subfeed will be auto-inserted for compatiblity with sub2video command lines * the new behavior is not exactly identical to the earlier behavior, but it basically allows to achieve the same results New 'subfeed' Filter ==================== * a versatile filter for solving all kinds of problems with subtile frame flow in filter graphs * Can be inserted at any position in a graph * Auto-inserted for sub2video command lines (in repeat-mode) * Allows duration fixup delay input frames with unknown duration and infer duration from start of subsequent frame * Provides multiple modes of operation: * repeat mode (default) Queues input frames Outputs frames at a fixed (configurable) rate Either sends a matching input frame (repeatedly) or empty frames otherwise * scatter mode similar to repeat mode, but splits input frames by duration into small segments with same content * forward mode No fixed output rate Useful in combination with duration fixup or overlap fixup ffmpeg Tool Changes =================== * delay subtitle output stream initialization (like for audio and video) This is needed for example when a format header depends on having received an initial frame to derive certain header values from * decoding: set subtitle frame size from decoding context * re-init graph when subtitle size changes * always insert subscale filter for sub2video command lines (to ensure correct scaling) Subtitle Encoding ================= * ignore repeated frames for encoding based on repeat_sub field in AVFrame * support multi-area encoding for text subtitles Subtitle OCR can create multiple areas at different positions. Previously, the texts were always squashed into a single area ('subtitle rect'), which was not ideal. Multiple text areas are now generally supported: * ASS Encoder Changed to use the 'receive_packet' encoding API A single frame with multiple text areas will create multiple packets now * All other text subtitle encoders A newline is inserted between the text from multiple areas graphicsub2text (OCR) ===================== * enhanced preprocessing * using elbg algorithm for color quantization * detection and removal of text outlines * map-based identification of colors per word (text, outline, background) * add option for duration fixup * add option to dump preprocessing bitmaps * Recognize formatting and apply as ASS inline styles * per word(!) * paragraph alignment * positioning * font names * font size * font style (italic, underline, bold) * text color, outline color Other Filter Changes ==================== * all: Make sure to forward all link properties (time base, frame rate, w, h) where appropriate * overlaytextsubs: request frames on the subtitle input * overlaytextsubs: disable read-order checking * overlaytextsubs: improve implementation of render_latest_only * overlaytextsubs: ensure equal in/out video formats * splitcc: derive framerate from realtime_latency * graphicsub2video: implement caching of converted frames * graphicsub2video: use 1x1 output frame size as long as subtitle size is unknown (0x0) Plus a dozen of things I forgot.. softworkz (26): avcodec,avutil: Move enum AVSubtitleType to avutil, add new and deprecate old values avutil/frame: Prepare AVFrame for subtitle handling avcodec/subtitles: Introduce new frame-based subtitle decoding API avfilter/subtitles: Update vf_subtitles to use new decoding api avcodec,avutil: Move ass helper functions to avutil as avpriv_ and extend ass dialog parsing avcodec/subtitles: Replace deprecated enum values fftools/play,probe: Adjust for subtitle changes avfilter/subtitles: Add subtitles.c for subtitle frame allocation avfilter/avfilter: Handle subtitle frames avfilter/avfilter: Fix hardcoded input index avfilter/sbuffer: Add sbuffersrc and sbuffersink filters avfilter/overlaygraphicsubs: Add overlaygraphicsubs and graphicsub2video filters avfilter/overlaytextsubs: Add overlaytextsubs and textsubs2video filters avfilter/textmod: Add textmod, censor and show_speaker filters avfilter/stripstyles: Add stripstyles filter avfilter/splitcc: Add splitcc filter for closed caption handling avfilter/graphicsub2text: Add new graphicsub2text filter (OCR) avfilter/subscale: Add filter for scaling and/or re-arranging graphical subtitles avfilter/subfeed: add subtitle feed filter avcodec/subtitles: Migrate subtitle encoders to frame-based API fftools/ffmpeg: Introduce subtitle filtering and new frame-based subtitle encoding avutil/ass_split: Add parsing of hard-space tags (\h) avcodec/webvttenc: convert hard-space tags to doc/APIchanges: update for subtitle filtering changes avcodec/webvttenc: Don't encode drawing codes and empty lines avcodec/dvbsubdec: Fix conditions for fallback to default resolution configure | 7 +- doc/APIchanges | 24 + doc/filters.texi | 756 ++++++++++ fftools/ffmpeg.c | 501 +++---- fftools/ffmpeg.h | 13 +- fftools/ffmpeg_filter.c | 235 +++- fftools/ffmpeg_hw.c | 2 +- fftools/ffmpeg_opt.c | 3 +- fftools/ffplay.c | 102 +- fftools/ffprobe.c | 47 +- libavcodec/Makefile | 56 +- libavcodec/ass.h | 144 +- libavcodec/assdec.c | 4 +- libavcodec/assenc.c | 191 ++- libavcodec/avcodec.h | 32 +- libavcodec/ccaption_dec.c | 19 +- libavcodec/codec_desc.c | 11 + libavcodec/codec_desc.h | 8 + libavcodec/decode.c | 60 +- libavcodec/dvbsubdec.c | 53 +- libavcodec/dvbsubenc.c | 96 +- libavcodec/dvdsubdec.c | 2 +- libavcodec/dvdsubenc.c | 102 +- libavcodec/encode.c | 61 +- libavcodec/internal.h | 16 + libavcodec/jacosubdec.c | 2 +- libavcodec/libaribb24.c | 2 +- libavcodec/libzvbi-teletextdec.c | 14 +- libavcodec/microdvddec.c | 7 +- libavcodec/movtextdec.c | 3 +- libavcodec/movtextenc.c | 126 +- libavcodec/mpl2dec.c | 2 +- libavcodec/pgssubdec.c | 2 +- libavcodec/realtextdec.c | 2 +- libavcodec/samidec.c | 2 +- libavcodec/srtdec.c | 2 +- libavcodec/srtenc.c | 116 +- libavcodec/subviewerdec.c | 2 +- libavcodec/tests/avcodec.c | 2 - libavcodec/textdec.c | 4 +- libavcodec/ttmlenc.c | 114 +- libavcodec/utils.c | 184 +++ libavcodec/version.h | 2 +- libavcodec/webvttdec.c | 2 +- libavcodec/webvttenc.c | 127 +- libavcodec/xsubdec.c | 2 +- libavcodec/xsubenc.c | 88 +- libavfilter/Makefile | 16 + libavfilter/allfilters.c | 16 +- libavfilter/avfilter.c | 30 +- libavfilter/avfilter.h | 11 + libavfilter/avfiltergraph.c | 5 + libavfilter/buffersink.c | 54 + libavfilter/buffersink.h | 7 + libavfilter/buffersrc.c | 72 + libavfilter/buffersrc.h | 1 + libavfilter/formats.c | 22 + libavfilter/formats.h | 3 + libavfilter/internal.h | 19 +- libavfilter/sf_graphicsub2text.c | 1132 +++++++++++++++ libavfilter/sf_splitcc.c | 395 ++++++ libavfilter/sf_stripstyles.c | 211 +++ libavfilter/sf_subfeed.c | 366 +++++ libavfilter/sf_subscale.c | 884 ++++++++++++ libavfilter/sf_textmod.c | 710 ++++++++++ libavfilter/subtitles.c | 63 + libavfilter/subtitles.h | 44 + libavfilter/vf_overlaygraphicsubs.c | 765 ++++++++++ libavfilter/vf_overlaytextsubs.c | 678 +++++++++ libavfilter/vf_subtitles.c | 56 +- libavutil/Makefile | 4 + {libavcodec => libavutil}/ass.c | 91 +- libavutil/ass_internal.h | 135 ++ {libavcodec => libavutil}/ass_split.c | 37 +- .../ass_split_internal.h | 32 +- libavutil/frame.c | 211 ++- libavutil/frame.h | 85 +- libavutil/subfmt.c | 45 + libavutil/subfmt.h | 115 ++ libavutil/version.h | 3 +- tests/ref/fate/.gitattributes | 3 + tests/ref/fate/filter-overlay-dvdsub-2397 | 182 +-- tests/ref/fate/mov-mp4-ttml-dfxp | 8 +- tests/ref/fate/mov-mp4-ttml-stpp | 8 +- tests/ref/fate/sub-dvb | 162 ++- tests/ref/fate/sub-textenc | 10 +- tests/ref/fate/sub-ttmlenc | 8 +- tests/ref/fate/sub-webvttenc | 10 +- tests/ref/fate/sub2video | 1091 ++++++++++++++- tests/ref/fate/sub2video_basic | 1239 +++++++++++++++-- tests/ref/fate/sub2video_time_limited | 78 +- 91 files changed, 11077 insertions(+), 1392 deletions(-) create mode 100644 libavfilter/sf_graphicsub2text.c create mode 100644 libavfilter/sf_splitcc.c create mode 100644 libavfilter/sf_stripstyles.c create mode 100644 libavfilter/sf_subfeed.c create mode 100644 libavfilter/sf_subscale.c create mode 100644 libavfilter/sf_textmod.c create mode 100644 libavfilter/subtitles.c create mode 100644 libavfilter/subtitles.h create mode 100644 libavfilter/vf_overlaygraphicsubs.c create mode 100644 libavfilter/vf_overlaytextsubs.c rename {libavcodec => libavutil}/ass.c (65%) create mode 100644 libavutil/ass_internal.h rename {libavcodec => libavutil}/ass_split.c (93%) rename libavcodec/ass_split.h => libavutil/ass_split_internal.h (86%) create mode 100644 libavutil/subfmt.c create mode 100644 libavutil/subfmt.h create mode 100644 tests/ref/fate/.gitattributes base-commit: dd17c86aa11feae2b86de054dd0679cc5f88ebab Submitted-As: https://master.gitmailbox.com/ffmpegdev/pull.18.v3.ffstaging.FFmpeg.1642649134.ffmpegagent@gmail.com In-Reply-To: https://master.gitmailbox.com/ffmpegdev/pull.18.ffstaging.FFmpeg.1642122813.ffmpegagent@gmail.com In-Reply-To: https://master.gitmailbox.com/ffmpegdev/pull.18.v2.ffstaging.FFmpeg.1642646916.ffmpegagent@gmail.com -
pr-ffstaging-18/softworkz/submit_subfiltering-v2
217d96c3 · ·Subtitle Filtering 2022 Subtitle Filtering 2022 ======================= This is a substantial update to the earlier subtitle filtering patch series. A primary goal has been to address others' concerns as much as possible on one side and to provide more clarity and control over the way things are working. Clarity is is specifically important to allow for a better understanding of the need for a subtitle start pts value that can be different from the frame's pts value. This is done by refactoring the subtitle timing fields in AVFrame, adding a frame field to indicate repeated subtitle frames, and finally the full removal of the heartbeat functionality, replaced by a new 'subfeed' filter that provides different modes for arbitrating subtitle frames in a filter graph. Finally, each subtitle filter's documentation has been amended by a section describing the filter's timeline behavior (in v3 update). The update also includes major improvements to graphicsub2text and lots of other details. Versioning is restarting at v1 due to the new submission procedure. Changes in v2 ============= * added .gitattributes file to enforce binary diffs for the test refs that cannot be applied when being sent via e-mail * perform filter graph re-init due to subtitle "frame size" change only when the size was unknown before and not set via -canvas_size * overlaytextsubs: Make sure to request frames on the subtitle input * avfilter/splitcc: Start parsing cc data on key frames only * avcodec/webvttenc: Don't encode ass drawing codes and empty lines * stripstyles: fix mem leak * gs2t: improve color detection * gs2t: empty frames must not be skipped * subfeed: fix name * textmod: preserve margins * added .gitattributes file to enforce binary diffs for the test refs that cannot be applied when being sent via e-mail * perform filter graph re-init due to subtitle "frame size" change only when the size was unknown before and not set via -canvas_size * avcodec/dvbsubdec: Fix conditions for fallback to default resolution * Made changes suggested by Andreas * Fixed failing command line reported by Michael Changes from previous version v24: AVFrame ======= * Removed sub_start_time The start time is now added to the subtitle start_pts during decoding The sub_end_time field is adjusted accordingly * Renamed sub_end_time to duration which it is effectively after removing the start_time * Added a sub-struct 'subtitle_timing' to av frame Contains subtitle_pts renamed to 'subtitle_timing.start_pts' and 'subtitle_timing.duration' * Change both fields to (fixed) time_base AV_TIMEBASE * add repeat_sub field provides a clear indication whether a subtitle frame is an actual subtitle event or a repeated subtitle frame in a filter graph Heartbeat Removal ================= * completely removed the earlier heartbeat implementation * filtering arbitration is now implemented in a new filter: 'subfeed' * subfeed will be auto-inserted for compatiblity with sub2video command lines * the new behavior is not exactly identical to the earlier behavior, but it basically allows to achieve the same results New 'subfeed' Filter ==================== * a versatile filter for solving all kinds of problems with subtile frame flow in filter graphs * Can be inserted at any position in a graph * Auto-inserted for sub2video command lines (in repeat-mode) * Allows duration fixup delay input frames with unknown duration and infer duration from start of subsequent frame * Provides multiple modes of operation: * repeat mode (default) Queues input frames Outputs frames at a fixed (configurable) rate Either sends a matching input frame (repeatedly) or empty frames otherwise * scatter mode similar to repeat mode, but splits input frames by duration into small segments with same content * forward mode No fixed output rate Useful in combination with duration fixup or overlap fixup ffmpeg Tool Changes =================== * delay subtitle output stream initialization (like for audio and video) This is needed for example when a format header depends on having received an initial frame to derive certain header values from * decoding: set subtitle frame size from decoding context * re-init graph when subtitle size changes * always insert subscale filter for sub2video command lines (to ensure correct scaling) Subtitle Encoding ================= * ignore repeated frames for encoding based on repeat_sub field in AVFrame * support multi-area encoding for text subtitles Subtitle OCR can create multiple areas at different positions. Previously, the texts were always squashed into a single area ('subtitle rect'), which was not ideal. Multiple text areas are now generally supported: * ASS Encoder Changed to use the 'receive_packet' encoding API A single frame with multiple text areas will create multiple packets now * All other text subtitle encoders A newline is inserted between the text from multiple areas graphicsub2text (OCR) ===================== * enhanced preprocessing * using elbg algorithm for color quantization * detection and removal of text outlines * map-based identification of colors per word (text, outline, background) * add option for duration fixup * add option to dump preprocessing bitmaps * Recognize formatting and apply as ASS inline styles * per word(!) * paragraph alignment * positioning * font names * font size * font style (italic, underline, bold) * text color, outline color Other Filter Changes ==================== * all: Make sure to forward all link properties (time base, frame rate, w, h) where appropriate * overlaytextsubs: request frames on the subtitle input * overlaytextsubs: disable read-order checking * overlaytextsubs: improve implementation of render_latest_only * overlaytextsubs: ensure equal in/out video formats * splitcc: derive framerate from realtime_latency * graphicsub2video: implement caching of converted frames * graphicsub2video: use 1x1 output frame size as long as subtitle size is unknown (0x0) Plus a dozen of things I forgot.. softworkz (26): avcodec,avutil: Move enum AVSubtitleType to avutil, add new and deprecate old values avutil/frame: Prepare AVFrame for subtitle handling avcodec/subtitles: Introduce new frame-based subtitle decoding API avfilter/subtitles: Update vf_subtitles to use new decoding api avcodec,avutil: Move ass helper functions to avutil as avpriv_ and extend ass dialog parsing avcodec/subtitles: Replace deprecated enum values fftools/play,probe: Adjust for subtitle changes avfilter/subtitles: Add subtitles.c for subtitle frame allocation avfilter/avfilter: Handle subtitle frames avfilter/avfilter: Fix hardcoded input index avfilter/sbuffer: Add sbuffersrc and sbuffersink filters avfilter/overlaygraphicsubs: Add overlaygraphicsubs and graphicsub2video filters avfilter/overlaytextsubs: Add overlaytextsubs and textsubs2video filters avfilter/textmod: Add textmod, censor and show_speaker filters avfilter/stripstyles: Add stripstyles filter avfilter/splitcc: Add splitcc filter for closed caption handling avfilter/graphicsub2text: Add new graphicsub2text filter (OCR) avfilter/subscale: Add filter for scaling and/or re-arranging graphical subtitles avfilter/subfeed: add subtitle feed filter avcodec/subtitles: Migrate subtitle encoders to frame-based API fftools/ffmpeg: Introduce subtitle filtering and new frame-based subtitle encoding avutil/ass_split: Add parsing of hard-space tags (\h) avcodec/webvttenc: convert hard-space tags to doc/APIchanges: update for subtitle filtering changes avcodec/webvttenc: Don't encode drawing codes and empty lines avcodec/dvbsubdec: Fix conditions for fallback to default resolution configure | 7 +- doc/APIchanges | 24 + doc/filters.texi | 756 ++++++++++ fftools/ffmpeg.c | 501 +++---- fftools/ffmpeg.h | 13 +- fftools/ffmpeg_filter.c | 235 +++- fftools/ffmpeg_hw.c | 2 +- fftools/ffmpeg_opt.c | 3 +- fftools/ffplay.c | 102 +- fftools/ffprobe.c | 47 +- libavcodec/Makefile | 56 +- libavcodec/ass.h | 144 +- libavcodec/assdec.c | 4 +- libavcodec/assenc.c | 191 ++- libavcodec/avcodec.h | 32 +- libavcodec/ccaption_dec.c | 19 +- libavcodec/codec_desc.c | 11 + libavcodec/codec_desc.h | 8 + libavcodec/decode.c | 60 +- libavcodec/dvbsubdec.c | 53 +- libavcodec/dvbsubenc.c | 96 +- libavcodec/dvdsubdec.c | 2 +- libavcodec/dvdsubenc.c | 102 +- libavcodec/encode.c | 61 +- libavcodec/internal.h | 16 + libavcodec/jacosubdec.c | 2 +- libavcodec/libaribb24.c | 2 +- libavcodec/libzvbi-teletextdec.c | 14 +- libavcodec/microdvddec.c | 7 +- libavcodec/movtextdec.c | 3 +- libavcodec/movtextenc.c | 126 +- libavcodec/mpl2dec.c | 2 +- libavcodec/pgssubdec.c | 2 +- libavcodec/realtextdec.c | 2 +- libavcodec/samidec.c | 2 +- libavcodec/srtdec.c | 2 +- libavcodec/srtenc.c | 116 +- libavcodec/subviewerdec.c | 2 +- libavcodec/tests/avcodec.c | 2 - libavcodec/textdec.c | 4 +- libavcodec/ttmlenc.c | 114 +- libavcodec/utils.c | 184 +++ libavcodec/version.h | 2 +- libavcodec/webvttdec.c | 2 +- libavcodec/webvttenc.c | 127 +- libavcodec/xsubdec.c | 2 +- libavcodec/xsubenc.c | 88 +- libavfilter/Makefile | 16 + libavfilter/allfilters.c | 14 + libavfilter/avfilter.c | 30 +- libavfilter/avfilter.h | 11 + libavfilter/avfiltergraph.c | 5 + libavfilter/buffersink.c | 54 + libavfilter/buffersink.h | 7 + libavfilter/buffersrc.c | 72 + libavfilter/buffersrc.h | 1 + libavfilter/formats.c | 22 + libavfilter/formats.h | 3 + libavfilter/internal.h | 19 +- libavfilter/sf_graphicsub2text.c | 1132 +++++++++++++++ libavfilter/sf_splitcc.c | 395 ++++++ libavfilter/sf_stripstyles.c | 211 +++ libavfilter/sf_subfeed.c | 366 +++++ libavfilter/sf_subscale.c | 884 ++++++++++++ libavfilter/sf_textmod.c | 710 ++++++++++ libavfilter/subtitles.c | 63 + libavfilter/subtitles.h | 44 + libavfilter/vf_overlaygraphicsubs.c | 765 ++++++++++ libavfilter/vf_overlaytextsubs.c | 678 +++++++++ libavfilter/vf_subtitles.c | 56 +- libavutil/Makefile | 4 + {libavcodec => libavutil}/ass.c | 91 +- libavutil/ass_internal.h | 135 ++ {libavcodec => libavutil}/ass_split.c | 37 +- .../ass_split_internal.h | 32 +- libavutil/frame.c | 211 ++- libavutil/frame.h | 85 +- libavutil/subfmt.c | 45 + libavutil/subfmt.h | 115 ++ libavutil/version.h | 3 +- tests/ref/fate/.gitattributes | 3 + tests/ref/fate/filter-overlay-dvdsub-2397 | 182 +-- tests/ref/fate/mov-mp4-ttml-dfxp | 8 +- tests/ref/fate/mov-mp4-ttml-stpp | 8 +- tests/ref/fate/sub-dvb | 162 ++- tests/ref/fate/sub-textenc | 10 +- tests/ref/fate/sub-ttmlenc | 8 +- tests/ref/fate/sub-webvttenc | 10 +- tests/ref/fate/sub2video | 1091 ++++++++++++++- tests/ref/fate/sub2video_basic | 1239 +++++++++++++++-- tests/ref/fate/sub2video_time_limited | 78 +- 91 files changed, 11076 insertions(+), 1391 deletions(-) create mode 100644 libavfilter/sf_graphicsub2text.c create mode 100644 libavfilter/sf_splitcc.c create mode 100644 libavfilter/sf_stripstyles.c create mode 100644 libavfilter/sf_subfeed.c create mode 100644 libavfilter/sf_subscale.c create mode 100644 libavfilter/sf_textmod.c create mode 100644 libavfilter/subtitles.c create mode 100644 libavfilter/subtitles.h create mode 100644 libavfilter/vf_overlaygraphicsubs.c create mode 100644 libavfilter/vf_overlaytextsubs.c rename {libavcodec => libavutil}/ass.c (65%) create mode 100644 libavutil/ass_internal.h rename {libavcodec => libavutil}/ass_split.c (93%) rename libavcodec/ass_split.h => libavutil/ass_split_internal.h (86%) create mode 100644 libavutil/subfmt.c create mode 100644 libavutil/subfmt.h create mode 100644 tests/ref/fate/.gitattributes base-commit: c936c319bd54f097cc1d75b1ee1c407d53215d71 Submitted-As: https://master.gitmailbox.com/ffmpegdev/pull.18.v2.ffstaging.FFmpeg.1642646916.ffmpegagent@gmail.com In-Reply-To: https://master.gitmailbox.com/ffmpegdev/pull.18.ffstaging.FFmpeg.1642122813.ffmpegagent@gmail.com