Startseite > android, informatik, livehacking > Batch transcoding with HandBrakeCLI for my Android phone

Batch transcoding with HandBrakeCLI for my Android phone

I own a smartphone and a bus ticket. This mean I often watch videos on my Desire Z when catching a ride to town. I often have videos which will not work on my Android phone, such as these in .wmv format or even DVDs. For these videos, I use handbrake with a custom preset by user LiveWire from the android-hilfe.de forum. Since my phone has a 480×800 screen, I just use that and it works great.

The problem here is that Hand BrakeCLI uses hardcoded presets, so we need to use its command line switches to accomplish a similar thing. Starting from the built-in presets, the „Universal“ profile seems to be a close enough fit, having a width of 720 pixels. To save more space, I’m adjusting the quality setting from 20 to 22.

+ Universal:  -e x264  -q 20.0 -a 1,1
-E faac,copy:ac3 -B 160,160 -6 dpl2,auto
-R Auto,Auto -D 0.0,0.0 -f mp4
-X 720 --loose-anamorphic -m 
-x cabac=0:ref=2:me=umh:bframes=0:weightp=0:8x8dct=0:trellis=0:subme=6

Another nice option might be the „Normal“ profile, which apparently just uses the resolution of the source video.

+ Normal:  -e x264  -q 20.0 -a 1
-E faac -B 160 -6 dpl2
 -R Auto -D 0.0 -f mp4 --strict-anamorphic -m
-x ref=2:bframes=2:subme=6:mixed-refs=0:weightb=0:8x8dct=0:trellis=0

I’m not sure about the advanced options for the x264 encoder (the -x flag), but I’ll just assume these don’t hurt. Another thing are the switches for anamorphic mode – I’m too lazy to read up on this. I should also note that I’m not going for perfect HD-like quality here. The videos I’m transcoding are mostly educational videos from sites like YouTube, so I just want something that works with reasonable quality without taking too much space.

For the record, my current command line for batch transcoding videos looks like this:

for wmv in *.wmv;
  do HandBrakeCLI -Z "Universal" -q 22 -i "$wmv" -o "m4v/`basename "$wmv" .wmv`.m4v";
done

This article will be updated as I uncover additional magic. If you don’t feel like messing with transcoding, you can just use RockPlayer from the Android market or the MPlayer build floating around on XDA to drain your battery with software decoding.

Advertisements
  1. Es gibt noch keine Kommentare.
  1. No trackbacks yet.

Kommentar verfassen

Trage deine Daten unten ein oder klicke ein Icon um dich einzuloggen:

WordPress.com-Logo

Du kommentierst mit Deinem WordPress.com-Konto. Abmelden / Ändern )

Twitter-Bild

Du kommentierst mit Deinem Twitter-Konto. Abmelden / Ändern )

Facebook-Foto

Du kommentierst mit Deinem Facebook-Konto. Abmelden / Ändern )

Google+ Foto

Du kommentierst mit Deinem Google+-Konto. Abmelden / Ändern )

Verbinde mit %s

%d Bloggern gefällt das: