04 August 2014

Monitor Emulator for Predictable Presentations

You're preparing to give a presentation. You load up PowerPoint (or Prezi, or Impress), load your presentation and get everything just right. When it's your turn, you step to the podium and plug your laptop into the projector -- and everything goes nuts.

The problem is that upon seeing the projector (or other video device) your computer changes video modes to match. Maybe it mirrors your screen to the projector. If so, it may have to change video resolutions. Or maybe it makes your desktop span both monitors. Either way, you end up messing with your settings for a minute or so and your smooth introduction to the audience is blown.

After this happened to me twice in a row, I found a geeky solution. A monitor emulator, sometimes called an EDID emulator, makes your laptop think the projector is already connected. I use an EM-EDID-HD15 by Hall Research.

Before the presentation I plug this in. Since the laptop thinks it now has a second display, I can get the video mode right -- mirroring, resolution, etc. Then, when I plug the projector into the other end of the emulator, the computer doesn't know anything has change and the presentation goes up smoothly.

As of this writing, the EM-EDID-HD15 is available from Amazon for $122. Google shopping shows some much better prices.

14 July 2014

FFmpeg Settings for Compatibility when Archiving Videos

We have hundreds of family videos in a variety of formats. Some have been captured from old VHS tapes. Some were recorded on DV tape using a camcorder and then transferred to my computer. And some were recorded on my Canon S5 IS. I want to convert them to a consistent video format that's playable on most of our current devices and will continue to be playable decades in the future. The questions boil down to two: What format to use? How to do the conversion?

A Quick Tutorial

Computer audio and video formats typically have three features:
  • The audio codec: This is how the audio information is compressed and encoded. Some codecs compress the audio to save space. Lossy compression schemes give up some detail of the audio – usually imperceptible detail. Common audio codecs include lossy compression: MP3, AAC, and Vorbis; lossless compression: FLAC (lossless compression); and uncompressed: PCM.
  • The video codec: This is how the video information is compressed and encoded. Most practical video codecs use lossy compression. Commonly-used codecs include H.264/AVC, H.262/MPEG-2, Theora, Motion JPEG, and DV.
  • The container format: This defines how the audio and video streams are interleaved and how metadata about the content is stored including information about which codecs are in use for the audio and video streams. It's the container formats, not the codec that is most familiar to computer users. Popular container formats include MP4, MPEG, AVI, OGG, ASF(WMV/WMA), and MKV.
In theory, any codec should be usable with any container. In practice, certain codecs are generally associated with certain containers. For example, OGG typically uses Theora video and Vorbis audio; MPEG uses MPEG-2 video and MP3 audio; and MP4 uses H.264 video and either MP3 or AAC for audio.

The Plan: Use FFmpeg to convert to MP4

After some research, I've decided that MP4 using the H.264 video codec and AAC audio codec is the best choice for my needs. It has excellent support on a variety of devices, media players, and web browsers and the codecs are also the most commonly used by Blu-ray discs. It also supports metadata.

Conveniently, FFmpeg is an open source program that can convert from just about any format into MPEG-4. Inconveniently, the pre-built versions of FFmpeg that you can download cannot encode high-quality audio in AAC format. It's limited to MP3 due to some unusual intellectual property licenses in the source code. And while MP3 is certainly good enough for the audio, many devices, particularly those from Apple, will not play MP3 audio when stored in an MP4 container.

For maximum compatibility you need a version of FFmpeg with AAC support. So, you (or a tech-savvy friend) will have to build a version of FFmpeg with AAC support. In my last post I wrote instructions on how to do that build.

Using FFmpeg

OK, you followed the instructions and have a functional copy of FFmpeg that supports H.264 and AAC. Now you need to know how to use it. FFmpeg is a command line tool with hundreds of options. The documentation is long and complicated. And if you google for FFmpeg settings you can get really confused really quickly. Much of the information is out of date as FFmpeg has been changed and updated over the last 14 years.

