ffmpeg is an excellent application on video conversion. It supports most of the file formats.
ffmpeg [[infile options][-i infile]]… {[outfile options] outfile}…
Convert from MPG to 3GP
ffmpeg -i video_clip.mpg -s qcif -vcodec h263 -acodec mp3 -ac 1 -ar 8000 -ab 32 -y clip.3gp
ffmpeg -i inputfile.mpg -s qcif -vcodec h263 -acodec aac -ac 1 -ar 8000 -r 25 -ab 32 -y outputfile.3gp
Convert from AVI to 3GP
ffmpeg -i video_clip.avi-s qcif -vcodec h263 -acodec mp3 -ac 1 -ar 8000 -r 25 -ab 32 -y clip.3gp
ffmpeg -i inputfile.avi -s qcif -vcodec h263 -acodec aac -ac 1 -ar 8000 -r 25 -ab 32 -y outputfile.3gp
Convert from 3GP to AVI
ffmpeg -i clip.3gp -f avi -vcodec xvid -acodec mp3 -ar 22050 file.avi
you need to install the codecs previously. All the xvid,mp3,avi,3gp codecs can be updated very easily in the debian based distros. All other disros also having the codecs in their own repositories.
There are other media conversion utilities also there as mencoder,transcode and there are a lot of GUI tools for this like drip, k9copy etc.
These tools add feathers in the linux’s hats.
Thanks for the readers and comments. There are many complaints that no audio from the 3gp files.
“-acodec aac” is the significant option here. This only gives excellent audio to the 3gp file in mobile phones.
Thanks for Sandeep. He only found that “aac” is the suitable codec for better audio.
Ho found that ffmpeg is available for windows also with nice GUI as “WinFF“.
get WinFF from http://www.winff.org
Thanks for the ffmpeg team.
powered by performancing firefox

thanks,
Very useful information
i have installed ffmpeg and mencoder,transcode in my system (OS is ubuntu)..
but iam getting this error ../
PLZ help me….
waiting for ur reply
desktop:~/sreedhar/Personal$ ffmpeg -i Tiger_Attack.mpg -s qcif -vcodec h263 -acodec mp3 -ac 1 -ar 8000 -ab 32 -y clip.3gp
FFmpeg version SVN-r9145, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration:
libavutil version: 49.4.0
libavcodec version: 51.40.4
libavformat version: 51.12.1
built on May 29 2007 11:24:51, gcc: 4.1.2 (Ubuntu 4.1.2-0ubuntu4)
Input #0, mpeg, from ‘Tiger_Attack.mpg’:
Duration: 00:00:33.7, start: 0.500000, bitrate: 913 kb/s
Stream #0.0[0x1e0]: Video: mpeg1video, yuv420p, 320×256, 104857 kb/s, 25.00 fps(r)
Stream #0.1[0x1c0]: Audio: mp2, 22050 Hz, mono, 64 kb/s
Output #0, 3gp, to ‘clip.3gp’:
Stream #0.0: Video: h263, yuv420p, 176×144, q=2-31, 200 kb/s, 25.00 fps(c)
Stream #0.1: Audio: 0×0000, 8000 Hz, mono, 0 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Stream #0.1 -> #0.1
Unsupported codec for output stream #0.1
Hi sreedhar!
you have to install multimedia codecs.
http://hivltg.co.uk/?p=8
http://onlyubuntu.blogspot.com/2007/03/install-mplayer-and-multimedia-codecs.html
http://ubuntuguide.org/wiki/Ubuntu:Feisty#How_to_install_Multimedia_Codecs
view the links above and install all the multimedia codecs.
Wishes.
its not warking,,:S
sorry i ment working
Great tip! I love the fact that you can’t find a decent avi-3gp encoder for windows, but in Linux it’s just there!
Is your ffmpeg a custo install or the one packaged with your distro? What distro? Ty
Useful guide. Thank for your post
not working
Hi T Shrinivasan!
I try this guide on Ubuntu s.o. for an “avi to 3gp” conversion for mobile phone destination (nokia n80).
3gp file work but without sound.
Maybe incorrect codec?
Can you help me?
Thanks!
Marco
Hi everyone,
here is my problem:
ffmpeg -i osalsi.3gp -f avi -vcodec xvid -acodec mp3 -ar 22050 osalsi.avi
FFmpeg version UNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: –prefix=/usr –libdir=${prefix}/lib –shlibdir=${prefix}/lib –incdir=${prefix}/include/ffmpeg –enable-shared –enable-libmp3lame –enable-gpl –enable-libfaad –mandir=${prefix}/share/man –enable-libvorbis –enable-pthreads –enable-libfaac –enable-libxvid –enable-pp –enable-libamr-nb –enable-libamr-wb –enable-x11grab –enable-libgsm –enable-libx264 –enable-liba52 –enable-libtheora –extra-cflags=-Wall -g -fPIC -DPIC –cc=ccache cc –enable-swscaler –disable-mmx
libavutil version: 49.5.0
libavcodec version: 51.48.0
libavformat version: 52.1.0
built on Dec 7 2007 09:08:06, gcc: 4.2.3 20071123 (prerelease) (Debian 4.2.2-4)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from ‘osalsi.3gp’:
Duration: 00:00:23.9, start: 0.000000, bitrate: 151 kb/s
Stream #0.0(eng): Video: h263, yuv420p, 176×144 [PAR 12:11 DAR 4:3], 29.97 tb(r)
Stream #0.1(eng): Audio: libamr_nb, 8000 Hz, mono
Unknown encoder ‘xvid’
Does anyone have an idea to solve that?
Thank you in advance!
(My distro is Debian)
Hi Titiana.
try:
fmpeg -i osalsi.3gp -f avi -vcodec libxvid -acodec libmp3lame -ar 22050 osalsi.avi
[...] here To convert AVI to 3gp using [...]
Thanks, we got an useful message.
But we need command for converting WMV video file to 3GP format.
Awesome! thanks.. saved a bunch of doc digging
Hai
I am converting a flv to 3gp and mp4 and shifting moov box from end to front for progressive downloads every thing is fine but when i starts playing mp3 and 3gp file via progressive download it starts playing and after paying some part it stop playing i am not understanding this what is problem ?
NEED HELP.
Vijay Patidar
[...] filmami 3GP nie sprawia większych problemów, można je konwertować w jedną i drugą choćby z wykorzystaniem ffmpeg (o mencoderze nie wspomnę
). Musiałem tylko porzucić Ex Falso na rzecz EasyTAG, gdyż przy [...]
[...] to fall back on Command Line. I tried to use this guide for a few files, but they didn’t play on my phone. DUH it didn’t support mp3 [...]
I have this return:
…
Unknown encoder ‘mp3′
What can I do?
–
Brazilian greetings.
2 cassioso:
try ‘-acodec libmp3lame’ instead of ‘-acodec mp3′
Hi all ,
Please do some suggestion , I want to convert 3gp file to 10sec play 3gp how can I do this using ffmpeg ?
i.e if test.3gp is 50 sec file than i want to get onther file
test2.3gp of 10sec only ……
I am using this
“/usr/bin/ffmpeg -i test.3gp -target ntsc-vcd -bf 2 -ss 00:00:00 -t 00:00:10 preview_test.3gp”
this will creates non zero bytes file but file does not play in plyer …
thanks
This is wrong, 3gp should not be encoded using the mp3 audio codec, but amr-nb (or similar) codec. This is why you won’t get sound when played with most phones using the method above. I.e use -acodec amr_nb, although you’ll need to compile mencoder with support for it.
ffmpeg* even
After some experimentation, the original example should be as follows…
ffmpeg -i video_clip.mpg -s qcif -vcodec h263 -acodec libamr_nb -ac 1 -ar 8000 -ab 12.2k -y clip.3gp
I hope this can help someone: Converting 3GP to AVI (Ubuntu)
http://ubuntuforums.org/showthread.php?t=363073
Cya.
Thanks for this post! I nearly emailed the client to turn down the project. I found the aac version doesn’t work for me but the mp3 version does.
Thanks again!
I need some help in converting an MP3 to 3GP using ffmpeg.
Please help me realizing the right options and codecs for the conversion.
Thanks in advance!
hi, i tried to converting mpg file to 3gp..then got this error..
Unknown codec ‘aac’..can you send to my email?
skwlsgelf@hereditary:~$ ffmpeg -i 111.mpg -s qcif -vcodec h263 -acodec aac -ac 1 -ar 8000 -r 25 -ab 32 -y 222.3gp1
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: –enable-gpl –enable-pp –enable-swscaler –enable-pthreads –enable-libvorbis –enable-libtheora –enable-libogg –enable-libgsm –enable-dc1394 –disable-debug –enable-shared –prefix=/usr
libavutil version: 1d.49.3.0
libavcodec version: 1d.51.38.0
libavformat version: 1d.51.10.0
built on Jul 23 2008 22:38:24, gcc: 4.2.3 (Ubuntu 4.2.3-2ubuntu7)
Input #0, mpeg, from ‘111.mpg’:
Duration: 00:31:46.1, start: 0.486033, bitrate: 942 kb/s
Stream #0.0[0x1e0]: Video: mpeg1video, yuv420p, 352×240, 800 kb/s, 29.97 fps(r)
Stream #0.1[0x1c0]: Audio: mp2, 44100 Hz, stereo, 128 kb/s
Unknown codec ‘aac’
skwlsgelf@hereditary:~$
>Unknown codec ‘aac’
The solution to this problem is very simple – just instead of ‘-acodec aac’ option, try to use ‘-acodec libfaac’.
gl & hf
Thanks for the effort!
ffmpeg -i video_clip.mpg -s qcif -vcodec h263 -acodec libamr_nb -ac 1 -ar 8000 -ab 12.2k -y clip.3gp
THIS COMMAND WORKS PERFECT!!!!!!!!! THANKYOU
Why The Hell is there no Gui for this…… as far as I am aware there isn’t, but I could be wrong…. I’ve looked everywhere though.
But Thankyou, the command worked.
kaddy
Hi all,
I’m rather new to Linux and using the Ubuntu Intrepid Ibex system. Now I tried to convert an avi – file to 3gp using ffmpeg and following the suitable instructions.
I have the following problem(s):
Error01:
root@tux88-laptop:~/Desktop# ffmpeg -i “Otto.avi” -s qcif -vcodec h263 -acodec aac -ac 1-ar -r 25 -ab 32 -y “Otto.3gp”
FFmpeg version r11872+debian_3:0.svn20080206-12ubuntu3, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: –enable-gpl –enable-pp –enable-swscaler –enable-x11grab –prefix=/usr –enable-libgsm –enable-libtheora –enable-libvorbis –enable-pthreads –disable-strip –enable-libfaad –enable-libfaadbin –enable-liba52 –enable-liba52bin –enable-libdc1394 –disable-armv5te –disable-armv6 –disable-altivec –disable-vis –enable-shared –disable-static
libavutil version: 49.6.0
libavcodec version: 51.50.0
libavformat version: 52.7.0
libavdevice version: 52.0.0
built on Oct 3 2008 22:40:31, gcc: 4.3.2
[theora @ 0xb7ec42f0]Theora bitstream version 30201
[theora @ 0xb7ec42f0]344 bits left in packet 81
[theora @ 0xb7ec42f0]7 bits left in packet 82
Input #0, ogg, from ‘Otto.avi’:
Duration: 00:01:18.1, start: 0.000000, bitrate: 188 kb/s
Stream #0.0: Video: theora, yuv420p, 320×240 [PAR 1:1 DAR 4:3], 25.00 tb(r)
Stream #0.1: Audio: vorbis, 44100 Hz, stereo, 112 kb/s
WARNING: The bitrate parameter is set too low. It takes bits/s as argument, not kbits/s
Unknown encoder ‘h263′
—————————————————————————-
Error02:
root@tux88-laptop:~/Desktop# ffmpeg -i “Otto.avi” -s qcif -vcodec h263 -acodec aac -ac 1-ar 8000 -r 25 -ab 32 -y “Otto.3gp”
FFmpeg version r11872+debian_3:0.svn20080206-12ubuntu3, Copyright (c) 2000-2008 Fabrice Bellard, et al.
configuration: –enable-gpl –enable-pp –enable-swscaler –enable-x11grab –prefix=/usr –enable-libgsm –enable-libtheora –enable-libvorbis –enable-pthreads –disable-strip –enable-libfaad –enable-libfaadbin –enable-liba52 –enable-liba52bin –enable-libdc1394 –disable-armv5te –disable-armv6 –disable-altivec –disable-vis –enable-shared –disable-static
libavutil version: 49.6.0
libavcodec version: 51.50.0
libavformat version: 52.7.0
libavdevice version: 52.0.0
built on Oct 3 2008 22:40:31, gcc: 4.3.2
[theora @ 0xb7ef22f0]Theora bitstream version 30201
[theora @ 0xb7ef22f0]344 bits left in packet 81
[theora @ 0xb7ef22f0]7 bits left in packet 82
Input #0, ogg, from ‘Otto.avi’:
Duration: 00:01:18.1, start: 0.000000, bitrate: 188 kb/s
Stream #0.0: Video: theora, yuv420p, 320×240 [PAR 1:1 DAR 4:3], 25.00 tb(r)
Stream #0.1: Audio: vorbis, 44100 Hz, stereo, 112 kb/s
Unable to find a suitable output format for ‘8000′
Can someone help me??
Thank you in advance!
Martin
[...] posts Convert AVI to 3gp using ffmpeg (http://goinggnu.wordpress.com/) Convert AVI to 3gp with ffmpeg [...]
Dear Mr. Shrinivasan,
I’m from Brazil, and here, a poor country like yours(well, poverty is no shame
) we love Linux. I’m a linux user since 2005. But, lately i’ m having a problem with Winff, which is the front end to ffMpeg. It’s not converting to xvid or mp3. The error is the same from the comments before me. it states: Unknown codec MP3 (or Xvid, the Xvid Issue i ‘ve already fixed). It’s in the presets of Winff, and i am making the changes by hand, one by one, something very laborious. If you’ve already made these changes in presets of Winff, i would like to ask you to make it public, so i (and many others around the globe) could benefit from it. Of course that i will make my work public, to help others with the same problems, but it will take sometime, since i am in the final exams of the year time, in college.
Well, thanks in advance for your attention,
Awaiting for you response,
Best regards from Brazil
Alessandro
Really cool tip. Thanks a lot.
Outstanding tutorial. I’m running ubuntu 8.10 and had a few hick ups installing ffmpeg, mostly because some of the library names changed and so forth. Here’s what worked for me, thank you again for this great tutorial, I’d be lost without it, now I just gotta figure out how to get the best resolution possible for the movies on my sony 580i:
svn co -r 14946 svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
./configure –enable-liba52 –disable-debug –enable-libfaad –enable-libfaac –enable-gpl –enable-nonfree –enable-libmp3lame –enable-libdc1394 –enable-libx264 –enable-libxvid –enable-pthreads –enable-libvorbis –enable-libtheora –enable-libgsm –disable-debug –enable-shared –disable-protocol=udp –prefix=/usr
sudo mkdir /usr/local/lib/pkgconfig
sudo mkdir /usr/include/libavdevice
sudo mkdir /usr/include/libavformat
sudo mkdir /usr/include/libavcodec
sudo mkdir /usr/include/libavutil
sudo mkdir /usr/lib/vhook
sudo apt-get install libx264-dev checkinstall
make
sudo make install
Hope this helps someone else out there.
@Martin, @linuxguy2001:
I’ve written a post on how to convert videos to 3GP in Ubuntu 8.10 (Intrepid) without the need to compile ffmpeg from source:
http://davidar.890m.com/2009/02/28/converting-videos-to-3gp-in-ubuntu-intrepid-810-with-ffmpeg/
ffmpeg -i facebook.avi -s qcif -vcodec h263 -acodec libfaac -ac 1 -ar 24000 -r 25 -ab 65535 -y test.3gp
this gives a better audio quality when acodec aac is not available.
see here.
http://www.linuxquestions.org/questions/linux-software-2/ffmpeg-psp-encoding-woes-with-a-solution-619247/
Thank you for the useful information.