Skip to content

Instantly share code, notes, and snippets.

@vvakame
Last active July 25, 2017 04:55
Show Gist options
  • Save vvakame/996b2c25f51fc4b4fd18 to your computer and use it in GitHub Desktop.
Save vvakame/996b2c25f51fc4b4fd18 to your computer and use it in GitHub Desktop.
IkaLog+動画での動作を目指す

IkaLog+動画での動作を目指す

当初とりあえず動画取りたいだけだったので赤黒(IkaLog作者さんのアフィリエイト付)を買ったのですが、MacだとOpenCVのVideoSourceにできないらしくて悲しい。 BlackMagicのなんたらを買ってみようかと思ったのですが、動作不良とかあってピーキーだからAjaにしなよ業務にも耐えれるよ!とか言われて業務ってなんだよいくらだよなにこれ!とかなってました。

とりあえず動画での動作を目指す。 解説記事とか開発者Wikiとかにしたがって環境構築はしてある体。

現状

なんか動かん!

43e0ca040ca8c098107a774a539814d9e77c0117 で作業。

https://dl.dropboxusercontent.com/u/14421778/IkaLog/ikalog_sample.mp4 がテスト用動画らしいので試すがプレビュー画面出ず。 https://dl.dropboxusercontent.com/u/6581286/IkaLog/vv-ikalog.mp4 が自前の動画なんだけどこれだと動画終わりの1フレームが静止画で表示される。 昨日のプレイを長時間録画したファイル2つだと、1つは動画終わりの1フレーム静止画で、もう1つはプレビュー画面出ず。

環境

とりあえず使ってるライブラリのバージョンが違うとかが一番ありそうなので誰か動いてる人とすりあわせしたい…。

# 家PC
$ sw_vers
ProductName:	Mac OS X
ProductVersion:	10.10.5
BuildVersion:	14F27
$ brew info python3
python3: stable 3.5.0 (bottled), HEAD
Interpreted, interactive, object-oriented programming language
https://www.python.org/
/usr/local/Cellar/python3/3.5.0 (3537 files, 60M) *
  Poured from bottle
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/python3.rb
==> Dependencies
Build: xz ✔, pkg-config ✔
Required: openssl ✔
Recommended: readline ✔, sqlite ✔, gdbm ✔, xz ✔
Optional: homebrew/dupes/tcl-tk ✘

$ brew info numpy
homebrew/python/numpy: stable 1.10.1 (bottled), HEAD
http://www.numpy.org
/usr/local/Cellar/numpy/1.10.1 (1393 files, 29M) *
  Built from source with: --with-python3
From: https://github.com/Homebrew/homebrew-python/blob/master/numpy.rb
==> Dependencies
Optional: homebrew/science/openblas ✘

$ brew info opencv3
homebrew/science/opencv3: stable 3.0.0 (bottled), HEAD
Open source computer vision library, version 3
http://opencv.org/

This formula is keg-only.
opencv3 and opencv install many of the same files.

/usr/local/Cellar/opencv3/3.0.0 (247 files, 104M) *
  Built from source with: --with-python3
From: https://github.com/Homebrew/homebrew-science/blob/master/opencv3.rb
==> Dependencies
Build: cmake ✔, pkg-config ✔
Required: jpeg ✔, libpng ✔, libtiff ✔
Recommended: eigen ✔, openexr ✔, homebrew/python/numpy ✔
Optional: ffmpeg ✘, gphoto2 ✘, gstreamer ✘, jasper ✔, libdc1394 ✘, openni ✘, openni2 ✘, qt ✘, qt5 ✘, tbb ✘
$ pip3 freeze
fluent-logger==0.4.0
msgpack-python==0.4.6
nose==1.3.7
numpy==1.10.1
oauthlib==1.0.3
Pillow==3.0.0
PyYAML==3.11
requests==2.8.1
requests-oauthlib==0.5.0
slackweb==1.0.5
u-msgpack-python==2.1
urllib3==1.12
wheel==0.26.0
wxPython-Phoenix==3.0.3.dev1830+0b5f910
@vvakame
Copy link
Author

vvakame commented Oct 22, 2015

わいわい!できたぞ!!
黒枠調整はテレビ側の設定でなんとかなるかなぁ…

