Wednesday, 17 December 2008

Transfer files to and from your nokia in ubuntu

Transfering files to and from your nokia phone is easy under linux if you use the correct tools, im going to show you how to do it using obexftp, obexftp-frontend, DKU-2 cable and my old Nokia 7600, this will work with any Nokia phone it doesnt have to be a 7600, You could also transfer files by mounting your phones system onto your hard drive but ill leave that for another blog :)

OK firstly we need to get the tools so fire up the terminal and enter;

$ sudo apt-get install obexftp openobex-apps

now we could use just these tools to transfer our files but whats the point in that when theres a nice GUI frontend available for obexftp.
You need to have java runtime installed to run the GUI so if you have java installed then skip the next step and if you havent got java installed then install it now by going to the command line and entering;

$ sudo apt-get install sun-java6-jre sun-java6-bin

Now well download the obexftp-frontend, its not available in the repositories but you can download extract and move it to your /home directory by entering;

$ wget -c && unzip && sudo cp -r obexftp-frontend-0.6.1-bin /home

Now we need to set our permissions to allow us to access and transfer files to and from our phone, go to the terminal and enter;

$ lsusb

and we should see a line similar to;

Bus 004 Device 002: ID 0421:0400 Nokia Mobile Phones 7600 Phone Parent

Now iv marked the important numbers above in red, the first number is the;
VendorID: 0421
and the second number is the;
ProductID: 0400

Your numbers will differ slightly but just remember that the first is the VendorID and the second is the ProductID.

Now in the terminal enter;

$ sudo gedit /etc/udev/rules.d/40-permissions.rules

and add the following to the end of the file that opens;

BUS=="usb", SYSFS{idVendor}=="VendorID", SYSFS{idProduct}=="ProductID", GROUP="plugdev", USER="yourUserName"

replacing VendorID and ProductID for your actual id numbers from before and put your own username where it says yourUserName and save, for example mines looks like this;
BUS=="usb", SYSFS{idVendor}=="0421", SYSFS{idProduct}=="0400", GROUP="plugdev", USER="mark"

Now we're almost finished just right click on the desktop and select "create launcher", name the launcher whatever you want and in the "command field" type;

java -jar /home/obexftp-frontend-0.6.1-bin/OBEXFTPFrontend.jar

Now all you need to do is click on the launcher you just created and it will open the ObexFTP-frontend for you to configure and the last step are to add;


where it asks for the ObexFTP Path:
Change Transport to USB and set Value to 1 then press Test connection and thats you done, you can now just use the launcher to start transfering files to and from your mobile phone.

Convert kaffiene .m2t or any other video file into images

A quick "how to" convert kaffeine dvb-t recordings which are stored with the file extensions .m2t or any other video file eg; mpg,avi etc into .png files,

First things first create a new folder where you want the images to be stored and remember there can be a lot of images depending on the size of the video.

To convert to small pictures which are 768 x 576 pixels (1.3 mb) simply open up the terminal cd to the new folder you'v just created and enter,

$ mplayer /Path/To/Your/File.m2t -aspect 16:9 -mc 0 -fps 30000/1001 -delay -0.222 -ao null -vf pullup,softskip,scale=768:576 -vo png

changing where iv wrote /Path/To/Your/File.m2t to your actual path and watch as your file converts into images.

To make the images bigger in size change scale=768:576 to scale=1440:1080 to make the images bigger in size 1440 x 1080 pixels (4 mb) make sure you have plenty of space on you hard drive if its a large file

$ mplayer /Path/To/Your/File.m2t -aspect 16:9 -mc 0 -fps 30000/1001 -delay -0.222 -ao null -vf pullup,softskip,scale=1440:1080 -vo png