I'm going to get you started by outlining the settings for this particular goal – encoding high-quality videos in MPEG-4 for long-term archive. For these examples, we'll be converting a video called MountainHike.avi into an MPEG-4 version called MountainHike.mp4. This example is based on converting videos from my Canon digital camera. It records videos in .AVI format using a Motion-JPEG video codec. The resulting .MP4 videos are about 1/10 the size of the originals, look just as good (to my eyes) and play on a greater variety of devices.

The Minimal Command-Line (that works)

FFmpeg is a command line tool so you need to launch an command-line shell. Here's the minimal command-line to do our conversion.

ffmpeg -i MountainHike.avi -pix_fmt yuv420p MountainHike.mp4

There are three parameters in this line:
  • -i MountainHike.avi
Specifies the input file name.
  • -pix_fmt yuv420p
Specifies that the pixel format should be YUV4:2:0. All you really need to know about this is that there are a number of different pixel formats. Some offer better quality than YUV4:2:0 but none are as commonly supported. If you don't specify a format then FFmpeg will preserve whatever format was in the original video and there's a very good chance that your player will not support that format. So, it's best to specify the pixel format.
  • MountainHike.mp4
A parameter without any prefix is considered to be the destination file name. Since the file name has a .mp4 extension, FFmpeg infers that the destination format is MP4 and it defaults the video and audio codecs to H.265 and AAC respectively. Those happen to be what we want and so thinks work. But, to optimize quality and compatibility we need a few more settings.

Explicitly Specify the Codecs and the File Format

ffmpeg -i MountainHike.avi -pix_fmt yuv420p -c:v libx264 -c:a libfdk_aac -f mp4 MountainHike.mp4

It's a good idea to explicitly specify which codecs to use and the destination file format. That way you're sure you're getting what you expect. The command line above does that. Here is what the additional parameters do:
  • -c:v libx264
Specifies that the video codec should be H.264.
  • -c:a libfdk_aac
Specifies that the audio codec should be AAC.
  • -f mp4
Specifies that the container file format should be MP4 (also known as ISOM or ISO base media file format).

Setting the MPEG-4 Profile for Compatibility

ffmpeg -i MountainHike.avi -pix_fmt yuv420p -c:v libx264 -c:a libfdk_aac -profile:v main -level 3.1 -f mp4 MountainHike.mp4

The MPEG-4 standards specify a number of different feature profiles. The best known are "baseline", "main", and "high". Within each profile are levels. the "main" profile with level "3.1" is supported by most mainstream devices including desktops, tablets, and phones. So it's a good choice to ensure compatibility.

Here are what the additional parameters do:
  • -profile:v main
Specifies that the MPEG-4 "main" profile should be used.
  • -level 3.1
Specifies level 3.1 within the main profile.

Setting the Video Quality

ffmpeg -i MountainHike.avi -pix_fmt yuv420p -c:v libx264 -c:a libfdk_aac -profile:v main -level 3.1 -crf 18 -f mp4 MountainHike.mp4

MPEG-4 can achieve higher video quality at the expense of size, or vise versa. In FFmpeg the CRF or Constant Rate Factor is the best parameter for managing quality. Values range from 0 (extremely high quality and high bitrate) to 51 (very low quality and low bitrate). The default is 23 and represents a good balance between quality and size. "Sane" values range from 18 to 28. Reducing CRF by six points will roughly double the file size.

Here's the additional parameter:
  • -crf 18
Since I'm archiving family videos and storage will only get cheaper with time, I'm choosing 18 for the maximum practical quality.

Tweaking the Audio Quality

You can use parameters to tweak the audio quality but I recommend leaving them alone. With no audio parameters, it will automatically select stereo or mono according to the input video and uses 128 kbps which is very good quality. If you do want to tweak the audio quality, start with this article.

Please Share

That's about all there is to it. If you have settings that work particularly well for you, please share in the the comments section. Happy transcoding!

06 June 2014

