From: Urban Wallasch Date: Thu, 27 May 2021 11:03:13 +0000 (+0200) Subject: * Improved subtitle filter option argument escaping. X-Git-Tag: v0.4~11 X-Git-Url: https://git.packet-gain.de/?a=commitdiff_plain;h=dc5e8bae36933d5816eebe47be02836c0d2b7018;p=ffpreview.git * Improved subtitle filter option argument escaping. * Added notes about subtitle rendering being an experimental feature. --- diff --git a/README.md b/README.md index 6e49a60..b7363c1 100644 --- a/README.md +++ b/README.md @@ -158,6 +158,12 @@ $ ./ffpreview.py -b /some/directory/* ``` **Note:** `ffpreview` does _not_ recursively traverse subdirectories. +## Known issues + +* Subtitle rendering is flaky at best. In particular, it does not work + when setting a start time and currently chokes on Windows paths. + Consider it an experimental feature. + ## License Ffpreview is distributed under the Modified ("3-clause") BSD License. diff --git a/ffpreview.conf.sample b/ffpreview.conf.sample index 1e542e2..7e5c459 100644 --- a/ffpreview.conf.sample +++ b/ffpreview.conf.sample @@ -97,10 +97,12 @@ time_skip=60 # to learn more about video filter expressions. customvf=scdet=s=1:t=12 +# EXPERIMENTAL: # Add rendered captions from specified subtitle stream. Stream numbering # starts at 0, set to -1 to disable. If the specified stream is not found, # this setting is silently ignored. Also, this setting only works when # start time is zero, i.e. the video is processed from the beginning. +# To top it off it will choke on Windows paths. addss=-1 # EOF diff --git a/ffpreview.py b/ffpreview.py index 2ab8284..d6fb29d 100755 --- a/ffpreview.py +++ b/ffpreview.py @@ -1800,11 +1800,9 @@ def make_thumbs(vidfile, thinfo, thdir, prog_cb=None): def fff_esc(s): # 1. escape ' and : s = s.replace("'", r"\'").replace(':', r'\:') - # 2. escape \ and ' and , + # 2. escape \ and ' (again!) plus [ and ] and , and ; s = s.replace('\\', '\\\\').replace("'", r"\'") - # 3. apparently [ and ] also have to be escaped?! - s = s.replace('[', r'\[').replace(']', r'\]') - # 4. time will tell, if we're still missing some + s = s.replace('[', r'\[').replace(']', r'\]').replace(',', r'\,').replace(';', r'\;') return s # generate thumbnail images from video