Saturday, December 28, 2013

compiling vlc (or vlc-warp) for Windows

Could not find any relevant solution to the cross-compiling issue - the dlls etc have not been made properly, so even mounting the Linux partition on Windows and trying to run vlc fails. Edit - the cross compiling post has now been updated with the solution - installing wine-dev package.

Tried the Msys method of compiling VLC on Windows. That fails when trying to build automake etc, saying
configure: error: cannot run C compiled programs

Next was to try the "advanced instructions" at
That has a note halfway down, saying
Note: I found that compiling 2.1.0 requires xgettext, msgmerge, msgfmt and so on. These in turn require libiconv. I'm not sure if that suffices as at this point I gave up. 
So I also gave up, for now.

Friday, December 27, 2013

cross compiling VLC Warp for windows

VLC wiki recommends cross-compiling from Linux as the preferred route to compile for Windows. But trying to compile the vlc-warp cloned from github, ran into lots of dependency problems. My Kubuntu 12.04 was borked by installing .deb which depended on newer libc versions, so gave it up and installed Ubuntu 13.10. 13.10 initially had older libraries like libc and so on, but after updating, the libraries required were updated to newer ones.

Then, followed the Win32 cross compile guide on the VLC wiki, and the build went through. I followed the "Preferred method" of MingW on Linux. First installed the build tools from the Unix compile wiki,
sudo apt-get install git libtool build-essential pkg-config autoconf
and then did apt-get install for all the packages mentioned on the cross compile guide. I used a tar.gz with a backup of the git clone of the vlc-warp directory which I had got for the Linux compile, and the backup of the vlc-contrib-i686-w64-mingw32-latest.tar.bz2 pre-built contribs which were got earlier while doing make prebuilt for the contribs. The make itself took only around 20 minutes, just like for the Linux make.

Unfortunately, after doing the make,
make package-win-common

