* Improved subtitle filter option argument escaping.
authorUrban Wallasch <urban.wallasch@freenet.de>
Thu, 27 May 2021 11:03:13 +0000 (13:03 +0200)
committerUrban Wallasch <urban.wallasch@freenet.de>
Thu, 27 May 2021 11:03:13 +0000 (13:03 +0200)
* Added notes about subtitle rendering being an experimental feature.

README.md
ffpreview.conf.sample
ffpreview.py

index 6e49a602140133313332aa71670efb19af8a296c..b7363c1350170d75583038fb2660d328b89d8de4 100644 (file)
--- 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.
index 1e542e2b15bb1035cea2eb8b8bbbf2de0dde47d3..7e5c459637e2ff7495022258b36c325de82c81e4 100644 (file)
@@ -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
index 2ab82849913178b150944b79bb7a6b24f113eac6..d6fb29d7e02913038873361a7d08cf57339a58c6 100755 (executable)
@@ -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