Created
February 16, 2016 14:41
-
-
Save ryopeko/97351a481475924c3ff1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+import sys | |
from ikalog import inputs | |
from ikalog import outputs | |
from ikalog.utils import IkaUtils | |
@@ -50,6 +51,15 @@ class IkaConfig: | |
# source.start_video_file(name='video.avi') | |
# source.set_frame_rate(10) | |
+ if len(sys.argv) > 1: # 引数を指定した場合はその引数のファイルを読み込んで再生 | |
+ print('input from sys.args') | |
+ source = inputs.CVFile() | |
+ source.select_source(name=sys.argv[1]) | |
+ source.set_frame_rate(10) | |
+ else: | |
+ source = inputs.AVFoundationCapture() | |
+ source.select_source(1) | |
+ | |
# パターン6: OpenCV の GStreamerパイプラインからの読み込み機能を利用する | |
# ・OpenCV が GStreamer に対応していること | |
# ・パイプラインは '$YOUR_STREAM_SOURCE ! videoconvert ! appsink' | |
@@ -59,8 +69,8 @@ class IkaConfig: | |
# source.select_source(name='decklinksrc connection=hdmi mode=720p5994 device-number=0 ! videoconvert ! appsink') | |
# | |
# 例) テストパターンを表示 | |
- source = inputs.GStreamer() | |
- source.select_source(name='videotestsrc ! videoconvert ! appsink') | |
+ #source = inputs.GStreamer() | |
+ #source.select_source(name='videotestsrc ! videoconvert ! appsink') | |
# 一部のHDMIキャプチャはHDMIソースのピクセルがずれている。 | |
# 必要に応じてキャプチャのオフセットを(x, y) 指定 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment