PySceneDetect
PySceneDetect copied to clipboard
Return SyntaxWarning errors
With PySceneDetect 0.6.4 debian unstable amd64 python 3.11.9 I see the warnings
/usr/lib/python3/dist-packages/scenedetect/_cli/__init__.py:927: SyntaxWarning: invalid escape sequence '\$'
help='Filename format to use for the scene list CSV file. You can use the $VIDEO_NAME macro in the file name. Note that you may have to wrap the name using single quotes or use escape characters (e.g. -f=\$VIDEO_NAME-Scenes.csv).%s'
/usr/lib/python3/dist-packages/scenedetect/_cli/__init__.py:1065: SyntaxWarning: invalid escape sequence '\$'
"""Split input video using ffmpeg or mkvmerge.
/usr/lib/python3/dist-packages/scenedetect/_cli/__init__.py:1208: SyntaxWarning: invalid escape sequence '\$'
"""Create images for each detected scene.
Thanks for letting me know, I should have a fix for this within a day or two.
Could you share the output of running the scenedetect version command? I'm having trouble reproducing this locally, and don't see the warnings in any of the Python 3.12 builds (example).
This is definitely an issue, and looks like this was upgraded from DeprecationWarning to SyntaxWarning in Python 3.12. I want to make sure these errors show up in builds here on Github so we can make sure it does not reoccur in the future, so I wonder if perhaps one of the third-party libraries being used is changing the default warning filter.
I see these warnings when the source is byte compiled byte compilation is done when the package is installed. Debian package from https://www.deb-multimedia.org/
$ sudo py3compile -f -p python3-scenedetect
/usr/lib/python3/dist-packages/scenedetect/_cli/__init__.py:927: SyntaxWarning: invalid escape sequence '\$'
help='Filename format to use for the scene list CSV file. You can use the $VIDEO_NAME macro in the file name. Note that you may have to wrap the name using single quotes or use escape characters (e.g. -f=\$VIDEO_NAME-Scenes.csv).%s'
...