From 24052da817e5c3a4a2eccb8add15371252de475e Mon Sep 17 00:00:00 2001 From: Urban Wallasch Date: Mon, 31 May 2021 13:33:17 +0200 Subject: [PATCH] * Capitalize FFpreview and FFmpeg when referring to projects (as opposed to actual executables). --- README.md | 40 ++++++++++++++++++++-------------------- ffpreview.conf.sample | 12 ++++++------ ffpreview.py | 15 +++++++++------ 3 files changed, 35 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index cd46c1c..7b3900d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Ffpreview +# FFpreview -Ffpreview is a python script that acts as a front-end for ffmpeg to +FFpreview is a python script that acts as a front-end for FFmpeg to generate interactive thumbnail previews for video files. @@ -12,14 +12,14 @@ generate interactive thumbnail previews for video files. To run `ffpreview.py` you will need Python version >= 3.7 installed, plus the PyQt5 python bindings for Qt5. -As a hard requirement, ffpreview relies on the `ffmpeg` program to +As a hard requirement, FFpreview relies on the `ffmpeg` program to generate the still frame thumbnails. To make full use of the interactive aspects you will need a video player application that can be started from the command line. The `mpv` player is highly recommended, as it readily -accepts all options passed by ffpreview. Other video players (like e.g. +accepts all options passed by FFpreview. Other video players (like e.g. `vlc`) may only provide slightly degraded functionality. -Additionally, ffpreview will use `ffprobe` (if available) to perform the +Additionally, FFpreview will use `ffprobe` (if available) to perform the initial video file analysis, but will gracefully fall back to `ffmpeg` for that purpose too, should `ffprobe` fail. @@ -36,8 +36,8 @@ the `ffpreview.conf.sample` example configuration file. ## Video filters -The thumbnail sampling method presets available in `ffpreview` translate -to `ffmpeg` filters as follows: +The thumbnail sampling method presets available in FFpreview translate +to FFmpeg filters as follows: `iframe` (_--iframe_, key frame detection): > `-vf select=eq(pict_type,I), ...` @@ -54,8 +54,8 @@ to `ffmpeg` filters as follows: `customvf` (_--customvf_, custom video filter): > `-vf YOUR_CUSTOM_FILTER, ...` -Please consult the official `ffmpeg` -[documentation](https://ffmpeg.org/ffmpeg-filters.html#select_002c-aselect) +Please consult the official +[FFmpeg documentation](https://ffmpeg.org/ffmpeg-filters.html#select_002c-aselect) to learn more about video frame select filter expressions. ## Usage @@ -123,36 +123,36 @@ window controls: ``` ### Notes -* In GUI mode, the --force flag is reset after the first view is - loaded, to prevent accidental rebuilds for subsequently opened - files. A forced rebuild can be initiated anytime via the context - menu. In batch mode the --force flag is applied to all input files. +* In GUI mode, the `--force` flag is reset after the view is (re-)loaded, + to prevent unnecessary rebuilds for subsequently opened files. A forced + rebuild can be initiated anytime via the context menu. In batch mode + the `--force` flag is applied to _all_ specified input files. * The thumbnail manager, accessible via context menu or command line - option, provides a simple way to keep track of saved previews - thumbnails and allows for easy loading of previews or deletion of + option, provides a simple way to keep track of saved preview + thumbnails and allows for easy loading of previews, or deletion of broken/unwanted preview folders. ### Examples -#### Start ffpreview with file open dialog: +#### Start FFpreview with file open dialog: ``` $ ./ffpreview.py $ ./ffpreview.py /path/to/some/directory ``` -#### Start ffpreview and show thumbnails for a single file: +#### Start FFpreview and show thumbnails for a single file: ``` $ ./ffpreview.py my_video.mp4 $ ./ffpreview.py -o ~/scratch -w 256 -g 8x4 -N 10 some_movie.mkv ``` -#### Start ffpreview in thumbnail manager mode: +#### Start FFpreview in thumbnail manager mode: ``` $ ./ffpreview.py -m ``` -#### Run ffpreview in batch mode (console only, no GUI): +#### Run FFpreview in console batch mode (no GUI): ``` $ ./ffpreview.py -b movie1.mkv movie2.mp4 another.mpg $ ./ffpreview.py -b /some/directory/* @@ -165,7 +165,7 @@ $ ./ffpreview.py -b /some/directory/* ## License -Ffpreview is distributed under the Modified ("3-clause") BSD License. +FFpreview is distributed under the Modified ("3-clause") BSD License. See `LICENSE` file for more information. ---------------------------------------------------------------------- diff --git a/ffpreview.conf.sample b/ffpreview.conf.sample index 112b311..c7ceb75 100644 --- a/ffpreview.conf.sample +++ b/ffpreview.conf.sample @@ -1,4 +1,4 @@ -# Ffpreview example configuration file +# FFpreview example configuration file # # Copy this file to "ffppreview.conf" and make the desired changes. @@ -59,7 +59,7 @@ force=False # Reuse the settings found in an existing index file in the thumbnail # directory, if at all possible. This option is ignored in 'force' mode. -# NOTE: Even if this option is set to "False', ffpreview tries to reuse +# NOTE: Even if this option is set to "False', FFpreview tries to reuse # existing files, provided all essential parameters still match the # current settings. reuse=True @@ -79,7 +79,7 @@ end= # scene - scene change detection, see 'scene_thresh' # skip - skip number of frames between thumbnails, see 'frame_skip' # time - sample a thumbnail every number of seconds, see 'time_skip' -# customvf - custom ffmpeg filter string, see 'customvf' +# customvf - custom FFmpeg filter string, see 'customvf' method=iframe # Scene change detection threshold for method 'scene'. @@ -91,9 +91,9 @@ frame_skip=200 # Sample interval in seconds for method 'time'. time_skip=60 -# Custom ffmpeg filter string for method 'customvf'. The configured -# expression is passed verbatim as argument to ffmpeg's "-vf" option. -# This is an advanced setting. Please consult the ffmpeg documentation +# Custom FFmpeg filter string for method 'customvf'. The configured +# expression is passed verbatim as argument to the `ffmpeg -vf` option. +# This is an advanced setting. Please consult the FFmpeg documentation # to learn more about video filter expressions. customvf=scdet=s=1:t=12 diff --git a/ffpreview.py b/ffpreview.py index edf6a59..9231557 100755 --- a/ffpreview.py +++ b/ffpreview.py @@ -5,12 +5,14 @@ ffpreview.py Copyright (c) 2021 Urban Wallasch -Ffpreview is distributed under the Modified ("3-clause") BSD License. +FFpreview is distributed under the Modified ("3-clause") BSD License. See `LICENSE` file for more information. """ _FFPREVIEW_VERSION = '0.3+' +_FFPREVIEW_NAME = 'FFpreview' + _FFPREVIEW_IDX = 'ffpreview.idx' _FFPREVIEW_CFG = 'ffpreview.conf' @@ -941,9 +943,10 @@ class aboutDialog(QDialog): self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) self.icon_label = QLabel() self.icon_label.setPixmap(ffIcon.ffpreview_pxm) - self.tag_label = QLabel('ffpreview %s\n' + self.tag_label = QLabel('%s %s\n' 'Copyright (c) 2021, Urban Wallasch\n' - 'BSD 3-Clause License' % _FFPREVIEW_VERSION) + 'BSD 3-Clause License' + % (_FFPREVIEW_NAME, _FFPREVIEW_VERSION)) self.tag_label.setAlignment(Qt.AlignCenter) self.hdr_layout = QHBoxLayout() self.hdr_layout.addWidget(self.icon_label, 1) @@ -1784,7 +1787,7 @@ class sMainWindow(QMainWindow): self.vfile = os.path.basename(self.fname) self.vpath = os.path.dirname(self.fname) self.thdir = os.path.abspath(os.path.join(cfg['outdir'], self.vfile)) - self.setWindowTitle('ffpreview - ' + self.vfile) + self.setWindowTitle(_FFPREVIEW_NAME + ' - ' + self.vfile) eprint(1, "open file:", self.fname) # clear previous view for sd in self.statdsp: @@ -2350,8 +2353,8 @@ def main(): if not _FF_DEBUG: os.environ['QT_LOGGING_RULES'] = 'qt5ct.debug=false' app = QApplication(sys.argv) - app.setApplicationName('ffpreview') - root = sMainWindow(title='ffpreview %s' % _FFPREVIEW_VERSION) + app.setApplicationName(_FFPREVIEW_NAME) + root = sMainWindow(title=_FFPREVIEW_NAME + ' ' + _FFPREVIEW_VERSION) # start console debugging thread, if _FF_DEBUG is set if _FF_DEBUG: -- 2.30.2