These are the tools you need to convert pretty much any video source into 3GPP2 video playable on W21SA or any other MPEG4-capable phone.
Suppose we have a video we want to convert, "test.avi". It's a 23.976 fps, 25 minute long video clip with audio. Let's make AviSynth script to process the video:
AVISource("test.avi").FDecimate(15) # load + drop fps BilinearResize(320, 240) # resize # If video is 16:9, you'll want to do something like: # BilinearResize(320, 180) # AddBorders(0, 30, 0, 30)Once this is done, load up the avs into VirtualDub. Skip around the video to make sure it looks OK. We'll use XviD's Simple@L2 profile to encode. You can do either one-pass CBR or multipass VBR encoding. Audio will be 64kbps AAC, but we'll take care of that later. For now, set XviD profile to Simple@L2 (that gets rid of most encoding options), set minimum quantizers to 2, and adjust other settings according to the material you are encoding. I usually do 2-pass VBR, and with 64kbps audio 25-minute clips end up as ~50megs, which gives pretty good video quality. Anyway. Go ahead and setup 1-pass or 2-pass encode and let it go. Make sure to set audio processing to "none" in virtualdub's audio menu. Come back in few minutes.
Re-load the avisynth script again, this time with audio enabled. Use File/Save WAV... menu in virtualdub to dump the audio. You'll want to resample it to 24khz at this point, either using VirtualDub (explained below), or some other audio processing program. Actually, you can resample the audio inside Avisynth script, too, but I won't get into that. In VirtualDub, set audio processing to "full process", goto Audio/Conversion menu, and set sampling rate to "Custom", and enter 24000 there. Don't fuck with other settings. Now go to File/Save WAV... and put it somewhere.
Drop into command line and startup faac.exe:
faac -b 64 -o test.aac --mpeg-vers 4 test.wavThat should give you a 64kbps MPEG4-AAC file. Now you have audio.
Using mp4creator.exe from MPEG4IP tools, create the 3G2 file:
mp4creator -allow-avi-files -create=test2p.avi test.mp4 mp4creator -create=test.aac -force3GPCompliance -interleave -optimize test.mp4First line will create the video and the 2nd one will mux in the audio. You should now have a MP4 file which should be playable on your mobile. At this point you can change the MP4 extension to 3G2, if your device requires it.
Using the USB Cable-WIN in Mass Storage mode or by using SD-Card adapter, copy the finished MP4 file to the phone. Either way, you'll want to copy it to
PRIVATE\AU\DF\D_MAand name the file as
MAV_####.3G2Where #### is a number starting from 0000 and up, if you're copying more than one file. Note, in the phone's UI these will be sorted by date. Also, if you find a file named "MA_F_000.MGR" in the same dir, delete it. It's the index.
You should be able to view the clip from the phone's SD data folder browser.
If you have W21SA and you've copied the file and can play it, by now you'll notice that it doesn't allow sending this image to TV-Out cable. This is, I guess for copyright protection reasons (haha). This is because the resulting 3GP2 file is missing the 'cpgd' (copyguard) and 'enci' (encode info) atoms which specify what you can or cannot do with the video. There is a chinese tool which allows adding these atoms, but it's difficult to use and not exactly bug-free. In the near future, there might be a solution to this problem using MPEG4IP library.
timecop @ efnet
Back to W21SA
last updated 2005/05/24