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.

ANALOG EMICO PANEL METER DC AMMETER 0 - 100 AMPS (QTY 1) picture

ANALOG EMICO PANEL METER DC AMMETER 0 - 100 AMPS (QTY 1)

$12.99



Vintage Promotional Never Miss Spark Plug Ammeter Amperes Meter picture

Vintage Promotional Never Miss Spark Plug Ammeter Amperes Meter

$29.99



Vtg Antique Early 1900s Hoyt Battery Cell Voltage Ammeter SteamPunk Tester  picture

Vtg Antique Early 1900s Hoyt Battery Cell Voltage Ammeter SteamPunk Tester

$14.95



Digital Multimeter Voltmeter XL830L AC DC Ammeter Ohmmeter Volt Meter Tester Ohm picture

Digital Multimeter Voltmeter XL830L AC DC Ammeter Ohmmeter Volt Meter Tester Ohm

$6.55



Early vintage ammeter made by Cenco Central Scientific Co. picture

Early vintage ammeter made by Cenco Central Scientific Co.

$204.00



AMMETER FARIA CORP -50 / +50 4010-5-7A 3W51623 NSN: 6625-00-979-6396 picture

AMMETER FARIA CORP -50 / +50 4010-5-7A 3W51623 NSN: 6625-00-979-6396

$14.95



WWII U.S. NAVY MARINES TBX-8 TYPE CAY-22130-A  *OGP UNUSED*  AMMETER REPLACEMENT picture

WWII U.S. NAVY MARINES TBX-8 TYPE CAY-22130-A *OGP UNUSED* AMMETER REPLACEMENT

$39.00



GENUINE Allis Chalmers Ammeter Gauge B C CA RC WC WF WD WD45 70275840 70275840V picture

GENUINE Allis Chalmers Ammeter Gauge B C CA RC WC WF WD WD45 70275840 70275840V

$42.50



Vintage Roller-Smith Vintage Brass Ammeter. Wood and brass picture

Vintage Roller-Smith Vintage Brass Ammeter. Wood and brass

$125.00



TRIPLETT MODEL 221-T, 0-15 DCMA VOLT AMMETER, 2-3/4

TRIPLETT MODEL 221-T, 0-15 DCMA VOLT AMMETER, 2-3/4" ROUND (NEW)

$59.99