From 9c18959b355e68dcdc627cf0f876785a501ec295 Mon Sep 17 00:00:00 2001 From: Urban Wallasch Date: Thu, 13 May 2021 10:44:59 +0200 Subject: [PATCH] * Allow invocation without filename, in fact no options at all. * Some additions to REAMDE and sample configuration. * Removed unused entry in cfg[]. --- README.md | 21 +++++++++++++++++---- ffpreview.conf.sample | 1 + ffpreview.py | 3 +-- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 51580c2..70de250 100644 --- a/README.md +++ b/README.md @@ -25,9 +25,10 @@ for that purpose too, should `ffprobe` fail. ## Configuration -All options available from the command line (see below) as well as the -invocations used to start external programs can be specified in the -configuration file, see `ffpreview.conf.sample`. +With few exceptions all options available from the command line (see +below) plus the invocations to start external programs can be specified +in the configuration file, for details see the `ffpreview.conf.sample` +example configuration. ## Usage @@ -85,12 +86,24 @@ window controls: Alt+Enter open the context menu ``` ### Examples + +#### Start ffpreview with file open dialog: +``` +$ ./ffpreview.py +$ ./ffpreview.py /path/to/some/directory ``` -$ ./ffpreview.py my_video.mp4 +#### Start ffpreview and show thumbnails for a single file: +``` +$ ./ffpreview.py my_video.mp4 $ ./ffpreview.py -t ~/scratch -w 256 -g 8x4 -N 10 some_movie.mkv ``` +#### Run ffpreview in batch mode: +``` +$ ./ffpreview.py -b movie1.mkv movie2.mp4 another.mpg +``` + ## License Ffpreview is distributed under the Modified ("3-clause") BSD License. diff --git a/ffpreview.conf.sample b/ffpreview.conf.sample index 7699837..c9d7741 100644 --- a/ffpreview.conf.sample +++ b/ffpreview.conf.sample @@ -70,6 +70,7 @@ frame_skip=200 time_skip=60 # Custom ffmpeg filter string for method 'customvf'. +# For more information on filter expressions refer to the ffmpeg man page. customvf=scdet=s=1:t=12 # EOF diff --git a/ffpreview.py b/ffpreview.py index 5a66cd0..e71c411 100755 --- a/ffpreview.py +++ b/ffpreview.py @@ -94,7 +94,6 @@ def sig_handler(signum, frame): def configure(): # set defaults cfg = { - 'home': expanduser("~"), 'conffile': 'ffpreview.conf', 'vid': '', 'outdir': '', @@ -145,7 +144,7 @@ def configure(): ' Shift+Enter play video starting at selected position\n' ' Alt+Enter open the context menu\n' ) - parser.add_argument('filename', nargs='+', default=os.getcwd(), help='input video file') + parser.add_argument('filename', nargs='*', default=os.getcwd(), help='input video file') parser.add_argument('-b', '--batch', action='count', help='batch mode, do not draw window') parser.add_argument('-c', '--config', metavar='F', help='read configuration from file F') parser.add_argument('-g', '--grid', metavar='G', help='set grid geometry in COLS[xROWS] format') -- 2.30.2