Display video or video frames?

(Already 2020 in China! Americans have a few hours to go.)

Anyway, here’s a working example with xjadeo driven by OSC.

(
f = { |port(rrand(57131, 57151))|
	var pid = ("xjadeo -O " ++ port).unixCmd;
	[NetAddr("127.0.0.1", port), pid]
};
)

#n, p = f.(57135);  // help: Assignment Statements -> Multiple Assignment

n.sendMsg("/jadeo/load", "path-to-your/video-file.mp4");
n.sendMsg("/jadeo/jack/disconnect");  // necessary for /seek to work

// random seek
(
r = fork {
	loop {
		n.sendMsg("/jadeo/seek", rrand(1000, 8000).asInteger);
		exprand(0.05, 0.5).wait;
	}
};
)

r.stop;

// play forward
(
r = fork {
	var perFrame = 1/23.9;
	(1000 .. 4000).do { |i|
		n.sendMsg("/jadeo/seek", i);
		perFrame.wait;
	};
};
)

r.stop

n.sendMsg("/jadeo/quit");

Or, to sync with server latency, n.sendBundle(s.latency, ["/jadeo/seek", frameNumber]);.

hjh

6 Likes