Troubleshooting

Dealing with Codecs

Understanding Codec Basics

In order to play a video (or make thumbnails using CLAutoThumbnailer) you need at least three additional pieces of software:

  1. A “splitter” (aka demultiplexer).

  2. A video codec.

  3. An audio codec.

The “splitter” splits the video file into separate audio and video streams that the other two codecs can use. I recommend using the either the splitter that comes with Microsoft Expression Encoder 4 or the Haali Media Splitter.

For the video and audio codecs, I recommend either the codecs specifically shipped with Microsoft Expression Encoder 4 and whose names start with “Expression Encoder” or the ffdshow codec. I personally use the K-Lite Codec Pack which includes the ffdshow codec, Haali and Gabest splitters along with many other useful tools.

Unfortunately, just because you can play a video doesn’t mean that you can generate thumbnails for it. This is because Microsoft Expression Encoder 4 maintains a separate list of enabled codecs (which it calls “filters”) that also has to be set correctly. This is explained in more detail in the next section.

Microsoft Expression Encoder 4’s Video Filter List

Even though CLAutoThumbnailer is a command line program, it is written using the Microsoft Expression Encoder 4 SP1 SDK so it also depends on the Microsoft Expression Encoder 4 user interface. In particular, CLAutoThumbnailer uses the exact same enabled video filter set that Microsoft Expression Encoder 4 is currently using.

See Troubleshoot playback problems for instructions on how to enable and disable video filters (aka video codecs). If Microsoft Expression Encoder 4 can’t import a video then CLAutoThumbnailer will also be unable to generate thumbnails for that video, and you’ll see the “isn’t a video file” error message. Any tips you find online for importing videos for Microsoft Expression Encoder 4 will also apply to CLAutoThumbnailer.

When you first install Microsoft Expression Encoder 4 it enables all the video filters that it finds on your system. For tracking down problems however, it’s much better to use only a very limited set of filters:

Recommended ffdshow filter set

Recommended filter set when using ffdshow codecs

Recommended |EE| filter set

Recommended filter set when using Microsoft Expression Encoder 4 codecs

If you need to support MPEG video files then enabling Microsoft’s MPEG-I Stream Splitter filter might be required.

Another “set” to try is enabling all the Microsoft filters.

You can click on any column label in the Compatibility filter list to sort by that column. You can also resize a column by dragging near the edge of its header.

You don’t have to restart Microsoft Expression Encoder 4 to see the effect of changing filters. Once it is able to import a troublesome video, just run CLAutoThumbnailer again.

Microsoft Expression Encoder 4 has a cache that it uses when importing videos. This doesn’t affect CLAutoThumbnailer but if you want to force Microsoft Expression Encoder 4 to analyze a file after importing, you need to clear the cache by choosing Tools ‣ Options..., clicking on the Other tab, and clicking the Clear Cache button.

Clearing the |EE| cache

Clearing the Microsoft Expression Encoder 4 cache

The ffdshow codec

If you are using the highly recommended ffdshow codecs then you might have to configure them. In particular they have a codec pane that lists all the supported codecs, whether they are enabled or not, and which decoder is being used.

ffdshow codecs pane

ffdshow codecs configuration pane

It’s also helpful to make sure a System Tray icon is displayed whenever the ffdshow video codec is being used:

ffdshow Tray, dialogs, & paths pane

ffdshow Tray, dialogs, & paths pane

You might want to also display a dialog whenever a “new” application trys to use the ffdshow codec:

ffdshow DirectShow control pane

ffdshow DirectShow control pane

Common Problems

Why do I get the following error messages when trying to run clatn?

‘clatn’ is not recognized as an internal or external command, operable program or batch file.

You didn’t follow the instructions for copying clatn.bat to a directory in your current PATH. See this for more information.

‘C:\Program Files\CLAutoThumbnailer\CLAutoThumbnailer.exe’ is not recognized as an internal or external command, operable program or batch file.

You didn’t follow the instructions for editing clatn.bat so that it points to the correct location of CLAutoThumbnailer.exe. See this for more information.

Why do I see a “Could not load file or assembly Microsoft.Expression.Encoder” message?

If you see the following when you try to run CLAutoThumbnailer:

Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'Microsoft.Expression.Encoder, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. Invalid pointer (Exception from HRESULT: 0x80004003 (E_POINTER)) ---> System.ArgumentNullException: Value cannot be null.
Parameter name: input
   at System.IO.BinaryReader..ctor(Stream input, Encoding encoding)
   at CLAutoThumbnailer.Loader.FindAssembly(Object sender, ResolveEventArgs args)
   at System.AppDomain.OnAssemblyResolveEvent(RuntimeAssembly assembly, String assemblyFullName)
   --- End of inner exception stack trace ---
   at CLAutoThumbnailer.CLAutoThumbnailer.ProcessFiles(List`1 filenames, StringdisplayFilename, String outputDirectory)
   at CLAutoThumbnailer.CLAutoThumbnailer.Main(String[] args)
   at CLAutoThumbnailer.Loader.Main(String[] args)

it means you forgot to install the free Microsoft Expression Encoder 4 which is a prerequisite for running CLAutoThumbnailer. Please see the Installation Instructions.

Why do I see the “isn’t a video file” message?

Make sure you close any open video players that are viewing that same file.

Also see Supported file formats

Follow these steps to help troubleshoot problems with unrecognized video files:

  1. Make sure BS.Player can play the video. Right-click on the video and choose Options ‣ Filters ‣ Advanced to see the codecs that BS.Player is using to view the video. Unfortunately, BS.Player typically uses its own private copy of these codecs but this information is still helpful when enabling filters in Microsoft Expression Encoder 4.

    |BSP| :menuselection:`Options --> Filters --> Advanced` Dialog box

    BS.Player Options ‣ Filters ‣ Advanced Dialog box

    Remember that even though CLAutoThumbnailer is only generating thumbnails, the proper audio codec also has to be installed on your system in order for it to open a particular video file.

    If BS.Player can’t play the video file then it might be corrupt.

  2. See if you can import the video using Microsoft Expression Encoder 4.

    If Microsoft Expression Encoder 4 can’t import the video it will sometimes display a helpful message explaining the reason why.

    If you are using the recommended ffdshow filter set try switching to the Microsoft Expression Encoder 4 filter set and vice versa. See here for more information.

    You can try asking about your problem on the Microsoft Expression Encoder Forum. They won’t be able to answer any questions about CLAutoThumbnailer, but getting Microsoft Expression Encoder 4 to correctly import a video will almost always also solve the problem for CLAutoThumbnailer.

  3. Use MediaInfo to figure out exactly what codec the offending video is using. Then try enabling some filters that appear to support that codec in Microsoft Expression Encoder 4. You also use the information displayed by BS.Player mentioned in this step to get a hint about what filters to enable.

  4. Try GraphStudio to see what codecs are used by default to render the video. If GraphStudio can play the video, then you can try enabling those filters in Microsoft Expression Encoder 4.

  5. If you are using the ffdshow codec you might have to configure it. See The ffdshow codec for more information.

  6. As a last ditch effort you can try enabling all the video filters in Microsoft Expression Encoder 4 and then seeing if you can import the video. If this is successful, then you “just” have to narrow down the list until only a few filters are enabled (google “binary search” for a “quick” way of doing this).

Why does Microsoft Expression Encoder 4 display the “Error: File type isn’t supported.” message?

If Microsoft Expression Encoder 4 displays an “Error: File type isn’t supported.” message when you import a video, try using the Gabest splitter(s) and disable the Haali Media Splitter(s).

This seems to happen particularly with MPEG encoded videos.

How do I fix broken video files?

Once you’ve determined that a video file appears to be corrupt, all is not lost. You can see if DivFix++ (for AVIs), Meteorite (for MKVs), or asfbinwin (for WMVs and ASFs) can fix it.

Why is CLAutoThumbnailer crashing?

If CLAutoThumbnailer crashes with a lengthy “Unhandled Exception” message, then there is probably some error in the program and you should report a bug here.

However, if it just crashes silently and mysteriously bounces you back to the Command Prompt the problem is more likely with the video codec you are using. Oftentimes, just trying again solves the problem. If not, try switching to the Microsoft Expression Encoder 4 filters if you are using the ffdshow codec or vice versa.

The ffdshow codec can be sensitive to its configuration settings. You might want to bring up the “ffdshow video decoder configuration” Dialog box and look around and see if any of the settings are obviously wrong. ffdshow usually has two options for decoder for any format, so try the other if one always seems to crash. For example, if the Xvid decoder is causing problems try libavcodec instead.

Why don’t my thumbnails match what I see with my video player?

This seems to be particularly a problem with MPEG2 encoded (aka VOB) files. The workaround is to use the Microsoft Expression Encoder 4 player to check thumbnail times.

Useful tools

MONOGRAM GraphStudio

File ‣ Render Media File... (Ctrl+R)

MONOGRAM GraphStudio screenshot

MONOGRAM GraphStudio screenshot

MediaInfo

MediaInfo screenshot

MediaInfo screenshot

asfbinwin

“Intuitive, fast and reliable tool for processing ASF and WMV files.

Asfbin is a full implementation of ASF file specification completely independent from Microsoft Windows Media Format SDK. This makes Asfbin especially powerful when it comes to fixing damaged ASF/WMV files. It can repair almost all types of errors within your favourite video files.”

DivFix++

“DivFix++ is FREE AVI Video Fix & Preview program.”

Meteorite

“Meteorite Project is DivFix++ like program but for Matroska/MKV files. It can repair your corrupted MKV video files to make it compatible with your player.”