Archive

Archive for the ‘Computers and Internet’ Category

Using Windows Media Player as the Universal Player

 
Update2:
 
Jon has packaged this properly and put up in his tools website. Please download by clicking the image above.
 
Update1: modified original code as per Jon’s suggestion 
 
I was tired of having too many media players (iTunes, QuickTime, Real, WinAmp) and wanted just my windows media player do all the stuff. This is what I did:
 
Uninstalled all third party players ( I love WinAmp, so may be I’ll come back to it later)
Installed Klite Mega Codec pack and used "5. Lots of stuff" option while installation, this took care of most of the stuff.
Installed OpenPLSinWM from Jon for my shoutcasts
 
Modified OpenPLSinWM , you can download here: so that I can listen to AAC+ streams
 
Note: For aac+ support in Windows Media Player, please install orban plugin
 
code:
1using System.IO;
2using System.Net;
3using System.Text.RegularExpressions;
4
5 namespace OpenPLSinWM
6
7{
8class OpenPlsInWM
9
10 {
11 [STAThread]
12 static void Main(string[] args)
13 {
14
15    if (args.GetUpperBound(0) > -1)
16    {
17
18        string filename = args[0];
19
20        using (StreamReader sr = new StreamReader(filename))
21        {
22        string pls = sr.ReadToEnd().ToLower();
23        Regex  http = new Regex(@"http://(.*)");
24        string url = http.Match(pls).Value;
25
26        WebResponse wres = WebRequest.Create(url).GetResponse();
27
28        //if aac+ stream replace http with icyx to play with orban
29
30        if(wres.Headers.Get("content-type")=="audio/aacp")
31        url=url.Replace("http","icyx");
32
33
34        if(url!=string.Empty)           
35        System.Diagnostics.Process.Start("wmplayer.exe",url);
36
37        else
38        Console.Write("could not read stream url info");
39
40        }
41    }
42
43
44    else
45
46    {
47         Console.WriteLine("Usage: OpenPlsInWM "playlist.pls"");
48         Console.WriteLine("Associate PLS file extension with this application to allow Windows Media Player to play them.");
49    }
50  }
51 }
52}
53

Adding A9 as the search provider for IE7

May 31, 2006 1 comment
IE7 uses a cool open search provider method (called opensearch!) to add search engines in addition to the defaults (google, msn search and msdn). It was funny that this open search method  is actually from A9 and A9 itself wasn’t listed in IE’s search provider page. I know its darn simple to add, and as a matter of fact it was so simple that I have created one.
Click here and click on a9.html file to install A9 as search provider for IE7. I love A9 especially since its powered by windows live, the clean interface is also a plus. I know there are many other search aggregators but I feeling happy about A9.

How to view malayalam in firefox

March 31, 2006 Leave a comment

Excellent info via: Curious Onlooker

"How to read Malayalam newspapers using FireFox

Most of the Malayalam newspapers use dynamic fonts. FireFox and Mozilla browsers do not support Dynamic fonts by default. Here is how you can read Malayalam and Other Indic publications using Firefox:

Option 1: Use firefox extension padma.

This works on all recent stable versions of Firefox at the time of this writing.

An advantage worth mentioning — padma converts those pages to Unicode for you – This saves you the pain of installing individual fonts for the content you want to read. In other words, if you have an Unicode malayalam font installed already, thats all it takes…!!

A little bit about padma from the extension’s page: Padma is a technology for transforming Indic text between public and proprietary formats for Mozilla based applications.

Ok, now how to get that done:

Step 1

Install Firefox’s extension padma.

If you have a fairly decent Unicode font installed already, you are good to go now. Otherwise, read on:

Step 2

Download Anjali Oldlipi – perhaps the best unicode Malayalam font. Open up this url, download the latest version of AnjaliOldLipi. (At the time of this writing, 0.730 is the latest).

Copy the downloaded font file into your Fonts Directory (Settings->Crontol Panel->Fonts).

In case you are running Linux I am going to assume that you already know how to add a font.

Now, fireup Firefox, Tools ->Options -> Content and set your Default Font to AnjaliOldLipi as seen in this screenshot:

That is it…!!

Enjoy browsing Malayalam publications like: Deepika, Madhyamam, Manorama, Mangalam, Mathrubhumi and more...

Oh, did I mention that you can kill all the annoying ads using AdBlock Plus?

Option 2:

Note: This is dependent on a Firefox extension "AutoCharacterEncoding" which does not seem to be in active development anymore. (Hey, developers are people too, and they move onto other things as well..!!) At the time of this writing, said extension does not work on Firefox 1.5.Another disadvantage is that, you are required to download and install the individual fonts of the malayalam publications you want to read, onto your computer.

Step 1

Download and install the fonts from the newspaper’s website, unless you already have them. (Download the .ttf file, and copy it over to your Fonts directory.)

Step 2

Install AutoCharacterEncoding from mozdev.

(It merely sets the fonts for userdefined character encoding automatically.)

Step 3

Restart FireFox, and browse, saving yourself from annoying ads and popups. "

Slickrun

March 29, 2006 Leave a comment
SlickRun has been my favorite tool. I have deleted all my quicklaunch icons and desktop shortcuts and have replaced all that with slickrun. I have reduced my mouse use to a large extent. Recently I came accross Vinod’s blog and saw the command line reference for most of the windows tasks. I have created a slickrun magic word list for almost all of it in Vinod’s list.  Download the file, open with notepad and replace foobar with your Active Directory name or Windows username.  Then use SlickRun and import these.
 
Some of the magic words that you may not associate with your tools and programs are all under mydocuments or under c:program files.
 
Remember all that you need to know after installation of slickrun  is Windows+Q and setup command for slickrun.
 
Enjoi.
 
Ah! another item to msn spaces wishlist: file upload
 

Build ffmpeg in Windows

March 1, 2006 Leave a comment
An amazing step-by-step approach to build ffmpeg in windows.
 
 
 
 
 
Sunday 27 February 2005 @ 2:22 pm

This tutorial is about transcoding video fom one codec into another using FFMPEG. I got deeper into FFMPEG when I wanted to transcode into FLV (Flash Video) and it works very well. I developed the Riva FLV Encoder, a GUI for FFMPEG.

We install the Minimalist GNU for Windows MinGW (Compiler) and MSYS (Minimal SYStem) which is a kind of unix-shell to access the MinGW-commands. Next we download, compile and install Lame, an open-source mp3-codec, with MSYS. Next we install WinCVS and checkout the latest cvs-release of FFMPEG. Finally we compile ffmpeg and I will show a few examples how to work with Flash Video (FLV).

  1. Download MinGW " MSYS current releases (Window Exe Binaries MSYS-1.0.10.exe & MinGW-3.1.0-1.exe)
    • Install MinGW Install MSYS
      (Aditional Instructions: go to http://sf.net and search for same to go to their respective project site. Ensure to select g++ and make in the latest  MinGW installer. I had to do it after I installed MinGW)
      HINT: During the Postinstall be sure to set the right path to MinGW with a "/" instead of a Windows-"". If you did it wrong anyway re-install MSYS to the same directory and do the postinstall right (I missed it a few times) Download and compile Lame
    • Extract Lame to your MSYS home-directory
      Open MSYS and change to your lame-directory (cd ../lame-XXX)
      Enter the following commands:

      CODE:

      1. ./configure //(takes a few minutes)
      2. make //(lame is being comiled; takes a few minutes, too)
      3. make install
      After installing you will recognize that there are new directories and files in MSYS/local which we will use while compiling ffmpeg with mp3-support
  2. Download WinCVS (http://www.wincvs.org) and install it (addn instr: install cvsnt and open winCVS.exe )
      Open the Command-Line window (CTRL-L) and enter the command:

      CODE:

      1. cvs -z9 -d:pserver:anonymous@mplayerhq.hu:/cvsroot/ffmpeg co ffmpeg
      Select "Execute for directory" and browse to you MSYS-Directory and select your home-directory ("home")
      Press "OK" and the current cvs release will be checked out into your home-directory (addn instr: a better option I feel is to download source from http://sf.net  and copy it to mysys/home/ffmpeg. Sometime latest is not always the greatest.  )
    • Compile FFMPEG
        Change the directory in MSYS to your ffmpeg-directory (cd ../ffmpeg)
        Enter the command:

        CODE:

        1. ./configure –enable-memalign-hack –enable-mingw32 –enable-mp3lame –extra-cflags=-I/local/include –extra-ldflags=-L/local/lib
        HINT: you can paste into MSYS by pressing your center mouse-button
      1. "–enabled-memalign-hack" is a Windows hack. Without this option ffmpeg always crashs with the message "removing common factors from framerate" when encoding AVIs.
      2. "–enable-mingw32". I see no difference without it but we compile with MinGW and it would not do a harm when ffmpeg knows this
      3. "–enable-mp3lame": Enable transcoding audio with the open-source mp3-lame-codec
      4. "–extra-cflags=-I/local/include –extra-ldflags=-L/local/lib": The cflags- and ldflags-parameter sets the right path to your lame-installation which you did in step 3.d.
        Enter command: make (ffmpeg is being compiled; takes a few minutes)
        With "make install" you could now copy the ffmpeg.exe to c:Program Filesffmpeg. But there is no need to.
    • Use FFMPEG
        Copy your compiled ffmpeg.exe from your MSYS directory to the directory where you like to transcode with ffmpeg
        Open the Dos-Shell and change to the directory where you copied the ffmpeg.exe
        Copy a test.mpg into your directory and enter the following command:

        CODE:

        1. ffmpeg -i test.mpg -ab 56 -ar 22050 -b 500 -r 15 -s 320×240 test.flv
        Your first FLV should be encoded now
    • Render Images from a Video
        Enter command:

        CODE:

        1. ffmpeg -an -y -t 0:0:0.001 -i test.flv -f image2 test%d.jpg
      • HINT: With -t you set the length of images to be extracted. Above we entered 1 millisecond the extract one image. If you miss this parameter all images of the video will be extracted

    ZLib Support (e.g. for TSCC and Quicktime codecs). This should be compiled into FFMPEG. It is not an explicit compile in the configure statement. Do the following steps and after configure you should see that zlib is "on".
    Download and compile ZLib
    Extract the files to your mysys directory
    Change the directory in MSYS to that directory
    Enter command ./confugure, make and make install.
    CODE:

    1. cp /local/lib/libz.a /mingw/lib/.
    2. cp /local/include/zlib.h /mingw/include/.
    3. cp /local/include/zconf.h /mingw/include/.

    AC3 Support
    Add "–enable-a52 –enable-gpl" to your configure command

    3GP Support
    If you want to enable 3GP support you have to add the AMR audio codec. Download the TS26.104
    REL-5 V5.1.0 26104-5??.zip here. Extract the codec into libavcodec/amr_float and add "–enable-amr_nb" to your configure command

    XVID Support (thanks to garvin.thornten at datel.co.uk)
    Download and install the codec from www.xlib.org (see xvidcore-xxxx/doc/install). Add "–enable-xvid –enable-gpl" to your configure command. When compiling with xvid codec in MinGW or cygwin you will get a "mkstemp" error when compiling "xvidff.c". To fix this edit "libavcodec/xvidff.c" and add the following after the #includes. This will probably be fixed in a future ffmpeg release: ´

    C:

    1. /* Added for windows compile —————– */
    2. #include <windows .h>
    3.        
    4. int xvid_ff_2pass(void *ref, int opt, void *p1, void *p2); void xvid_correct_framerate(AVCodecContext *avctx);
    5.  
    6. int mkstemp(char* template)
    7. {
    8.   char temppath[512];
    9.   if(GetTempPath(512,temppath)!=0)
    10.   {
    11.     if(GetTempFileName(temppath,"fil",0,template)!=0)
    12.     {
    13.       FILE *pFile;
    14.       pFile=fopen(template,"w+");
    15.       if(pFile!=NULL)
    16.         return (int)pFile;
    17.     }
    18.   }
    19.   return -1;
    20. }
    21. /* ——————————————- */
    22.  

    Link about qscale
    removed "-f singlejpeg" as its identical to "-f mjpeg"

    ffmpeg is a great encoder for converting between many video formats. Here’s how to install and use ffmpeg in windows.
     
    note: ffmpeg is great for flv conversions.
     
    1. install MinGW and MinSys
    2. install Lame
    3.
     
     

    Hosting

    February 23, 2006 1 comment
    I am  trying to decide whether to go for a shared windows hosting and host my blog through dasBlog or go for a cheaper linux hosting on php and WordPress. My good side says…" go for windows hosting and use dasBlog " my evil side says… "go for *nux hosting and use WordPress". But you know.. I am going to stick around with msn spaces.

    You would think that msn would have their hosting service. Yahoo has and its brilliant. The spendthrift that I am, I have my domain (rajivmenon.net)registered for $2/yr for 5 yrs at Yahoo Domains and point it to this spaces which is http://msnspaces.com/menonr. And have a email address too at hotmail using Live Domains

    The only fear I have right now is that if I’ll get stuck here without a better option to import these posts from msn spaces.

    Follow

    Get every new post delivered to your Inbox.