Building FFmpeg for H.264 and AAC

I'm planning to encode a bunch of family videos into MPEG-4 with H.264 and AAC. In my next post I'll get into the details of the command-line settings.

Due to licensing issues, the pre-built versions of FFmpeg for Windows that you can download do not include AAC audio encoding. For maximum compatibility across Windows, MacOS, iOS and others I need to use AAC. So, it becomes necessary to download and build FFmpeg from the source code.

The following are instructions for building FFmpeg in 64-bit with H.264 and AAC support. It's pretty straightforward for anyone who's used command-line software. But, if these instructions look too intimidating you might pay a college student $15 to do this and send you the result.

The build is on Windows and is targeted at 64-bit Windows. If you run into problems, first check the comments to see if someone else has addressed the issue, then check the original sources in the list below. Finally, if you have hints or solutions to emerging issues please comment for the sake of others. Here are the sources from which I assembled all of this (along with some trial and error):
Everything will be done in a new "ffb" folder (for "FFmpeg build"). There are no changes to the registry, no software installation programs to run. When you're finished just delete the "ffb" folder and your system will be as pristine as when you started. (But don't forget to copy the FFmpeg.exe file out of there before deleting the folder!)

1. Download and install MinGW-64 with MSYS

MinGW is a minimalist GNU Compliler collection for windows. MSYS is a set of Unix-like build utilities. There are a number of versions of these tools out there. In addition to the basic MinGW and MSYS you need a bunch of libraries and header files. Nyakov pointed to a package on xhmikosr.1f0.de that has all of the needed packages. For convenience, I've repackaged it as a .zip file from the original 7-Zip.

1.a. Create a folder called "ffb" in the root of your "C" drive (C:\ffb). You can put this elsewhere but the instructions below will be easier if it's in the root of "C". 
1.b. Download MSYS_MinGW-w64_GCC_483_x86-x64_Full.zip. It's a big file, approximately 170MB. If you've got 7-Zip handy you can download this smaller version from xhmikosr.1f0.de. You can also use a download manager.
1.c. Open the MSYS_MinGW-w64_GCC_483_x86-x64_Full.7z package using 7-Zip. Copy the MSYS folder and all of its contents into C:\ffb. So, now you have folder called C:\ffb\MSYS.
1.d. In the Windows File Explorer browse to C:\ffb\msys\postinstall and launch "pi.bat". The batch file will ask "Do you wish to continue..." You answer:  y (enter). It will ask "Do you have "MinGW" installed?" You answer: y (enter). It will ask "Where is your MinGW installation?" You answer: C:/ffb/MSYS/mingw (enter).
This is a post install process that will try to normalize between
your MinGW install if any as well as your previous MSYS installs
if any.  I don't have any traps as aborts will not hurt anything.
Do you wish to continue with the post install? [yn ] y

Do you have MinGW installed? [yn ] y

Please answer the following in the form of c:/foo/bar.
Where is your MinGW installation? C:/ffb/MSYS/mingw

        Normalizing your MSYS environment.

You have script /bin/cmd

Oh joy, you do not have C:/ffb/MSYS/mingw/bin/make.exe. Keep it that way.

When you configured MSYS, it created a "home" folder with your username. For these instructions we'll pretend that your username is "Fred". In the tasks that follow, substitute your username wherever "Fred" appears.

2. Download the source code packages

You'll need source code to the following packages. Download each from the specified URL

LAME MP3 audio encoder
Browse here and download lame-3.99.5.tar.gz
If the version you get is not 3.99.5 then either search the code repository for the earlier version or use the new version name in the commands that follow.

FDK AAC audio encoder
Browse here and download fdk-aac-0.1.3.tar.gz
As with the MP3 encoder. if the version is different from 0.1.3 you'll either need to search for the earlier version or use the new version name in the commands that follow.

VideoLAN x264 video encoder for H.264
Browse here and download last_x264.tar.bz2

