Sunday, December 4, 2011

Create, Edit Subtitles Files for Movies

Most of the time I have encountered a major problem. When I watch movies, some subtitle tracks are not align with the time. So it is hectic if you have only that subtitle track is available. So here I found a tool. It is great. You can do any customization you want.It is Subtitle Workshop.

Here are the links;




Monday, November 21, 2011

Download YouTube videos easily in the formats : MP4,FLV,3GP, WebM etc.

Most of the time I had the problem, the YouTube downloader software doesn't work properly. Also some times IDM is going wild. So most of the time I was in trouble while downloading some videos from you tube. So after some look-up here and there I found KeepVid (http://www.keepvid.com/)  is a good solution for download videos from streaming sites consistently. So guys try it out. You can use it freely on line.  It can Download videos fromYoutube, GoogleVideo, Break.com, Dailymotion, Blip.tv, Groper, Current TV etc also it can Download videos directly from the video webpage.
Steps of use :
  • To use this you have to install java.
  • Then copy your url of video.
  • Paste it in the KeepVid Site.
  • It will give you list of download options.
  • Here you go.

Sunday, November 20, 2011

ffdshow : A DirectShow and VFW codec for decoding/encoding many video and audio formats


This is really interesting. Try it out. The ffdshow is DirectShow and VFW codec for decoding/encoding many video and audio formats, including DivX and XviD movies using libavcodec, xvid and other opensourced libraries with a rich set of postprocessing filters.You can do so many things with this. It is all open source.



Visit : http://sourceforge.net/projects/ffdshow/


Friday, November 18, 2011

Inductive Loop Sensor & Dynamic Traffic Control for Intelligent Traffic Light System

Our Intelligent Traffic Light System is capable of changing priority level of the roads according to their traffic level. To measure the traffic level we have several mechanisms.
  • Image Processing
  • Pressure sensors, give reading when pressure changes by the vehicles
  • Inductive Loops
From the above methods we choose inductive loop.It is build on the concept of inductance change of a coil when a metal object come closer.You know that when you send electrical current through a wire, it generates a magnetic field. For a coil this electromagnetic field is high.You can change the inductance of the coil and change the electromagnetic flux by introducing additional conductive materials into the loop's magnetic field. This is what happens when a car pulls up to the intersection. The huge mass of metal that makes up your car alters the magnetic field around the loop, changing its inductance. 


So we have made a coil develop the inductive loop.We have some kind of metering device to meter the voltage level change in the coil. After some reading we have found this article, it really help to achieve our target.

In the above  circuit diagram we can connect the LED's positive pin to PIC device to get the input. So using that we can easily develop a algorithm to achieve dynamic traffic controlling.

References : Above diagrams and pictures are extracted from the following resources on the purpose to gather all the knowledge in to one place for learn easily.
  1. http://www.fhwa.dot.gov/publications/publicroads/98septoct/loop.cfm
  2. http://auto.howstuffworks.com/car-driving-safety/safety-regulatory-devices/red-light-camera1.htm
  3. http://www3.telus.net/chemelec/Projects/Loop-Detector/Loop-Detector.htm

8*6 LED Matrix for Intelligent Traffic Light System

Next Task was to make the controlling mechanism for traffic lights. Major problem was, there are not enough I/O pins in the PIC to control each bulb of the traffic light. So we choose small mechanism to avoid that problem. That is the 8*6 LED Matrix. To explain this concept I will use a article publish by electronic department of our university. (http://www.ent.mrt.ac.lk/web/knowledgebase/uc/5.3.pdf) . Here we use the mechanism used to light up pixels in a LCD display. I will explain the steps to light up all the 40 LEDs using this mechanism at same time.

     
  • To light a single LED in this matrix we have to give +,- voltages to its pins. You can notice that if we set any pin in PORTB to logic 1, it will give + voltage to LED's + pin. 
  • Then How we can give the ground connection to the - pin of the LED. For that we have to turn on the D400 transistor for that particular column.
  • After that particular LED will be light up. For example we can use this code to light up all the LEDS RA0 column,
          PORTB=0b11111111;
          PORTA=0b00000001;
  • To light up all the LEDS RA1 column,
          PORTB=0b11111111;
          PORTA=0b00000010;
  • To light up all the LEDS RA2 column,
          PORTB=0b11111111;
          PORTA=0b00000100;
  • To light up all the LEDS RA3 column,
          PORTB=0b11111111;
          PORTA=0b00001000;
  • To light up all the LEDS RA4 column,
          PORTB=0b11111111;
          PORTA=0b00010000;
  • To light each other LED in RA0 Column you can use this code,
          PORTB=0b10101010;
          PORTA=0b00000001;
  • Like that we can control each LED in a column using PORTB pins.But you can identify that you cant light up RA0 columns 0the row LED and off the   RA1 columns 0the row LED at the same time. Because we use PORTA pins to choose the column and PORTB to choose the row.
  • So how can we light up all the columns at same time. We use the weakness of human eye to this.If we light different columns at high speed you cant see a difference you will notice that all the LEDs are lighting at the same time.
  • Here is the code for that,
    while(1){
          PORTB=0b10101010;
          PORTA=0b00000001;
          PORTB=0b10101010;
          PORTA=0b00000010;
          PORTB=0b10101010;
          PORTA=0b00000100;
          PORTB=0b10101010;
          PORTA=0b00001000;
          PORTB=0b10101010;
          PORTA=0b00010000;
    }
  • In the same mechanism we implement the control system for our traffic light system. Below diagram will show you how we implement that.

    Bluetooth Wireless Communication method for Intelligent Traffic Light System

    • We choose Arduino Bluetooth Module Slave Wireless Serial Port 4P for our wireless communication purposes (http://www.ebay.com/itm/Arduino-Bluetooth-Module-Slave-Wireless-Serial-Port-4P-/150653185968?pt=LH_DefaultDomain_0&hash=item2313a12fb0).



      To use this device in the mood working 100% correct, we have to use a resistor divider to reduce the operating  Because PIC18f452's RX,TX operating in 5V-0V range but in this Bluetooth reviver it operates in 3.3V to 0V range. So we put up a voltage divider between the Arduino Bluetooth Module Slave Wireless Serial Port and the PIC's RX, TX pins. After setup according to the below diagram Bluetooth Module will start working. When you search for new Bluetooth it will appear as a other type of device.You can couple the device with your laptop using its embedded pin code. After that your PC will have a serial port open via Bluetooth. you can easily communicate with that.

    Choosing suitable micro controller for Intelligent Traffic Light System

    • Our first challenge was to find a suitable micro controller for this system. For this we consider following facts,
      • It have to control unknown number of lights belong to traffic lights. Most of the time it will more than 30.
      • It have to communicate with a laptop via Bluetooth or other wireless communication method.
      • It have to read unknown number of sensor values, most probably  less than 10.
      So considering above facts we choose the micro controller PIC 18f452 (http://www.microchip.com/wwwproducts/devices.aspx?ddocname=en010296) To fulfill the above aspects we have found some mechanisms.