動画からスライドを抽出するCLIソフト

ソフトウェア使用ログ
How To Extract Slides/Frames From a Video Presentation
There are several reasons to extract slides/frames from a video presentation, especially in the case of education or con...
pwd

C:\Users\icros

git clone https://github.com/kaushikj/video2pdf.git

Cloning into ‘video2pdf’…
remote: Enumerating objects: 47, done.
remote: Counting objects: 100% (21/21), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 47 (delta 18), reused 17 (delta 17), pack-reused 26Receiving objects: 38% (18/47), 27.36 MiB | 3.63 MiB/s
Receiving objects: 100% (47/47), 28.80 MiB | 3.42 MiB/s, done.
Resolving deltas: 100% (20/20), done.

cd .\video2pdf\
ls
ディレクトリ: C:\Users\icros\video2pdf

Mode LastWriteTime Length Name
—- ————- —— —-
d—– 2024/04/21 15:56 input
d—– 2024/04/21 15:56 output
-a—- 2024/04/21 15:56 1939 .gitignore
-a—- 2024/04/21 15:56 1534 README.md
-a—- 2024/04/21 15:56 57 requirements.txt
-a—- 2024/04/21 15:56 6563 video2pdfslides.py

cat .\requirements.txt

imutils==0.5.4
opencv_python==4.9.0.80 # ←opencv_python==4.5.2.52 を書き換えた
img2pdf==0.4.1

pip install -r requirements.txt


Collecting imutils==0.5.4 (from -r requirements.txt (line 1))
Using cached imutils-0.5.4.tar.gz (17 kB)
Preparing metadata (setup.py) … done
Requirement already satisfied: opencv_python==4.9.0.80 in c:\users\icros\appdata\local\packages\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\localcache\local-packages\python311\site-packages (from -r requirements.txt (line 3)) (4.9.0.80)
Collecting img2pdf==0.4.1 (from -r requirements.txt (line 4))
Downloading img2pdf-0.4.1-py3-none-any.whl.metadata (11 kB)
Requirement already satisfied: numpy>=1.21.2 in c:\users\icros\appdata\local\packages\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\localcache\local-packages\python311\site-packages (from opencv_python==4.9.0.80->-r requirements.txt (line 3)) (1.24.2)
Requirement already satisfied: Pillow in c:\users\icros\appdata\local\packages\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\localcache\local-packages\python311\site-packages (from img2pdf==0.4.1->-r requirements.txt (line 4)) (9.5.0)
Collecting pikepdf (from img2pdf==0.4.1->-r requirements.txt (line 4))
Downloading pikepdf-8.15.1-cp311-cp311-win_amd64.whl.metadata (8.6 kB)
Collecting Pillow (from img2pdf==0.4.1->-r requirements.txt (line 4))
Downloading pillow-10.3.0-cp311-cp311-win_amd64.whl.metadata (9.4 kB)
Collecting Deprecated (from pikepdf->img2pdf==0.4.1->-r requirements.txt (line 4))
Downloading Deprecated-1.2.14-py2.py3-none-any.whl.metadata (5.4 kB)
Collecting lxml>=4.8 (from pikepdf->img2pdf==0.4.1->-r requirements.txt (line 4))
Downloading lxml-5.2.1-cp311-cp311-win_amd64.whl.metadata (3.5 kB)
Requirement already satisfied: packaging in c:\users\icros\appdata\local\packages\pythonsoftwarefoundation.python.3.11_qbz5n2kfra8p0\localcache\local-packages\python311\site-packages (from pikepdf->img2pdf==0.4.1->-r requirements.txt (line 4)) (23.0)
Collecting wrapt<2,>=1.10 (from Deprecated->pikepdf->img2pdf==0.4.1->-r requirements.txt (line 4))
Downloading wrapt-1.16.0-cp311-cp311-win_amd64.whl.metadata (6.8 kB)
Downloading img2pdf-0.4.1-py3-none-any.whl (41 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 42.0/42.0 kB 690.3 kB/s eta 0:00:00
Downloading pikepdf-8.15.1-cp311-cp311-win_amd64.whl (3.5 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.5/3.5 MB 4.4 MB/s eta 0:00:00
Downloading pillow-10.3.0-cp311-cp311-win_amd64.whl (2.5 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.5/2.5 MB 3.8 MB/s eta 0:00:00
Downloading lxml-5.2.1-cp311-cp311-win_amd64.whl (3.8 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.8/3.8 MB 1.5 MB/s eta 0:00:00
Downloading Deprecated-1.2.14-py2.py3-none-any.whl (9.6 kB)
Downloading wrapt-1.16.0-cp311-cp311-win_amd64.whl (37 kB)
Building wheels for collected packages: imutils
Building wheel for imutils (setup.py) … done
Created wheel for imutils: filename=imutils-0.5.4-py3-none-any.whl size=25855 sha256=cbe055bcde2a165ae4f2b183f42c58a245b94ad35415a6144d81ea88fc1f5ee6
Stored in directory: c:\users\icros\appdata\local\pip\cache\wheels\31\d0\2c\87ce38f6052879e5b7b18f0f8b4a10ad2a9d210e908d449f16
Successfully built imutils
Installing collected packages: imutils, wrapt, Pillow, lxml, Deprecated, pikepdf, img2pdf
Attempting uninstall: Pillow
Found existing installation: Pillow 9.5.0
Uninstalling Pillow-9.5.0:
Successfully uninstalled Pillow-9.5.0
WARNING: The script img2pdf.exe is installed in ‘C:\Users\icros\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\Scripts’ which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use –no-warn-script-location.
Successfully installed Deprecated-1.2.14 Pillow-10.3.0 img2pdf-0.4.1 imutils-0.5.4 lxml-5.2.1 pikepdf-8.15.1 wrapt-1.16.0

python video2pdfslides.py '.\input\Test Video 1.mp4'

video_path .\input\Test Video 1.mp4
initialized output folder ./output/
total_frames: 7748.0
FRAME_RATE 3
saving ./output/000_0.02.png
saving ./output/001_0.27.png
saving ./output/002_1.9.png
saving ./output/003_3.21.png
4 screenshots Captured!
Time taken 40.17061233520508s
Please Manually verify screenshots and delete duplicates
Press y to continue and n to terminatey
output_folder_screenshot_path ./output/
output_pdf_path ./output/.pdf
converting images to pdf..
Pdf Created!
pdf saved at ./output/.pdf

コメント

タイトルとURLをコピーしました