From: Soft Works <softworkz@hotmail.com> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Subject: Re: [FFmpeg-devel] [PATCH 1/2] avcodec/{ass, webvttdec}: fix handling of backslashes Date: Fri, 4 Feb 2022 22:23:12 +0000 Message-ID: <DM8P223MB03651F29BE7D31E9E648F449BA299@DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM> (raw) In-Reply-To: <Yf2YU5aTFYW8fmJl@dismail.de> > -----Original Message----- > From: ffmpeg-devel <ffmpeg-devel-bounces@ffmpeg.org> On Behalf Of > Oneric > Sent: Friday, February 4, 2022 10:19 PM > To: FFmpeg development discussions and patches <ffmpeg- > devel@ffmpeg.org> > Subject: Re: [FFmpeg-devel] [PATCH 1/2] avcodec/{ass, webvttdec}: fix > handling of backslashes > > On Fri, Feb 04, 2022 at 06:48:40 +0000, Soft Works wrote: > > > [two-part message removed for brevity] > > > > I've found out where the \{ and \} escaping has come from: libass > > As already written in the commit-message of the first patch.. > > > You already noticed your proposal only works with VSFilters, > but even without this it's a terrible approach. Consider: > - fullwidth characters have different metrics then the "regular" ones > - fullwidth and small characters have a different visual appearance > - support for fullwidth and small characters in fonts is much rarer > than support for plain {} > - fullwidth characters are commonly used _as fullwidth characters_ > e.g. in text using one of the CJK writing systems. > Replacing them with non-fullwidth variants when transforming > away from ASS is guaranteed to be disastrous. > - Not sure if applies, but something to keep in mind: > {\r} is not a noop if the source-format had any sort of per-event > styling which got prepended to the ASS event text before > using the plain-text conversion for the rest of the event. No, this doesn't apply from what I've seen, but {} might still be preferable. > As noted in the discussion of the libass issue you linked, > it’s not unusual for ASS subtitle authors to employ > fullwidth curly braces for displaying curly braces > in all ASS-renderers. However, they have tight control over the > fonts used and can carefully select them to match the visual > appearance and compensate differing metrics with bespoke > local adjustments to \fs and negative \fsp. > ffmpeg does not have tight control over the fonts and it'd be silly > to require users to pass in special fonts just to render curly braces. I basically agree to everything you say - except that there's a little misunderstanding. Maybe I haven't explained well enough. We use ASS as the internal format to which all text subtitles are decoded and from which all text subtitles are encoded for output and for the upcoming subtitle filtering it's also the one and only format for text subtitles. BUT: That does not necessarily mean that the internally used ASS must be exactly the same that we're outputting when encoding to ASS. And that's why we need to consider this as two separate steps. It would also be possible to have options at the ass encoder to control the compatibility of the encoded ASS output. That internal ASS format already has some quirks that some had introduced in order to achieve certain things when other subtitle formats are involved at the input and at the output. That's why we should not continue adding one workaround on top of another but try to clean those things up instead. With your submission, you are actually pointing at a core point of evil: the escaping of braces in combination with the backslash logic introduces an unresolvable ambiguity. And when we don't clean that up, it won't be possible to get on a sane path. > If you want to make the rendering in VSFilters not complettly broken, > try to do what the libass-wiki recommends and add an empty command > block after an escaped opening curly brace. This way VSFilters > will display a lone backslash instead of a opening curly brace > but otherwise work fine without swallowing up text. > If done consistently closing curly braces won't need to be > escaped at all anymore. > However, such a VSFilter-compatibility change is unrelated to > fixing the broken \\ escape which doesn't work anywhere. see above, I'm not into changing ffmpeg's ass output, it's all about the internally used ass format and the escaping is a central problem there. > (Note that the wordjoiner doesn't have font or spacing issues as > it’s defined to be invisible and zero-width. Yes, and the use of this has already created issues, even in libass: https://github.com/libass/libass/issues/507 So it's very likely to cause issues in other implementations as well, and not many are developed as actively as libass. (and even that doesn't help when you don't get an update for your device/software). I wouldn't want to close like that, but I'm getting distracted right now. Will get back later. softworkz _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
prev parent reply other threads:[~2022-02-04 22:23 UTC|newest] Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-01-16 18:16 Oneric 2022-01-16 18:16 ` [FFmpeg-devel] [PATCH 2/2] avcodec/webvttdec: honour bidi marks Oneric 2022-02-01 17:38 ` [FFmpeg-devel] [PATCH 1/2] avcodec/{ass, webvttdec}: fix handling of backslashes Oneric 2022-02-01 19:44 ` Soft Works 2022-02-01 20:06 ` Oneric 2022-02-01 20:41 ` Soft Works 2022-02-01 23:25 ` Oneric 2022-02-02 4:44 ` Soft Works 2022-02-02 17:03 ` Oneric 2022-02-02 22:18 ` Soft Works 2022-02-02 22:44 ` Soft Works 2022-02-03 2:11 ` Oneric 2022-02-03 20:51 ` Soft Works 2022-02-04 1:01 ` Oneric 2022-02-04 1:30 ` Andreas Rheinhardt 2022-02-04 21:52 ` Oneric 2022-02-04 23:24 ` Soft Works 2022-02-05 1:20 ` Oneric 2022-02-05 2:08 ` Soft Works 2022-02-05 21:59 ` Oneric 2022-02-06 1:08 ` Soft Works 2022-02-06 1:37 ` Soft Works 2022-02-04 1:57 ` Soft Works 2022-02-04 5:34 ` Soft Works 2022-02-04 5:59 ` Soft Works 2022-02-04 6:48 ` Soft Works 2022-02-04 21:19 ` Oneric 2022-02-04 22:23 ` Soft Works [this message]
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=DM8P223MB03651F29BE7D31E9E648F449BA299@DM8P223MB0365.NAMP223.PROD.OUTLOOK.COM \ --to=softworkz@hotmail.com \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git