0
0

More than 1 year has passed since last update.

【Python】動画をコマ送りで見る方法をOpenCVで実装

Posted at

概要

動画をじっくりしっかり見たい!と思っても、なかなか
1コマ1コマ止めながらとか、ズームしたい!ってできませんよね。
動画の細かい部分を見たい時があったので、デバッグ用として作成しました!
(エラー処理は超ゆるいです)

使い方

次のコマに進めるには何かしらのキーを押さないといけない。
キーを押すまではimshowによりズームなり何なり可能。
"q"で再生終了。

ソースコード

debugVideo.py
import cv2

video = cv2.VideoCapture("output.mp4")

while video.isOpened():

    ret, frame = video.read()

    cv2.imshow("Preview", frame)

    if cv2.waitKey() & 0xFFF == ord('q'):
        break

video.release()

詳細

GitHubにも載せています。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0