FFmpeg video conversion utility
Browse here and scroll down to the "FFmpeg releases" section. Click on the "Download bzip2 tarball" link.
In my case, I chose the "FFmpeg 2.2.3 Muybridge" version which was released on 2014-06-03.

Move the four downloaded packages to your MSYS home folder, "C:\ffb\msys\home\Fred". (Remember, substitute your username for "Fred".)

3. Launch the MSYS command-line shell

MSYS has it's own command-line shell. Launch "C:\ffb\msys\msys.bat" to get it running. Then type the following command to make sure all the files are in the right place:

Fred@System ~
$ ls
fdk-aac-0.1.3.tar.gz  lame-3.99.5.tar.gz
ffmpeg-2.2.3.tar.bz2  last_x264.tar.bz2

4. Build the LAME MP3 audio Encoder

In the MSYS command-line shell type the following commands:
tar xvfz lame-3.99.5.tar.gz
cd ~/lame-3.99.5
./configure --prefix=/usr/local/x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-static --disable-shared --disable-decoder --enable-nasm
make clean && make
make install
cd ~
Fred@System ~
$ tar xvfz lame-3.99.5.tar.gz
    ... a bunch of stuff ...

Fred@System ~
$ cd ~/lame-3.99.5

Fred@System ~/lame-3.99.5
$ ./configure --prefix=/usr/local/x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-static --disable-shared --disable-decoder --enable-nasm
configure: WARNING: if you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used
checking build system type... i686-pc-mingw32
checking host system type... x86_64-w64-mingw32
checking for a BSD-compatible install... /bin/install -c
    ... a bunch of stuff ...
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands

Fred@System ~/lame-3.99.5
$ make clean && make
Making clean in vc_solution
make[1]: Entering directory `/home/Fred/lame-3.99.5/vc_solution'
rm -rf .libs _libs
    ... a whole bunch of stuff ...
make[2]: Nothing to be done for `all-am'.
make[2]: Leaving directory `/home/Fred/lame-3.99.5'
make[1]: Leaving directory `/home/Fred/lame-3.99.5'

Fred@System ~/lame-3.99.5
$ make install
Making install in mpglib
make[1]: Entering directory `/home/Fred/lame-3.99.5/mpglib'
make[2]: Entering directory `/home/Fred/lame-3.99.5/mpglib'
    ... a bunch of stuff ...
Libraries have been installed in:
    ... more stuff ...
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/home/Fred/lame-3.99.5'
make[1]: Leaving directory `/home/Fred/lame-3.99.5'

Fred@System ~/lame-3.99.5
$ cd ~

Fred@System ~

5. Build the FDK AAC audio encoder

In the MSYS command-line shell type the following commands:
tar xvfz fdk-aac-0.1.3.tar.gz
cd ~/fdk-aac-0.1.3
./configure --prefix=/usr/local/x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-shared=no
make clean && make
make install
cd ~
Fred@System ~
$ tar xvfz fdk-aac-0.1.3.tar.gz
    ... a bunch of stuff ...

Fred@System ~
$ cd ~/fdk-aac-0.1.3

Fred@System ~/fdk-aac-0.1.3
$ ./configure --prefix=/usr/local/x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --enable-shared=no
checking for a BSD-compatible install... /bin/install -c
checking whether build environment is sane... yes
checking for x86_64-w64-mingw32-strip... x86_64-w64-mingw32-strip
    ... a bunch of stuff ...
config.status: creating fdk-aac.pc
config.status: executing depfiles commands
config.status: executing libtool commands

Fred@System ~/fdk-aac-0.1.3
$ make clean && make
test -z "libfdk-aac.la" || rm -f libfdk-aac.la
rm -f "./so_locations"
rm -rf .libs _libs
    ... a bunch of stuff ...
  CXX    libSYS/src/wav_file.lo
  GEN    libfdk-aac.la
copying selected object files to avoid basename conflicts...

Fred@System ~/fdk-aac-0.1.3
$ make install
make[1]: Entering directory `/home/Fred/fdk-aac-0.1.3'
 /bin/mkdir -p '/usr/local/x86_64-w64-mingw32/lib'
    ... some stuff ...
 /bin/mkdir -p '/usr/local/x86_64-w64-mingw32/lib/pkgconfig'
 /bin/install -c -m 644 fdk-aac.pc '/usr/local/x86_64-w64-mingw32/lib/pkgconfig'

