|
 |
|
|
BlackBerry Extraordinaire
Posts: 2,031
Join Date: Dec 2006
Location: san francisco
Model: 8320
PIN: n/a
Carrier: t-mobile
|
vid2bb.sh: using mencoder to create videos -
02-19-2007, 12:51 PM
Originally posted in the 8100 forum in the encoding thread; this is a little script I wrote based on the parameters they've worked out. It's worked great for me.
== 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.
Code:
#!/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.
[ Linux & BlackBerry ] To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Last edited by rivviepop : 03-30-2007 at 11:22 PM.
|
|
|
|
|
BBFAQ Sysop
Posts: 8,149
Join Date: Jan 2005
Location: Prison
Model: 850
OS: 0.0.00001
PIN: How do I find mine?
Carrier: Post Office
|

02-23-2007, 05:33 PM
And one last sticky request please 
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
*Your village called and they want their idiot back!*
|
|
|
|
|
Thumbs Must Hurt
Posts: 70
Join Date: Dec 2006
Location: Cd. Juárez, Chihuahua, México
Model: 8100
PIN: 2053A30B
Carrier: Telcel
|

02-25-2007, 10:07 AM
man... I love Linux Philosophy
and thanks for the code rivviepop :D
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Blackberry 8100
|
|
|
|
|
BlackBerry Extraordinaire
Posts: 2,031
Join Date: Dec 2006
Location: san francisco
Model: 8320
PIN: n/a
Carrier: t-mobile
|

02-25-2007, 02:56 PM
Quote:
|
Originally Posted by indramilo
and thanks for the code rivviepop :D
|
my pleasure!  I'll tell you a little secret - I own [ bash-fu ] My professional life over the years as a systems engineer has given me ample opportunity to become one with the bourne. I thank my workplace and boss (who rocks) for allowing me to get nerdy on company time.
[ Linux & BlackBerry ] To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|
|
|
|
BBFAQ Sysop
Posts: 8,149
Join Date: Jan 2005
Location: Prison
Model: 850
OS: 0.0.00001
PIN: How do I find mine?
Carrier: Post Office
|

02-28-2007, 08:48 PM
Well, no doubt you are the man rivvie... Love the info on you're site... It ROCKS!
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
*Your village called and they want their idiot back!*
|
|
|
|
|
Knows Where the Search Button Is
Posts: 42
Join Date: Feb 2007
Location: Texas
Model: 8100
Carrier: T-Mobile
|

03-02-2007, 09:05 AM
Yes, I have used this scriptlet many times. Here's a problem though... and I hope it can be addressed quickly (as in today) because I'll be flying to Japan tomorrow and will be there for two weeks. I'd like to watch a couple of full-length movies on my BB8100!
Here's the problem. I encoded two movies down to BB size but these are formatted for wide-screen display. What do I need to change to make it look right on my BB display? Right now, they come out squished up horizontally.
Okay... right now, I'm re-coding it... don't have the original files available to me at the moment... hope the quality stays good. I set the target aspect ratio to be wider... I have no idea how the BB will play it though...
Okay, I recoded two movies. I just set the RES from 240:180 to 240:120 and it looks much better now... no notable decrease in size and so no decrease in quality is expected.... looks pretty good so far. I can still read the subtitles so I'm good. 
Device: Blackberry 8100 v4.2.0.64
Carrier: T-Mobile USA
BES: 4.1.0.38
Desktop OS: Fedora 7 Linux, Windows XP (vmware)
Last edited by erroneus : 03-02-2007 at 01:06 PM.
|
|
|
|
|
BlackBerry Extraordinaire
Posts: 2,031
Join Date: Dec 2006
Location: san francisco
Model: 8320
PIN: n/a
Carrier: t-mobile
|

03-02-2007, 12:26 PM
Quote:
|
Originally Posted by erroneus
because I'll be flying to Japan tomorrow
|
*jealous* Can I come? I'm super harajuku friendly.
Quote:
|
Here's the problem. I encoded two movies down to BB size but these are formatted for wide-screen display. What do I need to change to make it look right on my BB display? Right now, they come out squished up horizontally.
|
Ugh, never a fun problem; this is the dreaded 16:9 <=> 4:3 conversion problem (if I read/understand your post correctly). Help me out here -- are you saying the original movie is in 4:3 format and it's coming out 16:9, or the other way around? No, wait... ok this line:
RES=240:180
...is a 4:3 ratio. So, it sounds like you have a 16:9 movie -- what you want to do is adjust that ratio set to be 16:9, so maybe:
RES=240:135
...which is a 16:9 ratio exactly (well, exact as my little TI calculator can do  ). I bet that'll get rid of your squishedness.
[ Linux & BlackBerry ] To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|
|
|
|
Knows Where the Search Button Is
Posts: 42
Join Date: Feb 2007
Location: Texas
Model: 8100
Carrier: T-Mobile
|

03-02-2007, 01:07 PM
Yeah, I decided to actually read the script and the answer seemed obvious. I didn't use a calculator like you did, so I didn't come up with a figure as exact. The proportions look good enough though. 
Device: Blackberry 8100 v4.2.0.64
Carrier: T-Mobile USA
BES: 4.1.0.38
Desktop OS: Fedora 7 Linux, Windows XP (vmware)
|
|
|
|
|
BlackBerry Extraordinaire
Posts: 2,031
Join Date: Dec 2006
Location: san francisco
Model: 8320
PIN: n/a
Carrier: t-mobile
|

03-02-2007, 02:26 PM
Quote:
|
Originally Posted by erroneus
Yeah, I decided to actually read the script and the answer seemed obvious. I didn't use a calculator like you did, so I didn't come up with a figure as exact. The proportions look good enough though. 
|
Cool cool, I just updated the scriptlet to clarify that, so maybe it'll help the next person who comes along. 
[ Linux & BlackBerry ] To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|
|
|
|
BlackBerry Extraordinaire
Posts: 2,031
Join Date: Dec 2006
Location: san francisco
Model: 8320
PIN: n/a
Carrier: t-mobile
|

03-03-2007, 01:33 PM
I just added hopefully the correct res sizes for the 8800 (320x240) devices, I'm about to go troll the 8800 forum for a guinea pig. If you have an 8800 try it out and report back.
[ Linux & BlackBerry ] To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|
|
|
|
Knows Where the Search Button Is
Posts: 42
Join Date: Feb 2007
Location: Texas
Model: 8100
Carrier: T-Mobile
|

03-04-2007, 03:37 PM
I wonder if there's a way to add a command-line or two to determine the aspect ratio of the source video and simply either make a selection of aspect ratios or calculate the new, scaled down size for the target video file?
Well, I'm in Japan now and watching videos on the phone during the flight was pretty cool! Here's some tips! Disable the radio and bluetooth for impressive battery life. They want you to turn those things off during flight anyway, but there's a pretty good reason to comply right there. On the flight back, I'm going to re-code as many episodes of "Scrubs" as I can to fit on my 1GB mem card. (I wanted to get a 2GB card, but the price point wasn't attractive enough... the ratios are out of whack but then again, I saw a deal online recently where a 1GB card was like $15 or something like that...ridiculously cheap while 2GB remains at about $50....)
Yes, the 8800 being released within a day or two after I bought my 8100 gave me reason to pause. But then again, I might have gone with the 8100 anyway. The size is perfect. Going bigger doesn't appeal to me much at all.
Device: Blackberry 8100 v4.2.0.64
Carrier: T-Mobile USA
BES: 4.1.0.38
Desktop OS: Fedora 7 Linux, Windows XP (vmware)
|
|
|
|
|
BlackBerry Extraordinaire
Posts: 2,031
Join Date: Dec 2006
Location: san francisco
Model: 8320
PIN: n/a
Carrier: t-mobile
|

03-04-2007, 07:31 PM
Quote:
|
Originally Posted by erroneus
I wonder if there's a way to add a command-line or two to determine the aspect ratio of the source video and simply either make a selection of aspect ratios or calculate the new, scaled down size for the target video file?
|
Yeah, it's on my list of things to do.  If nothing else I want a commandline switch to choose a res, but it just hasn't been the highest priority item on my list of stuff. Maybe some day...but not today.
[ Linux & BlackBerry ] To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|
|
|
|
New Member
Posts: 5
Join Date: Mar 2007
Location: Katy, TX
Model: 8800
Carrier: Cingular
|

03-25-2007, 06:59 PM
I'm an 8800 user and will be happy to help with getting this script to work for me. I've been a Linux user for six years and am presently using Fedora Core 6 and Ubuntu 6.10. My BlackBerry is generally used with my company laptop, which has Windows XP.
When I've tried the script, I've had the video only show a couple of frames. I've tried with multiple mp4 formats as the source. All videos were rendered using Kino from personal DV files.
|
|
|
|
|
BBFAQ Sysop
Posts: 8,149
Join Date: Jan 2005
Location: Prison
Model: 850
OS: 0.0.00001
PIN: How do I find mine?
Carrier: Post Office
|

03-25-2007, 07:01 PM
Sweet! AND Welcome to the forums!!!!!!
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
*Your village called and they want their idiot back!*
|
|
|
|
|
BlackBerry Extraordinaire
Posts: 2,031
Join Date: Dec 2006
Location: san francisco
Model: 8320
PIN: n/a
Carrier: t-mobile
|

03-25-2007, 07:14 PM
Quote:
|
Originally Posted by tuxi
When I've tried the script, I've had the video only show a couple of frames. I've tried with multiple mp4 formats as the source. All videos were rendered using Kino from personal DV files.
|
This smells like poor encoding/decoding libs (I can't say for sure, but it's the first thing that comes to mind based on experience). Do you:
- have a newer mplayer installed from FreshRPMS? (or maybe RF or ATrpms)
linky: http://zod.freshrpms.net/rpm.html?id=888
- have the "win32" DLL files unzipped to /usr/lib/win32/ on your machine?
linky: http://www.mplayerhq.hu/design7/dload.html
direct x86 snag: http://www3.mplayerhq.hu/MPlayer/rel...061022.tar.bz2
As we all know, video encoding/decoding w/linux can be sort of hit or miss depending on your source; on my laptop I have the above two in place which does't produce any bad videos (most of the time, of course there are exceptions) and actually they're quite good.
Feel free to upload a smaller mp4 (if legal) that's giving you trouble and I'll give it a whirl, see what happens on my end.
[ Linux & BlackBerry ] To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
|
|
|
|
|
BBFAQ Sysop
Posts: 8,149
Join Date: Jan 2005
Location: Prison
Model: 850
OS: 0.0.00001
PIN: How do I find mine?
Carrier: Post Office
|

03-25-2007, 07:16 PM
My vids are ALL horrid!
@rivviepop don't you owe me a beer???? lol 
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
*Your village called and they want their idiot back!*
|
|
|
|
|
New Member
Posts: 5
Join Date: Mar 2007
Location: Katy, TX
Model: 8800
Carrier: Cingular
|

03-26-2007, 09:51 PM
Quote:
|
Originally Posted by rivviepop
This smells like poor encoding/decoding libs (I can't say for sure, but it's the first thing that comes to mind based on experience). Do you:
- have a newer mplayer installed from FreshRPMS? (or maybe RF or ATrpms)
- have the "win32" DLL files unzipped to /usr/lib/win32/ on your machine?
linky:
direct x86 snag:
|
I checked to see if my machine was setup as you describe before I ran the script.
rpm -qi mencoder gives
Code:
Name : mencoder Relocations: (not relocatable)
Version : 1.0 Vendor: Freshrpms.net
Release : 0.34.rc1try2.fc6 Build Date: Tue 09 Jan 2007 04:22:36 AM CST
Install Date: Sat 10 Feb 2007 07:50:47 AM CST Build Host: python3.freshrpms.net
Group : Applications/Multimedia Source RPM: mplayer-1.0-0.34.rc1try2.fc6.src.rpm
Size : 7362484 License: GPL
Signature : DSA/SHA1, Tue 09 Jan 2007 04:23:30 AM CST, Key ID 692ac459e42d547b
Packager : Matthias Saou <matthias@rpmforge.net>
URL : --
Summary : MPlayer’s Movie Encoder
Description :
MPlayer’s Movie Encoder is a simple movie encoder, designed to encode
MPlayer-playable movies to other MPlayer-playable formats. It encodes to
MPEG-4 (DivX/XviD), one of the libavcodec codecs and PCM/MP3/VBRMP3 audio
in 1, 2 or 3 passes. Furthermore it has stream copying abilities, a
powerful filter system (crop, expand, flip, postprocess, rotate, scale,
noise, rgb/yuv conversion) and more.
I'll PM you with a URL to pick up the example video.
Tuxi
BlackBerry 8800
Cingular Wireless
BES (version unknown)
Windows XP, kubuntu 7.10
|
|
|
|
|
BBFAQ Sysop
Posts: 8,149
Join Date: Jan 2005
Location: Prison
Model: 850
OS: 0.0.00001
PIN: How do I find mine?
Carrier: Post Office
|

03-26-2007, 10:26 PM
Looks OK to me but I will await rivviepop's response since he is far more advanced than me....
Quote:
|
Originally Posted by tuxi
I checked to see if my machine was setup as you describe before I ran the script.
rpm -qi mencoder gives
Code:
Name : mencoder Relocations: (not relocatable)
Version : 1.0 Vendor: Freshrpms.net
Release : 0.34.rc1try2.fc6 Build Date: Tue 09 Jan 2007 04:22:36 AM CST
Install Date: Sat 10 Feb 2007 07:50:47 AM CST Build Host: python3.freshrpms.net
Group : Applications/Multimedia Source RPM: mplayer-1.0-0.34.rc1try2.fc6.src.rpm
Size : 7362484 License: GPL
Signature : DSA/SHA1, Tue 09 Jan 2007 04:23:30 AM CST, Key ID 692ac459e42d547b
Packager : Matthias Saou <matthias@rpmforge.net>
URL : --
Summary : MPlayer’s Movie Encoder
Description :
MPlayer’s Movie Encoder is a simple movie encoder, designed to encode
MPlayer-playable movies to other MPlayer-playable formats. It encodes to
MPEG-4 (DivX/XviD), one of the libavcodec codecs and PCM/MP3/VBRMP3 audio
in 1, 2 or 3 passes. Furthermore it has stream copying abilities, a
powerful filter system (crop, expand, flip, postprocess, rotate, scale,
noise, rgb/yuv conversion) and more.
I'll PM you with a URL to pick up the example video.
|
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
*Your village called and they want their idiot back!*
|
|
|
|
|
BlackBerry Extraordinaire
Posts: 2,031
Join Date: Dec 2006
Location: san francisco
Model: 8320
PIN: n/a
Carrier: t-mobile
|

03-26-2007, 10:32 PM
| | |