make[3]: *** No rule to make target `/usr/include/wine/windows/stdole2.idl', needed by `stdole2.tlb'.  Stop.
make[3]: Leaving directory `/home/hari/vlc-warp-2.1/win32/npapi-vlc/activex'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/hari/vlc-warp-2.1/win32/npapi-vlc'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/hari/vlc-warp-2.1/win32/npapi-vlc'
make: *** [stamp-npapi-build] Error 2

I guess a solution to this would have to be a separate post.

Edit on 6 Jan 2014: The comments below helped solve this issue. Installing wine-dev package solved it.

Monday, December 23, 2013

clearing up disk space and increasing size of loop drive

My Kubuntu install, upgraded to 12.04 from 10.04, was running out of disk space on root. It was installed on a root.disk file on Windows NTFS partition. First tried googling and found this post, so did

sudo apt-get clean
sudo apt-get autoclean

sudo apt-get autoremove  
sudo apt-get install localepurge
Also tried listing packages with

dpkg-query -W --showformat='${Installed-Size} ${Package}\n' | sort -nr | less
and removing those which I did not need. But still, free space on disk was only less than a GB, compiling was eating up space too. So, tried googling increase size of Linux loop drive, and found this forum thread. That had a lot of "dangerous" warnings. Lost track of it since it was on the Mac, saw the Mac Safari history as given at this post - the History.plist file was a binary file, opened using PsPad's Hex editor.... Then found this solution by googling increase size of /dev/loop0

Booted into Ubuntu 13.10 Live DVD, navigated to the root.disk file.

sudo dd if=/dev/zero bs=1MiB of=root.disk conv=notrunc oflag=append count=1000
(where count is the number of MiB to add)

Then mounted it with
sudo losetup /dev/loop1 root.disk
and resized with
sudo losetup -c /dev/loop1
sudo resize2fs  /dev/loop1

At this point, the system alerts me to
Please run e2fsck -f  /dev/loop1
So I do a
sudo  e2fsck -f  /dev/loop1
and then repeat the
sudo resize2fs  /dev/loop1

Et voila! Done.

Only now did I see the official Wubi guide, which gives a solution to this very problem, in a "safe" way.

screenshots on Linux

Found this page with a review of lots of methods to take screenshots,

 sleep 10; import -window root MyScreenshot2.png

seems to be the least resource hungry method, since it needs only ImageMagick and not kde etc.

Taking screenshots with vlc, the vlc screen seems to come on top of other windows like options window etc. Or the window ordering for screenshots is different or something like that. Need to arrange open windows in non-overlapping ways to avoid problems.

Saturday, December 21, 2013

compiling vlc-warp from git

Paul Bourke has put his vlc-warp on github, tried compiling it for Linux. Before vlc-warp, wanted to check if vlc 2.1 would compile. Downloaded from and started following the instructions. (Initially, I tried without reading the instructions, quickly ran into dependency issues like the one discussed here.)

Tried it first on my dual boot Kubuntu 10.04. But trying to get the dependencies using
sudo apt-get build-dep vlc
did not go through - the package versions of the dependencies in 10.04 were too old. So, decided to try it using a Live DVD, Ubuntu Studio 13.10 was available with a colleague with his OSFY magazine subscription.

Initially, tried with the vlc source downloaded onto a Windows FAT32 drive. There, ./configure was not executable - apparently, the drive was mounted noexec or something like that. So, copied the source to the home folder, and started again.

Next error was, "Unable to find a source package for vlc" when trying the
sudo apt-get build-dep vlc
For this, selected both the "source files" and "universe" repositories in the package manager, did
apt-get update, then tried
sudo apt-get build-dep vlc
again, worked now.

./configure took a couple of minutes to run, and make took around 20 minutes on my machine, with an AMD Athlon dual-core 1.9 GHz processor. At the very end, make gave a couple of fatal errors, saying make-alias did not work. Most probably this was due to copying over the source from the Windows drive, which made all the files including make-alias and configure lose their executable permissions. But the only issue was that there was no vlc binary in the root folder, I had to go to the bin folder and choose the vlc-static binary. That worked. And I could choose the OpenGL video output - that is critical for vlc-warp to work.

Then tried with the actual vlc-warp. First tried downloading the source as a zip file using the link given on github. That did not work - make gave errors saying no git repository found or something like that. Then did it properly using
git clone
as given in the VLC build instructions. Then,
worked fine, twenty minutes later, I had the binary. Tried it out with a standard mesh file from Paul, performance was similar to the Windows version.

In summary: first check with VLC 2.1 installed on your machine if OpenGL video output is available, and if it works. Only if that works will vlc-warp 2.1 work. If your machine does not have a supported graphics card, the OpenGL option either won't be available, or using that option won't get you video using vlc. In that case, vlc-warp won't work either.

Edit: More caveats!

Tuesday, December 17, 2013

phplist unable to recognize bounce if email id has space before it

Looking at the bounce messages on phplist, found a couple of bounces every day, for which phplist could not identify the list subscriber - listed as Unknown. Viewing the bounce, found that the email id had a space in front of it, which was the reason why phplist could not identify it. Unsubscribed manually. (This is phplist version 2.10.10).

Wednesday, December 11, 2013

previewing video in Reaper, workaround for AAC

My version of Reaper, 3.52, had problems displaying videos using the FFMPEG option. Tried downloading various versions of the ffmpeg dlls and put them in the Program Files\REAPER folder with no results:

Finally deselected the FFMPEG option, choosing to preview video only with DirectShow - that works fine for me now. Options -> Preferences -> Media -> Video/REX/Misc, Disable FFmpeg decoding.

Most mp4 files have AAC audio. Unfortunately, Reaper (at least my version) seems to have issues with AAC, audio stutters and finally reduces to a single repeated hum after a few seconds. Workaround was to extract audio using Avidemux, save it separately using Audio -> Save Audio - and use that audio in Reaper.

file permissions

Just a note about file permissions with SMB on Linux. P had moved some folders to another folder. As a standard user with ssh, I couldn't delete them - had to be root. P then demonstrated that the folder with files in a Samba share was with owner nobody:nobody so that it could be deleted by users accessing the Samba share as guest on Win or Mac.

Sunday, December 08, 2013

quiz code correction

A found a bug in the 9th question of a quiz featured as a Sai Inspires link, which had been uploaded to our website in 2009! The answer was not being displayed. I checked for the reason in javascript, did not find any problem. P found the reason - the "answer area" div had been omitted in the html!

Thursday, December 05, 2013

network congestion and the nuclear option

Before starting the evening live broadcast today, listening to AsiaStream took a long time to buffer. Checking cyberoam usage logs, found that WAN download was maxing out. Even the firewall rule was not helping, probably because the connections were made before 4.15 pm, and the firewall rule after 4.15 pm would affect only new connections.

Under these conditions, BUTT would not connect easily. Earlier, I would just restart cyberoam (soft restart) and that would kill all concurrent connections, allowing BUTT to connect.

This time, went into Cyberoam -> System -> Diagnostics -> Active Connections list, and killed around 10-15 of the around 400 active connections, which had used max download bandwidth. Most of them were port 443 - https - most probably youtube. One or two were chat ports 5222 etc. Then was able to start streaming without issues.

Wednesday, December 04, 2013

ftp speed bump - restart solved

Our internal ftp server which also hosts our mailing lists suddenly slowed down: transfers which went at 100 Mbps over the LAN started going at 3-4 Mbps. A restart of the machine solved the issue. But during the restart, P reports, the system required a manual execution of fsck. Once that was done, system booted. It was our other internal server which needed the manual choice of boot device.

email for a new domain - options

Copy-pasting an email I sent about adding email for a new domain:

I see that the mail exchanger (MX) records are not set for this domain. So, currently, no emails for this domain are configured.

There are many options for email.

1. use the built-in free nettigritty email, or do a mail forwarding to some other account. This may be easiest to configure, but I have not tested nettigritty's mail servers reliability.

2. Use paid mail hosting, like google apps for business which starts from Rs. 150 per user per month. There are, of course, many other options here.

3. Unfortunately google's free plans no longer allow new sign-ups, so the option we chose for our earlier domains is not available. But Windows Live for domains is available for free. We could use that, and if necessary, forward to a gmail / id also.

4. There is probably one more option - domain alias. Google apps allows you to have aliases, so that email to can be directed to etc. 

Tuesday, December 03, 2013

youtube download failure and solution

Yesterday, for the first time, the youtube mp4 file I downloaded using Flashgot Firefox add-on did not work. Then, another file I downloaded also appeared to be "corrupted". Googling got me this page which indicated that the problem was that youtube was using MPEG-DASH streaming, and so the files were not downloaded correctly.

Tried using Youtube Center as indicated in this Dave's tip, but even with the Youtube Center firefox add-on, when downloaded with flashgot, the downloaded file still had issues.

Then tried the old faithful - the bookmarklet. Finally, video downloaded with that worked fine. Of course, a caution for users, you have to click on the download link on the right of the text box and not on the bigger "Free Download" link below, which is actually an ad for another downloader product. And keepvid needs to run a java applet.

What could I do with the "corrupted" downloaded videos? This post indicated that GPAC might be able to help. (BTW, Nirsoft's freeware tools are really nice!)

And indeed, the mp4box utility contained in the GPAC download did the trick - made the video readable by AVIDemux using
MP4Box -add file.mp4 out_file.mp4

Even though the documentation said that the -isma switch would make the video compatible with most players,  doing
MP4Box -isma file.mp4

had a similar result as the -add above, with the file being readable by VLC and AVIDemux, but not directshow. Used Avidemux to re-encode the file as HuffYUV, then directshow could read it. Using Avidemux in copy mode was not enough. And after all this, there was no audio stream. Apparently, the downloaded file contained only the video stream and not the audio.

So, the best option would be to re-download using Keepvid or something like that, unless you need only the images and not the sound, like in my case.

Edit: Just noting that mkv files produced in "Copy" mode using Avidemux could be played by TheKMplayer, VLC etc, but not directshow/Windows Media Player. avi files produced in the same way could not be played by TheKMPlayer either, though VLC could.