Convert the video to 3GPP format

Source: Internet
Author: User
Tags unpack
About 3GPP
In todays mobile phones the 3GPP standard is widely in use for videos on the phone. Newer camera mobiles can take movies from their integrated camera which are encoded in 3GPP (usually with suffix. 3GP ).
Currently, 3GPP standards are widely used in mobile phone video screens. Recently, mobile phones can use their own integrated cameras to take a 3GPP-encoded movie (usually later. 3GP ).
3GPP stands for 3rd Generation Partnership project and is a consortium which agrees on standards for telecommunications. The video standard is one spec that came out. See their page at http://www.3gpp.org for more information.
The Third-Generation Partnership Program (or third-generation Partnership Program) is a telecommunications standards and specifications Association, the transmission of visual standards is a description, view more about them: http://www.3gpp.org.
This page describes how to convert regular video files like Avi or MpEG with freely available

Open source tools like mplayer and FFMPEG into a gp3 file. I have tested this on Fedora Core 2 and copied the files to my Nokia 6230 (and watched them of course :-) this page is not meant for novice users. I will not answer questions via email about this. fight it yourself to get it working.

For Login ze users there is a tool called Nokia multimedia converter that you can download from Forum Nokia at http://www.forum.nokia.com. you will need to register but the download itself is free. it is a Java application that converts the videos with a graphical interface. I have not tested if it can be used on Linux. I prefer the open source tools.
This section describes how to use the free and effective open-source tool mplayer and FFMPEG to convert Standard visual screen files (such as avi and MPEG) to gp3 files. I have passed the test on the FC2 platform, and copy the converted files to your nokia6230 (watch them run). This page is not prepared for beginners. I will not reply to questions about this page by email, you must get the answer through your own efforts (Labor achievements ),

: For Windows (the Translator's note: The word ze has a problem) users, there is a Nokia multimedia Conversion Tool for use (Translator's note: mplayer, FFMPEG in the use of Windows is estimated not as convenient as NOKIA tool), this tool can be downloaded from the Nokia website: http://www.forum.nokia.com, although the download software itself is free, but you need to register before download, it is a visual screen conversion application that develops graphical interfaces in Java.ProgramI did not test whether the tool can be used in Linux. I like this open-source tool.

Theory

= Principle =

I do not know the video standard completely but here are some information that you shoshould know when dealing with those videos (this is not yet integrated into the different programs and so you will need to do some handwork, see below)

The video is encoded in H.263 (for more info ask Google) and the audio in Narrow-Band Amr (Adaptive multi-rate) Audio Codec (for more info see [RFC 3267]).

: I am not very familiar with visual screen standards, but when you convert those video formats, you should understand some information here (these <video file formats> different files must be integrated into different programs, so you will encounter difficulties, see the following): H.263 (ask Google for H.263) for video encoding and narrowband Amr (multi-channel adaptation) for Audio Encoding/decoding (for more information, see [RFC 3267]).

What you need

= What Do You Need =

You will need the following packages. if you are using a distro like Fedora Core you can get these easily from third-party apt repositories like [freshrpms]. [mplayer] [FFMPEG] with additional files. see below these packages have dependencies by themselves. read their pages on what that is or use a package management system that cares for you about that.

: You need the following software packages. If you are using a distro, such as Fedora Core, you can easily get [freshrpms] from a third-party website space. [mplayer]. [FFMPEG] and other files. See the following program toolkit has many dependencies. You can go to their website to learn about these dependencies, or use the package management system. It will tell you what dependencies this package has. (Note: there are too many programs in Linux that are dependent on this program. Fortunately, yum is a great tool, but it is estimated that you can only rely on the official website or package management tool ).

Setup of mplayer and FFMPEG

= Mplayer and FFMPEG installation =

Install mplayer. I have used a 1.0 pre. FFMPEG needs some additional files that are not part of the distribution (I guess because of licensing issues ). I have tested this with FFMPEG version 0.4.8. get the source code and unpack it. if you use version 0.4.8 read on below. otherwise read the notes here on how to determine which files you need: Go to the directory, open the file "Configure" and search for "Amr" or "3GPP ". at the very end of the file you should find some notes that tells you which files to get. there shoshould be a note like

 
Echo "AMR Nb float notice! Make sure you have downloaded ts26.104"
Echo "REL-5 v5.1.0 from"
Echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-510.zip"
Echo "and extracted the source to libavcodec/amr_float"

The name before the. Zip (here 26104-510) is the interesting part. The path is wrong. If you use version 0.4.8 you need 26104-510.

Install mplayer. I am using 1.0 pre (Translator's note: Probably pro ). FFmpeg requires some dependent files not part of the release version (I guess it is due to license release). I have tested FFMPEG 0.4.8. Get thisSource codeIf you are using version 0.1.8, read the following. For other versions, see the comments below to determine which files are needed: Enter the sourceCodeDirectory, open the "Configure" file, and find the "Amr" or "3GPP" characters. You can find some comments in the partial part of the file, which will tell you which files are what you need, the following is a sample annotation.

 
Echo "AMR Nb float notice! Make sure you have downloaded ts26.104"
Echo "REL-5 v5.1.0 from"
Echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-510.zip"
Echo "and extracted the source to libavcodec/amr_float"

This. ZIP file (26104-510) should be noted later. This is incorrect. If you are using 0.4.8, 26104-510 should be used. (Translator's note: it is estimated that there are benevolent brother | renmei will this original article: "Echo" http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-510.zip "" changed, but do not want to change as well, it will be more new people .)

Do this for the version you determined: Go to http://www.3gpp.org/ftp/Specs/archive/ open the folder that is mentioned last in the URL, here: 26_series open the folder Matchin your version, for the version mentioned: 26.104 get the zip mentioned, for the example: 26104-510.zip

Now unpack the FFMPEG source and do:

 
Mkdir-P libavcodec/amr_float
CD libavcodec/amr_float
Unzip 26104-510.zip
Unzip 26104-510_ansi_c_source_code.zip
CP-F makefile. GCC makefile

Now go to the FFMPEG Dir and configure as usual with an additional "-- enable-amr_nb" argument. example :. /configure -- enable-amr_nb. make and make install as usual. note for RPM users: Get the src rpm (if you use apt: APT-Get source FFMPEG) and install it. go to/usr/src/RedHat/specs and edit FFMPEG. spec. add at the top where it says source source1: 26104-510.zip. copy the ZIP file to/usr/src/RedHat/sources add the following to the % prep section after the % setup macro:

 
Mkdir-P libavcodec/amr_float
CD libavcodec/amr_float
Unzip % source1
Unzip 26104-510_ansi_c_source_code.zip
CP-F makefile. GCC makefile

And add the -- enable-amr_nb flag to the configure line. now rpmbuild-Ba FFMPEG. spec & rpm-uvh -- force .. /RPMS/i386/FFMPEG *. (You shoshould install FFMPEG before this via apt or something like that to resolve all dependencies !).

Encode videos

Now that you got everything setup we can finally encode some nice videos :-) to get an actual example I will describe here how to convert undo from [platige image] For your mobile. you can get the video on the their page at http://www.undomovie.com/also have a look at "The Cathedral" which is even more impressive! Get the Undo. MPG file and store in a directory. Go to that directory. Now we do the following

 
Mencoder undo. mpg-nosound-OVC lavc-lavcopts vcodec = MPEG4-VOP expand = 176: 144, scale = 176:-2-O movie. Avi-ofps 12

This will scale the movie down to qcif resolution (176x144), remove the sound (will care about that later) and store it as MPEG4 in an AVI container with 12 frames per second. you may want to play with the frames per second. I found 12 frames per second to be just fine. do not change the resolution however. the Nokia 6230 that I have also only has 128x128 pixel display, but 3GPP only defines a small set of resolutions supportd. qcif is one of them and shoshould be used. the later steps will fail if you change this.

Now we want to get the sound from the video:

 
Mplayer-vo null-ao PCM-AF resample = 8000, volume = + 4db: SC undo. mpg

This extracts the audio from the file and resamples the sound to 8 kHz (seems to be a requirement for AMR) and makes the sound 4 dB louder. it also applies a soft clip filter. the result is a file called audiodump.wav that contains the sound.

Now we put both files together and merge it into a 3GPP file:

 
FFmpeg-I movie. Avi-I audiodump.wav-B 48-Ac 1-AB 12-map 0.0-map 1.0 undo.3gp

We use FFMPEG to merge the two inputs movie. avi and audiodump. avi into the file undo.3gp. we use a bitrate of 48 kbit/sec for the video and 12 kbit/sec for the audio. we only use one audio channel (Mono) and map the video and audio streams appropriately into the new file.

Done. Now you can copy the file to your mobile (see nokiacopyviabluetooth) and enjoy the show :-)

Enhancements

In some cases you may want to apply a few enhancements to the video material you have got. in undo you may have noticed the black bars. these cocould be removed for more real video information. for undo this is not really useful, since this involves scaling and this makes the video look narrow. for other vids it may fit better. in general what you need are images that can be easily scaled down to qcif (176x144) or sqcif (128x96) resolutions (for the Nokia 6230, other phones, other resolutions... but 3GPP/H.263 is pretty strict about allowed resolutions (see this [page about H.263] for a listing. I guess all of these are supported by 3GPP, but I have no clue which cell phones can decode which resolutions ). to find out what to crop mencoder has s nice filter that will tell you just that:

 
Mencoder undo. mpg-nosound-OVC lavc-lavcopts vcodec = MPEG4-VF cropdetect

This will give you output lines like

Crop area: X: 512 .. 0 y: 202 .. 207 (-VF crop =-512: 6: 512: 202) 00 [0: 0]

So WWE create a cropped. Avi with the cropped movie:

 
Mencoder undo. mpg-nosound-OVC lavc-lavcopts vcodec = MPEG4-VF crop =-512: 6: 512: 20-O cropped. Avi-ofps 12

Now you can rescale the movie. to actually make use of the space and stretch the movie we will use the following command:

 
Mencoder cropped. Avi-nosound-OVC lavc-lavcopts vcodec = MPEG4-VOP expand = 176: 144, scale = 176: 144-O movie. Avi-ofps 12

Then extract the sound and merge the files using FFMPEG as described above.

Simplified procedure

Download the following three files at www.3gpp.org:

Http://www.3gpp.org/ftp/Specs/2004-03/Rel-5/26_series/26204-520.zip

Http://www.3gpp.org/ftp/Specs/2004-03/Rel-5/26_series/26073-530.zip

Http://www.3gpp.org/ftp/Specs/2004-03/Rel-5/26_series/26104-540.zip

Decompress the package to the following folders:

 
26204-520.zip into libavcodec/amrwb_float
26073-530.zip into libavcodec/AMR
26104-540.zip into libavcodec/amr_float

Recompile FFMPEG, remember to add-enable-amr_nb-enable-amr_wb

Run the following command to complete the conversion. For more information about the parameters, see man.

 
FFmpeg-I test. Avi-y-B 20-s sqcif-R 10-acodec amr_wb-AB 23.85-Ac 1-ar 16000 test.3gp

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.