Converts a video presentation into a deck of pdf slides by capturing screenshots of unique frames
Project description
video2pdfslides-tddschn
PyPI Upload of https://github.com/kaushikj/video2pdfslides,
with more command line options.
All credits to https://github.com/kaushikj.
Description
This project converts a video presentation into a deck of pdf slides by capturing screenshots of unique frames
youtube demo: https://www.youtube.com/watch?v=Q0BIPYLoSBs
Installation
Requires Python 3.9.
pipx
This is the recommended installation method.
$ pipx install video2pdfslides-tddschn --python "$(which python3.9)"
pip
$ python3.9 -m pip install video2pdfslides-tddschn
Usage
video2pdfslides <video_path>
it will capture screenshots of unique frames and save it output folder...once screenshots are captured the program is paused and the user is asked to manually verify the screenshots and delete any duplicate images. Once this is done the program continues and creates a pdf out of the screenshots.
$ v2ps --help
usage: video2pdfslides [-h] [--output_slides_dir OUTPUT_SLIDES_DIR] [--frame_rate FRAME_RATE] [--warmup WARMUP] [--fgbg_history FGBG_HISTORY]
[--var_threshold VAR_THRESHOLD] [--detect_shadows] [--min_percent MIN_PERCENT] [--max_percent MAX_PERCENT] [-V]
video_path
Converts a video presentation into a deck of pdf slides by capturing screenshots of unique frames
positional arguments:
video_path path of video to be converted to pdf slides
optional arguments:
-h, --help show this help message and exit
--output_slides_dir OUTPUT_SLIDES_DIR
path of output folder (default: ./output)
--frame_rate FRAME_RATE
no of frames per second that needs to be processed, fewer the count faster the speed (default: 3)
--warmup WARMUP initial number of frames to be skipped (default: 3)
--fgbg_history FGBG_HISTORY
no.of frames in background object (default: 45)
--var_threshold VAR_THRESHOLD
Threshold on the squared Mahalanobis distance between the pixel and the model to decide whether a pixel is well described by the
background model. This parameter does not affect the background update. (default: 16)
--detect_shadows If true, the algorithm will detect shadows and mark them. It decreases the speed a bit, so if you do not need this feature, set the
parameter to false. (default: False)
--min_percent MIN_PERCENT
min percentage of diff between foreground and background to detect if motion has stopped (default: 0.1)
--max_percent MAX_PERCENT
max percentage of diff between foreground and background to detect if frame is still in motion (default: 3.0)
-V, --version show program's version number and exit
Example
There are two sample video avilable in "./input", you can test the code using these input by running
More
The default parameters works for a typical video presentation. But if the video presentation has lots of animations, the default parametrs won't give a good results, you may notice duplicate/missing slides. Don't worry, you can make it work for any video presentation, even the ones with animations, you just need to fine tune and figure out the right set of parametrs, The 3 most important parameters that I would recommend to get play around is "MIN_PERCENT", "MAX_PERCENT", "FGBG_HISTORY". The description of these variables can be found in code comments.
Develop
$ git clone https://github.com/tddschn/video2pdfslides-tddschn.git
$ cd video2pdfslides-tddschn
$ poetry install
Developer contact info
kaushik jeyaraman: kaushikjjj@gmail.com
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for video2pdfslides-tddschn-0.1.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 929d6c776a7994f1b051c3493c8688115b3fdebd7b9f967ec541e92b6aaf7d3c |
|
MD5 | 6f6bcac8eef2ca3a1e5f0d58089a5015 |
|
BLAKE2b-256 | 5c19fe038c52c3808cb3ab0795355a49f2d205712635ccb811ffc8197467e64f |
Hashes for video2pdfslides_tddschn-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c0bafc7ac9246602a08585a535f7a6fc36f57b5a74080798c4293870e41c497a |
|
MD5 | 33bfb0fe50b66ed35e5d599c4be0f9ad |
|
BLAKE2b-256 | 0bb2b08a4317c510e2f10c27b04b726684d8bf885c4df5f38e2ac56f44ccdc6b |