From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 3587A40C5F for ; Sat, 5 Feb 2022 21:59:43 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 58FF768B05B; Sat, 5 Feb 2022 23:59:42 +0200 (EET) Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [85.215.255.23]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A53C868AE71 for ; Sat, 5 Feb 2022 23:59:35 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1644098375; s=strato-dkim-0002; d=oneric.de; h=In-Reply-To:References:Message-ID:Subject:To:From:Date:Cc:Date:From: Subject:Sender; bh=q/ep8IbRmkDVnDCUSWXdpjkP6tFlELz6sRvXxzoUocI=; b=jTVFsd/meoiQEzRE9lGsyl7OWiPrrSgyW07lKQkIbbzRYGjOynVVU+Ak5nWo4kMSA+ Q4ikleTetmKtYdVxhQ/HOpbA24VlE99oL/LrutxNE2xG40YIqRCjCJbtKHKsBK00EnbB OdNg1DsCZc0BTo7V2QjGXx8d2L1JXt+RhDbfPfmmTJqgG/9YbUrxJSSwfZ0eaw4FSUXl lQNWr1LS7giQSy+WevRYIGRx8UrFWLuzft3NWPIgdFsGQ8x1Xaj7DI579VqWalnm36cc 2pkuElRSAfgQw9xoDidRlAIN3dXng5Y2vYU+A/LtjJDcTQmyjcXB6SIe2nb0EepyKJbS JrMg== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":I2IBZ0mrW/AWQXwgB4oxKM1YsW1lFUznrLvi/XReWqAAlWwZ8wlvfXmGs4jUQ0oz8ZbhHexs8fhgU3UEINkh7b+FchF3Von7gOKwU8A=" X-RZG-CLASS-ID: mo00 Received: from oneric.de by smtp.strato.de (RZmta 47.39.0 AUTH) with ESMTPSA id jfcdcdy15LxZZAt (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate) for ; Sat, 5 Feb 2022 22:59:35 +0100 (CET) Date: Sat, 5 Feb 2022 22:59:34 +0100 From: Oneric To: FFmpeg development discussions and patches Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="xBGG3jDIgNTP0U/4" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Subject: Re: [FFmpeg-devel] [PATCH 1/2] avcodec/{ass, webvttdec}: fix handling of backslashes X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --xBGG3jDIgNTP0U/4 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Sat, Feb 05, 2022 at 02:08:48 +0000, Soft Works wrote: > Let's try to approach this from a different side. Which case is > your [1/2] commit actually supposed to fix? Escape backslashes when converting from WebVTT to not accidentally introduce active ASS sequences and replace the wrong backslash-escape in ff_ass_bprint_text_event with an escape that actually works. > How did you test your patch? > Can we please go over an example? Take a look at the attached WebVTT file. We expect the second event to be rendered like this, as from WebVTT’s point of view it’s just normal text: our final \h approach \N into \ Coruscant. What we currently get after conversion to ASS is like this though (pay attention to the number of spaces): our final approach into \ Coruscant. If we escape \ as \\ like ff_ass_bprint_text_event currently does, we instead get the following rendering which is also wrong: our final \ approach \ into \\ Coruscant. If instead the word-joiner is appended as in my patch, the visual output matches the expectation (mail does not contain U+2060): our final \h approach \N into \ Coruscant. You can confirm this for yourself by feeding the original WebVTT to a native WebVTT renderer, e.g. https://zcorpan.github.io/live-webvtt-viewer/ and using ./ffmpeg -i test2.vtt -f ass tmp_conv.ass on master, master + my patch and master + a modified patch to use \\ then watching how the converted file gets rendered by mpv, VLC or so. I was not able to create a sample using ff_ass_bprint_text_event as the only users seem to be teletext and some rawtext(?) subtitles and I don't know how to create such files. However, as nothing special happened to the \\ for WebVTT after this sequence was inserted for the internal representation, and since the preceding comment (wrongly) declares \\ to be an ASS rather than an internal escape, it seems highly unlikely to behave any different. You are very welcome to provide a sample using the ff_ass_bprint_text_event codepath and keep_ass_markup=false to verify or debunk this. --xBGG3jDIgNTP0U/4 Content-Type: text/vtt; charset=us-ascii Content-Disposition: attachment; filename="test2.vtt" WEBVTT 00:00.000 --> 00:01.000 Senator, we're {A} making 00:01.000 --> 01:01.000 our final \h approach \N into \ Coruscant. --xBGG3jDIgNTP0U/4 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --xBGG3jDIgNTP0U/4--