Created on April 15, 2021 (Updated on January 18, 2023)
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.
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:
From left to right, the parameters given are as follows:
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:
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:
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:
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:
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:
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
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:
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:
It's a mouthful, so let's break it down like we did earlier:
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.
give me money
This really makes me want to use ffmpeg Big Time!
2 comments on this page
Sort: Ascending | Descending
Leave a Comment