BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 03-27-2008, 08:34 AM   #1
patros
New Member
 
Join Date: Mar 2008
Model: 8310
PIN: N/A
Carrier: Vodafone
Posts: 2
Default Converting videos for your BlackBerry on Linux

Please Login to Remove!

It took me a while to get this right so I thought I would share it. This is a bash script using ffmpeg to encode video so it will play on your BlackBerry (I am using an 8310 although small modifications like resolution should make it play on others).

Code:
#!/bin/bash
mkdir BBV
ls -1 |
while read FILENAME; do
    ffmpeg -i "${FILENAME}" -vcodec xvid -s 320x240 -qscale 10 -ab 48k -ar 22050 -ac 1 -acodec mp3 "./BBV/${FILENAME}" &
done
For those who aren't very good with command line stuff run this script from the folder with your avi files in it. It will create a sub-directory "BBV" which will contain the BlackBerry version of the videos. It will run all the encoding at the same time in parallel. If you want it to encode just one file at a time (a good idea if you are trying to encode a lot of videos) remove the "&" from the end of the ffmpeg line.

You can also achieve better video quality or smaller file sizes by adjusting the number after qscale. 1 for best and I think it is 30/31 for worst quality (smallest file sizes but really bad quality). I played with the -qscale setting a bit and found that 10 was a pretty good balance between quality and size. For 45 minutes of video the files ended up being about 60-75mb. The reason for the size change is that the qscale setting adjusts the bitrate throughout the video to achieve the same quality as opposed to using a constant bitrate throughout the video.

To save space (and also mean two people can share a pair of headphones at the same time without missing anything) it converts the audio to 1 channel (-ac 1). If the audio is too tinny for you you can play with the -ab and -ar parameters. Although I found some values would cause the audio to get out of sync with the video.

Last edited by patros; 03-27-2008 at 08:42 AM..
Offline  
Old 03-30-2008, 07:30 PM   #2
funkym
CrackBerry Addict
 
Join Date: Oct 2005
Model: 8320
Carrier: HK CSL
Posts: 505
Default

Thanks a lot. Nice script!
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


EEPROM BIOS USB Programmer CH341A + SOIC8 Clip + 1.8V Adapter + SOIC8 Ad Hot picture

EEPROM BIOS USB Programmer CH341A + SOIC8 Clip + 1.8V Adapter + SOIC8 Ad Hot

$16.39



CH341A SOIC Clip Socket 1.8V 3.3V USB EEPROM Flash BIOS Repair Programmer picture

CH341A SOIC Clip Socket 1.8V 3.3V USB EEPROM Flash BIOS Repair Programmer

$16.88



Universal Programmer picture

Universal Programmer

$107.99



(1 Piece) Authentic Atmel AT28C64B 64K  (8K x 8) EEPROM 28 Pin DIP New picture

(1 Piece) Authentic Atmel AT28C64B 64K (8K x 8) EEPROM 28 Pin DIP New

$10.95



CH341A EEPROM Flash BIOS USB Programmer Kit with SOP8 Clip picture

CH341A EEPROM Flash BIOS USB Programmer Kit with SOP8 Clip

$12.21



USB Programmer CH341A 24 25 Series Flash EEPROM BIOS Repair Tool picture

USB Programmer CH341A 24 25 Series Flash EEPROM BIOS Repair Tool

$12.88







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.