vid2bb.sh: using mencoder to create videos
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 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. |
And one last sticky request please :)
|
man... I love Linux Philosophy
and thanks for the code rivviepop :D |
Quote:
|
Well, no doubt you are the man rivvie... Love the info on you're site... It ROCKS!
|
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. :) |
Quote:
Quote:
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. |
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. :)
|
Quote:
|
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.
|
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. |
Quote:
|
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. |
Sweet! AND Welcome to the forums!!!!!!
|
Quote:
- 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. |
My vids are ALL horrid! :razz:
@rivviepop don't you owe me a beer???? lol :) |
Quote:
rpm -qi mencoder gives Code:
Name : mencoder Relocations: (not relocatable) |
Looks OK to me but I will await rivviepop's response since he is far more advanced than me....
Quote:
|
Quote:
You had asked about what the right size is in PM -- well, the *specs* say an 8800 is supposed to be able to play 320x240 (which would be fullscreen) but I don't have one to test with over my way, so I am unsure. But the 240x180 version should probably play fine on your device, I would imagine it might have a black border on the left and right though? (you'll have to tell me) Regardless, let us know how these vids I converted work on your 8800... |
Quote:
All of the 4:3 videos play with black bars on the side since the display on the 8800 is apparently 16:9. I stick with my assertion that if 320 pixels is the width, then 180 must be the height. If this is correct, the proper 4:3 size is 240x180, and the player has to reduce the video size on the fly if it is in a higher resolution. A question on the win32 codecs: I copied the newest codecs into /usr/lib/win32. Some of the older codecs (with slightly different names) remain in the directory. Should I purge the directory and recopy the newest only? Thanks. |
All times are GMT -5. The time now is 09:00 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.