From 7575a3e031d0af5b946cec510f32d528badd4755 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Thu, 15 Aug 2019 09:56:21 +0530 Subject: [PATCH] Plugin vidthumb --- plugins/README.md | 3 ++- plugins/vidthumb | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100755 plugins/vidthumb diff --git a/plugins/README.md b/plugins/README.md index 5cf6ca72..9c6b52de 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -14,7 +14,7 @@ The currently available plugins are listed below. | imgur | bash | - | Upload an image to imgur (from [imgur-screenshot](https://github.com/jomo/imgur-screenshot)) | | ipinfo | sh | curl, whois | Fetch external IP address and whois information | | kdeconnect | sh | kdeconnect-cli | Send selected files to an Android device | -| moclyrics | sh | [ddgr](https://github.com/jarun/ddgr), moc | Show lyrics of current track in moc | +| moclyrics | sh | [ddgr](https://github.com/jarun/ddgr), [moc](http://moc.daper.net/) | Show lyrics of current track in moc | | mocplay | sh | [moc](http://moc.daper.net/) | Appends (and plays, see script) selection/dir/file in moc| | ndiff | sh | vimdiff | Diff for selection (limited to 2 for directories) | | nmount | sh | pmount, udisks2 | Toggle mount status of a device as normal user | @@ -30,6 +30,7 @@ The currently available plugins are listed below. | thumb | sh | [lsix](https://github.com/hackerb9/lsix) | View thumbnail of an image or dir of images | | transfer | sh | curl | Upload file to transfer.sh | | upgrade | sh | wget | Upgrade to latest nnn version manually on Debian 9 Stretch | +| vidthumb | sh | [ffmpegthumbnailer](https://github.com/dirkvdb/ffmpegthumbnailer),
[lsix](https://github.com/hackerb9/lsix) | Show video thumbnails in terminal | | viuimg | sh | [viu](https://github.com/atanunq/viu), less | View an image or images in a directory | #### Installing plugins diff --git a/plugins/vidthumb b/plugins/vidthumb new file mode 100755 index 00000000..a6eb0e43 --- /dev/null +++ b/plugins/vidthumb @@ -0,0 +1,27 @@ +#!/usr/bin/env sh + +# Description: Generate video thumbnails and view them +# +# Requires: +# ffmpegthumbnailer: https://github.com/dirkvdb/ffmpegthumbnailer +# lsix: https://github.com/hackerb9/lsix +# +# Shell: POSIX compliant +# Author: Arun Prakash Jana + +mkdir .nthumbs > /dev/null 2>&1 + +for file in *; do + if [ -f "$file" ]; then + ffmpegthumbnailer -i "$file" -o .nthumbs/"${file%%.*}".jpg 2> /dev/null + fi +done + +# render thumbnails in lsix +lsix .nthumbs/* + +# remove the thumbnails +rm -rf .nthumbs + +echo -n "Press any key to exit..." +read dummy