LoginSignup
0
0

More than 1 year has passed since last update.

resolumeにprocessing4のカメラ映像をSyphonで送る mac

Last updated at Posted at 2022-08-08

参考にしたwebサイト
https://office606.org/archives/42/
http://dekapoppo.blogspot.com/2017/06/macsyphonvdmx5.html
https://resolume.com/support/ja/syphonspout

processingも勉強していて、resolumeを使い出したので、送れたらいいなと思ってやってみた。
macbook16 promax

まずprocessing3がmacのOSが新しくなった関係で、webカメラ使ったGettingStartedCaptureが動かなくなっていたので、困っていた。いろんな回避方法が載っていたが、結局processing4でやったら上手く写るようになった。

せっかく色々作ったのでresolumeで写せたらいいなと思って、調べてみた。やってみた。

processingの出力画面をresolumeで取り込むためにはsyphonという仕組みが必要みたい。

syphonというのはソフトの名前ではないらしい。

まずprocessing側でsyphonのライブラリを追加しておく

スケッチ>ライブラリをインポート>syphonする

webカメラを利用するサンプルスケッチをsyphonで出力できるように追加する

/**

  • Getting Started with Capture.
  • Reading and displaying an image from an attached Capture device.
    */

import codeanticode.syphon.*;//追加した
SyphonServer server;//追加した

import processing.video.*;

Capture cam;

void setup() {
size(640, 480, P3D);//P3Dというところを追加しないと動かない
server = new SyphonServer(this, "Processing Syphon");//追加した
String[] cameras = Capture.list();

if (cameras == null) {
println("Failed to retrieve the list of available cameras, will try the default...");
cam = new Capture(this, 640, 480);
} else if (cameras.length == 0) {
println("There are no cameras available for capture.");
exit();
} else {
println("Available cameras:");
printArray(cameras);

// The camera can be initialized directly using an element
// from the array returned by list():
cam = new Capture(this, cameras[2]);//ここの配列の番号は自分の利用したいカメラの番号にする。どの番号がどのカメラに対応しているかは、プログラムを実行した時に出力されている。
// Or, the settings can be defined based on the text in the list
//cam = new Capture(this, 640, 480, "Built-in iSight", 30);

// Start capturing the images from the camera
cam.start();

}
}

void draw() {
if (cam.available() == true) {
cam.read();
}
image(cam, 0, 0, width, height);
server.sendScreen();//追加した
// The following does the same as the above image() line, but
// is faster when just drawing the image without any additional
// resizing, transformations, or tint.
//set(0, 0, cam);
}

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