Digital Wanderers



Thursday, May 22, 2008

How to download blocked filetypes from your office PC

Suppose your employer is blocking some filetypes(like avi,mp3) or due to some security settings you are unable to download allowed filetype(eg. zip), there is a solution to download these files using MediaConvert.

Idea is to convert the file to some other similar filetype.
If the file is .avi then you can convert it to .mov or some other format which is NOT blocked in your office.

Get the full url link (Copy Link Location in firefox) of the blocked file.
Let this link be http://abc123.com/...../tutorial.avi
Now go to MediaConvert.
Select "Conversion From Url" option.
Paste your link http://abc123.com/...../tutorial.avi in the File box and select input type as .avi .
Now come down and select the output file (here video) type to an unblocked video type(eg .mov).Press OK and wait for the download link.

I used the same technique to download a zip file.
It was blocked by my employer because the url contains the word "application/zip"
which is not allowed.

NB: Please verify that content of the file is not against the rules of the company.

Friday, May 2, 2008

How to Access USB Video Camera with Python for Windows XP

Here is a step by step guide on accessing USB Camera(Webcam) with Python and Python Imaging Library(PIL).
(For Windows platform).

1. Download and install Python 2.5 from here. You can choose the folder C:\Python25 for installation.

2. Download the zip file Videocapture from Sourceforge here.
Open the zip file and copy the vidcap.pyd in DLLs to C:\Python25\DLLs and files in Lib to C:\Python25\Lib folders respectively.

3. Download and run the EXE Python Imaging Library 1.1.6 for Python 2.5. You can run this exe from any folder.

The installation is over. Now you are ready to access the USB camera.

4. Open the GUI for Integrated Development Environment(IDLE) by Start -> Programs -> Python 2.5 > IDLE (Python GUI).

You can take a snapshot by executing three command lines only:

>> from VideoCapture import Device
>> cam = Device()
>> cam.saveSnapshot('Snap.jpg')

Snap.jpg file will be stored in the root folder C:\Python25.
It can be viewed by MS Paint.

PIL - Python Image Libray is a collection of files to manipulate images.
You can find a tutorial
here Python Imaging Library Handbook.