Commit c2c2d93a authored by Michael Murtaugh's avatar Michael Murtaugh

Merge branch 'collage-shell-client' of gitlab.com:sicv/vitrine into collage-shell-client

parents 93a16484 821f31e7
......@@ -12,9 +12,8 @@ The server is written in javascript and requires node to run it. Camera and feat
For node, the required packages can be installed with the command:
apt-get install nodejs npm python-opencv
npm install socket.io node-static javascript-state-machine extend dateformat async minimist
npm install socket.io node-static javascript-state-machine extend dateformat async minimist socket.io-client
and install ffmpeg via deb-multimedia:
......
var io = require('socket.io-client'),
fs = require('fs'),
spawn = require('child_process').spawn,
player = null;
var settings = JSON.parse(fs.readFileSync("settings.json", "utf8")),
serverbase = "http://"+settings.ipaddress+":"+settings.port,
socket = io.connect(serverbase);
socket.on("connect", function (data) {
console.log("connected to socket server");
});
socket.on("collage", function (d) {
// video.style.display = "none";
if (player) {
player.kill();
player = null;
}
// player = spawn('cvlc', ['--no-video-title-show', '--loop', 'collage/creatingcollage.mp4']);
player = spawn('scripts/play', ['collage/creatingcollage.mp4']);
console.log("Creating collage...");
});
socket.on("collagegif", function (d) {
console.log("collagegif", d.src);
if (player !== null) {
player.kill();
player = null;
}
console.log("scripts/playurl " + (serverbase+"/"+d.src));
player = spawn('scripts/playurl', [serverbase+"/"+d.src]);
});
var spawn = require('child_process').spawn,
path = "collage/creatingcollage.mp4",
// params = ['-loop', '0', path],
params = ['--loop', path],
// params = ['-fs', '-loop', '0', path],
// mplayer = spawn('mplayer', params);
player = spawn('cvlc', params);
player.on("close", function (code) {
console.log("player closed with code", code);
});
// ok killing a spawned process doesn't seem to be a problem... moving on...
setTimeout(function () {
player.kill();
setTimeout(function () {
player.kill();
console.log("second kill");
setTimeout(function () {
console.log("that's all folks");
}, 5000);
}, 5000);
}, 10000);
......@@ -7,3 +7,7 @@ settings.json:
archive.json: archive/
./getfaces.py archive/* > archive.json
creatingcollage.mp4: creatingcollage.png
ffmpeg -framerate 1/10 -i creatingcollage.png -c:v libx264 -r 15 -pix_fmt yuv420p creatingcollage.mp4
\ No newline at end of file
......@@ -6,4 +6,4 @@ collagegif=$3
rm -f frames/*
# rm "$cameragif" # actually this *can not* happen as it needs to be served...
scp "$archivegif" "$collagegif" aa:/var/www/vhosts/sicv.activearchives.org/httpdocs/vitrine
#scp "$archivegif" "$collagegif" aa:/var/www/vhosts/sicv.activearchives.org/httpdocs/vitrine
#!/bin/bash
# cvlc --loop $1
killall -s 9 vlc
cvlc --fullscreen --no-video-title-show --loop $1
#!/bin/bash
# cvlc -loop $1
killall -s 9 vlc
# wget $1 -o tmp.webm
cvlc --fullscreen --loop --no-video-title-show $1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment