]> git.sesse.net Git - mlt/commitdiff
Add example of how to list of codecs.
authorDan Dennedy <dan@dennedy.org>
Tue, 30 Nov 2010 06:49:54 +0000 (22:49 -0800)
committerDan Dennedy <dan@dennedy.org>
Tue, 30 Nov 2010 06:49:54 +0000 (22:49 -0800)
src/swig/python/codecs.py [new file with mode: 0755]

diff --git a/src/swig/python/codecs.py b/src/swig/python/codecs.py
new file mode 100755 (executable)
index 0000000..a1f4e45
--- /dev/null
@@ -0,0 +1,24 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+# Import required modules
+import mlt
+
+# Start the mlt system
+mlt.Factory().init( )
+
+# Create the consumer
+c = mlt.Consumer( mlt.Profile(), "avformat" )
+
+# Ask for video codecs supports
+c.set( 'vcodec', 'list' )
+
+# Start the consumer to generate the list
+c.start()
+
+# Get the vcodec property
+codecs = mlt.Properties( c.get_data( 'vcodec' ) )
+
+# Print the list of codecs
+for i in range( 0, codecs.count()):
+       print codecs.get( i )