make[1]: Leaving directory `/home/Fred/fdk-aac-0.1.3'

Fred@System ~/fdk-aac-0.1.3
$ cd ~

Fred@System ~

6. Build the x264 video encoder

In the MSYS command-line shell type the following commands. Since VideoLan posts daily snapshots, the name of the folder to which the tarball unpacks will probably be different from the one shown in the "cd" command. Look at the output from the "tar" command and use the corresponding folder name on the "cd" command:
tar xvjf last_x264.tar.bz2
cd ~/x264-snapshot-20140605-2245
./configure --prefix=/usr/local/x86_64-w64-mingw32 --cross-prefix=x86_64-w64-mingw32- --host=x86_64-w64-mingw32 --enable-static --bit-depth=8 --enable-win32thread
make clean && make
make install
cd ~
Fred@System ~
$     ... a bunch of stuff ...

Fred@System ~/x264-snapshot-20140605-2245
$ ./configure --prefix=/usr/local/x86_64-w64-mingw32 --cross-prefix=x86_64-w64-mingw32- --host=x86_64-w64-mingw32 --enable-static --bit-depth=8 --enable-win32thread
platform:      X86_64
system:        WINDOWS
cli:           yes
    ... some stuff ...
bit depth:     8
chroma format: all

You can run 'make' or 'make fprofiled' now.

Fred@System ~/x264-snapshot-20140605-2245
$     ... a bunch of stuff ...
deo/crop.o filters/video/depth.o input/avs.o input/threa
.a -lgpac_static -lz -lws2_32 -lwinmm  -lshell32 -m64

Fred@System ~/x264-snapshot-20140605-2245
$ make install
install -d /usr/local/x86_64-w64-mingw32/bin
install x264.exe /usr/local/x86_64-w64-mingw32/bin
    ... some stuff ...
install -m 644 libx264.a /usr/local/x86_64-w64-mingw32/lib
x86_64-w64-mingw32-ranlib /usr/local/x86_64-w64-mingw32/lib/libx264.a

Fred@System ~/x264-snapshot-20140605-2245
$ cd ~

Fred@System ~

7. Build FFmpeg

In the MSYS command-line shell type the following commands:
tar xvjf ffmpeg-2.2.3.tar.bz2
cd ~/ffmpeg-2.2.3
CPPFLAGS="$CPPFLAGS -I/usr/local/x86_64-w64-mingw32/include" ./configure --extra-ldflags='-L/usr/local/x86_64-w64-mingw32/lib' --prefix=/usr/local/x86_64-w64-mingw32 --cross-prefix=x86_64-w64-mingw32- --target-os=mingw32 --enable-w32threads --enable-memalign-hack --arch=x86_64 --enable-runtime-cpudetect --disable-debug --enable-static --disable-shared --disable-ffplay --disable-ffserver --enable-gpl --enable-version3 --enable-nonfree --enable-libmp3lame --enable-libfdk-aac --enable-libx264
make clean && make
make install
cd ~
Fred@System ~
$ tar xvjf ffmpeg-2.2.3.tar.bz2
    ... a bunch of stuff ...

Fred@System ~
$ cd ~/ffmpeg-2.2.3

Fred@System ~/ffmpeg-2.2.3
$ CPPFLAGS="$CPPFLAGS -I/usr/local/x86_64-w64-mingw32/include" ./configure --extra-ldflags='-L/usr/local/x86_64-w64-mingw32/lib' --prefix=/usr/local/x86_64-w64-mingw32 --cross-prefix=x86_64-w64-mingw32- --target-os=mingw32 --enable-w32threads --enable-memalign-hack --arch=x86_64 --enable-runtime-cpudetect --disable-debug --enable-static --disable-shared --disable-ffplay --disable-ffserver --enable-gpl --enable-version3 --enable-nonfree --enable-libmp3lame --enable-libfdk-aac --enable-libx264
install prefix            /usr/local/x86_64-w64-mingw32
source path               .
C compiler                x86_64-w64-mingw32-gcc
    ... a bunch of stuff ...
License: nonfree and unredistributable
Creating config.mak, config.h, and doc/config.texi...
config.h is unchanged
config.asm is unchanged
libavutil/avconfig.h is unchanged

WARNING: x86_64-w64-mingw32-pkg-config not found, library detection may fail.

Fred@System ~/ffmpeg-2.2.3
$ make clean && make
CC      libavdevice/alldevices.o
CC      libavdevice/avdevice.o
CC      libavdevice/dshow.o
    ... a whole bunch of stuff ...
CP      ffmpeg.exe
STRIP   ffprobe.exe
STRIP   ffmpeg.exe

Fred@System ~/ffmpeg-2.2.3
$ make install
INSTALL doc/ffmpeg.1
INSTALL doc/ffprobe.1
INSTALL doc/ffmpeg-all.1
    ... a bunch of stuff ...
INSTALL libavutil/avconfig.h
INSTALL libavutil/ffversion.h
INSTALL libavutil/libavutil.pc

Fred@System ~/ffmpeg-2.2.3
$ cd ~

Fred@System ~

FFMpeg is ready

If all of the above has proceeded without significant errors, the result will be four applications all located in C:\ffb\MSYS\local\x86_64-w64-mingw32. They are:

  • ffmpeg.exe: The video converter application we were seeking through this exercise.
  • ffprobe.exe: An application for reporting information about a multimedia file or stream including the container type, codecs used, resolution, metadata and so forth.
  • lame.exe: A command-line encoder for MP3 audio files.
  • x264.exe: A command-line version of the x264 video encoder.
So, how do you put FFmpeg to work converting your video files? That will be the subject of my next blog post.

17 May 2014

CISS for Massive Printer Ink Savings

I'm dedicating my inaugural post on this blog to something that has saved me many hundreds of dollars.

Like many of you, I have a color ink jet printer at home. And for a long time I spent a lot of money on ink cartridges. Consumer Reports has found that printer ink costs between $13 and $75 an ounce. Indeed, we once had a printer that only cost $65 and yet a replacement set of ink cartridges cost $70. It went through ink so rapidly that we ended up giving it away just to save money.

We tried a number of alternatives such as recycled ink cartridges, refilling services, and refilling our own cartridges. All worked, all saved money, but none came close in convenience or savings to a Continuous Ink Supply.

Continuous Ink Supply

There is a cluster of manufacturers making Continuous Continuous Ink Supply Systems (abbreviated "CIS" or sometimes "CISS"). These include replacement ink cartridges with a set of tubes that connect to large inkwells which you place next to the printer.

In my case, I use an HP OfficeJet 6500A All-In-One that uses HP 920 Ink Cartridges.

This model has been discontinued and so remaining units are overpriced. But when it was new it cost me $225. Similar, but newer models are available. I originally chose it over less expensive models because, at the time, it was rated as one of the best for cost of supplies. Even so, a new set of cartridges cost $69.50 on Amazon.com. So after four sets of cartridges I exceeded the cost of the printer.

Two years ago I chose a CIS system from InkXPro.com. At the time it cost $99.00 which was less than two sets of cartridges (it costs even less now). Yet it came with 400ml of ink pre-installed. It's hard to tell for sure but a rough guess is that it's equivalent to around 20 sets of cartridges. That was a huge savings! But almost as important, once I got it installed I went for nearly a year without having to mess with ink in any way. No need to replace cartridges. No bad prints because of expended cartridges. And no additional costs.

Here's a shot of my printer with the system installed. You can see the case with the add-on inkwells to the right.

Here's a picture of the interior. You can see the aftermarket cartridges and ink tubing ribbon that feeds them.

And here's a closeup of the inkwells. You can see the notch I cut in the printer cover with a nibbler tool to allow the ink tubing to pass inside.

When the ink finally got depleted to about 20% (which is when they recommend you replenish the ink), I bought six 100ml bottles of ink (three of black and three colors) for less than $30.

Too Good to be True?

It's not all a cakewalk. The instructions aren't going to win any prizes for quality writing. I had to cut a notch int the printer for the ink ribbon. I would have voided the warranty if it hadn't run out already. The installation is a bit fussy – requiring some trial and error. And you need gloves and a bunch of paper towels because it's inevitable that you will have a few ink drips when installing.

However, once you get the system functioning it can go for months or years and thousands of prints with minimal additional care.


Here are some tips from my experience. Hopefully they'll help you get functioning quickly.
  • Time: Allocate a couple of hours for the installation. It shouldn't take that long – the instructions are simple enough and there aren't very many tasks to perform. But I've installed these twice and both times I had to fuss with them before things worked well. So have enough time and be patient trying things until everything works. The rest of these tips will give you an idea of some of the things I had to fuss with.
  • Protect your workspace: During installation, put the printer on a non-absorbent surface and have a roll of paper towels handy. Ink drips are virtually guaranteed. The water soluble ink will easily clean up from non-porous surfaces. But anything porous (tablecloths, clothes, etc.) can be stained.
  • Protect youself: Wear gloves (to keep your hands from being stained) and grubby clothes.
  • Youtube it: See if there's a YouTube video showing installation of a CIS on your particular printer model. I found one for mine. Though I didn't follow the exact same approach (I routed my ink ribbon differently) it was still very helpful. Try searches for "CIS" or "CISS" and your printer model.
  • Priming the printhead: If you have a brand new printer, use the manufacturer's cartridges to begin with. The printer has to prime the print head and many printers won't do that properly from the CIS (or from any aftermarket cartridges for that matter).
  • Chip wars: To limit the aftermarket for print cartridges, most manufacturers (including Epson and HP) have chips embedded in their print cartridges. Some CIS kits include instructions for removing the chips from OEM cartridges and installing them on the new CIS cartridges. Some manufacturers redesigned their cartridges to make the chips harder to remove. Lawsuits followed. At this point, most CIS kits come with cloned chips. In my case, the printer displays the message "non-HP cartridges installed" whenever I restart the printer. After I clear the message everything works. Before buying a kit, find out what the chip situation is for your particular printer and CIS combo.
  • Chip Removal: If your kit DOES require chip removal there are two common methods. One is to carefully remove it with an X-Acto knife. The other is to heat it gently with a lighter or heat gun to soften the adhesive. I've used both methods successfully. If using heat, don't get the lighter too close or let the flame actually touch the chip. Within about half an inch for two seconds is sufficient. 
  • Dye vs. pigment ink: There's a lot of discussion online about pigment ink (which have suspended color solids) vs dye ink (where the color is dissolved in the liquid). Generally they say that pigment has more vivid colors and doesn't fade as easily. However, dye inks have improved over the last decade (more fade-resistant than before) and they have always been less prone to clogging the printhead. I recommend using whatever your printer originally used. In my case, (HP 6500A) that means pigment for black and dye for the colors. I've had excellent results with this setup.
  • Syringes for ink transfer: The same vendor that sells your CIS will also sell chip refilling supplies. One of the most common tools is a 5ML syringe with a blunt needle. These are the best and least-messy way to transfer ink. They also aren't very expensive. Have a few on hand.
  • Chip positioning: The manufacturer of the cartridges in my kit could have done a better job of making moldings to align the chips right. This is where I spent the most time fussing with it. I had to remove the chips (they're held on with double-stick tape) and re-position them using an original cartridge for comparison. It took several tries before the printer would recognize the cartridges.
  • Caps and air filters: The ink wells have vents in the top. They should come with the vents plugged with caps. After installation but before printing you must remove the caps and replace them with air filters. The instructions on my kit weren't very clear about this. It's worth purchasing some spare filters. I've had ink splash into them, clogging them up. And they don't cost very much. Here's what the air filters look like:
  • Position the tanks low during installation: To install the cartridges, you have to remove covers, turn them opening side down and snap them into place. The first time I did this I dripped ink all over the inside of the printer. You can prevent this (or at least reduce it) by doing two things. First, make sure the vents on your ink wells are plugged (see "Caps and air filters above"). Next, position the wells as far below the level of the printer as possible during the installation. This will create negative pressure in the cartridges and reduce dripping.
  • Position the tanks level with the printer during operation: The ink flows according to pressure. Keeping the tanks level with the printer will keep things flowing properly. (Some, unusual setups have you put the wells above the printer. When in doubt, follow the instructions that came with your kit.)
  • Use "clean print heads" liberally: To get things started, remove bubbles from the ink lines and so forth you can run your printer through it's head cleaning cycle. This wastes ink but with a CIS that's no longer a serious concern.
  • Make sure the cartridges in the printer are at least 2/3 full of ink: During installation, or after many months of use, the air gap at the top of the cartridges may grow. The cartridges should be at least 2/3 full of ink. If ink drops below you need to "purge" the air. Here's my method: 1) Glove up and get a roll of paper towels. 2) Fill a syringe with ink of the appropriate color (use the blunt-tipped needle). 3) Cap off the vents in all of your inkwells. 4) Move the inkwells to a level below the printer. 5) Carefully remove the tube from the top of the cartridge that is low. 6) Fill the cartridge to the top using the syringe and blunt needle. 7) Replace the tube. 8) Blot up any ink that dripped using a paper towel. 9) Restore the inkwells to the right level and restore the air filters. 10) Run the printer through a head-cleaning cycle to clear bubbles from the ink tubes.
  • Refill your inkwells when they near 20%: If you let your inkwells run dry then you'll get bubbles in the system and have to spend a bunch of effort priming the system again. Better just to keep your inkwells topped off. I found the least messy way to transfer ink is with the syringe/blunt needle combo even though it takes several repeats with large inkwells.
Reading the above seems like it takes lots of fussing to get things to work right. It does take a bit of fussing at the outset and then occasional service after lots (and lots) of prints. Since installing the CIS we've printed more than 10,000 pages on this printer. We've kind of gotten a bit liberal with printing because ink costs so little. So, proportional to the number of pages printed it's actually been very reasonable amount of effort.

Here are some of the vendors from which I've purchased products. I don't know if they're really better than others but they've worked for me.

(Full disclosure: I have an Amazon Partners account. So, if you purchase something from Amazon after following one of my links I'll get a minuscule commission. I have no relationship to the vendors listed below and don't get anything for mentioning them.)
  • InkXPro: This is where I bought my kit.
  • BCH Ink: Seems to be one of the better brands of ink with lots of endorsements (and occasional counterfeits). I've used it to refill my system with good results. I usually buy them on Amazon.
  • InkProducts: I've bought a few supplies from these guys. One innovation is that they offer "chip blocks" for printers using HP 920 and 564 ink cartridges. These blocks hold the chips in exactly the right place so you can insert and remove aftermarket ink cartridges without chip issues.
  • HotZone360: I haven't dealt with them at all. But they sell and support printers with pre-installed CIS systems at reasonable prices.
  • InkSystem: Another vendor with a line of printers with pre-installed CIS systems. That's a great way to avoid the installation complexities!
  • CISInks: Yet another vendor. I haven't tried them but their website offers a complete line and helpful videos.
I hope you have similar success to mine!

(Updated with more tips on 15 December 2014)