Return to Digital Photography Articles

What are THM files?

THM files are THuMbnails that are automatically generated alongside certain larger photo and video file types, such as Canon's RAW (.CRW) and movies (.AVI). The THM file format is essentially identical to the JPEG File Format (JFIF) -- in fact, renaming a suitable (i.e. small) .JPG image file to .THM effectively creates a THM thumbnail. Similarly, renaming a *.THM file to *.JPG will allow you to double-click and open in a photo viewer.

In addition to the compressed image data, a JPEG file contains a series of markers that carry useful metadata -- details about how the photo was taken, camera settings, etc. While most of this metadata is written by the camera itself, some items are done by the user by a catalog / photo browser program. These details include titles, descriptions, keywords and many other fields (even GPS coordinates!).

The specification of the JPEG (or THM) file format is openly published, and so inserting in additional metadata into a file is generally no problem. Unfortunately RAW file formats (e.g. .CRW or .CR2 in the case of Canon) are proprietary and not published. Therefore, it is very difficult (or risky) for a third-party program to make modifications to these files, such as the addition of metadata content.

Since Canon (and other manufacturers) realize that a) they want to keep their RAW format secret and b) they must allow some means for people to annotate the metadata, the solution is to create a "buddy file" mechanism. THM files are the buddy-files associated with Canon RAW files.

A .THM file is simply a small JPEG preview image that is used to house all of the writeable metadata content that would otherwise be written into the associated RAW file. The THM and RAW file must have exactly the same name, and any file operation (copy, move, delete) must be done to both in order to maintain the link.

Therefore, you might find a 20061015_1234.CRW along with a 20061015_1234.THM file in your image directory.

Why do you need to write metadata?

Ideally, you would have a writeable metadata format associated with all images in your database. This allows you to associate metadata (e.g. IPTC) with each image.

Advantages of being able to write the metadata:

  • Allows rebuild of catalog database categories should the database get corrupted
  • Allows export to another catalog program

RAW files require a buddy .THM file to accomplish this update with third-party utilities.

Can I delete THM files?

While these THM files might appear to clutter up your image directories, try to avoid the temptation in deleting them! Eventually, you may run into problems when managing the RAW files within a digital asset management program (photo catalog database), where you may want to associate additional metadata with the images.

If you did delete them, then please check out the article: recreating THM files from RAW.

Unfortunately, it's easy to accidentally delete these .THM files when you are working in an environment that isn't buddy-file aware (such as Windows XP). Most aware environments will perform the same operation on the original and associated buddy file (rename, copy, delete). Doing this outside such an editor can cause the association to become broken.

I discovered that a number of my older RAW files were missing the associated THM file, which was immediately flagged by catalog program as soon as I tried to open up an IPTC editor window.

 


Reader's Comments:

Please leave your comments or suggestions below!
2008-02-24tim
 try "super" from erightsoft for a free video converter. The website looks dodgy but the product itself seems to work well
2008-01-11vonda
 i took some pics with my minolta ae 2 and i have a .THM
files . how do i change them so i can see them ? they are of my child playing Basketball..we run windows xp? please help
 The key point is that the .THM doesn't actually contain anything important -- the actual image or video you're looking for will be in a .JPG or .AVI file by the same name. Think of the THM file as just a preview of what the main file should contain.
2007-12-26Balmung
 I have the same problem above. I can't figure out how to play videos from my canon ixus. I want to put some AVI videos to my digicam and play it on my tv with TV-out. I tried converting flv files to avi and put it on my digicam but with no luck. Is there any converters compatible with my camera's video codec?
 Please try out the steps indicated in my response to Collin's similar question below. Let me know if you have any troubles.
2007-12-22collin
 I just purchased this same camera and I am trying to run videos on it as well. I have copied the post below from a different person asking the same question. Please let me know if you were able to figure out how to get this working. Thank you.

< -- Comment from 2007-07-30 Regarding Canon IXUS 75 -- >
 The hardest part will be to find a suitable converter that will convert from whatever video source you are using (e.g. MOV, AVI, MPG, FLV, etc.) into MJPEG AVI (Motion JPEG). I have not yet run into any free MotionJPEG encoders yet (if anyone knows of one, please post a comment), so it seems that most of them are commercial products in the $20 range.

Once you have found one, encode with the following parameters (which will match the Canon IXUS 75 / SD750 AVI settings):

Output File Format.AVI
Video Resolution640x480
Video Bit Rate< 2000 kbps
Video Frame Rate15 or 30 fps
Video Codec (FourCC)MJPG
Audio Bit Depth16 bit
Audio CodecPCM

Name the output file: MVI_####.AVI where #### is a number between 0000 and 9999 (eg. MVI_1000.AVI).

To ensure that you've done the encoding correctly, you can open the generated .AVI file in JPEGsnoop and confirm that the Video FourCC code is in fact MotionJPEG.

Once you have generated the .AVI file, we just need to create a suitable .THM file. Another poster has suggested that the camera doesn't actually use the JPEG image stored within the thumbnail file, so a quick solution may be to do the following:

  • Encode your video and produce a .AVI file (e.g. MVI_1000.AVI)
  • Copy a .THM file from another video produced by your digicam (e.g. MVI_0064.THM) and rename it to match the same initial filename as your encoded video (e.g. MVI_1000.THM).
  • Copy both files (e.g. MVI_1000.AVI and MVI_1000.THM) onto your memory card.
  • View the contents of the memory card with your digicam in Playback mode
Let me know if this works. I will have a look for suitable converters on the web to do the encoding part, and once I find a good one I'll create a page here that shows you how to do the steps in more detail. If you do manage to locate a converter (e.g. with a free trial) and complete the steps above, please let me know -- and I'll help you get it working if there are any troubles.
 
2007-11-29rajkamal
 I Have sony p990i PDA mobile . when ever i take a Video its Save in Mobile and Play well but when i transfer those files its save as .THM

how can i play it on my Laptop

Thanks
Raj kamal
 The phone should be able to save out as either an .AVI or .WMV. Make sure that you are transferring these files and not just the .THM.
2007-11-19mukesh
 i have got the info on THM file. It was very informative. excellent site
2007-11-06Jason
 Hey guys i have a Sony Cybershot but I find myself unable to put an AVI file in it. So i tried converting them but there are no convertible program i can find! SO help me!!! Please!!!
 Digital cameras are very specific about what video formats they can read from the memory card. It is very likely that the AVI video file will need to be converted to Motion JPEG format. Remember that AVI is not actually a specific file format, but a container that can contain many different types of data.

You should be able to confirm this by opening up a video taken by your Sony digicam in JPEGsnoop. It will probably say that it detects a MotionJPEG AVI file. Then, try opening up the AVI file that you are trying to load into your digicam, and you'll probably see a FourCC code other than MJPG (Motion JPEG).
2007-07-30 
 I have a Canon Ixus 75, and I have been trying to put my own videos onto the camera. The 3" screen is just to gorgeous not to "abuse" it as a media player ;) Anyways. I've found the exact codec used, MJPG_MainConcept Video V3.2.4. I've created short clips with the 320x240 15fps resolution and the exact same audio settings. I copied a THM form a video taken with the cam, and I even set the extra info in the video to CanonMVI06 as it is in the videos made by the camera. So far no luck. It still gives me "Unidentified image"

I've also copied the thm of one clip made with the cam over another also made with the cam and it works, it actually shows the first frame of the video rather then the wrong image from the thm file. So it looks like we can reuse thm's from different videos. I just haven't figured out how to get it to accept the encoding. Perhaps there is some subtle setting in the encoder? There are many options, perhaps too many to try them all...
 The THM will be the easy part to make work on the camera, as it is simply a JPEG image. So long as the resolution matches (and potentially a few other fields), the camera should still display the thumbnail. JPEGsnoop should help you identify any other details within the THM.

As for the video encoding, the camera is going to be very picky. Without having a detailed comparison analysis of the .avi files, it would be hard to discern what you may still be missing in the encode.

That said, I have actually been working on enhancing JPEGsnoop to read MotionJPEG videos, which will allow you to accomplish this exact analysis! If you can leave me a message, I'll help you get your media player working
2007-04-27sunil
 I have video clips taken by sony cybershot digital camera. The video clips were then copied on a cd along with the associated THM files. when the cd is played on dvd/cd player pictures can be viewed but the sound is missing. what can be done to view these video clips with sound using dvd/cd player? pl. advise.
 I haven't heard of this problem before. Not all DVD players will play all video / photo file formats, so it could be due to an incompatibility between your particular player and the codec (type of file format) used in your videos. To narrow down the problem I would try: 1) do the videos play in Windows? 2) do the videos play on someone else's DVD player? (make sure it is a different brand)
 
2007-04-16Greg
 I used to have a bunch of video files on my harddrive. they have since been replaced by these THM files. the size of the files indicates that the original movies are no longer there. What happened to the videos and is there any chance of getting them back? also, what can i do to avoid this happening in the future? is it a flaw in windows or on the camera's software? the camera is a canon powershot S230 and the program that came with it is Zoombrowser.

I would appreciate any help with this.
 Unfortunately, you are probably out of luck. In all likelihood, the video files were not replaced by the .thm files. Instead, for each video you had both an .avi file (the movie itself) and a .thm (thumbnail / metadata info for the movie) file. Somehow, you must have deleted the movie files but left the .thm files behind.

It would be hard to guess at why the video files were deleted in the first place, so I can't recommend any real way to avoid this problem. Nonetheless, I would suggest that you consider backing up all your photos & videos immediately after doing your first pass at deleting the obvious bad shots (with more than one hard drive, it's pretty easy to set this up to be done automatically). This way, you can hopefully recover from accidents like this in the future. Hopefully you didn't lose any important video clips.
2007-04-12Andy
 Does anyone know how to convert THM files to a more readily watchable format (avi, mpeg etc)? I know you can read them with certain image viewers but windows media does not recognise.
 When digital cameras store videos on a memory card, they usually write two files for each video: the <filename>.AVI (or .MP4) file and the <filename>.THM file.
  • The .AVI file is your actual video, and this should be playable in Windows Media Player or other viewers.
  • The .THM file is a small thumbnail picture from your video that also contains some of the image information (EXIF metadata), such as shot time, camera settings, etc. This file is not generally playable on anything and is only usually kept to retain that metadata information. You can delete these without affecting your original video. There is no video footage stored within these files.
2007-04-09connor
 thanks it was useful
2007-04-06edward
 is there a way to put avi files onto a camera, i have a sony cybershot???
 Not generally. The camera will probably be very picky about the type of AVI file that you put on the memory card in order for it to read and play it on the camera. It is likely that the type of AVI file must match exactly (e.g. MotionJPEG) as well as the resolution (e.g. 320x240). Some cameras may require that the .THM files are present as well.

So, if you are copying a AVI file that was recorded by the same camera previously, then it may work after copying the AVI file to the memory card. Trying to use a different AVI file will probably mean needing to convert the type of AVI file (to MotionJPEG and the proper resolution).

I have not tried this yet, but I might investigate to see how easy or difficult it is to do this and report back here.

 


Leave a comment or suggestion for this page:

(Never Shown - Optional, if you want a reply)
 

NOTE: I am out of the country for several months (in India), so comments will be held and only posted infrequently. Thanks!

13 users online