-# 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.
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.
## 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), ...`
`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
```
### 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/*
## 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.
----------------------------------------------------------------------
-# Ffpreview example configuration file
+# FFpreview example configuration file
#
# Copy this file to "ffppreview.conf" and make the desired changes.
# 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
# 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'.
# 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
Copyright (c) 2021 Urban Wallasch <irrwahn35@freenet.de>
-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'
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)
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:
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: