Wednesday, June 27, 2012

fades to trims

After watching a fulldome show of Space Opera where the sequences were cropped using Trim in avisynth, found the abrupt cut transitions were too jarring in most cases. So, added 5 frame fades, like below:

FadeIO0(Trim(mix,73200,73220),5) ++ \
FadeIO0(Trim(mix,73457,73477),5) ++ \
FadeIO0(Trim(mix,4621,57424),5) ++ \
FadeIO0(Trim(mix,58301,59714),5) ++ \
FadeIO0(Trim(mix,60757,68115) ,5)
# FadeIO0 does the fade without adding any black frame at the begin or end.

While doing the export from avs to avi in Virtualdub, a virtualdub audio filter is required for this show, to reduce gain by 50%, as below.

Monday, June 18, 2012

filing income tax return online

Filing the income tax return is seen with trepidation by many (most?) people. Some of the pain associated with it can be reduced by knowing more about the process. Encouraged by this post by a colleague, I decided to try and file my own return this year. Keeping at hand income statement, investment and other transaction history, LIC and other receipts, PAN numbers of all entities, etc. is of course necessary, so I invested in a (physical) folder to keep all the papers in one place. Even after doing so, I was initially stumped while entering the numbers - the deductions need to be grouped according to section! (Section of the IT Act).

Some googling + a couple of phone calls solved the questions in my mind.

If I have to mention losses like short term capital loss - investing in a fund and then redeeming it at a loss during the financial year - then I have to use not the ITR1 form, but the ITR2 form.
https://incometaxindiaefiling.gov.in/portal/individual_huf.do

LIC premia for simple life insurance come under 80C, Health Insurance premia under 80D, Infrastructure bonds under 80CCF
http://www.licindia.in/tax_benefit.htm

Specific LIC schemes come under 80CCC - specifically mentioned in the premia receipts.

Tax saving mutual funds come under 80C, as mentioned in the mutual fund transaction statement.

SSSIHL donations come under "100% deduction without qualifying limit" in the 80G section since universities come under this ambit,
http://yourownadviser.com/articles/article_65_27-nov-2011

Now there may be misconceptions or errors in this post - in case you notice any, please let me know in the comments or by email to hn_88 at rediffmail dot com

Saturday, June 16, 2012

back to Linux on the Toshiba AC100

Have gone back to Linux on the Toshiba AC100 since it is probably of more use that way as a general purpose machine. After installing the proprietary NVidia driver, which is supposed to be required for HDMI out, found that suspend / hibernate don't work any more. The system does not come out of suspend - no display. Battery life seems to be only 4 hours now. Not sure if this is due to Linux or due to lessening of life over the last few months.

Thursday, June 14, 2012

escaping quotes in php

The TFD folks had trouble entering the TFD - they had copy-pasted the TFD into the data entry form which uses php, and on submitting it, got errors like
Warning: odbc_exec() [function.odbc-exec]: SQL error: [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression ''In spiritual matters // snip

Guessed that this was due to unescaped quotes. Asked him to manually remove the quotes before submitting. It worked. But he was again stumped by an apostrophe which again caused hiccups. Checked with P and he changed the code from

//$singlequote= "\'";

//$replace_singlequote= "''";
//$messageposted = str_replace($singlequote,$replace_singlequote,$messageposted);

and so on to

messageposted = htmlspecialchars($messageposted);

Tuesday, June 12, 2012

connection issues and workaround

At times when starting the live audio broadcast with BUTT, it is unable to connect to the streaming server immediately, and shows "Connecting..." for even as long as 2-3 minutes. Found a workaround - Restart management services on Cyberoam just before starting the stream. Why does this happen, and only in the evenings and not in the mornings? My feeling is, looking at the usage graphs on Cyberoam, that Cyberoam has too much traffic in the evenings, and doing the restart bounces off some of the excess traffic like streaming video and the like.


Monday, June 11, 2012

MNP - Mobile Number Porting experiences

Starting last year, Indians could change their mobile service providers without changing their mobile numbers. I had been a happy Airtel customer for around nine years, so I thought I need not port my number. But then a series of events made me change my mind. Airtel started asking me for ID proof documents repeatedly over a period of months, even after the ID proof documents were submitted. Tata Docomo had some nice plans and some of my colleagues shifted to Docomo. So, I ported my number from Airtel to Docomo.

That first port went off without a hitch. The only issue was, Tata Docomo had poor connectivity near the Planetarium, and no signal inside the building. This was clearly not acceptable, so I had to port again.  I thought I would give Vodafone a try, since Airtel was so ornery about my ID proof. For the mandatory 3 month waiting period between ports, I had to set up call forwarding so that calls to my number would be forwarded to my secondary mobile whenever the first one was out of range, ie. I was inside the building. Thus, I came to port my number for the second time, Tata Docomo to Vodafone.

Vodafone had coverage at the places I wanted, but.... no conference calling for pre-paid customers in AP! Also, the network quality was not as good, with voice drops etc, and the need to go to the lobby to answer calls to get a better signal. So I had to port again, especially since call conferencing is so much a requirement for me. Running out of options, I was going back to Airtel.

But now the porting process did not go smoothly. Each time a port request is made, the incumbent service provider calls up the customer to try to persuade him not to leave. The Vodafone rep gave me false information, that conference calling has been enabled "just last week". Still, I said I wish to port. But the porting did not happen. My local dealer, who was doing all the SIM card work for me, told me that this had happened to two other customers of his also, when they ported away from Vodafone - the Vodafone rep denies the porting request saying, "Customer cancelled port request"!

On the dealer's advice, tried another port request, with the same SIM, without submitting fresh documents. That did not go through. Calls to Airtel customer care indicated that the port was "in process", meaning that documents were awaited. Each of these port requests took two weeks, with a wait time of 7 days for the port to work under normal conditions, and a two week wait for a fresh porting code.

So, tried a port once again, with the same SIM, but with one more copy of ID proof documents. This time, the port went through. The Voda SIM stopped connecting to the Voda network, inserting the Airtel SIM connected to Airtel network. But.... no outgoing calls, and incoming calls were getting the message, "This number is blocked."

The dealer said that it would be resolved in one day. But since this is not normal behaviour, I called up Airtel customer care. The first level support agent said, "Everything is fine at our end". But I was not able to recharge, not able to get or make calls! So, I asked the call to be escalated. Second level support said, "Please call 123 (customer service IVR) and set your language preference there, that should solve the issue". And it did! So, finally, I am back with Airtel, which has a superior network in this part of the world.

Monday, June 04, 2012

more on overlay

After my earlier post on using AviSynth and virtualdub to create an overlaid video, found that the framerate of the clips had been wrong. The first version of the script had
bg=Imagesource("bk3.jpg", end = 16200, fps=30, use_DevIL=true)
top = BicubicResize(Crop(DirectShowSource("1.mp4"),40,6,-36,-4),320,240,0,0.75)

audio=DirectShowSource("1.mp4")
video1=Audiodub(Overlay(bg, top, 834, 771), audio)

Overlay uses the background clip's length to create the framerate. In this case, the clip used for "top" became speeded up.
So, modified the script, and also took into account that some of the clips were PAL and some NTSC - converted the PAL to NTSC using Bob and Weave using the recipe given here.

bg1=Imagesource("bk3.jpg", end = 15732, fps=30)

# changed the number of frames here
top = BicubicResize(Crop(DirectShowSource("1.mp4"),40,6,-36,-4),320,240,0,0.75)
audio=DirectShowSource("1.mp4")
video1=Audiodub(Overlay(bg1, top, 834, 771), audio)
# this was NTSC video, did not have to change framerate

 
bg2=Imagesource("bk3.jpg", end = 17264, fps=30)
# changed the number of frames here to match number of frames
#  in 30 fps version of ntscvid2 below

palvid2=DirectShowSource("2.mp4")
palvid2=Bob(palvid2) # Separate fields and interpolate them to full height.
palvid2 = ChangeFPS(palvid2, 60000, 1001)
# Convert field rate to NTSC, by duplicating fields.


palvid2 = SeparateFields(palvid2)
palvid2 = SelectEvery(palvid2,4,0,3)
# Undo Bob, even field first. Use SelectEvery(4,1,2) for odd field first.
ntscvid2= Weave(palvid2)
top2 = BicubicResize(ntscvid2,320,240,0,0.75)
audio2=DirectShowSource("2.mp4")
video2=Audiodub(Overlay(bg2, top2, 834, 771), audio2)

# and so on

Sunday, June 03, 2012

recovering a Windows XP laptop

V's Windows XP laptop - this old Acer machine, repurposed as an internet radio player - was not booting. Not even in safe mode command prompt only. As recommended by PB, tried booting from Windows XP boot disk, recovery console. That worked. Then tried chkdsk in recovery console, rebooted, chose "Last known good configuration", worked fine.

Did a Scandisk thorough after that also, just to be safe. Seems to work fine now.

abandoned attempts to play shows on Toshiba AC100

With mvideoplayer app on the Toshiba AC100, was able to play files sequentially from a folder - that seemed to be its playlist functionality as mentioned briefly earlier. With that, tried to play today's Planetarium show using the Toshiba AC100. Made multiple copies of the intro avi files in each relevant folder using hard links, with the SD card formatted as ext3 on Linux to save space on the SD card.
ln /full/path/to/sourcefile /full/path/to/destinationfile
And so on.

Unfortunately, when the video stutters a bit - and the Toshiba has that problem, with a few frame drops here and there - the HDMI input on the projector blacks out for 5 seconds or so. This happened 2-3 times during the show. Clearly this is unacceptable, so gave up playing Planetarium shows on the Toshiba AC100 for now.

The HDMI input does make a difference, with the video being much crisper than with the VGA output from the laptop. Maybe a standalone HD player might work out.

Saturday, June 02, 2012

importing files without playing them - revisited

After I had used this technique, we have made some changes, ie. adding DiscourseStream to the mkcsv scripts, with AsiaStar being dropped. So, had to do an additional step of creating some dummy records for DiscourseStream - finding the fileid 695 for bcid 1314 (Signature tune for AsiaStar), changing it to bcid 9 (DiscourseStream) and changing the time from 6.30 am IST to 7.00 am IST (changeover time for DiscourseStream). Then changing bcid for a couple more dummy records which have timestamp after 7 am. This way, imported a lot of files like Polish Veda Pushpanjali, Satyopanishad in Mandarin, etc to our audio archive / audio search.

avisynth and virtualdub redux

Last time I had used a transform in virtualdub in order to create a video with predominantly white background and a window with a slideshow. This time, did all the processing in avisynth and used virtualdub only to save as avi. Used virtualdub's audio filters for the first time, and had to see this article in order to make them work - we need to add the input and output filters in addition to any other filter we add, and then link them together in a meaningful way.

The main avisynth filter I used was Overlay. Also, Crop to remove unnecessary black bars from one of the videos. The script is as follows, concatenating together three videos with a background pic which has a nice frame on a predominantly white background, as below.

top = BicubicResize(Crop(DirectShowSource("1.mp4"),40,6,-36,-4),320,240,0,0.75)
audio=DirectShowSource("1.mp4")
video1=Audiodub(Overlay(bg, top, 834, 771), audio)

top2 = BicubicResize(DirectShowSource("2.mp4"),320,240,0,0.75)
audio2=DirectShowSource("2.mp4")
video2=Audiodub(Overlay(bg, top2, 834, 771), audio2)

top3 = BicubicResize(DirectShowSource("3.mp4"),320,240,0,0.75)
audio3=DirectShowSource("3.mp4")
video3=Audiodub(Overlay(bg, top3, 834, 771), audio3)

video1 ++ video2 ++ video3

Tuesday, May 29, 2012

extracting audio from DVD

The older post on this topic mentioned DVD Decrypter and others. This time, for some reason, that method did not work. Perhaps because of some mistake in the sequence of steps, I suppose, the resulting file was a VOB file and not an mp2 file. Anyway, the file was not being opened by any of the AC3 decoding methods like WinAmp plugin etc.

So, this time, I tried just copied the VOB files to the hard disk and opening them with VirtualDubMod, extracting the audio stream using Streams -> Stream List -> Save wav. That wav was opened using Soundforge, using AC3 codec. Slightly buggy, since each VOB file's wav data had the duration info of the entire program chain, and so had some sort of repeating audio after the first 25 minutes or so which had to be cut out. But otherwise OK.

Sunday, May 20, 2012

installing Perl module on dreamhost

K wanted me to include mp3 tags on the downloads at dl.radiosai.org. Googled installing Perl Module without root access, and found lots of people doing it, so went on to install MP3::Tag module without root access.

First I tried the procedure at
http://perl.jonallen.info/writing/articles/install-perl-modules-without-root
but the perl process kept getting killed as given at
http://wiki.dreamhost.com/Killed

Dreamhost recommends installing via the CPAN command, as given at
http://wiki.dreamhost.com/CPAN
and then the process doesn't get killed.

But the wiki had some bugs. Got errors like

Cannot gzopen $ENV{HOME}/.cpan/sources/authors etc. Googled it and found
http://discussion.dreamhost.com/thread-87436.html
where the user k2S explains that he did two things differently from the wiki page
http://wiki.dreamhost.com/CPAN
that is

**don't forget to add the suggested lines into your '~/.bash_profile' - that is, not ~/.profile
 ** test command 'echo $PERL5LIB', it should return the correct path

* *I had to edit also ~/.cpan/CPAN/MyConfig.pm and replace all '$ENV{HOME}' with the correct path

Once I did this, the install worked fine, with perl -MMP3::Tag -e 1 not returning any errors.
 (I had actually done the manual config of the MyConfig.pm  as given in the wiki, too.)

After the module installation, some trial scripts still gave errors. Trying out a basic script from

http://search.cpan.org/~ilyaz/MP3-Tag-0.9709/Tag.pm
got errors like
Can't call method "get_tags" on an undefined value

Found this explanation, that it is because the file has no tag to begin with:
http://www.linuxquestions.org/questions/programming-9/cant-call-method-title-on-undefined-title-in-perl-script-396858/

Then tried tagging the file with no tag to start with, and got errors like:
Can't call method "new_tag" on unblessed reference at ./mp3tagger.pl line 6.

Problem was - the filename has to have the full path, and not start with ~/
Once that was done, the script worked. Now to work out some sort of tagging scheme, after which the tagging can be done.

Friday, May 18, 2012

Cyberoam and ftps

The guys at the studio had some trouble connecting to secure ftp. Their newly commissioned server would accept connections only over secure FTP on port 21, as below,
I was able to connect from BSNL network as well as from the Planetarium. But when they tried from the studio, they were getting timed out at "Initializing TLS". I replied with the following:
When the connection is initialized, a dialog box pops up, talking about the certificate, and whether we want to accept the certificate - attached. Only after you say yes does it connect. So, there are several possibilities - either your machine is not getting the certificate due to cyberoam, or somewhere in settings you have set it to not ask, or deny the certificate.

My guess is cyberoam. Cyberoam is set to proxy ftp connections. So, ftps may need some settings. You may want to ask the cyberoam support about this.
http://kb.cyberoam.com/print.asp?id=36&Lang=1&SID=

"Cyberoam parses SSL handshake (SSLv2, SSLv3, and TLS) and extracts “Common Name” (CN) from the certificate. It applies control filters on common name. Based on the outcome of filters, user is either served the page or the connection is terminated."

So probably somewhere in cyberoam you will need to add the certificate of this server, saying accept this certificate. Only then, I am guessing, will cyberoam connect to the server....
They contacted cyberoam support, and as per their recommendation added a MASQ rule so that this connection goes directly instead of through cyberoam's transparent proxy. Then it worked fine.
 

Wednesday, May 16, 2012

Prayaya

A sent me this link,
http://en.prayaya.com/index.html
for software which can create a portable subset of your desktop with the software you need, which you can then run from USB key or other portable storage on any Windows computer. Basically making any app portable. Interesting concept.

Wednesday, May 09, 2012

Google Sky Map

I remember seeing a device on Amazon.com which you could point to the sky, and it would label the objects seen. Now, an app - free to boot - does the same job. Google Sky Map.

Sunday, April 29, 2012

finally disabled old server

When the SaiUniti FS3 was restarted, our old Colinux service as well as the ShoutCast servers started running on it again, as I found with the Colinux auto email on reboot, since they were set to automatic startup. So, logged in to the server, disabled the automatic startup of all the shoutcast services + colinux on that server.

Thursday, April 26, 2012

regressive feature on Mac OS X Lion

Yesterday DSP came with his MacBook to reinstall Microsoft Office to solve a bug as instructed by "experts" at Applecare Australia. Long procedure to uninstall, and after reinstalling, a longer time to download and install all updates. And finally, at the end, his problem remained. His issue was that even after he releases the SHIFT key, the next letter would be capitalized. Now, this is actually a "feature" of Mac OS X Lion, carried over from iOS - demonstrated by typing something in TextEdit. But it does create problems for those who type moderately fast.

monitoring apache server

A couple of days back, we were caught left-footed when our website slowed down to a crawl. The "standard practice" of restarting the process, restarting networking, even rebooting the server, did not help. Later, found that the problems were due to a 500 MB + flipbook uploaded the previous night, with a link on the home page.

Voxel support had pointed to
apache2ctl -t
as a possible first test, to see if apache was able to start with the config given. Did some googling and found this optimization and tuning page, which has some sections relevant for our static website also. In particular, the part where he says use
apache2ctl status
and
top d 1
to monitor apache's health.

These discussions also provide some tips on monitoring swapping, disk thrashing, io bottlenecks etc using vmstat, top, iotop and so on. This page has a good description of vmstat and free, what the displays mean etc.

Monday, April 16, 2012

preventing saiwaves disk from filling up

PB reports:

automysqlbackup script runs on Krishna and takes a backup into ~/dbBackups on krishna
The cron on saiwaves takes a copy of the backup into saiwaves through dbdumpsftp.sh

Changed the scp to copy only the daily folder instead of the entire backups folder. Also, changed destination to /local instead of ~

/local has about 200+ GB free

Hope this resolves the issue.