...
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#	modified:   tasks.py
#
diff --git a/tasks.py b/tasks.py
index 8d007a2..c6d0860 100644
--- a/tasks.py
+++ b/tasks.py
@@ -67,4 +67,56 @@ class MXFConvertOP1AToAtomTask (MXFConvertTask):
 class MXFConvertAtomToOP1ATask (MXFConvertTask):
     toatom = False
     name = 'Covert OP-Atom to OP1A'
-    
+
+
+@plugin
+class MakeProxyTask (Task):
+    ui = 'copydir'
+    name = 'Create proxy files'
+    default_params = {
+        'source': '',
+        'destination': '',
+    }
+    toatom = True
+
+    def run(self, source=None, destination=None):
+        index = 0
+        if not os.path.exists(destination):
+            os.makedirs(destination)
+        if not source.endswith('/'):
+            source += '/'
+        if not destination.endswith('/'):
+            destination += '/'
+
+        total = sum(len(x) for a,b,x in os.walk(source))
+
+        for (dirpath, dirnames, filenames) in os.walk(source):
+            for file in filenames:
+                if os.path.splitext(file.lower())[1] in ['.mxf', '.mov', '.m2v']:
+                    srcfile = os.path.join(source, dirpath, file)
+                    destdir = destination + os.path.split(srcfile)[0][len(source):]
+                    try:
+                        os.makedirs(destdir)
+                    except:
+                        pass
+
+                    p = subprocess.Popen([
+                        'ffmbc',
+                        '-i', srcfile,
+                        '-s', '1280x720',
+                        '-vcodec', 'libx264',
+                        '-preset', 'fast',
+                        '-profile', 'baseline',
+                        '-b', '1200k',
+                        '-acodec', 'aac',
+                        '-ac', '2', '-ar', '44100', '-ab', '128k',
+                        '-y',
+                        '-strict', 'experimental',
+                        os.path.join(destdir, file + '.mov')
+                    ])
+                    o,e = p.communicate()
+                    if p.returncode:
+                        print o, e
+
+                index += 1
+                self.set_progress(index, total)
