Wednesday, May 23, 2012

How-To Convert Audio/Video in Linux

Sometime we need to convert audio/video from type to another for many reasons such as reduce the size  of an email attachment, compatibility hell or others.Linux users are lucky enough to have a nice tool called ffmpeg.

ffmpeg is a very fast video and audio converter that can also grab from a live audio/video source. It can also convert between arbitrary sample rates and re-size video on the fly with a high quality polyphase filter.

Installation is easy and straight forward since ffmpeg tool is exist in most primary distributions repository.so we can use the package manager to install it. since i am running a fedora system i am going to us YUM.

$ sudo yum install ffmpeg


The usage of ffmpeg is easy too, i will show few examples.

Example below is the simplest way, which is to pass the input file name and the output file name only.

$ ffmpeg -i mysong.wav mysong.mp3    # this will convert audio.wav to audio.mp3.

$ ffmpeg -i video.avi video.mp4    # same as the previous example.

Notice that we are providing the output file's extension too. There are many options for this tool, the most common are below.

Audio/Video

-i  input file name
-b  bitrate
-f  format ( mp3,ogg,wav,avi,mp4...etc)
-fs file size, this option will trim your video when the size limit is reached
-y  overwrite output files
-sameq covert but keep original quality

Video only

-r frame rate (fps)
-s set frame size (128x96,800x600,1920x1080...etc)


a little more advanced method were we put more options is use.

$ ffmpeg -i song.mp3 -y -b 44.1k -f ogg -fs 10M song


$ ffmpeg -i video.webm -y -b 44.1k -f avi -fs 100M -s 1920x1080 -r 60 video

see the manual for all options


$ man ffmepg

Saturday, May 19, 2012

General Purpose Voice Command Device

ABSTRACT

General purpose voice command device controlled by means of the human voice, with ability to interact and responds back a neural speech belongs to the asked command or by performing a related certain hardware action like switching or stepping a motor.

System Overview

The device totally removes the usage of buttons or switches, and instead its responds to human-independently vocal commands.

SUMMARY


Approach Type Quick-And-Dirty
Programming Languages POSIX and ANSI C
Processors I686 Compatible CPU and Microchip PIC18F4550
Software Components/Libraries Linux Kernel, Bash Shell, Gstreamer, Espeak,Microchip USB Framework and other open-source libraries
Compiler/Linker GNU C Compiler
Microchip C18



How to delete saved wireless network in gnome 3

Presumption

Linux system with GNOME 3

you had to connected a wireless network and it is automatically saved and every time the saved network is available, Network manager is trying to connect it.

How-TO

open your favorite terminal emulator

write

$ nm-connection-editor

click on wireless tab, and then select the unwanted network and delete it.


Monday, May 14, 2012

Syntax highlighting in nano text editor

Presumption

Linux system with nano text editor


open your favorite terminal emulator 

go to your home directory

$ cd ~

create a file named ".nanorc"

$ nano .nanorc

add the following lines

include "/usr/share/nano/c.nanorc"
include "/usr/share/nano/java.nanorc"
include "/usr/share/nano/sh.nanorc"
include "/usr/share/nano/perl.nanorc"

save

CTRL+X

have a nice coding!

Monday, May 7, 2012

How to ptrhead on Linux using codeblocks IDE


If your linker is complaining when you are pthread-ing on your Linux, then you are probably looking for the solution below

Method 1






From "Setting" menu choose "Compiler and debugger.." click on "linker Settings" tab, under "Other linker option" write 'pthread', click OK and compile.


Method 2

 





If the first method didn't work for you,repeat the same steps and remove what did you write under "Other linker option". now under "link libraries" scroll down and click "add" then add the path to libpthread. to know its location. execute in terminal


$ locate libpthread


then click OK.

the linker is happy now, so compile your code.