Quantcast
Channel: Digitalwerks » gphone
Viewing all articles
Browse latest Browse all 2

Video encoding for the Android: Step-by-Step

$
0
0

I have written a couple of previous posts about my experiences using the T-Mobile HTC G1 Android Google phone, including an in-depth look at how it handles video playback.  As a way to help other G1 users get video on to their phones, I put together this step-by-step guide to using the MeGUI application to encode video into a format that the G1 can play, while retaining as much quality as possible.  Because of the relatively low resolution of G1 compatible video, I have not focused as much on making the files as small in size as possible, but once you’ve mastered the basic steps outlined here, you should not have too much trouble tweaking the process to get smaller sizes if that is of importance to you.  With microSD cards getting cheaper and cheaper, I frankly have not found much need to really optimize encoding for size, but your needs may differ.

Necessary tools:
The first step is to download and install the required software.  This first version of this guide is PC only, but again, it would not take too much effort to replicate the steps shown here on a Mac of Linux computer.  If anybody has specific questions about those alternatives, please just drop me a line.  

MeGUI is a free, open source encoding application available for download from Sourceforge.  It is quite mature and is very powerful, although we will only be scratching the surface of its capabilities here.  
Also necessary is the AAC encoding executable from Nero.  The AAC encoder is also free, but after download, make sure to note where on your system the application gets installed.  Later on, you will need to show MeGUI where it is located.
After basic installation of MeGUI and neroaacenc.exe, you will want to update MeGUI using the built in update function.  The application actually bundles a number of other apps, all of which are updated quite frequently, so it is always worth your while to make sure everything is as current as possible.  

After updating, also check to ensure that the neroaacenc executable is properly installed.

Next, you will want to download my Android-G1 encoding profile.  Once downloaded, you will import it to MeGUI to make it available for use.

Step 1: AVS Script
So, you should be all set up by this point, and ready to actually get to the task of encoding.  MeGUI is a bit different from many other video encoding applications, in that it requires you to create an AVISynth file, or AVS script.  It’s not as complicated as it sounds, but it is an extra step.  Luckily, MeGUI takes the hard part out of it by providing an interface for inputing the necessary information into your script under the Tools menu.



The key items to pay attention to for Android encodes are resize and crop. Set the first number (width) of resize to 480, and then let the program automatically set the resulting width while maintaining the proper aspect ratio. Then click the “crop” button and hit auto-crop. If there are any black borders to remove (which is very important when screen real estate is at a premium as on the Android) the program will figure it out automatically.
Once finished with resize and crop settings you will click “Save” which should pop up a preview window of what the new video will look like, and take you back to the original MeGUI interface page.

Step 1: Prepping the encode
After creating your AVS script, and assuming you have the G1-Android preset properly imported, then the only setting you need to look at now is output format, which needs to be set to “MP4.” If so, hit “Enqueue.”
At this stage you can also set up the audio encoding. Choose the original souce file for input, select the Nero AAC: NDAAC-LC 96kbps preset, make sure the audio output format is MP4-AAC, select a new name for the audio output file, and hit “Enqueue.”

Step 2: Encoding
Click the Queue tab, see that your audio and video encoding jobs are lined up properly, and hit “Start.”
One progress on both audio and video is finished, open up the Muxing/Muxing MP4 tool, and queue up the process of bringing together the audio and video streams into one MP4 file.

Once that job is finished, you should be all set to transfer the completed file to your Android phone. If you have a Video Player application installed from the Android Marketplace, you should be now watching high quality video on your Android.

MPEG-2 Sources
For MPEG-2 sources, there are additional steps. The first is the DG Indexer -> D2V creator.

Run your source file through the D2V creator. (You will have to Queue the process up and run it).

Afterwards you will have an audio stream for later encoding, while for video the AVS script creator will pop up using the D2V file you’ve created. For MPEG-2 sources you will most likely want to de-interlace the video, so that will be set at this stage as well.
Go to the Filters tab of the AVS script creator and click “Analyze.”

It will take a little while for the analysis process to complete, but at the end you if you are in need of it, the “Deinterlace button” will be automatically clicked for you. At this point you can go back to the main AVS script creator page and move ahead in the encoding process normally, as described above. When it comes time to set the encoding processes from the main MeGUI interface, choose the audio stream that was established by the D2V creation process to be encoded into AAC audio.


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images