Dec 23, 2009

Format Numbers to be Comma Separated

I have a number 1234567890, and I want to insert a comma at the gap of three digits like this:1,234,567,890

If this is the problem running in your head then the following one liner will be helpful to you.

$ echo "1234567890" | sed -e ':a' -e 's/\(.*[0-9]\)\([0-9]\{3\}\)/\1,\2/;ta'

Dec 15, 2009

Convert VOB to AVI using ffmpeg

Suppose you have a myVideo.vob and you want to convert to avi format.
Open a terminal and execute the following command

$ ffmpeg -i myVideo.vob myvideo.avi

Possible errors:
1 "ffmpeg: symbol lookup error: ffmpeg: undefined symbol: avcodec_channel_layout_num_channels"
$ export LD_LIBRARY_PATH=/usr/local/lib/ && ffmpeg -i myVideo.vob myvideo.avi

If this doesnt solve the problem then retry that after installing the libavcodec52 and libavutil49 packages:
$ sudo apt-get install libavcodec52  libavutil49