• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Guide: How to convert videos with Handbrake

Usta

Android Expert
Jul 8, 2010
2,582
1,379
The Netherlands
Thanks to a number of universal video players in Market, playing videos with different formats on Android devices is no longer a problem.
However, there are a number of occasions where you want to convert them.

For example:
* when the videos are on a DVD (or ripped to PC)
* when you have a complex video which your phone cannot play (like 1080p full HD videos)
* when you want to have a video that is natively supported by Android OS.

Handbrake is a very suitable software to use for such conversions. It is an open-source, GPL-licensed, multiplatform, multithreaded video transcoder, available for MacOS X, Linux and Windows. It is suitable both for the beginners and advanced users, and can produce excellent results. For this reason, I'm making this guide for everyone, with screenshots (who doesn't like screenshots? :)).


Step 1) Download Handbrake from here: HandBrake
Install and run.

Step 2) Click "Source" and select the video file you want to convert. I'll select the Full HD 1080p trailer from Thor movie (source: Youtube).
Set the Destination path and output file name. Select MP4 as the file extension/container. Now select "Universal" from the right side Presets section.
In Picture tab set the resolution so that the lower number equals to that of the lower number of your phone's screen resolution. For example, my phone has 800x480 screen resolution, so here I make sure that the display size says "1129x480". Note: you can only change the larger number, the smaller one just follows.
capture1kt.jpg


Step 3) In Video tab, set Video codec to "H.264(x264)", Framerate to "Same as Source", Avg Bitrate to "1000". Optional - you can also select "2 Pass encoding" for a bit better quality, but it takes the conversion process too long.
A note here: I selected Avg Bitrage mode, because it is more suitable for all source videos. The experienced users can select "Constant quality" mode to get a better bitrate allocation across video frames, aka get better quality for smaller file size.
capture2x.jpg


Step 4) In Audio tab, select the necessary settings as in picture and remove any extra tracks.
capture3n.jpg


Step 5) If you want to add subtitles, then add them here. If you do, then check "Burned In" box so that you don't have issues with most of the players.
capture5i.jpg


Step 6) Go to "Advanced" tab and make sure that the settings are like this - Don't change anything there!
Press the "Start" button and wait for the program to finish the job.
capture4gy.jpg


Note: One time action - you can add these settings and create your phone preset just before the conversion on step 6. Press "Add" button under the Presets, type a name, and "Set Default". Next time, when you load a new file, just use this new preset and all your settings should be restored.


Good luck! :)
 
Step 6) Go to "Advanced" tab and make sure that the settings are like this - Don't change anything there!
How important are the exact settings in the "Advanced" tab?

I've ripped videos to put on my Dinc2 using 2 or 3 of the different HB presets, including "iPhone4", "Normal", and a modified "Universal"; all have various different settings selected in the "Advanced" tab, particularly when it comes to B frames, motion interpolation method, and the 3 checkboxes for CABAC, 8x8 transform, and Weighted P frames.

All of the movies play, all look about the same on a 4" 800x480 screen, and all are about the same size. The encode time varies somewhat, but other than that I'm having a hard time telling what all these options change.

Can anyone explain, or point me to a guide that explains?
 
  • Like
Reactions: kerwar
Upvote 0
The "Universal" preset keeps the encoded video at H264 Baseline profile.
The moment you start to change Advanced settings, like for example selecting CABAC, then you are changing the encoding profile to H264 Main/High/other.
While these other profiles provide more fine tuning and compression, they are also increasing the chances of incompatibility of video playback on Android phones.
Sure, the modern dual-cores can handle videos at H264 Main Profile, but most of the single cores will fail to play them.
 
  • Like
Reactions: kerwar
Upvote 0
Thanks for the instructions. I've been using HandBrake with the iPhone 4 profile to convert video for my Galaxy S but it's hit and miss. Sometimes it works and sometimes it doesn't. This particular video I tried to convert with the iPhone 4 profile and decreased the picture height to 480 and limit the size to 1GB, my Vibrant can't play. The iPhone 4 plays just fine and the quality quite good. I than follow you instructions, using Universal profile and Avg Bitrate 1000. The file is more than twice as big as the one using iPhone 4 profile. This time my Vibrant can play. Even though the file size on the Universal profile is more than twice as the iPhone 4 profile, the quality of the iPhone 4 profile is much better. I can tell by playing both file from my computer. You explain on the setting in the Advanced tab... so you much compression and that's the reason the Vibrant can't play. I think the Vibrant and the iPhone 4 have pretty much hardware. So, why is iPhone 4 can play the file but not the Vibrant. Is iOS better then Anroid then?
 
Upvote 0
Step 5) If you want to add subtitles, then add them here. If you do, then check "Burned In" box so that you don't have issues with most of the players.
capture5i.jpg

I'd like to clarify that handbrake lets you hardcode (burn-in) external files in .srt format only. If you want to hardcode subtitles in the idx/sub format, you first have to embed them in the same mkv as the video using mkvmerge (it's quick); you cannot hardcode idx/sub subtitles stored as external files, at least with the current version.
This is the solution I use to play videos with DicePlayer on my Android.

If you only have an avi (not mkv) with idx/sub subtitles, you can also use virtualdub with the vobsub plugin to hardcode the subtitles.

Hope this is useful.
 
  • Like
Reactions: kerwar
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones