Index: Makefile.am
===================================================================
--- Makefile.am	(revision 2885)
+++ Makefile.am	(working copy)
@@ -126,6 +126,7 @@
 	$(srcdir)/Imaging/SvgFile.cs		\
 	$(srcdir)/Imaging/X3fFile.cs		\
 	$(srcdir)/Imaging/XmpFile.cs		\
+	$(srcdir)/Imaging/AviFile.cs		\
 	$(srcdir)/Imaging/Tiff.cs		\
 	$(srcdir)/Loupe.cs			\
 	$(srcdir)/MainWindow.cs			\
Index: Imaging/AviFile.cs
===================================================================
--- Imaging/AviFile.cs	(revision 0)
+++ Imaging/AviFile.cs	(revision 0)
@@ -0,0 +1,70 @@
+using System;
+
+namespace FSpot.Avi {
+	public class AviFile : ImageFile // SemWeb.StatementSource 
+	{
+		MetadataStore store;
+
+                // false seems a safe default
+                public bool Distinct {
+                        get { return false; }
+                }
+
+		public AviFile (Uri uri) : base (uri)
+		{
+		}
+
+		public AviFile (string path) : base (path) 
+		{
+		}
+
+		public MetadataStore Store {
+			get {
+				if (store == null) {
+					store = new MetadataStore ();
+					using (System.IO.Stream input = Open ()) {
+						Load (input);
+					}
+				}
+				return store;
+			}
+		}
+
+		public void Load (System.IO.Stream stream)
+		{
+			try {
+				store.Import (new SemWeb.RdfXmlReader (stream));
+				store.Dump ();
+
+			} catch (System.Exception e) {
+				System.Console.WriteLine (e.ToString ());
+			}
+		}
+
+		public override Gdk.Pixbuf Load (int max_width, int max_height)
+		{
+            Gdk.Pixbuf pixbuf = null;
+            try {
+                string tempPath = "." + System.IO.Path.GetFileNameWithoutExtension(this.Uri.AbsolutePath) + ".png";
+                tempPath = FileImportBackend.UniqueName(FSpot.Global.PhotoDirectory, tempPath);
+                // We will use totem-video-thumbnailer to get our pixbuf
+                System.Diagnostics.Process thumbnailerProcess= new System.Diagnostics.Process();
+                thumbnailerProcess.StartInfo.FileName="totem-video-thumbnailer" +
+                    " -s " + max_width + "x" + max_height + " " + this.Uri.AbsolutePath + " " + tempPath;
+                thumbnailerProcess.Start();
+                thumbnailerProcess.WaitForExit(5000); // Wait until the process ends (up to 5 seconds)
+                pixbuf = new Gdk.Pixbuf (tempPath);
+                System.IO.File.Delete(tempPath);
+            }
+            catch (System.Exception e) {
+                System.Console.WriteLine (e.ToString ());
+            }
+            return pixbuf;
+        }
+
+		public void Select (SemWeb.StatementSink sink)
+		{
+			Store.Select (sink);
+		}
+	}
+}
Index: Imaging/ImageFile.cs
===================================================================
--- Imaging/ImageFile.cs	(revision 2885)
+++ Imaging/ImageFile.cs	(working copy)
@@ -63,6 +63,7 @@
 			name_table [".mrw"] = typeof (FSpot.Mrw.MrwFile);
 			name_table [".raf"] = typeof (FSpot.Raf.RafFile);
 			name_table [".x3f"] = typeof (FSpot.X3f.X3fFile);
+            name_table [".avi"] = typeof (FSpot.Avi.AviFile);
 		}
 
 		public Uri Uri {
