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

So, have written a script to run as root cron,, 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

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


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.

Virtualdub audio filter graph manipulation

Googled for help in manipulating the graphs in Virtualdub audio filters. Found this page which explains how to add and remove connections.
"To connect filters together, drag from an input pin of one node to the output pin of another. (Counter-intuitive, eh?) .... As with nodes, connections may be selected and deleted."

Sunday, December 02, 2012

f4v post-processor for playing f4v files

B wanted the audio from some f4v flash video files. Though I had flash video directshow codecs, the files were not opening in Virtualdub using AviSynth. Googled and found this page which guided me to the Adobe download site, where this explanation is given:
"Adobe Flash Media Server version 3.5 and later and Adobe Flash Media Live Encoder 3 can record content in MPEG-4 (F4V) format using an industry-standard recording technology known as "fragments" or "moof atoms." Some MPEG-4 compatible tools and players do not support moof atoms, and therefore cannot recognize files recorded by Flash Media Server. The F4V Post Processor tool aggregates the information from all the moof atoms into a single moov atom and outputs a new file. Use the F4V Post Processor tool to prepare F4V files for editing in Adobe Premiere® Pro, delivery over HTTP, or in video players that support H.264 and AAC formats, including Adobe Media Player."

So, I had to run the files through the f4vpp.exe and extract the audio from the post-processed files. The f4vpp process takes around 45 seconds for a 200 MB file and so on on my machine.

Saturday, December 01, 2012

irctc booking tips invalid

The new rules at the Indian Railways ticket booking site have made most of the old tips invalid. The mobile site used to be more responsive, but now booking is not allowed from the mobile site between 8 am and noon. Tatkal ticket booking is allowed only after 10 am and not at 8 am. "Quick Book" is also not allowed 8 am to noon. Also, the Tatkal ticket is available for booking only from the day before the journey date (and not two days before).

The mobile site uses user agent detection to redirect desktops to the desktop site. This detection is not so great - my HTC Wildfire with Android 2.3 has the default browser as well as Opera mobile being redirected to desktop site despite the mobile version setting being turned on. But User Agent switcher addon for firefox does the job with ease.

Edit: A couple of tips learnt from my experience this morning with Tatkal booking.
  1. Patience is a virtue - try, try, try again. On the third trial, after one hour of timeouts and service unavailable messages, got through.
  2. One timesaver would be to copy the From and To station fields in their entirety logging on to the site a few minutes before the 10 am deadline. Then, you can avoid waiting for the station pop-up, by pasting this info directly into the box. Confirmed working on Firefox.

wifi connection issue with HTC Wildfire

This morning, the HTC Wildfire refused to connect to wifi at work - kept saying "Scanning" after wifi was enabled. Reboots did not solve the issue. After I took it home too, it continued to refuse to connect. Many scary scenarios are described on the web, like having to do a factory reset. Anyway, turned on Airplane mode, turned off Airplane mode, and hey presto, wifi working again. In the evening after going back to work too, it connects without a hitch.

So, the solution was a simple Airplane mode toggle. Probably some hidden bug.