[FFmpeg-devel] [PATCH v18 12/19] fftools/ffmpeg: Replace sub2video with subtitle frame filtering and use new frame-based subtitle encoding API

Soft Works softworkz at hotmail.com
Fri Dec 3 16:26:05 EET 2021



> -----Original Message-----
> From: ffmpeg-devel <ffmpeg-devel-bounces at ffmpeg.org> On Behalf Of Michael
> Niedermayer
> Sent: Tuesday, November 30, 2021 2:11 PM
> To: FFmpeg development discussions and patches <ffmpeg-devel at ffmpeg.org>
> Subject: Re: [FFmpeg-devel] [PATCH v18 12/19] fftools/ffmpeg: Replace
> sub2video with subtitle frame filtering and use new frame-based subtitle
> encoding API
> 
> On Mon, Nov 29, 2021 at 07:48:25PM +0000, Soft Works wrote:
> > 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 retained and applied to all subtitle frames (bitmap, text, ..).
> >
> > 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>
> 
> This breaks:
> ./ffmpeg -i ~/tickets/153/bbc_small.ts -filter_complex '[0:v][0:s]overlay' -
> qscale 2 -t 3 -y file.avi
> 
> Press [q] to stop, [?] for help
> subtitle input filter: decoding size 0x0
> Auto-inserting graphicsub2video filter
> [swscaler @ 0x5578a748db00] Value 0.000000 for parameter 'srcw' out of range
> [1 - 2.14748e+09]
> [swscaler @ 0x5578a748db00] Value 0.000000 for parameter 'srch' out of range
> [1 - 2.14748e+09]
> [swscaler @ 0x5578a748db00] Value 0.000000 for parameter 'dstw' out of range
> [1 - 2.14748e+09]
> [swscaler @ 0x5578a748db00] Value 0.000000 for parameter 'dsth' out of range
> [1 - 2.14748e+09]
> [graphicsub2video @ 0x5578a735e880] [IMGUTILS @ 0x7ffd6097eab0] Picture size
> 0x0 is invalid
> Error reinitializing filters!
> Failed to inject frame into filter network: Invalid argument
> Error while processing the decoded data for stream #0:0
> [libmp3lame @ 0x5578a73d3380] 3 frames left in the queue on closing
> Conversion failed!

@Michael - I've just submitted a fix for this.

It wasn't actually a regression. It was a bug in dvbdubdec that just got
covered up earlier by some sub2video hacks.

Best regards,
softworkz


More information about the ffmpeg-devel mailing list