Log in

View Full Version : Encoding DivX5 for PPC using Gordian Knot


Linus
07-15-2003, 05:11 PM
I've been using Gordian Knot to encode "full-sized" (~700MB) DivX movies for my PC for the last several months. I'm used to the interface, and I like GKnot's middle-ground between doing everything manually (best quality) and having everything automated (not quite as good). Between PocketMatrix's DivX to PPC guide (http://www.pocketmatrix.com/guides/dvd2divx/), Doom9's DivX5 Guide (http://www.doom9.org/index.html?/gknot-main3.htm), and posts in this forum and the Project Mayo Forums (http://forums.projectmayo.com/index.php), I came up with settings that I thought would work. Basically, it was the same as I did for my desktop PC, only I disabled DivX Pro features (psychovisal enhancements, bidirectional encoding, quarter pixels, etc.), shrunk the resolution to a max dimension of 320 pixels, and set a target file size of 200MB.

Too bad it didn't work. I've tried encoding Back To The Future several times, going through settings very carefully, and every time it comes out 550+ MB. Any idea why?

Also, anyone know of any guides for encoding DivX movies for PPCs using GKnot? If one doesn't exist and I get this working, I'd be willing to write one up.

kagayaki1
07-15-2003, 05:17 PM
What are your audio settings?

Pat Logsdon
07-15-2003, 05:20 PM
Are you decimating your frames by 2? That's the first thing I'd check.

Linus
07-15-2003, 05:31 PM
kagayaki1: I loaded up the right AC3 file, set the size to 8-14 MB, and used 1x VBR MP3 (calculate frame-overhead checked). Should I do something different?

Surgical Snack: The framerate I've been using is 23.976 - the lowest GKnot has in its drop-down list. Would a lower framerate actually look decent on a PPC? If so, do you know how I would go about lowering it via GKnot?

I'm using DivX 5.05 Pro, GKnot 0.28, and CodecPak 1.1 on a 2.53GHz P4 w/ 1GB RAM.

Pat Logsdon
07-15-2003, 06:00 PM
The framerate I've been using is 23.976 - the lowest GKnot has in its drop-down list. Would a lower framerate actually look decent on a PPC? If so, do you know how I would go about lowering it via GKnot?

Framerate is different than decimation - by decimating the frames by 2, you'll be throwing out every other frame, rather than changing the rate at which the frames play. The framerate you have is good - I wouldn't change it. But if you decimate by 2, you'll cut your file size in half. :)

Unfortunately, I haven't used Gordian Knot (I use VirtualDub), so I can't tell you exactly how to do it. :(

Linus
07-15-2003, 06:20 PM
Framerate is different than decimation - by decimating the frames by 2, you'll be throwing out every other frame, rather than changing the rate at which the frames play. The framerate you have is good - I wouldn't change it. But if you decimate by 2, you'll cut your file size in half. :)

Wouldn't decimating by 2 (removing every other frame) change the framerate from 24 to 12 fps? If you removed every other frame but didn't change the rate they display, it would run at 2x speed (not good). Regardless, if decimating by 2 shows motion well enough on PPCs, I'll do it.

Unfortunately, I can't find any options for decimation in GKnot. Maybe I'll end up using the cumbersome VirtualDub method after all.

Pat Logsdon
07-15-2003, 06:46 PM
Wouldn't decimating by 2 (removing every other frame) change the framerate from 24 to 12 fps? If you removed every other frame but didn't change the rate they display, it would run at 2x speed (not good). Regardless, if decimating by 2 shows motion well enough on PPCs, I'll do it.
Yup - you're right - I'm wrong. :) In VirtualDub, I never mess with the framerate but always decimate. Vdub then automatically changes the framerate. Every single movie I've watched on my Axim has been encoded this way, and it's just fine. Even the action sequences in The Matrix look great.

Unfortunately, I can't find any options for decimation in GKnot. Maybe I'll end up using the cumbersome VirtualDub method after all.
It's not too bad once you do it once or twice. You can also save all of your settings in a .vcf file so you don't have to load them again, which is nice. The instructions on pocketmatrix you linked to above work well. Follow those and you should be done in no time!

Good luck!

P.S.: The pocketmatrix site says to resize the video first, then rotate it. I'd do it the other way around. For some reason, if you resize first, you sometimes end up with choppy video. Don't ask me why, it doesn't really make sense, but it works... :roll:

kagayaki1
07-15-2003, 07:03 PM
It's important to understand the work you're doing to resize for PPC should NOT be done in Gordian Knot. GK should only be used for creating the original DivX movie. Once you have the "full sized" version that you'd play on a standard computer, you use VituralDub to take care of the rest.

I still use an old tutorial I got from the Pocket DivX forums, simply called "Encode_DivX_for_PPC" I don't have the link right in front of me, but once you have it, it's easy! I'll see if I can find it. In the meantime, dig through the forums under "Pocket DivX Encoding"

Buddha
07-15-2003, 07:05 PM
Linus,

What bitrate is indicated in GK (gordian knot) when you have everything set? If you don't know, try encoding the movies at a videobitrate of, let's say, 175kbps or 200kbps and then check what kind of filesize it gives you when encoded. In general the video bitrate of your movie shouldn't exceed 200-250kbps otherwise it might get pretty 'big'.

When one decimates by 2, the rate is changed and every second frame building up the movie is removed. The movie runs the same length but each remaining frame is shown twice as long since the image is redrawn at half the rate of the framerate you started with. The size of the file does not change if one uses the same bitrate, but instead the gain will be that there are twice as many bits available for each frame of the movie, which can result in better overall image quality.

As for the sound, if you keep getting bigger files check that the sound is really encoded at the correct bitrate. You can check this by using a tool like GSpot, which you can find at Doom9 (http://www.doom9.org) in the download section. Start GSpot and drag the movie over the program and you'll get all sorts of information about the movie including the bitrate of the audio.

As a sidenote:
There is now a pretty good read included in PocketMVP, in the help section about everything one should know about compression and encoding for the PPC, it's not a direct 'HOW-TO guide' but rather it explains the basics of video-encoding etc. I recommend anyone to read it if one wants to get a better understanding of this (as the author of the helpfile calls it) 'art'.

Good luck,

kagayaki1
07-15-2003, 07:06 PM
http://forums.projectmayo.com/viewtopic.php?topic=3544&forum=25

Guide to encoding. If you're using a new PPC2K3 device, and you have read the thread on the new binaries Pedro wrote to have a working version of PMVP, try skipping the decimation step. It may unreasonably increase file size, but the new devices are supposed to play very well at 24fps, without throwing out every other frame.

Download this, and save it in a permanent place.

Linus
07-15-2003, 11:24 PM
Okay, I think I've figured out my problem. According to GSpot (thanks Buddha!), my audio wasn't being encoded at all - it was still in 448kbps AC3 (can you say overkill?). Unfortunately, I tried setting the audio bitrate to 32 kbps (on the bitrate tab), and that didn't work either - same result. I looked at the one other DivX file I've got handy that I encoded using GKnot, and it left the audio as 448kbps AC3 too. Anyone know how to get this to work? The only other audio options I can think of are after you click Save & Encode - I thought the guide said to "Just Mux" the audio, should I be doing something else?

Maybe it's time to give up and go the VirtualDub route. *sigh*

Buddha
07-16-2003, 09:25 PM
I checked the encoding process and see what your are describing:



The only other audio options I can think of are after you click Save & Encode - I thought the guide said to "Just Mux" the audio, should I be doing something else?


When you select 'just mux' the original dolby soundtrack is muxed with the video, so the soundfile is not converted and stays 'HUGE'. Instead of choosing 'just mux' you should choose:

'MP3 [fill in the bitrate you want e.g. 32kbit/sec or 48] constant bitrate'

and be sure 'Re-Calculate Video Bitrate' is checked to be on the safe side, also you might want to uncheck 'Delete Wav' but that's up to you.


Good luck

Linus
07-18-2003, 08:28 PM
It's never easy. Damnit, I just want this to work!

I tried all sorts of combinations to get GKnot to work. Whether I set the audio bitrate in the Bitrate tab or in the Save & Encode dialogue, the audio was left as 448kbps AC3, making a huge file.

So then I tried VirtualDub. Followed the instructions on the PocketMatrix (http://www.pocketmatrix.com/guides/dvd2divx/) guide exactly except for using DivX 5.05 (pro features turned off) instead of 4.12, and I get this error message every time: "Cannot start video compression: The source image format is not acceptable. (error code -2)".

At first, it seemed like I'd messed something up with the resolution calculations. But no, everything was a multiple of 16. I even tried another movie, cut out the rotate filter, and went directly from 720x480 to 320x240 (all divisible by 16). Same error message.

This thread (http://forums.projectmayo.com/viewtopic.php?topic=6060&forum=25) over in the PocketMayo forums seemed like it might be some help, but everything I have is divisible by 16 (and hence 4).

Any ideas?! I'm using VirtualDub 1.5.4, DVD2AVI 1.76, VFAPI Converter 1.04, and HeadAC3he 0.23a.

Linus
07-22-2003, 10:40 PM
Got it working. Uninstalled the Pro DivX codec (5.05) and installed the Basic and everything's fine.

Several posts in various forums seemed to indicate that 250 kbps was about the highest bitrate PPCs could handle. Well, I've been testing out my 2210, and it played everything I threw at it (up to 1500 kbps) flawlessly, with no dropped frames. Naturally, that bitrate means I can't fit much on my 256MB SD card, but I was still impressed with the quality.

Am I missing something here or is the 2210 way more multimedia-capable than other PPCs?

Talyn
07-22-2003, 11:23 PM
FYI: you don't need WM2003 to play 24 fps. PPC2002 will play at 24fps just fine in fullscreen landscape view, and does 30fps easily if the video was encoded for portrait view.

What I do when encoding a DVD is to look at what the source is (film or animation) and the type of movie it is (lots of action or no). If I don't really care if it's a lower framerate or not, I'll go ahead and decimate by 2. If I want a higher framerate, I use the Inverse Telecine (adaptive mode) instead of decimating (also located in the Framerate dialog in VirtualDub). What this does is attempt to return a 29.97fps DVD back into the normal NTSC 23.98fps video, which runs perfectly in Pocket MVP. Occasionally a video will be very jumpy when using this method, so I would definately run a test on a smaller section of the DVD rip first. (I've only actually had one movie do this, the rest have all turned out fantastic).

Also, decimation will not cut the filesize in half. It only reduces it by a small percentage.

Just because decimation is in all the guides, doesn't mean it's a requirement. Think outside the box.

As for bitrates, no 250 is not the max. In fact, the PocketMVP help file indicates their preferred range is 200-400kbps. I typically use a bitrate in the mid- to upper- 200's but I've also used low 300's and while the filesize certainly increases, the video quality is astounding without dropping frames.

Buddha
07-23-2003, 11:14 AM
Several posts in various forums seemed to indicate that 250 kbps was about the highest bitrate PPCs could handle.


This is not the maximum bitrate ALL ppc's can handle this is just what most older ppc's can handle while still giving decent quality and keeping bitrates at/below 250 gives the best of both worlds: viewable movies that are not too big.

Most new ppc devices are a lot faster than the old ones so in theory you can have much higher bitrate but if its really worth the space is up to you to decide. Just remember that you use up a lot of precious space and instead of carrying 4 episodes, of e.g. the simpsons, on your card you can only carry 2 episodes. I myself enjoy having room for both a movie or a couple of episodes AND have some room left for music (ogg) + other files or games (Monkey Island 2 at the moment).


Good luck with your mobile movie-watching. :mrgreen: