Skip to content

Instantly share code, notes, and snippets.

View neuralvis's full-sized avatar

Madhu Srinivasan neuralvis

View GitHub Profile
@neuralvis
neuralvis / FFMPEG-Howto.md
Last active December 1, 2020 20:50
Encoding frames using ffmpeg

To convert the frames into a movie playabale in the visualization labs, the following command should be used:

ffmpeg -r 60 -f image2 -s 1920x1080 -i %04d.png -vcodec libx264 -crf 25  -pix_fmt yuv420p test.mp4

Will create a movie named movie.avi at 15fps from the files contained in the folder screens named frame0000.png, frame0001.png, etc

@neuralvis
neuralvis / interlace.py
Created January 19, 2012 05:37
A python script to interlace a stereo-pair to show on 3D displays
# This is a script designed to take two images and interlace them. For a usefullness
# point of view the images should be left and right eye images which one wishes to
# display on a JVC micro-polarized display (or any other display using interlaced
# stereo)
import Image
import sys
import numpy
def interlace(left, right, stereo):
@neuralvis
neuralvis / interlace.sh
Created January 19, 2012 05:38
Script to be used with interlace.py
#!/bin/sh
#This script needs to be used in conjuntion with interlace.py
#It will always do a "mkdir" on the output_directory, even if it exists. On most Unix systems it is fine.
if [ $# -ne 4 ]
then
echo "Error. $0 Needs 4 arguments."
echo "Please use: $0 <start_frame> <end_frame> <input_directory> <output_directory>"
@neuralvis
neuralvis / tiling.py
Created January 19, 2012 05:40
Splitting a hi-resolution frame into subframes to fit Zone-2
# This script is designed to split up a frame 5440x30720 into 40 subframes 1360x768 to fit zone 2 (AESOP diplsay).
# Written by Chris Knox and Luca Passone.
import sys
import Image
import os
def split_on_nodes(filename):
'split a file up to fill the nodes of zone 2'
orig = Image.open(filename)
@neuralvis
neuralvis / tile.sh
Created January 19, 2012 05:41
Tiling generator - used in conjunction with tiling.py
#!/bin/sh
if [ $# -ne 3 ]
then
echo "Error. $0 Needs 3 arguments."
echo "Please use: $0 <input_directory> <x_tiles> <y_tiles>"
exit
fi
i=0
@neuralvis
neuralvis / VB3-HowTo
Created January 19, 2012 05:42
Using VB3 to display hi-resolution videos on the wall
Since it is not possible to play a single 41MP movie on the AESOP display due to bandwidth issues, we split it up into one for each display. At this point we need a program that synchronises the play/pause actions across all the nodes and screens. For this purpose we use VB.3
First we need to define the CGLX default configuration so VB.2 knows the nodes, the screens on the nodes, the screens' details, ip addresses and port numbers required for playback. In this case we are using the AESOP display (zone 2 hence the usage of z2-csdefault.xml).
export CGLX_DEFAULT_CONF=/opt/kaust/config/cglx/z2-csdefault.xml
Now we launch VB.3 telling it that it will be displaying on 4 rows, and the folder containing the movies named in column, row order.
For example, we can name the files with the following format:
screen_<column>_<row>.avi
@neuralvis
neuralvis / Fullscreen API.js
Created February 2, 2012 19:59 — forked from robnyman/Fullscreen API.js
Fullscreen API
var docElm = document.documentElement;
if (docElm.requestFullscreen) {
docElm.requestFullscreen();
}
else if (docElm.mozRequestFullScreen) {
docElm.mozRequestFullScreen();
}
else if (docElm.webkitRequestFullScreen) {
docElm.webkitRequestFullScreen();
}
@neuralvis
neuralvis / backbone-links.md
Created March 6, 2012 10:17 — forked from beriberikix/backbone-links.md
AWSUM Web Development Linkz
@neuralvis
neuralvis / html5-filesystem.jade
Created March 19, 2012 10:36
HTML5 Filesystem API usage- uses filerjs
///HTML5 Filesystem API
input(type="file", id="myfile", multiple)
script(id='myscript', type='text/javascript')
document.querySelector('#myfile').onchange = function(e){
//Open the FS, otherwise copy the files into the FS
if(filer && !filer.isOpen){
openFS(this.files);
} else {
importToFS(this.files);
}
@neuralvis
neuralvis / makefile
Created May 2, 2012 07:46
Makefile for Latex
# $Id: makefile 11 2007-04-03 22:25:53Z jpeltier $
# This file seems to originate from something called 'the ultimate
# latex makefile' that different authors worked on. Find original
# versions at:
# http://tadek.pietraszek.org/blog/2006/03/24/the-ultimate-latex-makefile/
# (c) by Tadeusz Pietraszek
# http://www.acoustics.hut.fi/u/mairas/UltimateLatexMakefile/
# (c) by Matti Airas
#
# Call 'make dvi' for minimal compilation, to check for proper latex