How to Encode Video

Many thanks to the author of this script, rivviepop @ BlackBerry Forums

This is a little script I wrote based on the parameters.

–SNIP–

Getting the right params to mencoder to produce top quality video is always a chore, but using method 1 in the original post is working wonderfully for me — I’ve converted all sorts of stuff (WMV/AVI/MPG/FLV/MOV) and so far only the FLV conversions have audio sync problems (nothing new). I’m even going to say that the videos look better (and run smoother!) on my Pearl than any S60 device I’ve used.

Stupid Bash Trick time — here’s a helper script, save it as “vid2bb.sh” somewhere in your $PATH on Linux/OSX. Make it executable then run with a simple “vid2bb.sh <FILE>” command, the output will be in the input directory.

 #!/bin/bash
 
 FILE=$1
 
 ## 8100, 240x260 res
 ## uncomment one of the below depending on your input format
 #RES=240:135             # resolution, 16:9 ratio
 RES=240:180             # resolution, 4:3 ratio
 
 ## 8800, 320x240 res
 ## uncomment one of the below depending on your input format
 #RES=320:180             # resolution, 16:9 ratio
 #RES=240:180             # resolution, 4:3 ratio
 
 ## generic
 ABR=64                  # audio bitrate
 VBR=230                 # video bitrate
 
 mencoder "$FILE" \
         -o "${FILE%.*}_bb.avi" \
         -of avi \
         -ovc lavc \
         -oac lavc \
         -lavcopts vcodec=mpeg4:vbitrate=$VBR:acodec=mp3:abitrate=$ABR \
         -vf scale=$RES
 
 

Note that the above takes the input filename, chops off the extension and adds a “_bb.avi” to the end of the output file to help you know which files are your BB ready ones. A quick sort, drag&drop and they’re on your device.

My setup is Fedora Core 6 with the FreshRPMS mplayer builds installed (which grabs all the latest libavcodec and so on), as well as the Essential codecs pack (from the MPlayer website) unxipped to /usr/lib/win32/ — these codecs always seem to produce better quality.

Rockville Krypton-M5 8000 Watt Peak / 2000w RMS Mono 1 Ohm Car Amplifier Amp picture

Rockville Krypton-M5 8000 Watt Peak / 2000w RMS Mono 1 Ohm Car Amplifier Amp

$1588.98



Bottlehead Crack with Speedball 1.1 Amplifier picture

Bottlehead Crack with Speedball 1.1 Amplifier

$750.00



1976 Motorola CM-1680N UHF Power Amplifier Cool Power Print Ad picture

1976 Motorola CM-1680N UHF Power Amplifier Cool Power Print Ad

$19.49



Germanium Diode Crystal Radio Receiver Assembled with Earphone and V2 Amplifier picture

Germanium Diode Crystal Radio Receiver Assembled with Earphone and V2 Amplifier

$45.00



NEW AVON M50/C50 GAS MASK AUDIO AMPLIFIER VPU(Voice Projection Unit) SPEAKER New picture

NEW AVON M50/C50 GAS MASK AUDIO AMPLIFIER VPU(Voice Projection Unit) SPEAKER New

$50.00



VoiceBooster MR1506 (Aker) 10watt Voice Amplifier picture

VoiceBooster MR1506 (Aker) 10watt Voice Amplifier

$65.00



VINTAGE MASCO MONO TUBE AMPLIFIER AM-20B TIQ-2  w/POWER CORD - U.S. ARMY 1951 picture

VINTAGE MASCO MONO TUBE AMPLIFIER AM-20B TIQ-2 w/POWER CORD - U.S. ARMY 1951

$849.00



1937 Wurlitzer Models 312 / 412 / 35 Tube Audio Amplifier # 45 Tube Type picture

1937 Wurlitzer Models 312 / 412 / 35 Tube Audio Amplifier # 45 Tube Type

$275.00



Rowe 125 Watts Stereo Amplifier P/N 6-07438-02 Untested picture

Rowe 125 Watts Stereo Amplifier P/N 6-07438-02 Untested

$105.00



Avon 71009/2 Audio Amplifier for M50  Respirator Gas Mask picture

Avon 71009/2 Audio Amplifier for M50 Respirator Gas Mask

$84.95