Convert Your Videos to 3gp with ffmpeg


ffmpeg is a very nifty tool for audio and video conversion. It supports various formats. In my case, I was looking to convert a few videos that I had to 3gp format for viewing on my cell phone.

I had 2 choices – mencoder and ffmpeg but sadly neither of them supported 3gp videos on ubuntu. Since, I came across the post on using ffmpeg for 3gp videos on goinggnu I decided to go with ffmpeg. Even medibuntu repostiories do not have ffmpeg with 3gp support for Ubuntu 9.10(Karmic). So, only way ahead was to compile my own copy of ffmpeg

Firstly, I had to get ffmpeg from svn

svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg

You need to get following files from medibuntu repository

  • libamrnb3
  • libamrwb3
  • amrnb
  • amrwb

And then install ffmpeg

cd ffmpeg
./configure –enable-nonfree –enable-gpl –enable-pthreads
–enable-libopencore-amrnb –enable-libopencore-amrwb
–enable-version3 –enable-libmp3lame –enable-libxvid
make && checkinstall

NOTE: You need checkinstall installed on your system to complete the last step. Make sure that it is installed.

sudo apt-get install checkinstall

NOTE: I have enabled libmp3lame and libxvid in the above command, if you want support for those codecs, you will need to install libmp3lame-dev and libxvidcore4-dev. If you don’t want those, you can remove it from the configure command.

sudo apt-get install libmp3lame-dev libxvidcore4-dev

OK. Now you’re ready to convert your videos to 3gp format. You just need to use the following command

ffmpeg -i inputFile -s qcif -vcodec h263 -acodec libopencore_amrnb -ac 1 -ar 8000 -ab 12.2k -y outputFile

The above is the setting that worked best for me. You might want to make some changes according to what your device supports best. For example, you may want to use -f psp for your PSP. The options are nicely explained in ffmpeg documentation.

TIP: You can create a simple script out of the above command and use it everytime instead of having to remember it.

#!/bin/bash
/usr/local/bin/ffmpeg -i $1 -s qcif -vcodec h263 -acodec libopencore_amrnb -ac 1 -ar 8000 -ab 12.2k -y $2

#!/bin/bash

/usr/local/bin/ffmpeg -i $1 -s qcif -vcodec h263 -acodec libopencore_amrnb -ac 1 -ar 8000 -ab 12.2k -y $2

Just put these 2 lines in a file and save it under /usr/bin and make it executable.

Now you can use this, let’s say we named it as 3gpconverter

3gpconverter inputFile outputFile

Enjoy your video on while on the go.

  • Share/Bookmark

Be the first to comment - What do you think?

Posted by Mehul Ved    Date: Wednesday, November 11, 2009

Categories: open source, tools

Tags:

Installing DTC on CentOS to manage hosting on your server


Firstly, let me introduce you to DTC. DTC(Domain Technologie Control) is a open source web based control panel by GPLHost. No points for guess what license it is released under. Why use a web based control panel? The story behind it is that our company purchased a physical server in partnership with a few others. As per the agreement, we would be doing the whole setup and maintenance of the server. What the other partners in this deal require is the ability to create email addresses and manage their website. Thus, the decision was taken that a control panel will be installed and client access to it will be given to others with whom the server is shared.

So, now “Why DTC?” Following are the reasons we selected DTC

  • It can run on CentOS without much hassles. The CentOS install is well documented.
  • Mailing lists with many options  using mljmm
  • Package installer (like fantastico) to be able to install many apps (phpBB, osCommerce, Drupal, etc…) in few clicks
  • Management of shared hosting
  • Support ticket system is included

Next part is going on to the actual installation. We had finalised on using CentOS as our OS on the server, so following the CentOS installation how-to on the DTC wiki was a breeze for the most part. You can find the how-to here. Though the how-to is for RHEL/CentOS4, it works as well on CentOS 5 except for a few minor problems which I came across. These problems are easy to solve and it’s solution is available on their forums.

The first problem was getting squirrelmail to work with DTC. The fix is given out here in a very understandable manner.

The second issue is with phpmyadmin missing the mcrypt library. It’s as simple as installing php-mcrypt package.

I am still having a problem with logging in through ftp. But, it seems to be an isolated issue with my setup as my searches are not coming up with anything worth while. And even the logs fail to show up anything useful. If this is solved, I will update the post or make a new post on solving this issue depending on the complexity of the solution.

Some other useful resources related to DTC can be found at:

DTC wiki – http://dtcsupport.gplhost.com/

DTC forums – http://forums.gplhost.com/

  • Share/Bookmark

Be the first to comment - What do you think?

Posted by Mehul Ved    Date: Saturday, April 25, 2009

Categories: Uncategorized

Tags:

Linux Powered Wall Plug Computer


Can you imagine your power adaptor running Linux? And connecting it to your network? And this just for $100!
Marvell Semiconductors has introduced Sheevaplug, a always-on device resembling a power adaptor. It ships with Linux on-board and uses open hardware.
The device draws 5 Watts of power even though it is packed with amazing computing power.The hardware specifications go something like this
* 1.2 GHz ARM CPU
* 512 MB RAM
* 512 MB Flash disk
The device is available in single quantities as well as in bulk, where the volume pricing could fall to as low as $50.
The device can be accessed over TCP/IP. It also includes a mini-USB cable, serial console interface and JTAG for other ways of accessing it.
The device supports any distribution running 2.6 series kernel and support for ARM.
Read up more on it
http://www.linuxdevices.com/news/NS9634061300.html
http://www.marvell.com/featured/plugcomputing.jsp

  • Share/Bookmark

Be the first to comment - What do you think?

Posted by Mehul Ved    Date: Thursday, March 5, 2009

Categories: OS

Tags:

Released – GUI for phoronix test suite


The Phoronix Test Suite is the most comprehensive testing and benchmarking platform available for the Linux operating system.

It consists of

  • 80+ Test Profiles
  • 30+ Test Suites
  • Extensible (XML-based) Testing Architecture
  • Automated Test Installation
  • Dependency Management Support
  • Module-based Plug-In Architecture
  • Integrated Results Viewer
  • PNG, JPG, Adobe SWF, SVG Graph Rendering Support
  • Autonomous Batch Mode Supported
  • Global Database For Result Uploads, Benchmark Comparisons
  • HTML Documentation Covering Test Profiles, Module Framework
  • Installed Software, Hardware Detection
  • System Monitoring Support

Phoronix Test Suite runs on Linux, OpenSolaris, Mac OS X, & FreeBSD Operating Systems. Since it’s public release a year ago, one of the most popular feature requests has been for a graphical user interface.

With the release of Phoronix Test Suite 1.8.0 Alpha 2, a preview of this GUI has been introduced. Those testing Linux, OpenSolaris, BSD, and Mac OS X systems now have a simple, intuitive GUI for facilitating their system benchmarks. This optional user interface for the Phoronix Test Suite is written in GTK2 and requires the PHP GTK module. The release 1.8 has this initial interface while it will be finalized for the release of Phoronix Test Suite 2.0 later this year.

The interface can manage test installations, viewing information on tests and suites, looking at test results, carrying out the actual testing process, and other features.

To read more about the GUI check the full article here

  • Share/Bookmark

Be the first to comment - What do you think?

Posted by Mehul Ved    Date: Thursday, February 26, 2009

Categories: open source, tools

Tags: , , , , ,

Launch of Mumbai Python User’s Group

Mumbai's Python User Group, it's introduction and next meetup.

Read more...

Be the first to comment - What do you think?

Posted by Mehul Ved    Date: Sunday, February 22, 2009

Categories: open source, programming, python

Tags: , , ,

Chirp – twitter yourself on command line

A command line twitter client with wide range of features

Read more...

Be the first to comment - What do you think?

Posted by Mehul Ved    Date: Sunday, January 18, 2009

Categories: OS, open source

Tags: , , , ,

A day in life of a geek


  • Share/Bookmark

3 comments - What do you think?

Posted by mehul    Date: Friday, November 21, 2008

Categories: Uncategorized

Tags:

Access VirtualBox Guest Network From Outside


I have been looking for a way to enabling network inside virtualbox so that I can access it from anywhere thus being able to run various services inside virtual environment, trying out anything without any worries.

Here’s a simple how-to borrowed from archlinux wiki

Install bridge utils for creating bridge and uml_utilities for creating a tun device

pacman -S bridge-utils uml_utilities

Open the file /etc/udev/rules.d/60-vboxdrv.rules and add the following line to it

KERNEL==”tun”, OWNER=”root”, GROUP=”vboxusers”, MODE=”0660″

Then type the following command to load the tun module

modprobe tun

Now, let’s setup a bridge device to bridge network from your physical network interface to the virtual one

  • Create a bridge interface

brctl addbr br0

  • Set your interface in promiscous mode so it can accept packets from any interface

ifconfig <interface name> 0.0.0.0 promisc

  • Now, bridge the bridge interface with the real network interface

brctl addif br0 <interface name>

  • Now set the bridge interface to acquire IP address as your physical network interface would. eg if eth0 is your network interface and it acquires IP via DHCP then

dhclient br0

  • And finally add virtualbox host interface

VBoxAddIF vbox0 <VirtualBox user> br0

Now start VirtualBox and go to network settings. Select network interface as ‘host networking’ and interface device as ‘vbox0′.

Now you need to give an unused IP address in your IP range of the internet gateway. If you cannot provide that due to some reason then what you can do is create a virtual interface say eth0:0 then bind bridge network to that interface and setup NATing to pass packets between virtualbox and external network.

  • Share/Bookmark

9 comments - What do you think?

Posted by mehul    Date: Sunday, November 16, 2008

Categories: open source

Tags: , , , , , , , , , , ,

Some nifty fun with Linux and PDF files


Let me narrate 3 nice experiences with pdf on Linux while at work

1) Merging multiple PDF files

gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOUTPUTFILE=filename.pdf file1.pdf file2.pdf……..fileN.pdf

2) Convert ps to pdf

ps2pdf file.ps file.pdf

3) Compressing PDF files.

4) Convert images to PDF

convert image1.jpg image2.gif image3.tiff…….imageN.xyz filename.pdf

  • Share/Bookmark

1 comment - What do you think?

Posted by mehul    Date: Sunday, November 2, 2008

Categories: open source, tools

Tags: , , , , ,

Viewing MS Word files on Command Line


I had to urgently view a MS Word file but I didn’t have a word processor on my system to view it in, KWord2 beta wasn’t able to support MS Word files. And I couldn’t find any small word processor or the one that wouldn’t being a gnome and a half in with itself. So, I decided to explore the CLI way.

I came across this nice article on how to view MS Word files on CLI. One of those softwares which I tried out is antiword, as it seemed most suitable to my purpose. A nifty utility to download and use while Oo.org takes it’s sweet couple of hours.

Another nice thing is that it can be used when you don’t have X running or if you’re connecting via SSH.

Viewing the file in antiword is as simple as typing

antiword filename.doc

Though it has a few options to format stuff via parameters, I don’t need them. But, they can be quite useful for some purposes.

Pipe the document through a pager and nicely sit and enjoy reading your MS Word document over Command Line Interface.

My thoughts on the software – simple, easy to use and makes life easy when all you want is to view simple text from a MS Word document. What I miss the most in the software is the ability to open odt files :(

  • Share/Bookmark

2 comments - What do you think?

Posted by mehul    Date: Tuesday, October 7, 2008

Categories: open source

Tags: , , , , ,

Next Page »

WordPress Loves AJAX