Friday, March 29, 2013

calculate the disk space based on file date

Contributed by PB:

du -h (current usage)

du -ch `find /path/to/files/ -mtime -365` (last one year)

du -ch `find /path/to/files/ -mtime -730` (last two years)


etc.

viewing our live streams on Android

There was a request from the team preparing a customized android tablet for radiosai to consider changing our embedded player to something based on html5 so that Android would play it. They suggested videojs.

But according to this stackoverflow post, it looks like videojs does not work with our Wowza server: a test page I made also did not work. Our jwplayer embed does have a html5 option, but that seems to work only on iOS devices - "Cupertino streaming".

Wowza forums recommend using RTSP for streaming to Android, and when I made a link like they suggested, that worked fine on my HTC Wildfire for recorded streams. So, perhaps the rtsp urls
rtsp://[our-server-ip-address]:1935/live/myStream
(where myStream is the stream name)
or
rtsp://[our-server-ip-address]:1935/vod/flv:our-filename.flv
is the way to go for Android.

Monday, March 25, 2013

using WinDirStat for disk cleanup

Earlier, I had FolderSize installed on my system, but it was sometimes troublesome in taking up system resources when I did not need it to be running and so on. So, uninstalled it, and now installed WinDirStat. Since it is a standalone application, I can run it only when I need to see the sizes of folders. Collects statistics reasonably fast, all local drives scanned in the time it took to write this post.

Friday, March 22, 2013

problem with HDMI output

Unfortunately, the cable which V gave me to test was probably not meant for HDMI -> VGA. I think it is meant for VGA -> HDMI. I connected my player to my projector with that cable, did not work, and when I put back my old cable which used to work, still not working. Had to run shows from laptop VGA out for a couple of days.

Borrowed a Mac mini from studio to test HDMI projector input, found it working. The Mac mini can play the video at 720p on the HDMI out without any glitches, but with 1080p, the video drops frames, runs at around 15 fps or so. Then, tried the bluray player once again, found it working now! Probably the issue was a loose cable.

Wednesday, March 20, 2013

ubuntu panel disappearing

V tried to install the Nvidia accelerated driver on the Toshiba AC100 Smartbook running Ubuntu 12.04, and his desktop panel disappeared, though clicking in the relevant place still opened the correct apps. He did not want to change to 12.10 since he preferred the Unity interface to the Lubuntu interface on 12.10.

Problem and solution seems to be described here.
http://askubuntu.com/questions/162854/launcher-icons-invisible-still-work-in-12-04

But it gets stuck as given below,
http://askubuntu.com/questions/146456/cant-restore-unity-desktop

So I just re-flashed and re-installed 12.04.

Saturday, March 16, 2013

migration of codeigniter-based site to godaddy

Successfully migrated a site based on the codeigniter framework from a generic server with CPanel to Godaddy. Went smoother than expected, though both servers were Linux servers.

While exporting database, the information_schema database is actually not supposed to be exported or imported. One has to choose the other database and then export. On godaddy, the database has to be created first, and godaddy's control panel fixes that the superuser name (of the db) and the dbname have to be the same. After this was done, came across this "No input file specified" error. The answer, via stackoverflow, was in the github docs. Followed those steps of changing the config file (in two places - in the public folder as well as the admin folder) and changing the htaccess file, choosing to save it in Unix LF style using PsPad, and problem fixed.

Edit: The admin area was broken. To fix it, had to modify the htaccess file in the admin folder, change
RewriteRule ^(.*)$ /index.php?$1 [QSA,L]
to
RewriteRule ^(.*)$ /admin/index.php?$1 [QSA,L]

and also change the admin/config/config.php file, had to set the URI protocol to Auto in order for auth to work.
$config['uri_protocol']    = 'AUTO';

Monday, March 11, 2013

Microsoft WorldWide Telescope for fulldome

The Microsoft WorldWide Telescope has planetarium features - fulldome projection, warped view as well as fisheye, and the option to use custom warp files in Paul Bourke's format. Unfortunately the tours are bandwidth hungry, and render on the fly, so that many landscapes etc are seen blurry and partly downloaded when played. The "Render to video" feature for the Tours has an option to "wait for downloads to complete" but the feature seems buggy. When I try to render a dome master, it shows the files being written, but no files are seen in the chosen folder. When I try to render low res files, like 640x480, the files do render, but apparently the file write is not able to keep up with the video being played in realtime, so the app crashes instead of doing an async render. This test was done with version 3.0.76.1

This version also crashed on my WinXP machine when doing full screen in full dome fisheye format. But later, after a system restart, full-screen mode did not crash. But it does show visible "stitch boundaries" - quite spoils the night sky look!


Since my main interest in checking out MS WWT was to try and render fulldome masters, and it does not seem to be doing that for me, I'll uninstall it for now.

Sunday, March 10, 2013

online resources for fulldome production

Tried out a few options of the many many resources available on the internet, like the ones mentioned in the Small Planetarium Yahoo Group.

  1. Tried the dome-masters available at spacetelescope.org - unfortunately, only one of them is a bonafide animation - others seem to be just a single hubble image rotated around the centre of the dome. I can do simple rotations myself!
  2. The Science on a Sphere program links to many hi-res movies - 2048x2048 on the public ftp site ftp://public.sos.noaa.gov - these movies are generally suitable only for projection on the sphere as designed, but some parts of some of the movies can perhaps be adapted for fulldome, like animations of LCROSS hitting the surface of the moon etc. In most cases, such animations may be available for fulldome from other sources, so it may not be worth the hassle to try this out. An interesting sidelight while downloading deserves a separate post.
  3. Some youtube videos like the ones from jakimsuk are available in 720p and seem to be prewarped for 4x3 projection. But the material is probably copywrited, like Spitz trailers and so on.

Saturday, March 09, 2013

downloading large files over ftp

When downloading files from ftp://public.sos.noaa.gov the connection was timing out, and the server did not seem to resume downloads correctly. So I tried downloading from our dedicated server, and then transferring from there to our machine using sftp. Worked like a charm. A 1.3 GB file downloaded in 6 minutes - 40 Mbps! Later, sftp transfer to our local machine took 3 hours or so.

1535001090 bytes received in 359.52 secs (4169.5 kB/s)

Sunday, March 03, 2013

using stellarium screenshots in planetarium shows

Tried out various options on the dome -
  1. taking screenshots from within stellarium using the Ctrl-S shortcut key or using scripting
  2. saving screen-grabs as movies using Fraps and Taksi
The difference in quality is glaring. The best quality is seen with the screenshots captured from withing Stellarium without warping. That is, when the Spheric mirror distortion option is chosen, the quality degrades.
So, I will have to go with first creating screenshots in fisheye mode, then cropping them and distorting them.

Tuesday, February 12, 2013

smooth edits without re-encoding - Avidemux

Avidemux succeeded where Virtudaldub failed.

more flipflops before finally opting for Lubuntu

I removed the Linux install from the Toshiba AC100 and restored Android in order to watch videos with hardware graphics acceleration - without acceleration, HD videos were not watchable. The saved Android backup on DVD did not work! But this post (if that page is blocked, archived version is here) saved the day, with links to working saved partitions from this location. The actual restore really takes only 5 minutes.

Installing Lubuntu once again (12.10, from the instructions here) took around half an hour after the flashing, since the installer needs to run from the tarball in the USB mem key and set up all the files onto the install partition. And why did I go back to Lubuntu? Because V wanted to buy the machine to use as a portable work-horse, and wanted to use OpenOffice etc.

Friday, February 08, 2013

smooth edits without re-encoding - failed with virtualdub

Tried to get smooth edits with fades without re-encoding the entire video using the following:
  • Cut the required portions in Virtualdub by choosing start - end points on keyframes and choosing Direct Stream Copy mode.
  • Made avisynth files for the portions where fades are required
  • Used Virtualdub to encode the avisynth files to avi with the same bitrate settings
  • Used Virtualdub "Append video segment" to add the files together and save the result using Direct Stream Copy mode.
Unfortunately, this does not work. The files got with Direct Stream copy and the freshly re-encoded fade bits don't work with each other, Virtualdub complains "The video streams do not share a common sampling rate" - it detects one frame rate as 30 and the other as 30.00003 fps.

Tried installing Adobe Premiere Pro CS2 - that also does not work without re-encoding (except for DV files etc.) "Smart encoding is a feature enabled in CS6."

Edit: 12 Feb - Tried Boilsoft Video Joiner  for joing the clips. Gives exactly the same error, so probably it uses vdub as the backend! But Avidemux succeeded in doing the job.

Sunday, January 27, 2013

flash player archive page

Quite useful for getting Flash for Android devices and for old versions of MacOS etc - here is the link.

Sunday, January 20, 2013

installing ubuntu on an old machine which can't boot from CD or USB

Here is a guest post by V:

Installing Ubuntu on an old machine

 
The Dell Inspiron laptop had 384MB RAM and a 30GB HDD. It was running Windows XP and was predictably very sluggish. So I thought installing ubuntu would give it a new lease of life.
 
Constraints:
  • CD drive does not work
  • BIOS does not have option to boot from USB drive 
Installation:
  • Removed the HDD from the laptop  
  • Connected the HDD as a external drive using IDE-USB connector  
  • Created two partitions on the HDD using 'Disk utility': 1GB (FAT32) and 29GB (Free space)  
  • Setup the 1GB partition for Ubuntu 8.04 install using 'Startup Disk Creator' (Lubuntu 12.04 / Lubuntu 12.10 are too heavy for the system) 
  • Plugged in the HDD back into the laptop 
  • Selected 'Try Ubuntu without installing' option 
  • In Live Mode, selected 'Install Ubuntu' (on the top right corner of the screen) 
  • Answered the questions on Language, Location and Keyboard Layout 
  • Selected 'Manual' option for partitioning the drives (as against options for 'Guided' partitioning) 
  • Followed instructions given in http://www.linuxbsdos.com/2011/05/23/install-ubuntu-11-04-on-external-hard-disk/
And that's it!

Wednesday, January 09, 2013

AmazonGlobal's free shipping - but not duty-free

Recently I got an email from Amazon - FREE AmazonGlobal Shipping on Orders of $125 or More - now available for India. But checking it out, K told me that import duties are levied at checkout, making it not so attactive. Also, only very few items are available for this free shipping to India. Import duties came to roughly 30% of the value of the product for a few which I tried out. Eg. item cost Rs. 17,000, shipping = Rs. 350 (and if we choose free shipping we save this Rs. 350) and import fees = Rs. 5000. So really not worth it. Family and friends can get small items for personal use through customs for free, this is a much more viable option.

Friday, December 14, 2012

cyberoam traffic management and QoS - solved

In an earlier post, I had mentioned how excessive "other" usage was causing issues with live audio streaming. Finally we seem to have hit upon a solution which does not need manual intervention or restarts of cyberoam.

The trick was to add a rule to reject all traffic at the Live times below the rule which allows traffic at the Live times on applying QoS rule of lower priority. There were a few hiccups due to the Live time schedule info changing during a Cyberoam upgrade - after the upgrade, we are able to set it only in intervals of 15 minutes instead of 1 minute intervals. But still, the rule appears to work fine now. I had set the traffic to be limited to 1 Mbps, and the traffic graph reflects it.

Now probably I can relax the rule to allow upto 4 Mbps traffic, but keep the QoS rule of lower priority for other traffic and higher priority for the live audio streaming.

Wednesday, December 12, 2012

more about making fulldome images from panoramas

My earlier observation about the panoramic image needing to be stretched 2.5 times vertically as a rule of thumb seems to be valid only for those pans which have exactly the same field of view as that particular pan! Trying out more panoramas, found that if the image appears vertically compressed after making the panorama, we need to crop the initial image by cutting off some of the top and bottom to make it more strip-like, then resize with stretching to a square shape, and then polar distort. The resizing to make a square is actually not essential, but it allows us to standardize on the image size as 2048x2048 etc. And conversely, if the image appears vertically stretched, add more sky at the top if cropping is not desired.

Then the pre-processing of the pans - the pan can be made straight with the help of the ruler by dragging it down in Gimp as mentioned at this page.

Tuesday, December 11, 2012

more details of rotating Pans on the dome

As mentioned in my earlier post, I'm using blender to rotate Panoramic images made into fisheye fulldome frames. By trial and error, got some insights on what looks good on our dome. A rotation from -30 degrees to +30 deg in 10 seconds is too fast. A 30 second clip seems desirable, and with only -15 deg to +15 deg of rotation.

For creating keyframes in blender, shortcut key is I (i, not L). In 3D view, select the object by right-clicking, N for numerically entering location/size values, press I after entering the desired values. Move to the next required keyframe, repeat the above. The rotations speed up and slow down at begin and end points by default - some sort of spline for velocity changes. Click on the Start and End frame to edit number of frames.

To delete a keyframe, one way is to go to Dope Sheet view, select the keyframe by right-clicking on it, and hitting the X key, or Key -> Delete Keyframes menu item.


Monday, December 03, 2012

bounce processing - flush file if too large

Bounce processing is one thing which keeps failing in the Sai Inspires list. And if the bounces are not processed, more emails will get bounced due to Yahoo and others thinking that we're spamming, and that makes the whole thing a mess.


I have been manually checking at the eventlog in phplist for the bounce processing messages. But instead of that, thought I would write a script to automatically check if the bounces file is too large - it will be large if it has not been processed, and then the processing will continue to fail, so we have to flush the file and start retrieving fresh emails as given at
http://hnsws.blogspot.in/2011/04/bounce-processing-cleanup.html

So, have written a script to run as root cron, testbouncesfile.sh, with inspiration from this post, something like this:

CURRENT_DATE=`date +%Y-%m-%d' '%H:%M:%S`
find $FILE_TO_FLUSH -size +2k

while read file; do


  echo "$file is too large = $(stat -c%s "$file") bytes, flushing it with rm   and touch." > $MAIL_FILE

  mail -s "Automatic Bounce message check at $CURRENT_DATE" -c $MAIL_COPY $MAIL_DESTINATION < $MAIL_FILE

  rm $FILE_TO_FLUSH
  touch $FILE_TO_FLUSH
  chown therelevantmailaccount:mail $FILE_TO_FLUSH
  chmod 660 $FILE_TO_FLUSH

done

The cron runs as root for the permissions required. I'd tested it with a dummy mail file which I tried making bigger / smaller etc. Today, 6 days after I made the script and put it in the cron, I got a mail from root with /var/mail/relevantfile is too large = 9209549 bytes, flushing it with rm and touch.