Skip to main content

Video or Folder preview generator

Project description

Github PyPi Python CI

Previewer

Command line tool to generate montages/sequences from video clips or folders containing images.

previewer is a collection of tools:

  • previewer montage: to generate a single image with thumbnails (a montage) from a folder containing images or a video
  • previewer gif: to generate a Gif (or mp4/webp/webm) with thumbnails from a folder containing images or a video
  • previewer video-thumbnailer: to extract a given number of thumbnails from a video clip
  • previewer resize: to change geometry (resize, crop, fit, fill) of images

Install

Install dependencies

$ sudo apt update
$ sudo apt install imagemagick ffmpeg

Install the latest release of previewer from PyPI

$ pip3 install previewer
$ previewer-montage --help

Or install previewer from the sources

$ pip3 install poetry
$ pip3 install git+https://github.com/essembeh/previewer
$ previewer --help

Montage

previewer montage can create preview image from a folder containing images or a video.

You can customize the generated image:

  • change the background color
  • change geometry (width, height, crop, fit or fill) of the thumbnails
  • show or hide the a title
  • show or hide image filenames
  • adjust the space between thumbnails
  • add a border, a shadow to thumbnails

Example:

$ previewer montage --size 120x120 --crop --fill --background SlateGray1 "Rick Astley - Never Gonna Give You Up (Official Music Video).mp4"
🎬 Generate montage from video ./Rick Astley - Never Gonna Give You Up (Official Music Video).mp4 using 36 thumbnails
🍺 Montage generated ./Rick Astley - Never Gonna Give You Up (Official Music Video).jpg

Example of montage

Sequence

previewer gif can generate sequences with images in a folder or extracted from a video.

You can customize the sequence:

  • choose the format between gif, mp4, webp or webm
  • adjust fps (frames per seconds), delay between 2 frames ...
  • when extrating frames from a video, you can either use a fixed number of frames to extract or compute it given a given speed
  • change geometry (width, height, crop, fit or fill) of the frames

Example:

$ previewer gif --size 320x240 --crop --fill -n 20 "Rick Astley - Never Gonna Give You Up (Official Music Video).mp4"
🎬 Generate gif from video ./Rick Astley - Never Gonna Give You Up (Official Music Video).mp4 using 20 thumbnails
🍺 Sequence generated ./Rick Astley - Never Gonna Give You Up (Official Music Video).gif

Example of sequence

$ previewer gif --start 3 --end 4 --fps 10 --aba --size 320x240 --crop --fill "Rick Astley - Never Gonna Give You Up (Official Music Video).mp4"
🎬 Generate gif from video ./Rick Astley - Never Gonna Give You Up (Official Music Video).mp4 using 10 thumbnails
🍺 Sequence generated ./Rick Astley - Never Gonna Give You Up (Official Music Video).gif

Example of sequence with A-B-A loop

Thumbnailer

previewer video-thumbnailer can extract and resize/crop frames from a video

You can also:

  • choose the frame count to extract
  • select a start position and/or a end position in the video
  • change geometry (width, height, crop, fit or fill) of the frames

Example:

$ previewer video-thumbnailer -n 20 "Rick Astley - Never Gonna Give You Up (Official Music Video).mp4"
Extract 20 thumbnails from ./Rick Astley - Never Gonna Give You Up (Official Music Video).mp4
  Rick Astley - Never Gonna Give You Up (Official Music Video)/frame 01 (0:00:05).jpg (1920x1080) at position 0:00:05
  Rick Astley - Never Gonna Give You Up (Official Music Video)/frame 02 (0:00:15).jpg (1920x1080) at position 0:00:15
  Rick Astley - Never Gonna Give You Up (Official Music Video)/frame 03 (0:00:26).jpg (1920x1080) at position 0:00:26
  Rick Astley - Never Gonna Give You Up (Official Music Video)/frame 04 (0:00:37).jpg (1920x1080) at position 0:00:37
  Rick Astley - Never Gonna Give You Up (Official Music Video)/frame 05 (0:00:47).jpg (1920x1080) at position 0:00:47
  Rick Astley - Never Gonna Give You Up (Official Music Video)/frame 06 (0:00:58).jpg (1920x1080) at position 0:00:58
  Rick Astley - Never Gonna Give You Up (Official Music Video)/frame 07 (0:01:08).jpg (1920x1080) at position 0:01:08
  Rick Astley - Never Gonna Give You Up (Official Music Video)/frame 08 (0:01:19).jpg (1920x1080) at position 0:01:19
  Rick Astley - Never Gonna Give You Up (Official Music Video)/frame 09 (0:01:30).jpg (1920x1080) at position 0:01:30
  Rick Astley - Never Gonna Give You Up (Official Music Video)/frame 10 (0:01:40).jpg (1920x1080) at position 0:01:40
  Rick Astley - Never Gonna Give You Up (Official Music Video)/frame 11 (0:01:51).jpg (1920x1080) at position 0:01:51
  Rick Astley - Never Gonna Give You Up (Official Music Video)/frame 12 (0:02:01).jpg (1920x1080) at position 0:02:01
  Rick Astley - Never Gonna Give You Up (Official Music Video)/frame 13 (0:02:12).jpg (1920x1080) at position 0:02:12
  Rick Astley - Never Gonna Give You Up (Official Music Video)/frame 14 (0:02:23).jpg (1920x1080) at position 0:02:23
  Rick Astley - Never Gonna Give You Up (Official Music Video)/frame 15 (0:02:33).jpg (1920x1080) at position 0:02:33
  Rick Astley - Never Gonna Give You Up (Official Music Video)/frame 16 (0:02:44).jpg (1920x1080) at position 0:02:44
  Rick Astley - Never Gonna Give You Up (Official Music Video)/frame 17 (0:02:54).jpg (1920x1080) at position 0:02:54
  Rick Astley - Never Gonna Give You Up (Official Music Video)/frame 18 (0:03:05).jpg (1920x1080) at position 0:03:05
  Rick Astley - Never Gonna Give You Up (Official Music Video)/frame 19 (0:03:16).jpg (1920x1080) at position 0:03:16
  Rick Astley - Never Gonna Give You Up (Official Music Video)/frame 20 (0:03:26).jpg (1920x1080) at position 0:03:26
🍺 20 thumbnails extracted in Rick Astley - Never Gonna Give You Up (Official Music Video)/

Example of thumbnailer

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

previewer-0.3.0.tar.gz (17.6 kB view hashes)

Uploaded Source

Built Distribution

previewer-0.3.0-py3-none-any.whl (22.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page