[Atrix 4G Q&A, Help & Troubleshooting] Girgizzlemuf:
Transcode: Megui

Guide for Transcoding with Megui

Step 1: What file are you transcoding??​

Yes, this is an important step. Say you get a movie from a 'reputable' source, or you ripped your own. If you are anything like me, I like MKV files. They play nicely on my desktop running Vista (don't flame pl0x, I know Vista sucks), but don't work on the phone. Usually stuffed inside that shiny MKV is a high-profile x264 encoded video with ridiculous settings and a shiny 5.1 (or 6.1, or even 7.1) FLAC audio track. Sometimes subtitles! And even in more cases multiple audio tracks! Will your Atrix play this monster file? lolno. Can we make it work for your Atrix? Yes. Read on.

This example is going to be using a MKV file, and we will be converting to a 720p MP4 using x264 and AAC. (Most other files will work this way as well. If you are ripping a dvd and looking to stuff it on your phone, find a guide on the internet. Google is your friend. Most guides will tell you how to get the dvd into a workable format on your computer, from there you can use this guide.)

Step 2: Get Megui.
​

As said previously, you will need Megui. (found here). You will also need avisynth. (get that here; make sure you get version 2.5.8, as it is the most stable at the time of writing this.) Install avisynth first, then Megui to prevent any serious issues. Megui will tell you it needs avisynth before you install it anyway, so this cuts out a step in the process.

For best audio results, you can get neroAACenc also. When you update megui, it will tell you how to get this file. Follow the directions on the website it sends you to at the update step to get this awesome audio encoder. Megui will tell you how to make it work.

As stated before I am not responsible for bricking your computer with this software. I am also not responsible for any issues regarding bugs or technical support with the software I listed. I just use it. It works flawless for me on 3 different x64 based computers (Windows XPx64, Vista Ultimate x64, and 7 professional x64)

Step 3: Megui.​

Megui, after it is updated and working, looks like a complicated piece of software. There are so many configuration options even the configuration options have configurations if you go deep enough. Lucky for us, they are not as complicated as they seem. We will only be working with a few of the options.

In this case, we will be working with a MKV that has a video, an audio, and a subtitle track.

A. Extract the file.

Tools > HD Streams Extractor.

The reason we do this is to get all the information we can out of the file. Choose the radio button for 'select file as input' and either type or click the '...' button to browse to your file. Once that is done, we want to extract everything. So under the streams list, check them all. If you want to change the location that they extract to, then do so it is all up to you. This particular case will produce 3 files, a video track, an audio track, and a subtitle track. Click Queue. This will take you back to the main window. Click the queue tab and click start at the bottom to begin extracting the files.​

B. Index the Video

Now we have the files extracted, we need to index the video file that was produced from this extraction. To do this, go to Tools > File Indexer and choose the *.mkv file that was extracted from the last step. Why this file and not the original? Because this file has only video in it, no extra crap. The file produced will most likely be 'T1_Video - .mkv' unless your source had a strange index set to begin with. Because this is a MKV file, we only have one option for indexing, and that is with 'FFMSIndex'. Click the queue button, go back to the queue tab on megui and click start.​

C. AVIsynth gui inside Megui

Once the previous step has been completed, we will have a window pop up with the video in it. Yay! This video has a few things we need to do to it before we can start the actual encode process though. In my example, the frame rate is too high for the phone to understand (120fps... i should slap someone for that), and it by default has no subtitles. Contrary to popular belief, we do not have to resize the video to 960x540 as per the resolution of the phone, because it will play back up to 1080p. This video is fine at 1280x720. So unless you are concerned with the amount of space its going to take on your phone, leave the resize option alone. (*) Go to the filters tab. Under deinterlacing, choose 'progressive scan'. Reason for this: this example is animu. For some reason, it cannot detect interlacing in animu. If you have a film or another source, then you can click analyze and it will figure out what it needs to do with the file. Under filters, choose either a spline16 or a spline36 (because we aren't resizing) for the resize filter. If you are going to try to upscale, make sure you choose one of the soft resize filters. (*) Subtitles: choose your subtitle file. In this case, 'T3_Subtitle - 3 Subtitle (ASS).ass'.

To fix the framerate problem I had with this video, I changed the actual script manually. Under the script tab I changed a value. Avisynth script is a pain, but this made convert it properly.

FFVideoSource("C:\Users\Girgizzlemuf\Videos\TranscodeHOWTO\T1_Video - .mkv").AssumeFPS(24000,1001)

Reason I just changed the .assumefps is because the video is actually 23.976 fps, it was just tagged wrong when I extracted it. With this, we are done. Click Save and we can finally encode!

*If you resize the video to something smaller, make absolutely sure you choose the "resize mod16" option or things WILL break. Also, the only way to upscale properly is to add a soften filter and some grain to the video on the upscale. You can check google for some filters that will do that, and check with the megui nomenclature to get the filters working right. I don't recommend upscaling native 720p footage, but upscaling 480p or 576p footage tends to work OK.​

D. The Encode. (Video)

Now we get to the part that actually matters. After you click save from part C, go to the input tab. Choose 'x264: *scratchpad*' under Encoder settings and click 'config'. The x264 Config dialog will open. Click the checkbox next to 'Show Advanced Settings'. Under the AVC Profiles pulldown, choose 'Baseline Profile' or 'Main Profile'. Please note that if you enable main profile, you will need to go to the 'Frame-Type' tab, and DISABLE 'Weighted prediction for B-Frame', and change 'P-frame Weighted Prediction' to 'Disabled'. Under Tunings, choose the type of video that you are using (in my case, animation). AVC level we can leave at unrestricted/autoguess. If you want a bit more compressability you can change the level if you want. The lower the number, the less information is stored per frame. If you want to change the bitrate you can, i prefer a constant quality of between 18 and 21, (the bigger the number the smaller the file fyi). Any of the other tabs are up to your discretion on modification. You don't need to change the other values. If you want to save the preset, click 'New' down by the presets and name it so you can just load it later from the main window without changing any of the other settings. Click OK, make sure the file format is 'MP4', then click 'Enqueue' under the video encoding.​

E. The Encode (Audio)

Same drill as video. Choose the audio file, choose either 'Nero AAC: *scratchpad*' or 'FAAC: *scratchpad*', then click configure. It should also be noted that while FAAC is open source, you will get better results from NeroAAC. Both will give the same basic options. Under output channels, my personal preference leans toward 'Downmix multichannel to DolbyDigital Pro Logic II' for the simulated surround experience when plugged into a tv, and the samplerate at 48000hz for the best range of sound. As far as bitrate is concerned, VBR 100 will get you about cd quality sound. (NeroAAC give the option for a quality, Q=0.5 is a bit better than cd quality.) Again, you can save your profile as whatever so you don't have to click the options again, click ok and click enqueue on the audio dialog.​

* side note, my example i did not re-encode the audio, as the audio extracted was AAC. lucky me~ *

** side side note, you can close out of the video preview window at any time after the video has been put in the encode queue.​

F. Almost done...

In the main window, go to the Queue tab and click start at the bottom. After some magical mumbo jumbo, your files will be done. This will take a while depending on the specs on your encoding machine. After that is done, we need to make it into a file that has both the audio and the video. Under Tools > Muxer > MP4 Muxer we find just that. Choose your video, make sure the right framerate is selected (in my case, 23.976), choose your audio, and name your file at the end in the box named 'Muxed Output'. It will most likely try to name the file for you, you can change it to whatever you want as long as it ends in .mp4. Click Queue, go to the queue tab in the main window and click start one last time. Once that is done, you have a video that will play flawlessly in the stock media player on your phone.​

And that is it. Results may vary depending on the video used, and bitrates/quality will vary depending on your tastes. If the final product is more than 2gb, it will cause some weird issues on the phone. If that is the case, reduce the bitrate on the video and that should solve your problem. If you are using a constant quality, x264 Q=20 (depending on motion) will yield between 350~400mb/30 minutes so plan accordingly. I personally have made a 720p video that was about 2 hours long fit 1.4gb with x264 baseline Q=20 and audio through neroAAC@Q=0.5.

If you would like some screenshots illustrating the process, you can go here to find them.