$ python3 IkaLog.py ~/Movies/AVerMedia_Capture_recording-2015-10-23-03-09-0.mp4
input from sys.args
<ikalog.inputs.cvcapture.CVCapture object at 0x10ccdf4e0>: initalizing pre-recorded video file /Users/vvakame/Movies/AVerMedia_Capture_recording-2015-10-23-03-09-0.mp4
start model.train 991
done model.train
Loaded weapons recoginization model.
[event] 00:40 on_lobby_matching  Lobby_type: public
[event] 00:44 on_lobby_matched  Lobby_type: public
ゲームスタート。マップ シオノメ油田 ルール ナワバリバトル
[event] 00:54 on_game_start
[event] 01:02 on_game_go_sign
[event] 01:02 on_game_team_color
プレイヤーをたおした!
[event] 01:21 on_game_killed
プレイヤーをたおした!
[event] 01:39 on_game_killed
プレイヤーをたおした!
[event] 01:50 on_game_killed
たおされた!
[event] 01:53 on_game_dead
死因: sshooter_collabo
[event] 01:57 on_game_death_reason_identified  weapon = sshooter_collabo
プレイヤーをたおした!
[event] 02:11 on_game_killed
たおされた!
[event] 02:27 on_game_dead
死因: barrelspinner
[event] 02:31 on_game_death_reason_identified  weapon = barrelspinner
たおされた!
[event] 02:54 on_game_dead
死因: sshooter_collabo
[event] 02:58 on_game_death_reason_identified  weapon = sshooter_collabo
たおされた!
[event] 03:07 on_game_dead
死因: nzap89
[event] 03:12 on_game_death_reason_identified  weapon = nzap89
プレイヤーをたおした!
[event] 03:22 on_game_killed
たおされた!
[event] 03:25 on_game_dead
死因: hotblaster_custom
[event] 03:29 on_game_death_reason_identified  weapon = hotblaster_custom
プレイヤーをたおした!
[event] 03:40 on_game_killed
たおされた!
[event] 03:45 on_game_dead
死因: hotblaster_custom
[event] 03:49 on_game_death_reason_identified  weapon = hotblaster_custom
[event] 04:05 on_game_finish
<ikalog.scenes.result_judge.ResultJudge object at 0x11467b438>: duration = 594 ms
[event] 04:12 on_result_judge  judge: lose, knockout: False
ゲーム終了。 ステージ:シオノメ油田 ルール:ナワバリバトル 負け 603p 8K/6D 使用ブキ:ノヴァブラスター チーム内順位: 1
スクリーンショット ./screenshots/ikabattle_20151023_032016.png を保存しました
[event] 04:19 on_game_individual_result
Entering result_gears loop
<ikalog.scenes.result_gears.ResultGears object at 0x11467b908>: duration = 1657 ms
[event] 04:26 on_result_gears
Escaped result_gears loop
Entering result_gears loop
<ikalog.scenes.result_gears.ResultGears object at 0x11467b908>: duration = 62 ms
[event] 04:31 on_result_gears
Escaped result_gears loop
[event] 04:34 on_lobby_matching  Lobby_type: public
Watchdog fired. Closing current session
ゲームセッション終了
<ikalog.outputs.csv.CSV object at 0x110e8c898> (enabled = True)
<ikalog.outputs.json.JSON object at 0x110e8c8d0> (enabled = True)
[event] 04:39 on_game_session_end  death_reasons = {'sshooter_collabo': 2, 'hotblaster_custom': 2, 'nzap89': 1, 'barrelspinner': 1}
[event] 05:08 on_lobby_matched  Lobby_type: public
ゲームスタート。マップ シオノメ油田 ルール ナワバリバトル
[event] 05:19 on_game_start
[event] 05:27 on_game_go_sign
[event] 05:27 on_game_team_color
プレイヤーをたおした!
[event] 05:38 on_game_killed
プレイヤーをたおした!
[event] 05:41 on_game_killed
プレイヤーをたおした!
[event] 05:52 on_game_killed
プレイヤーをたおした!
[event] 06:05 on_game_killed
プレイヤーをたおした!
[event] 06:08 on_game_killed
たおされた!
[event] 06:10 on_game_dead
死因: wakaba
[event] 06:14 on_game_death_reason_identified  weapon = wakaba
プレイヤーをたおした!
[event] 06:37 on_game_killed
プレイヤーをたおした!
[event] 06:39 on_game_killed
プレイヤーをたおした!
[event] 07:00 on_game_killed
プレイヤーをたおした!
[event] 07:20 on_game_killed
たおされた!
[event] 07:27 on_game_dead
死因: carbon_deco
[event] 07:31 on_game_death_reason_identified  weapon = carbon_deco
たおされた!
[event] 07:40 on_game_dead
死因: carbon_deco
[event] 07:44 on_game_death_reason_identified  weapon = carbon_deco
プレイヤーをたおした!
[event] 07:52 on_game_killed
プレイヤーをたおした!
[event] 07:55 on_game_killed
プレイヤーをたおした!
[event] 08:22 on_game_killed
たおされた!
[event] 08:23 on_game_dead
死因: wakaba
[event] 08:26 on_game_death_reason_identified  weapon = wakaba
[event] 08:31 on_game_finish
<ikalog.scenes.result_judge.ResultJudge object at 0x11467b438>: duration = 6067 ms
[event] 08:43 on_result_judge  judge: win, knockout: False
ゲーム終了。 ステージ:シオノメ油田 ルール:ナワバリバトル 勝ち 1042p 12K/5D 使用ブキ:ノヴァブラスター チーム内順位: 2
スクリーンショット ./screenshots/ikabattle_20151023_032122.png を保存しました
[event] 08:45 on_game_individual_result
Entering result_gears loop
<ikalog.scenes.result_gears.ResultGears object at 0x11467b908>: duration = 6380 ms
[event] 08:57 on_result_gears
Escaped result_gears loop
Watchdog fired. Closing current session
ゲームセッション終了
<ikalog.outputs.csv.CSV object at 0x110e8c898> (enabled = True)
<ikalog.outputs.json.JSON object at 0x110e8c8d0> (enabled = True)
[event] 09:05 on_game_session_end  death_reasons = {'carbon_deco': 2, 'wakaba': 2}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment