PDA

View Full Version : New Updated Video Encoder for G1



KungFuNunChuck
11-03-2008, 03:10 PM
Thanks to dLirious and teckel on TmoNews for putting together the best video encoding instructions for the current G1 video player. This fixes the stretching on some media when viewed on the player.

Original thread is on http://forums.tmonews.com.s52300.gridserver.com/index.php?topic=3261.0


This doesn't just give instructions on how to make a video, but how to do it with high quality, so the movie is the correct aspect ratio, and movies filmed in Panavision and other higher aspect ratios are always shown in normal 16x9 widescreen. Also, this is for DVD rips from widescreen sources (everything I have is widescreen). If you're doing TV shows or something else at 4:3 this won't work (I can give those instructions as well if there's demand for it).

http://www.erightsoft.net/SUPER.html#Dnload (http://www.erightsoft.net/SUPER.html#Dnload)

Click "Start Downloading SUPER" towards the bottom of the page, then "download and use" towards the top, and finally "Download SUPER © setup file" towards the bottom. (the site requires this for ad views or something, but it is free so it's worth the hassle).

SUPER © 16:9 Widescreen Setup:
Codecs: MP4 - H.264 - AAC LC
Video: 480:270 - 3:2 - 23.976 - 480kbps(yes, you set the video to 480x270)
Audio: 441002 - 96kbps - Default
Options: Hi Quality:OFF - Top Quality:OFF - Pad:Top:24 Bottom:26 Left:0 Right:0 - Crop:Top:0 Bottom:0 Left:Calc Right:Calc
While everything else stays the same from movie to movie, the Calc options above need to be calculated depending on the resolution of the video source. I'll quickly give the calculation and then give an example. The calculation is ( Width - ( Height * 16 / 9 ) ) / 2. Width and Height are of the source video and the result would be what you would select for the left and right crop.

Here's a couple examples from my DVD rips:

* 886x480 source video: ( 886 - ( 480 * 16 / 9 ) ) / 2 = 16 (set the left and right crop to 16)
* 1128x480 source video: ( 1128 - ( 480 * 16 / 9 ) ) / 2 = 137 (set the left crop to 136 and the right crop to 138)
* 852x480 source video: ( 852 - ( 480 * 16 / 9 ) ) / 2 = -0.7 (this movie is already 16x9 so you can turn Crop OFF)


That's it! Perfect aspect ratio, no stretching, and very high quality. Oh, and I would suggest that when you playback a movie TURN ON AIRPLANE MODE! (Home, Menu, Settings, Wireless controls, Airplane mode). The phone searching for GSM, Edge, 3G, Bluetooth, Wi-Fi, GPS, and apps trying to use connections will cause your video to slow down, pause, or even fail. As a bonus, it will also greatly extend video viewing time.

Here's a simple Excel form that I've created to calculate the crop values. Feel free to download and use: Simple Movie Ratio Calculator (http://www.fileden.com/files/2008/10/30/2166567/Movie%20Ratio%20Calculator.xls)


Other information:
For high quality, I went with 480kbps video and 96kbps audio. When doing samples, I tested many bit rates and found 480/96kbps to be the perfect balance between quality and file size. A 90 minute movie will be about 380MB using these settings, this allows me to have about 8-9 movies on a 4GB card, plenty for me. You can sacrifice quality for a smaller file size by using 336kbps video and 64kbps audio which will result in the same 90 minute movie being about 265MB.

23.976 frames per second is what all DVD's of movies are filmed at as movies are all shot at 24 frames per second. Using 25 frames per second or 29.97 or 30 will just LOWER the quality because the converter will have to create averaged frames or duplicate previous frames to generate more frames than the source video has. If the source movies you're converting from are not 23.976 already, whoever ripped it did so incorrectly. In the future, make sure you always rip movies from DVD at 23.976.

You should always use the 3:2 aspect ratio in SUPER © as that's what the G1 format is. If you don't select 3:2, if you preview the movie on your computer it will look different than on your G1 because it will stretch it on your computer. Basically, keeping it always at 3:2 no matter what the source will allow you to preview videos on your computer and they will look the same on your G1 as well.


Saving File:

Right click in the box directly under the purple €œOUTPUT€ section to reveal the menu for Super ©. Here you will select the default area to save your file by selecting €œOutput File Saving Management.€ And you will also find the function to add your media files here as well €œAdd Multimedia Files€ or Ctrl+A.

Once you have added the file just click on the €œEncode (Active Files)€ button and voila!!! You will have your newly converted video files for your G1. Hope this was useful and if you have any questions please feel free to PM me or post your questions. I do have the direct link for the Super © program so if you are having trouble finding it just PM me and I€™ll gladly send it to you. ENJOY!!!!

EDIT: Once you have loaded the video you intend to encode you can double click on the file to find out its' original settings such as frame rate and such so you can choose it from the list. This might help with the quality of the video.

NOTE: You can download the Video Player 1.0 in the android market to play these files.

Here's a screen shot for the lazy folks (jk):
http://i478.photobucket.com/albums/rr144/neel469/Super-CNEW3.jpg

SUPER © 4:3 Non-Widescreen Setup:
Codecs: MP4 - H.264 - AAC LC
Video: 432:320 - 3:2 - 29.97 or 23.976 - 480kbps (yes, you manually set the video to 432x320)
Audio: 441002 - 96kbps - Default
Options: Hi Quality:OFF - Top Quality:OFF - Pad:Top:0 Bottom:0 Left:24Right:24 - Crop:Crop:OFF
The Green settings are the ones you change for 4:3 video. There's no calculation because the source is a fixed 4:3 aspect ratio. Also, you would choose 29.97 or 23.976 depending on what the source was. Movies are always 23.976 and TV is always 29.97. You could also look at the source video FPS and just match it. If everything was ripped correctly, it would only ever be 29.97 or 23.976. But, I'm sure people rip things incorrectly so you may see 30fps, 25fps, 24fps, or others. I guess it may just be best to always look at the FPS of the source video you're converting and just match it as it would be better to not degrade something further that was already degraded because the wrong frame rate was used. But, going forward make sure you only ever rip movies and video at either 29.97 or 23.976 as that's what all TV, DVD's, and Blu-ray's are recorded at.

Maximosis
11-03-2008, 03:12 PM
Thanks I downloaded it it worked for like videos then told me my computer didnt have enough resources to run it... I HAVE a SUPER THURBO COMPUTER i wonder why?

KungFuNunChuck
11-03-2008, 03:16 PM
Thanks I downloaded it it worked for like videos then told me my computer didnt have enough resources to run it... I HAVE a SUPER THURBO COMPUTER i wonder why?

I had that issue also when I first installed it on my laptop. I remember it showing what the recommended resources are to run smoothly and then lists what your computer is currently running. If an area of that is below standard, that pop up appears and rendering my be a little off.

yeaitalktuff
11-03-2008, 04:58 PM
This does work takes a long time to encode but its great. I did the moovie 300

unknown.soul
11-03-2008, 05:04 PM
Thanks I downloaded it it worked for like videos then told me my computer didnt have enough resources to run it...
Same here, it said my processor is 180mHz lol

Stanovoy
11-03-2008, 05:13 PM
@Mods: Can we put this in the knowledge base?

thebizzboy
11-03-2008, 08:27 PM
really quick..download program clonedvd mobile and use the iphone settings
find program here
www.9down.com (http://www.9down.com)

orange
11-03-2008, 10:15 PM
this is cool.

KungFuNunChuck
11-03-2008, 10:49 PM
really quick..download program clonedvd mobile and use the iphone settings
find program here
www.9down.com (http://www.9down.com)

The issue with most iphone settings is stretching. With widescreen movies the current video player on G1 does an "auto fit" which makes the video off aspect. Watching badly calibrated videos is like kissing your 3rd cousin...sure you can do it, but it still ain't right!

On that note, good night.

Fare
11-03-2008, 10:54 PM
If you're doing TV shows or something else at 4:3 this won't work (I can give those instructions as well if there's demand for it).

Does this include instructions on how to crop it correctly? I am doing a 4:3 atm, but I am not sure if it's going to be stretched or not. I'll make good use of the instructables if ya post them ;)

dfarted
11-03-2008, 11:05 PM
cracked some dvd before, i could use this.....post my reply once finish...thanks a lot .

KungFuNunChuck
11-03-2008, 11:06 PM
Does this include instructions on how to crop it correctly? I am doing a 4:3 atm, but I am not sure if it's going to be stretched or not. I'll make good use of the instructables if ya post them ;)

I'll check on the progress of 4:3 aspect in the morning. The OP on tmonews is my brother and I asked him for padding calculation to view TV shows. I'l keep you updated.

Fare
11-03-2008, 11:18 PM
I'll check on the progress of 4:3 aspect in the morning. The OP on tmonews is my brother and I asked him for padding calculation to view TV shows. I'l keep you updated.

cool. I found this (http://forums.tmonews.com/index.php?topic=4644.msg72244#msg72244). Gonna give it a shot and then test what you have to recommended.

KungFuNunChuck
11-03-2008, 11:29 PM
cool. I found this (http://forums.tmonews.com/index.php?topic=4644.msg72244#msg72244). Gonna give it a shot and then test what you have to recommended.

Those settings look right. I'll also test it out in the morning and transfer to the phone during lunch. If its good, I'll update the original post. Nice find!

andersayz
11-04-2008, 12:06 AM
everytime i try to use super c i get an error eventually and the video never finishes converting. i'm beginning to think my computer just wont run it . the program spits out the message about not having the right specifications for the program to run blah blah blah...

anyway is there another free program out there that will convert and fix the stretching problem?? i hate the stupid stretching on the video player.

ghoonk
11-04-2008, 01:11 AM
Has anyone tried this:

http://www.videohelp.com/tools/3GP_Converter

I used to use it to convert videos to my PSP and it seems to have a profile for the iPod.

Likewise, I use Nokia Internet Tablet Video Converter (available as a free download from Nokia.com) to convert my movies to MP4 that works on my N800. I will try to copy a movie from the N800 to the G1 later this evening and let you guys know how it goes.

pancit175
11-04-2008, 01:22 AM
This may be asking too much, but I have recorded programs that were shot in widescreen but displayed in fullscreen with the black bars (top & bottom). Is there a way to cut out the black bars from the video so it has better ratio on the G1?

ghoonk
11-04-2008, 01:26 AM
In all my years of tinkering about with encoding videos for multiple devices (PSP, iPod, iPhone, Nokia E51, SE P990i, Nokia N800 Internet Tablet, Nokia E61), I have yet to come across an application that could do this if the bar bars are in the video itself. That would require video editing, not something that most people would do / want to do. It's time-consuming and system-intensive and has little in the way of returns.

pancit175
11-04-2008, 01:40 AM
I figured it was a long shot, but worth knowing.

Mr. Moe
11-04-2008, 08:48 AM
subscribing to this thread for future review when I get home

KungFuNunChuck
11-04-2008, 08:58 AM
everytime i try to use super c i get an error eventually and the video never finishes converting. i'm beginning to think my computer just wont run it . the program spits out the message about not having the right specifications for the program to run blah blah blah...

anyway is there another free program out there that will convert and fix the stretching problem?? i hate the stupid stretching on the video player.

Have you tried closing all other applications while running the encoder? When I convert video I try not to be doing anything else on that comp just to make sure there's no little hiccup in the process.

KungFuNunChuck
11-04-2008, 09:02 AM
This may be asking too much, but I have recorded programs that were shot in widescreen but displayed in fullscreen with the black bars (top & bottom). Is there a way to cut out the black bars from the video so it has better ratio on the G1?

As Ghoonk stated, that requires video editing. Super C and other encoders allow you to add bars (or padding). I suppose you could try cropping the left and right side of the video and see how the results are. Remember the video player on the G1 auto-fits, so it more than likely is possible with the right setting, but that's more effort than I'd like to put into it.

KungFuNunChuck
11-04-2008, 10:18 AM
cool. I found this (http://forums.tmonews.com/index.php?topic=4644.msg72244#msg72244). Gonna give it a shot and then test what you have to recommended.

Tested it this and it works great. I went ahead and updated the OP to include 4:3 aspect.

Maximosis
11-04-2008, 10:25 AM
I needed this for the longest i have a huge collection of movies.

CJ Chitwood
11-30-2008, 10:51 AM
For those of us using Linux:

Download the source code for ffmpeg and the amr_wb and amr_nb libraries (from what I could tell, the amr provide h263, which is all the G1 can decode). You'll have to google these last two -- it's how I found them, and they weren't exactly hiding, but they're not "free" as in speech like most Linux software, so they can't be redistributed. You will also want libmp3lame if you don't already have it, as well as libfaac0 and libfaad0.

When compiling ffmpeg, use the following command for the configuration:



./configure --enable-gpl --enable-libamr_nb --enable-libamr_wb --enable-libmp3lame --enable-libvorbis --enable-libfaac --enable-libfaad --enable-nonfree --enable-decoder=h263 --enable-encoder=h263



You may wish to have "checkinstall" installed. It provides an easy method of removing programs that were compiled from source (saves you from having to have the source around to run "make uninstall", which doesn't always work anyway).


After ffmpeg is installed, with all the above-mentioned libraries, the command is straightforward.



ffmpeg -i source-video.avi -s 480x320 -vcodec mpeg4 -acodec libfaac -ac 1 -ar 16000 -r 13 -ab 32000 -aspect 3:2 output-video.G1.mp4


This is VERY basic. For full options, go to http://ffmpeg.mplayerhq.hu/ffmpeg-doc.html#SEC6

-s is "size" of output video. This gave me fits early on because I tried it before (via GUI wrappers, IIRC) and was told by the program that this size wasn't supported regardless of which codec I selected. I don't know what the diff is, but it works for me now.
-vcodec Choices for G1 are mpeg4 and h263. IMHO I get better quality and marginally smaller file size with mpeg4.
-acodec libfaac is the audio codec. I know of no other choice here for this purpose.
-ac 1 Number of audio channels. Use 1 to save filesize since you only have one speaker. Unless you like wearing those painful earbuds all the time. Then use -ac 2.
-ar 16000 Audio sampling rate in Hertz. Some formats won't work with anything other than 8kHz. 16 kHz seems okay to me, considering what I'm watching it on. Don't expect HiFi from a phone.
-r 13 Frames per second. Larger is smoother, but 30 fps requires double the file size of 15 fps. 12 is about the slowest my eyes can comfortably watch. Since DVDs are right at 25 FPS, 12.5 being half of this, I go with 13.
-ab 32000 bitrate of the audio -- 32 kbps in this case. Normally I'd balk at such low numbers, but remember, I'm trying to keep filesize low. I'm not broadcasting to a large audience with this, am I? No, it's for me. For you? Use your best judgement. Experiment a little.
-aspect 3:2 Obviously, this is the aspect ratio of the output file. I'm not sure it matters, when the output size is being set before.

There are a few more options you'll need to know, but you have to do the math. Just like with the Windows side, your 16:9 or 4:3 isn't going to fit without stretching unless you pad it out.

-padtop #, -padbottom #, -padleft #, -padright # - number of pixels thick of padding (black bar) to put on this edge of the video.

I'll use The Terminal starring Catherine Zeta Jones [/drool] and Tom Hanks as a perfect example. The rip I have is 480x256. Not the highest grade to begin with, but I'll live. This is a 1.875:1 ratio, neither 16:9, 16:10. 4:3, nor 3:2. Doesn't matter though, because the G1 screen is 480 pixels wide to begin with. We just need to pad the video out to 320 pixels tall. 320 - 256 is 64, so we need 32 pixels top and bottom.



$ ffmpeg -i terminal.avi -s 480x256 -vcodec mpeg4 -acodec libfaac -ac 1 -ar 16000 -r 13 -ab 32000 -aspect 3:2 -padtop 32 -padbottom 32 terminal.G1.mp4



mplayer spits out the size of the movie in the command line window before playing it, so get the size ratios from that. Divide the actual width by the intended width to get a number, then divide the actual height by that same number to get the intended height. This way, your video will always be full width (assuming you're doing widescreen. If you're doing 4:3, simply swap height and width and solve for the other).




For another example, Office Space, in my rip, is 672 by 352. I want to scale it to fit 480 by 320. 672 (starting width) divided by 480 (target width) is 1.4, so if I divide 672 by 1.4 I get 480. 1.4 is the magic ratio, because now I know what to divide the starting height by to get the target height. So likewise, I divide 352 (starting height) by 1.4 and I get 251.4 (target height). Since ffmpeg requires an even number (and you can't have a fraction of a pixel), I'll round it down to 250 (252 would work too, it won't be visibly noticeable). So the output video will be 480 by 250. [edit: This is the -s option above, and thus should be -s 480x250 on the ffmpeg command line.] This will be full width in the G1, but requires padding top and bottom to prevent the G1 decoder from stretching it to fill the screen. 320 (screen height) - 250 (video height) is 70. Since the padding number must be an even one, I'll go with 34 pixels on top and 36 on the bottom to equal 70 total. [edit: -padtop 34 -padbottom 36 on the ffmpeg command line.]

But what if you like old T.V. shows? Let's say we have a 4:3 video, let's say it's 640 by 480, and we want it to be on the G1. Well, if we fit full width, the G1 will shrink it to fit, and everyone will look wide, so instead, we fit it full height and pad out the width. We know, therefore, the height has to be 320, but it's currently 480. 480 divided by 320 is 1.5, so we divide 640 by 1.5 to get the intended width of 426.667. So we can scale 640x480 down to 426x320. It will now need padding on the left and right to keep G1 from stretching it out to fit the screen. 480 wide, minus 426 output, is 54. Divide by 2 to get 27. Pad left 26 and pad right 28 and you'll have perfect aspect ratio that will fit the screen.

So, -s is the output size BEFORE applying crop and pad arguments.

I think I get it.... ;)



Addendum: While ffmpeg is running, you should see the following:



Output #0, mp4, to 'Braveheart.G1.mp4':
Stream #0.0: Video: mpeg4, yuv420p, 480x320 [PAR 1:1 DAR 3:2], q=2-31, 200 kb/s, 13.00 tb(c)
Stream #0.1: Audio: libfaac, 16000 Hz, mono, s16, 32 kb/s


This will tell you exactly what the output file will be in width and height, and for the G1 should always be 480x320 for optimum scaling. If it's anything other than 480 by 320, you WILL have stretching in the playback on the G1. May be minimal; may not even be noticeable, but it will be there.

shlongwoodian
12-07-2008, 01:56 PM
it just works, period. great post, great screen shots. also used "NoChange" to address stretching issues. 4:3 works just fine for the cartoon network .avi vids i was encoding.

thanks kchuck!

providence
04-19-2009, 01:53 AM
Can you explain the formula pls

( Width - ( Height * 16 / 9 ) ) / 2.


Here's a couple examples from my DVD rips:

* 886x480 source video: ( 886 - ( 480 * 16 / 9 ) ) / 2 = 16 (set the left and right crop to 16)
* 1128x480 source video: ( 1128 - ( 480 * 16 / 9 ) ) / 2 = 137 (set the left crop to 136 and the right crop to 138)
* 852x480 source video: ( 852 - ( 480 * 16 / 9 ) ) / 2 = -0.7 (this movie is already 16x9 so you can turn Crop OFF)


if its negative then its already in 16:9?