Welcome to PocketMatrix.com, a Mobile Devices enthusiast website. If you're a developer, be sure to check out our developer forums.
You can change your sidebar preferences in your Profile.

Encode DivX Videos for PPCs
DVD to PPC (advanced)
guide written by Florian "accolon" Hillebrand
Release 2 | March 31, 2002
Copyright 2002 by [accolon|Media|Consulting]

stats: HTML 49kB | images 612kB

 

This guide is supposed to help you encoding DivX videos for use with the Pocket DivX Player on all PocketPC devices, for example to play your favourite DVD when you want and where you want.

Important: DivX 5 is already available, but the Pocket DivX Player supports 4.1x only, which will be used for this guide.

It may seem a little bit complicated at first, but you'll see: it's worth the effort!
Although some all-in-one solutions are available (like GKnot), the method this guide describes will give you the most control over the entire process resulting in a video that will exactly fit YOUR needs.

The guide is divided into 3 parts:

> I. ripping a DVD so that you get usable video material for the conversion
> II. converting your video into DivX for PPC
> III. Appendix

The appendix contains useful additional information about splitting DivX movies, tips for playback etc. as well as some examples.

The first part is not PPC specific, it describes the ripping process for almost all conversions.
You can refer to the second part only if you want to convert other sources than DVDs (e.g. dowloaded trailers, music videos etc.).

Disclaimer / readme.1st / Known Shortcomings:

Parts of this guide are based on different sources, especially on the ripping guides from http://www.doom9.org/. I didn't ask for permission, so please don't hate me! ;-)

Please DO NOT use this guide to do anything illegal, for example ripping or converting copyrighted material; be aware that it might be illegal in your country even if you own the DVD! I'm not responsible for the things YOU do!

Though it is quite unlikely to cause any harm to your system / to your configuration by following this guide, I'm not responsible for any damage that may occur! As usual, make sure to have backups of recent date!

This guide is NOT perfect, it's based on my personal experiences and I'm using the software I like to use. There are many other ways to achieve the same goal, perhaps even better ways. Feel free to experiment (indeed, you NEED to experiment to get the optimum, since this is a GUIDE only!) and contact me if you want to make suggestions, have problems etc.!

I will correct mistakes and extend the guide if possible and/or necessary, but I need your feedback.
This refers especially to the IVTC part which I had to improvise for reasons explained further on.

I hope I didn't forget something important... Have fun!

P.S.: Please excuse my English, it might be strange sometimes since it's "German English". I hope it's at least understandable... ;-)

 

History:

March 19, 2002: Release 1
(initial release)

March 31, 2002: Release 2
(some parts reworked, minor additions; thanks to drpaulmhine and Jaspa for spotting some difficulties / for useful hints)

Please refer to this PocketMatrix.com thread for further tips, additions between guide releases, troubleshooting etc.!

 

I. Ripping a DVD

Minimum requirements:

What you will need (download & decompress to separate folders):
8-10 GB free HDD space (depending on movie length) SmartRipper (DVD ripper)

Pentium III 500 MHz or faster recommended

DVD2AVI (frameserver tool)
128 MB RAM or more recommended VFAPI Converter (creates pseudo .AVI files)
DVD drive for your PC; Microsoft Windows (2000 or XP recommended) HeadAC3he (for AC3 audio conversion)

Please note:
You may also follow the ripping guide provided by Chris Edwards (which is much easier for newbies) till "Step 2: VOB to AVI", but my method has some advantages: a) it's faster since you do not have to convert the VOBs which takes a VERY long time; b) better quality since the high quality DVD sources are directly converted to DivX without the VOB-to-AVI conversion step; c) the resulting video material can be used for ANY conversion, you are not limited to PocketDivX / to PPC resolutions.

A few steps more may lead you to better results in shorter time - you decide!

 

1. We use SmartRipper to copy the DVD to your HDD and remove any protection it might have (hope you've read the disclaimer!). SmartRipper is easy to use and very powerful, since it's capable of parsing the .IFO files of your DVD, which means that it drops all irrelevant information during the rip process.

Insert the DVD and run SmartRipper. It will unlock your DVD drive so it is able to access the encrypted files (if this doesn't work correctly, run any software DVD player like PowerDVD and start playing a movie scene. Pause it and rerun SmartRipper; do NOT close the player until ripping is complete!) and then you'll see the main screen.

 

2. You do not have to change any of the settings, SmartRipper is automatically configured to do exactly what we want it to do (that's why it's called SMART Ripper ;-D). Simply make sure that Rip-Method: Movie is selected as well as the main movie on your DVD (normally the longest one which SmartRipper has already selected):

Select your desired target directory (which is also our work folder from now on) in the box at the bottom and hit Start. Relax and watch while the tool works, it will give you detailed information about speed, decryption etc. - it's NOT important for our further work.

The whole process will take some time, depending on the movie length and the speed of your PC / DVD drive.

 

3. Next, we have to make the .VOBs usable for further conversion.
Run DVD2AVI, which is an excellent frameserving tool.
First of all, make sure that Help --> VFAPI Plug-In is selected.
Select File --> Open and open the first of the ripped .VOB files from the work folder; if they are consecutively named, this should also load all the others:

Make sure that they have the correct order; click OK and you will see the main window again. Now we have to find out what kind of movie we're dealing with; set Video --> Field Operation to None and press F5 to start the preview (you can stop it by pressing Escape).

The Statistics Window shows some important things which you should write down:

The first is Aspect Ratio, you'll either get 16:9 or 4:3.

The second, more important thing is Frame Rate / Video Type and Frame Type.

Frame Rate = 25.000 fps:
Your source type is PAL. If the Frame Type is Interlaced, start the preview again and watch closely if you see no horizontal black lines going through the picture - then the frames are actually progressive and you're already done here.
If there are such black lines, try changing the field order by selecting Video --> Field Operation --> Swap Field Order and run the preview again. If you can still see the horizontal lines reset the Field Operation to None, otherwise leave it as it is.

Frame Rate = 29.970 fps:
Let the preview run for a couple of minutes, then take a look at the Video Type: If it's FILM only or FILM at a percentage higher or equal to 95%, activate Video --> Field Operation --> Forced FILM.

Otherwise you will have to perform IVTC (InVerse TeleCine), the same also applies if the Video Type is NTSC.

Stop the preview and make sure that Video --> Color Space --> YUV is selected, otherwise we would lose our speed advantage.

 

4. Let's deal with the audio now.
Open vts_0x_INFO.txt (it has the same number x as all the .VOBs) from the work folder and locate the Stream Info section:

We are only interested in the Audio streams, which are English and Japanese in this example. The first stream is Track 1, the second one Track 2 and so on, this is important for DVD2AVI.

Select Audio --> Track Number and then the desired track in DVD2AVI, e.g. Track 1 for English here.

Set Audio --> Channel Format to Auto Select; leave all the other settings at default or change them as follows:

 

5. Select File --> Save Project, enter a name and save it to the work folder. There you will already find a .D2V project file created by SmartRipper during the 2nd step, simply overwrite it to avoid later confusion!
DVD2AVI will now extract the selected audio track from the .VOBs and create a project file for further use. You may close DVD2AVI now, but DO NOT delete or move the .VOBs or any other file!

The audio track will have a name similar to this one: vts_01 AC3 T01 3_2ch 448Kbps DELAY 80ms.ac3
The DELAY value (here: 80ms) is important later on; you should also play the audio track with your software DVD player to check if it has the right language.

 

6. If you are using VFAPI for the first time, make sure you run vifpset.bat in the Codec folder to install the codec!

VFAPI allows you to create a pseudo .AVI out of many formats (just like DVD2AVI projects, which we are using).
VFAPI behaves like a real video codec, but in reality it's just a wrapper which gets data from the frameserver application and wraps it into an .AVI that can be used by any application that is able to open standard .AVI files, just because the pseudo .AVI behaves just like a real one.
When the application wants to read a frame of the .AVI, VFAPI tells the frameserver to decode the desired frame of the VOB file and serve it to VFAPI in uncompressed format. VFAPI will then wrap the frame to the .AVI. This is just for information purposes, you do not need to know the details.

Run VFAPIConv-EN.exe from the Reader folder, click Add Job and open the DVD2AVI project (the .D2V file) or the TMPGEnc project if you performed IVTC.

Make sure that you select the Options according to the screenshot above, enter a name for the Output-File, click OK and then Convert.
The whole process takes just a few seconds; you should have a quite small .AVI file now. Try to play it with Windows Media Player, it's probably a slideshow rather than a movie (that's because of the frameserving progress I described), but it should run.

Important:
Under certain circumstances you might encounter problems at this point, e.g. Media Player won't play the video and give you an error message (thanks to drpaulmhine for pointing this out!). Read Appendix b.) for further instructions!

The video part is now complete, we've got an .AVI that can be used for further conversion according to the second part of this guide.

 

7. Now we have to make the AC3 audio track usable as well, therefore we will convert it to .WAV format.

Start HeadAC3he and confirm the message windows; select Source File file and open the .AC3 file.
The tool should insert the DELAY value and name of the Destination File automatically, otherwise do the appropriate changes by hand.

Destination Format should be WAV / 16 bit int; enable 2-pass-mode: hybrid (or float if you have enough space on your HDD, this will make the conversion faster but needs twice the space for the temp file) and set Normalize to: 100%. Everything else remains at default in the main window.
Expand the Options window. HeadAC3he should have selected all needed Input Channels; click the 2ch button at the bottom and set Downmix Type to Stereo.

Click Start and wait for the conversion to finish; you can view the progress in the Log window. The conversion takes some time, depending on the length of the AC3 track, the hybrid / float setting and the Priority settings; set them higher if you don't use your computer while converting.

The audio part is now complete, we've got a .WAV that can be used for further conversion according to the second part of this guide.

 

II. Converting into DivX for PPC

This part of the guide can be used for DVD sources from part one as well as for converting ANY other video source readable by VirtualDub, this contains standard .AVI files as well as MPEG1, for example downloaded music videos, trailers etc.
If your source is not supported by VirtualDub try to convert it, for example use the export option of QuickTime to create a .MPG file from your QuickTime movie.

Minimum requirements:

What you will need (download & decompress / install):
Pentium III 500 MHz or faster recommended VirtualDub

128 MB RAM or more recommended

DivX 4.12 Codec
PocketPC supported by PPC DivX Player DivX Player for PPC for your PPC

1. Make sure you've installed the DivX Codec (DO NOT use the new DivX 5, the PPC player doesn't support it yet!).

Run VirtualDub, select File --> Open video file... and choose the video you want to convert - either the VFAPI pseudo .AVI created in part one or any other video file VirtualDub shows. You may use the slider to check that everything is okay.

Important:
Under certain circumstances you might encounter problems at this point, e.g. VirtualDub won't open the video and give you an error message (thanks to drpaulmhine for pointing this out!). Read Appendix b.) for further instructions!

 

2. Select Audio --> Full processing mode.
When you are using the VFAPI pseudo .AVI, select WAV Audio... and open the .WAV file created with HeadAC3che, otherwise select AVI Audio to use the stream your source file contains.

Select Audio --> Conversion... and make the necessary changes; we need 16bit 44kHz Stereo audio for further processing; if you are using a DVD source you will probably have 48kHz. Change it to 44kHz (or 44100Hz), select High quality and press OK.

Now go to Audio --> Compression... and select MPEG Layer-3.

I suggest you use 32kBit/s, 22050Hz, Mono for the audio of your DivX movie, it works best for me and has acceptable quality.
You may also try the next better setting (48kBit/s, 44100Hz, Mono) which increases the filesize as well as the quality slightly (!), your PPC should have no problems with one of these settings. DO NOT choose Stereo, it doubles the filesize and causes decoding problems on slower devices. Click OK.

 

3. Make sure that Video --> Full processing mode is selected and go to Frame Rate...

Select Process every other frame (decimate by 2) and click OK. This will effectively reduce the number of frames by factor 2 without affecting video/audio synchronization; fewer frames means smaller filesize and less decoding effort for your PPC.

 

4. Go to File --> File Information... and write down the Frame size value, for example 720x576 for many DVD sources.

Then go to Video --> Filters..., press Add..., select resize from the list and press OK.

At this point you have to decide whether you want to encode the movie for portrait or landscape mode; since PPCs have a screen resolution of 240x320 (width x height), your DivX movie either needs a width of 240 for portrait or 320 for landscape mode.

Enter the desired value into the width field and calculate the correct value for height:

a) If you are using a standard video file like a music video, simply select a height that keeps the aspect ratio.
Example: If your source has a resolution of 352x240 (VideoCD format, used for most music videos), it has an aspect ratio of 1,466:1 (e.g. 352 / 240). Divide the width value by the desired width, e.g. 352 / 320 for landscape mode and the source height by this result, which means:

352 / 320 = 1,1
240 / 1,1 = 218,1818

DivX requires multiples of 16 for the resolution (thanks to Jaspa), so you have to choose the next value which is divisible by 16, in this example 224.
The target resolution is therefore 320x224; the small 6 pixel error doesn't matter.

b) If you are using a DVD source, you can't simply decrease the values, instead you have to look at the Aspect Ratio you took from the DVD2AVI Statistics Window.

Choose a target width as well and calculate the height as follows:

16:9
height = desired width * 9 / 16 --> for example 320 * 9 / 16 = 180 (for landscape)
4:3 height = desired width * 3 / 4 --> for example 320 * 3 / 4 = 240 (for landscape)

These values have to be multiples of 16 as well, which means a height of 176 for 16:9 sources, you can ignore the small 4 pixel error, it won't be visible.

 

5. Select Filter mode : Bicubic, this will provide the best quality for reducing the resolution. Bilinear would be used for enlarging the video; the Precise ones may provide slightly better quality but require much more time.

Press the Show preview button and make sure it looks okay (e.g. no unnaturally stretched image etc.).

 

6. If you are using a DVD source, it will probably contain black bars at the top and bottom of the screen; I strongly suggest to remove them for quality reasons. The hard cut between the black bars and the image uses up much of the provided bitrate, therefore decreasing overall image quality.

Check the cover of your DVD / your DVD box, you should find another ratio (most times on the back side), either 1:2.35, 1:1.85 or 1:1.33.

Divide the target resolution either by 2.35 or 1.85 or 1.33 and round the result to the next multiple of 16.

In this case, press the Cropping... button in the Filters list, use the slider to move to a image where you can see the black bars well and use the Offset fields to make the bars disappear, click OK.

Then press the Configure... button again and change the height value to the new one; check the preview again and verify your changes.

If you have black bars but don't know about the ratio mentioned above, try to experiment with these 3 standard values first (one of them is correct for 99% of all DVDs, usually 2.35 for 16:9!) or make the changes on your own until you are satisfied. Just make sure that width and height are multiples of 16 and that the preview satisfies you!

 

7. If you want to make a landscape movie, I suggest to rotate the video at this point. The Pocket DivX Player is able to rotate videos during playback, but this consumes quite a bit of the rare computing power and is slow especially on MIPS CPUs. Skip this step for portrait movies.

In the Filters list, click Add... again and select rotate. Rotate the image Left by 90 and click OK twice.

You should see the main window of VirtualDub again, use the slider to see the source video (the left one) and the filtered (right) one at the same time.

 

8. Now that we have set up everything, all we need to do is to encode / compress the video. We will use 2-pass encoding which takes twice the time of a normal encoding process, but it provides the best quality. On the first pass, the DivX codec scans the source video and generates a log file which contains special information used for the second pass. In general, the second one then distributes the available bitrate according to the log file and creates the final output video.

Go to Video --> Compression... and select the DivX Codec 4.12. Press the Configure button.

Select 2-pass, first pass and make sure that Performance/quality is set to Slowest. Slower performance means better quality.

Set the bitrate to 200 kilobit/second, perhaps you can go up to 250kbps, but 200kbps works best for me (and my Cassiopeia E-125) and delivers good quality.
The values to the right are not important for 2-pass encoding, nevertheless make sure they appear as follows and you won't run into problems ;-).

You may change the Log file, but normally this is not necessary. If everything is set up according to the screenshot above, press OK two times.

 

9. That's all for now, start the first pass with File --> Save as AVI... and enter a filename for the temporary movie (which doesn't use much space on your HDD).
The conversion will take some time, depending on the length of the source file and the speed of your PC. You should expect some hours; increase the priority of the thread if you don't want to use your computer, this will speed up the process. The Status window keeps you informed about the progress.

 

10. When the first pass is complete, go to Video --> Compression... again, select the DivX Codec 4.12 and press Configure.

Simply change Variable bitrate mode to 2-pass, second pass and press OK 2 times.

DO NOT change anything else here, and DO NOT change the filter settings you've made for the first pass. Otherwise the log file would not match the source and the result would be useless!

Go to File --> Save as AVI... again and enter a name for the final DivX video. After the conversion has finished (the second pass is normally faster than the first one), your movie for Pocket DivX is ready. Try to play it with Windows Media Player, there should be no problems. If you chose to rotate it for landscape mode, you should see it just as you wanted it to be; you may delete the sources and temp/log files now.

That's all! Have fun and feel free to contact me for suggestions!

Simply copy the movie to your PPC and enjoy... WAIT! The file is too large? Then we have to split the .AVI - see Appendix a.)!

 

III. Appendix

a.) Splitting .AVI files:

Open the DivX movie you want to split with VirtualDub and (IMPORTANT!) set both Video and Audio to --> Direct stream copy. Otherwise you would re-encode the movie! VirtualDub should give you a warning then, but you never know.

Because of the Variable Bitrate DivX uses, there is no way to predict the exact filesize of the parts of the main movie you are going to create, therefore you have to guess and experiment a bit.

Go to File --> File Information, check the # of frames (time) value there and do simple math.

Let's say you have got 60,000 frames, a filesize of 120 MB and memory cards for your device with a capacity of 64 MB each; in this case it would be good to split the movie into 2 parts of about 60 MB each which fit onto your memory cards. This means you should split after about 30,000 frames. In other cases, simply divide up the number of frames according to the desired size of the parts.

Press the Mark in button 4 to set the start position of the desired part (normally frame 0 for the first part).

Use the slider 1 to move approximately to the desired value and the either the forward/backward buttons 2 or your cursor keys to move frame by frame and the keyframe buttons 3 or SHIFT + cursor keys to go to the previous/next keyframe (look for the letter K in the status bar).

Make sure you only cut within keyframes, otherwise you would lose frames and destroy the video!

Press the Mark out button 5 to set the end position of the part.

Use File --> Save as AVI... to save the first part of your movie. Since there's no encoding, it should only take a few minutes.
If the file is too large, make the part smaller, e.g. select fewer frame.

The slider is still at the end of the first part (make sure it is a keyframe!), so click the Mark in button 4, move the slider to the right again (keyframe!) and press 5 to set the end of the next part. Save it and repeat the process until you are finished.

 

b.) Fixing pseudo .AVI problems:

In most cases problems are caused by "wrong" .AVI settings in the Windows registry. If you're encountering problems, download these files and double-click on the included .REG files. Confirm the appearing dialogue to import their contents to the registry and start over with step 6. of the ripping guide. If it doesn't work immediately, please try to reboot your PC before applying the next .REG file!

Each file restores more standard Windows .AVI settings than the previous one; please follow this order and use the next .REG file only if the previous one didn't help even after rebooting!

Again:
Though it is quite unlikely to cause any harm to your system / to your configuration by using one of these files, I'm not responsible for any damage that may occur!
As usual, make sure to have backups of recent date!

AVIfix.zip try this one first, it should help in most cases
AVIReset.zip try this one next; you have to reboot
AVIResetAll.zip extended version of AVIReset.zip; you have to reboot

Applying the first file (AVIfix.zip) again after you've applied the other ones has also proven useful!

 

c.) Playback tips:

> Free up as much memory as you can, uninstall really unnecessary programs and close everything except the Pocket DivX Player!
> If possible, perform a soft reset before watching a DivX movie; this cleans up the memory.
> In PocketDivX, select File --> Configure... and make sure you've enabled the cache! Set it at least to 4-6 MB!
> If you don't encounter problems switch off the AVI Index, this requires less memory.
> Use pre-rotated movies for landscape mode if possible, the Pocket DivX rotation option uses much computing power.
> The Show dropped frame option helps to discover major performance problems, the number of dropped frames should be as low as possible.

 

d.) Examples:

Both examples have been created following this guide; they're running perfectly on my Cassiopeia E-125 from a 64 MB CF card.
The copyright owners of these images are the respective artists, companies etc.; the images are used for educational non-profit demonstration purposes only!

Ghost in the Shell (source: DVD)

 

Shakira - Whenever, Wherever (source: MTV music video)