Convert video to 3GP format.

Now I expected this to be hard. Or at least take a lot of fiddling to get right. However, it seems to be quite easy. This site has all the goodness. It requires three steps. Now assume we have a file called movie.mpeg and we want to convert it to movie.3GP. The steps required would be

mencoder movie.mpeg -nosound -ovc lavc \
-lavcopts vcodec=mpeg4 \
-vop expand=176:144,scale=176:-2 \
-o movie.avi -ofps 12

This will extract the video, scale it and reduce the frame rate. Now we need to extract the sound.

mplayer -vo null -ao pcm -af \
resample=8000,volume=+4db:sc movie.mpeg

An output file called audiodump.wav will be created that has the audio that we require. Finally we need to combine these two files together.

ffmpeg -i movie.avi -i audiodump.wav \
-b 48 -ac 1 -ab 12 -map 0.0 -map 1.0 movie.3GP

And that is that. I suppose I should add this to the HantsLUG wiki. Next I need to bundle this lot up into a script so I can then forget all about how this works 🙂

8 thoughts on “Convert video to 3GP format.

  1. You can directly use single command with ffmpeg:
    ffmpeg -i movie.mpeg -vcodec mpeg4 -r 15 -b 128k -s qcif -acodec amr_nb -ar 8000 -ac 1 -ab 13 -f 3gp -y output.3gp

  2. Pingback: ppip: 流浪的天空 » 杂记:Linux的世界,每一天都在战斗

  3. Nope, I am note sure what that says. By using Google Language tools, it would appear that it is a comment about Microsoft and Linux. Unfortunately the Chinese to English translation of Google is not that great. All I am sure of is that the first line mentions Bill Gates.

  4. Let me help you, hope my translation could bring out the thought of the author precisely 🙂

    Bill Gates’ dream is to let everybody’s desk to have a PC, therefore he designed Windows, a user based, “easy to use” operating system. They teased Google, “our product is more sticky than yours, because if search engine damaged, it could be switched to another immediately; but if Windows damaged, user doesn’t know how to switch, they would be worried, trying to fix it.” However, almost every Windows user live in the threatening of virus and hoodlum software**, China has just having a new definition for “hoodlum software”, and this has created a bunch of security software companies. Live with Windows is like fighting with virus everyday. Since 1-2 months ago, “Nan Kai” school network is affected by arp virus, “Meng Lou” building’ s network down 1-2 days every week.
    However Windows has many advantages, for example its software is designed for user, easy to use. Beside MS Office series, other 3rd party software are easy to use too, download-install-use is the common steps. But you need to face a lot of problem with Linux. No matter Debian or SuSe or Ubuntu, software installation always require more effort (even though there is a good package management system like apt), there will always be something outside the system, that require user to handle by themselves. This is also mentioned by caii in his blog: to satisfy user’s need, at least to make a good work on fundamental stuff like font, is an opportunity to Linux software company in China.
    Recently I reinstall KDE on my Ubuntu 6.10, and switched to KDE desktop. After using KDE with SuSe for a month, my preference has gone to KDE. Compare to Gnome, KDE is more mature, well designed desktop system. Many Gnome software, e.g.: tomboy and F-spot, don’t have “Help” at all, there is only an “about”, assuming finding out how to use is the users job. Most KDE software would have a simple help, could it be due to the KDE ‘ fundamental system help is more complete? Gnome main menu uses 3 group of text as menu list, and not using icon, not really understand why they design in such a way, but why don’t they save the desktop space of user? There are also a lot of Gnome desktop application is still in experimental stage, for example bluetooth that I used recently, there is no options of bluetooth in Gnome, when receiving a file, there is only one message box pop up. In the other hand, KDE’s kbluetooth is much better.
    I finally found the method to convert avi to 3gp, beside mencoder, ffmpeg is also needed. mencoder movie.mpeg -nosound -ovc lavc -lavcopts vcodec=mpeg4 -vop expand=176:144,scale=176:-2 -o movie.avi -ofps 12mplayer -vo null -ao pcm -afresample=8000,volume=+4db:sc movie.mpegffmpeg -i movie.avi -i audiodump.wav -b 48 -ac 1 -ab 12 -map 0.0 -map 1.0 movie.3GP

    **I do not know this term, just direct translate, but it means software like adware, spyware, malicious software …

  5. The vop expand=176:144,scale=176:-2 part sets the resolution. Shouldn’t you use 320 x 240 for SE k800i instead of 176 x 144 for better resolution?

  6. I could be wrong, so don’t quote me, but I think that the 3gp specification sets the size and the bandwidth required. So although the K800i has a higher resolution screen, I am not sure you can create a higher resolution file and still be 3gp compliant.

    The thing to do is to give it a go. However, please don’t blame me if it turns your phone into a smouldering wreck 🙂 If it does work, a post here telling of your success would be appreciated.

  7. Setting resolution to 320×240 works perfectly. It will make the filesize slightly bigger, so try yourself whether it’s worth it or not. You can use a single command to do everything, just like peikfeng already posted. Thanks for these instructions anyway!

Comments are closed.