Short-circuited TV
Hack, Act, Interact Progress.

Project notes on the installation by Bostjan Spetic, Kiberpipa.

When Shaina proposed her project for festival HAIP, we were immediately for it - it was a nice mixture of raising social awarenes and innovative / subversive usage of present technology. Shaina wanted to do it with laying kilometers of video cables around the city, but we knew, that

a) this wouldn't work in Ljubljana, because there just isn't enough crowded places within a reasonable distance, and
b) because we could have problems getting permissions for laying cables in public or risk abandoning the project in the middle of the festival.
Besides, we work with computers and internet, so it made sense to try to stream everything, and add another aspect to the project - exposing the latest video transfer technology and it's potential (ab)uses.

So, we had to negotiate some interesting places, which turned out to be quite painful. There are lots of cameras in Ljubljana, they are here for years allredy and nobody seems to care about them.But,
a) not that many are at the public places, but mostly pointed at particular entrances or spots, and
b) they are all very private and regulated by very strict rules about personal information privacy.

So the owners are not alowed to do anything with them, mostly the owners don't even operate them, but a contract firm does it for them. And they loose their licence if something goes wrong
...Just this summer, there was an afair in the largest clothes-shopping mall in Ljubljana, where someone noticed surveillance cams in the dressing rooms and some footage came to the press and tv. Some interesting public areas in the city center were thus not avaliable to us.

We decided that one camera should be at the festival in Kiberpipa anyway to potentially serve as a shoutbox for the others. Our friends at the students organization allowed us to use their camera at the main hallway, which is constatly crowed with a queue of students. So the first two were not a problem. We were counting on a very crowded and popular bar, but they declined at the last moment, so our friend got a permission to setup one at tthe Faculty for Social Work in Ljubljana.

We decided to setup the fourth at the train station where we also installing a a variation of Burnstation. We were discussing this with them and asked if we could use the stream from one camera also. This made sense, because they both would stand together, and would atract more people. The main hall of the train station is crowded all the time anyway...

So, the lady from the office was very friendly and excited, the chief of electricity confirmed, chief of technicians confirmed, chief of the station confirmed. Their lawyer suggested a 'no', but she decided 'what the heck, it's only for a few days'.

Then, the next day she called me to let me know, that the chief of security (a quite notorious guy in Slovenia, involved in some weird violent situations from our transition) said something like 'over my dead body'. (yes, i am exagarating a bit ;) Well, when we came to setup the thing, after a few minutes of doubt,
we said 'what the heck' and stuck our own camera on the same stand. Some 10 min after this one of the station security came to se what was happening, but didn't say a word.

To setup the project in our way, we also required a fast, broadband internet connection near the camera. the first two were not a problem. The faculty sent us their technician, who came in his spare time and was very friendly. The trainstation was a horror story. It took us three full days of talking over the mobile phone with the computer guy, who gave us wrong settings, to come to the spot and then it took him 15 minutes to discover the proper ones. (it took Rama on his own the other day 15 seconds). At first he wanted us to use wireless, which didn't work, because of supposebly nonstandard accesspoint password settings (they said they used 4-letter password, linux wouldn't connect with less than 8). After we discovered, that the Accesspoint was exactly half a meter away from us, behind a glass wall, we were eager to use the cable. He was really trying to convince us that this is not a good idea, that it would bother the usage of the doors (which were blocked by a wall of bricks anyway), just so that he wouldn't have to leave his office. *sigh*

The computers were the glue of everything.
Unfortunetly they arrived from the store on the day the festival started, so we were in a constant lack of time with getting them to work. The plan was: use ffmpeg2theora for grabbing from video4linux device (video input) and encoding to theora stream and oggfwd to forward the stream to icecast2 server, everything in a nice two row pipeline, and playback using whatever-player-we-chose-mplayer-so-we-could-script-it - a classical procedure we were using for some years now.
Well... Sure it worked for one stream, but then, when we added two more, the streams started to randomly die. Most of the time we were afraid it was the bandwidth problem. Or the overloaded Icecast2 server (which was also main file and ltsp server at the moment).

We thought of cpu, but it didn't make sense, since they were brand new and 'top' showed only 30%-50% usage for ffmpeg2theora. So we tested the bandwidth, and it was enough.
And we setun extra virtualized dedicated streaming server. (we lots some latency there, so instead of 8secs the lag was reduced to 4secs, decieving us to think this was the problem for samo time). In the meantime, we still had to setup all the cameras and computers, so the team had to concentrate of differrent problems. (another one was to study the usage of ratpoison, to make the four mplayer windows look nicer). Well, after three days of this three-fronts-act-as-one situation, things started to sort out.

At one point, after a whole day of running around, it suddenly hit me like a storm - we were supposed to stream sound aswell! How could i forget we never did that before, and how could i forget that i've heard many times before, that separate sources of sound and video are a pain to syncronise? You know the feeling before math exam, when you realise that you forgot your pocket calculator at home? ARGH! I said nothing to Shaina, I explained the situation to the guys, and in the next hour we tested 5 other possible streaming solutions. They all could work, but would require us to invest couple of hours into studying them. At that point, I asked some of our festival guests what was their candidate for a solution, and Daniel said simply: 'gstreamer'. I know Daniel, and I know he knows what he is talking about, especially with gstreamer, which was very
unstable when I was last using it. So Daniel went and typed the 4 rows long gstreamer pipeline that 'just worked'. Perfect, problem solved. I love geeky festivals, because there is sooooo much knowledge simply floating around, waiting to be used for another wacky idea.

Streams crashed still though, but they had sound with them now. On the fourth day, we finished setting up everything, including mics, but the streams just wouldnt work. I never loose hope, I usually know the potentials of the technology and my team very accurately, but this time, I was feeling very much defensless. By sheer coincidence, someone setup cpu-usage graph at one of the desktops (why isn't this default in ubuntu anyway? one should always know what is going on inside his computer...), and after all four mplayers were up, it suddenly showed 100% usage (why this wasn't shown in top earlier remains a mystery to me, maybe because we were constantly testing the pipelines and reseting the streams, and never really watched 4 at once for long enough...).
We were blinking our eyes at the graph for some moments, checked out 'top' output and notice X11 to use all the resources. ARGH again! mplayers used unaccelerated video output by default, so the fancy graphics cards had nothing to do, and the cpu ofcourse couln'd handle rendering everything for
them. 30 more seconds, '-vo gl' and everything was perfect. Smooth, no lag, voice, clear picture. Ever use videoconference software? Ever tried 4-way conference? well, I assure you, not at this quality of image and sound, on a regular pc.

The team was thrilled, and soon everything was working properly. It seems very funny now, and we surely won't do the same mistakes again. And a general opinion was, that this kind of experiences are priceless. Each of us got a lecture in team-work, team-spirit, endurance and systematic aproach towards problems. (and all the technology that was absored in the process).


#v4lctl -c /dev/video0 setattr input Composite1
[[ $# -ne 1 ]] && echo -e "usage: $0 /<the name of the file>.ogg\n\nexample: $0 /kiberpipa.ogg" && exit#mkdir /var/lock/stream && ffmpeg2theora -v 1 -a 1 --v4l /dev/video0 -o /dev/stdout | tee ./pipe | ./oggfwd 8000 hackme "$1"mkdir /var/lock/stream && gst-launch-0.10 v4lsrc ! video/x-raw-yuv, width=320, height=240 ! videoscale ! video/x-raw-yuv, width=320, height=240 ! theoraenc bitrate=96 ! queue ! oggmux name=m ! queue ! shout2send ip= port=8000 mount="$1" password=hackme alsasrc ! audioconvert ! vorbisenc max-bitrate=$(expr 64 \* 1024) ! queue ! m. &sleep 2v4lctl -c /dev/video0 setattr input Composite1 trap "rm -r /var/lock/stream; pkill -9 gst-launch-0.10; $0 $@" EXIT wait

Playback Stream

#!/usr/bin/env bash [[ $# -ne 1 ]] && echo -e "usage: $0 <the thingy i want to play>\n\nexample: $0 kiberpipa.ogg" && exit if mkdir /var/lock/"$1" ; then mplayer -nocache -vo gl"$1" & else exit fiwait $!trap "rm -r /var/lock/"$1"; kill -9 $!; $0 $@" EXIT


Chitrakarkhana Home

Project Home
Shaina's notes:
Crew and more pics

Video split at source. Students Organistation Of the University of Ljubljana.

CCTV, mic and monitor at Students Organisation.

The Security Guard from The Students Organisation looks up.

Piggy-backing on a new camera at Faculty of Social Work, University of Ljubljana.

Desktop and quad interface in the foyer of Faculty of Social work.

Scripting the quad interface at Faculty of Social Work.

Installing under the camera at the Train Station.

The internet from behind the door at the train station.

Desktop at the train station.

Bostjan keeping the flow.