Razorback
NewsProjectsGuidesResourcesContact
 Guide Index Quick Links


Encode Movies for Playback on Old Computers

Created on April 15, 2021 (Updated on January 18, 2023)

Contents
  1. Obtain the Necessary Materials
  2. Using FFmpeg
  3. Downsizing a Video
  4. Reducing the Sample Rate
  5. Encoding MPEG-1 Videos

240P POLITICS video in Windows for Workgroups 3.11's media player

Ever wanted to get your favorite video to play back on an old computer the way 240p Politics does it? With a free command line program called FFmpeg, you can convert a video for playback on a 486, all without having to fetch some obscure 90's software!

Obtain the Necessary Materials

First, of course, you'll need to download FFmpeg through a package repository, or something from this list of builds compiled for Windows.

Then, you'll need a source video that you wish to encode for old computers to play back. It'll be easiest if the video is already at a small 4:3 resolution like 320x240, but if it isn't, FFmpeg has several filters you can use to downscale the video.

Plenty of old operating systems like Windows 95 will come with support for Cinepak AVI playback out of the box, but if you're using something like Windows 3.1, you'll first need to install Microsoft Video for Windows.

To make running FFmpeg easier in the Windows command prompt, you should append to the PATH environment variable with a pathname leading to the FFmpeg executables. That way, you won't have to type the full path to the program every time you want to use it anywhere else.

Using FFmpeg

Since FFmpeg is a command line program, you'll need to open up a terminal or command prompt in order to use it. To convert any video with sound straight to a Cinepak AVI with this program, you'd type something like this:

ffmpeg -i mcdonals.mp4 -c:v cinepak -c:a pcm_u8 mcdonals.avi

From left to right, the parameters given are as follows:

  • ffmpeg - the program we're running
  • -i mcdonals.mp4 - the input or source video to convert (replace mcdonals.mp4 with the filename of your video)
  • -c:v cinepak - the video codec to use for the output file
  • -c:a pcm_u8 - the audio codec to use for the output file
  • mcdonals.avi - the output file's name; given the codec being used, the extension must be AVI

Keep in mind that this command assumes the source video is already in a 320x240 resolution. Also, FFmpeg's Cinepak encoder is SLOOOOOOW! I figure nobody cares so much to maintain support for it so as to make it work much faster, but it is an open source program, so... if you can do that, that would do wonders for everyone here.

I always stick to pcm_u8 for the audio codec, which is basically raw audio with 8-bit precision. Not only is it very easy on CPUs due to its non-complex nature, it's also one of the only audio codecs readily supported on old video players. You could probably use pcm_u16 or pcm_s16 as well, but those are sure to just add more bulk to your video, as these AVIs simply can't match the space efficiency of modern codecs like H.264.

Downsizing a Video

You may prefer to downsize your video in your new favorite video editor Olive, as such a program like that will allow you to see exactly where you can "crop" a widescreen video to 4:3, positioning it exactly on the area where most of the video contents can be seen and downscaling it in one clean run. It also lets you more easily vary the position of a clip at different times; that is, in your timeline, you'd split one clip into multiple parts, one for the opening credits, another for the bulk of the video, and yet another for the end credits, all with different positions independent of each other.

Regardless, if you only want to downsize a video without going through the trouble of using a video editor, FFmpeg has two filters useful for the job. In between -c:v cinepak and -c:a pcm_u8, you can add another parameter:

-vf scale=320:240

As it would imply, this scales the output video down to 320 pixels wide by 240 pixels high. Of course, your source video would still have to be 4:3 for this to look right, otherwise the video's going to be squished as if it went through a trash compactor. If your source video is in an aspect ratio like 16:9, you could keep the widescreen ratio with a resolution like 428x240; my installation of Windows for Workgroups 3.11 certainly doesn't complain, but it's not gonna cleanly fit any resolutions most old video cards use.

Instead of using the scale filter right away, you should first run FFmpeg to create a 4:3 cropped version of your video. Using the crop filter in place of the scale filter, run a command like this:

ffmpeg -i mcdonals.mp4 -vf crop="960:720" mcdonals_crop.mp4

This will crop a 720p video into a 4:3 aspect ratio from the center. If the crop's starting position needs to be something else, you can add two addition parameters to the filter specifying the starting X and Y positions. -vf crop="960:720:0:0" crops the video starting at the upper left corner.

Check your cropped video to see if it looks satisfactory. If you need to experiment with cropping, use FFplay to run the source video through the crop filter without encoding anything. You can type something like this at the command line:

ffplay -vf crop=960:720:0:0 mcdonals.mp4

Once you have the right position you want, apply that to FFmpeg.

Here are some resolutions you can use to crop popular widescreen formats down to 4:3:

  • 360p - 480x360
  • 480p - 640x480
  • 720p - 960x720
  • 1080p - 1440x1080
  • 4K - 2880x2160

There are better explanations of FFmpeg filters out there; I'm just here to brief you on the ones you'll need to know to create the perfect Cinepak AVI.

If your cropped output looks good, you can then downscale that to another video in 240p; this will be the one to encode with Cinepak.

Reducing the Sample Rate

One way many people reduced the size of their AVIs was by drastically lowering the sample rate of the audio to 8kHz or 11kHz. In between -c:a pcm_u8 and mcdonals.avi, add a new parameter -ar 11025 to reduce the audio sample rate to 11kHz.

There is a chance your source video may have a sample rate of 48kHz. If this is the case, that sample rate should not be used, as most sound cards made before 1998 did not support hardware 48kHz mixing. 44kHz will ensure greatly reduced CPU overhead.

Some valid sample rates are:

  • 8000 - toaster quality
  • 11025 - low quality
  • 22050 - medium quality
  • 32000 - sorta high quality
  • 44100 - high quality
  • 48000 - also high quality, mainly used for DVDs

You can also add -ac 1 next to the -ar parameter to use mono audio in the output video, further cutting down on its size.

If all goes well, you should be able to see your video on your old computer in 240p goodness! By the way, here's a little fun fact... 60FPS videos work in Windows 3.1 as well.

If the slow speed of encoding to Cinepak is a bother, it might be worth looking at this Bash script I wrote.

Encoding MPEG-1 Videos

XingMPEG playing a video in Windows for Workgroups 3.11

Encoding in MPEG-1 is kind of tricky if you're targeting old machines since it's not immediately clear what they expect. If you were to run a command like this:

ffmpeg -i mcdonals.mp4 -c:v mpeg1video -c:a mp2 mcdonals.mpg

The video would work in your new spiffy PC with a good video player like VLC or mpv, but if you were to try to throw it into a much older player like XingMPEG or Windows Media Player, it would almost certainly throw some kind of fit - severe lag, video not looking correct, or worse. These players need videos to be encoded in a certain way which they can digest.

Luckily, FFmpeg is very much capable of covering a wide ground, so all you have to do is make your command look more like this:

ffmpeg -i mcdonals.mp4 -c:v mpeg1video -r 29.97 -b:v 1000k -minrate 1000k -maxrate 1000k -bufsize 1000k -vf scale=352:240 -c:a mp2 -ar 44100 -b:a 128k -write_xing 1 mcdonals.mpg

It's a mouthful, so let's break it down like we did earlier:

  • -c:v mpeg1video - The video codec to use
  • -r 29.97 - The frame rate; this should always be 29.97 assuming you're sticking to NTSC
  • -b:v 1000k - The bitrate to go by for the video; you could make this something like 500k-800k to save size at the cost of quality, or go higher if desired
  • -minrate 1000k - Minimum bit rate to use; this could be the same as the baseline and max, or lower just in case it may help reduce file size where it can
  • -maxrate 1000k - The maximum bitrate to use
  • -bufsize 1000k - The buffer size to use
  • -vf scale=352:240 - Scale to this resolution; 352x240 is used because it seems it should be the most ideal for old MPEG players
  • -c:a mp2 - The audio codec to use, which is MPEG audio layer 2
  • -ar 44100 - audio sample rate to use; 44.1KHz is required to get ActiveMovie to cooperate with the clip
  • -b:a 128k - Audio bitrate; 128Kbps is reasonable for 44.1KHz
  • -write_xing 1 - looks to be mainly useful for aiding in precise seeking from what I've read

For something like this, you may very well want to write a command line script to take care of most of the typing for you.

Note: When you encode the video with settings like these, there's a good chance you may encounter a constant avalanche of buffer underflow errors. Don't worry too much about these upfront; you can review the video once it's finished encoding to see if it looks acceptable to you. If it doesn't, maybe bumping up the bitrate could help, but don't expect such antiquated hardware to be able to handle perfect quality that you can get out of an MP4 file easily. To suppress the stream of errors, add -loglevel quiet right after ffmpeg.

Try it on an old machine; if you can play it back and navigate through it easily, it should be well primed for the platform. I've only just started to get a tighter grip on this sort of MPEG encoding myself, so hopefully I'm not missing anything, but it is entirely possible that more may need to be added to this approach to make clips more compatible with more hardware capable of MPEG playback.


Comments

pee pee poo poo - February 19, 2023 at 07:35 PM

give me money

Xnmcv - January 21, 2023 at 01:04 AM

This really makes me want to use ffmpeg Big Time!

2 comments on this page

Sort: Ascending | Descending

Leave a Comment

Name: (required)

Website: (optional)

Maximum comment length is 1000 characters.
First time? Read the guidelines

SORRY NOT GONNA SHOW THIS IN TEXT BROWSER
Enter the text shown in the image: