[FFmpeg-devel] [PATCH 21/24] fftools/ffmpeg: Introduce subtitle filtering new frame-based subtitle encoding

Michael Niedermayer michael at niedermayer.cc
Fri Jan 14 18:52:52 EET 2022


On Fri, Jan 14, 2022 at 01:13:30AM +0000, ffmpegagent wrote:
> From: softworkz <softworkz at hotmail.com>
> 
> This commit actually enables subtitle filtering in ffmpeg by
> sending and receiving subtitle frames to and from a filtergraph.
> 
> The heartbeat functionality from the previous sub2video implementation
> is removed and now provided by the 'subfeed' filter.
> The other part of sub2video functionality is retained by
> auto-insertion of the new graphicsub2video filter.
> 
> Justification for changed test refs:
> 
> - sub2video
>   The new results are identical excepting the last frame which
>   is due to the implementation changes
> 
> - sub2video_basic
>   The previous results had some incorrect output because multiple
>   frames had the same dts
>   The non-empty content frames are visually identical, the different
>   CRC is due to the different blending algorithm that is being used.
> 
> - sub2video_time_limited
>   The third frame in the previous ref was a repetition, which doesn't
>   happen anymore with the new subtitle filtering.
> 
> - sub-dvb
>   Running ffprobe -show_frames on the source file shows that there
>   are 7 subtitle frames with 0 rects in the source at the start
>   and 2 at the end. This translates to the 14 and 4 additional
>   entries in the new test results.
> 
> - filter-overlay-dvdsub-2397
>   Overlay results have slightly different CRCs due to different
>   blending implementation
> 
> Signed-off-by: softworkz <softworkz at hotmail.com>
> ---
>  fftools/ffmpeg.c                          |  493 ++++----
>  fftools/ffmpeg.h                          |   13 +-
>  fftools/ffmpeg_filter.c                   |  235 ++--
>  fftools/ffmpeg_hw.c                       |    2 +-
>  fftools/ffmpeg_opt.c                      |    3 +-
>  tests/ref/fate/filter-overlay-dvdsub-2397 |  182 +--
>  tests/ref/fate/sub-dvb                    |  162 +--
>  tests/ref/fate/sub2video                  | 1091 +++++++++++++++++-
>  tests/ref/fate/sub2video_basic            | 1239 +++++++++++++++++++--
>  tests/ref/fate/sub2video_time_limited     |   78 +-
>  10 files changed, 2829 insertions(+), 669 deletions(-)

./ffmpeg -i ~/tickets/153/bbc_small.ts -filter_complex '[0:v][0:s]overlay' -qscale 2  -t 3 f.avi

Press [q] to stop, [?] for help
Auto-inserting subfeed filter
Auto-inserting graphicsub2video filter
Assertion c > 0 failed at libavutil/mathematics.c:60
Aborted (core dumped)


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Everything should be made as simple as possible, but not simpler.
-- Albert Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20220114/2c2f5a56/attachment.sig>


More information about the ffmpeg-devel mailing list