我想弄清楚如何在python中使用MLT的GTK2使用者。用户被概述为这里。
含氧API中没有关于使用这个消费者的任何内容,我能找到的唯一细节就是C 代码本身。
我尝试了以下基于play.py示例的代码,但是它给出了错误
NotImplementedError: Wrong number or type of arguments for overloaded function 'new_Consumer'.
Possible C/C++ prototypes are:
Mlt::Consumer::Consumer()
Mlt::Consumer::Consumer(Mlt::Profile &)
Mlt::Consumer::Consumer(Mlt::Profile &,char const *,char const *)
Mlt::Consumer::Consumer(Mlt::Profile &,char const *)
Mlt::Consumer::Consumer(Mlt::Service &)
Mlt::Consumer::Consumer(Mlt::Consumer &)
Mlt::Consumer::Consumer(mlt_consumer)代码:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Import required modules
import mlt
import time
import sys
import gtk
# Start the mlt system
mlt.Factory().init( )
# Establish a profile
mlt_profile = mlt.Profile( )
# Create the producer
p = mlt.Producer( mlt_profile, "video_file" )
self.mltwidget = gtk.HBox()
fp.add(self.mltwidget)
if p:
# Create the consumer
c = mlt.Consumer( mlt_profile, "gtk_preview", self.mltwidget)
# Turn off the default rescaling
c.set( "rescale", "none" )
# Connect the producer to the consumer
c.connect( p )
# Start the consumer
c.start( )
# Wait until the user stops the consumer
while c.is_stopped( ) == 0:
time.sleep( 1 )
else:
# Diagnostics
print "Unable to open ", "video_file"你们能让我知道如何使用这个消费者吗,或者给出一些如何解决这个问题的建议?另外,一些关于如何在我的GTK2应用程序中嵌入MLT使用者生成的SDL屏幕的建议是很棒的:)
非常感谢!
发布于 2014-11-10 12:59:19
因此,经过进一步调查,GTK+消费者似乎使用了standard,因此标准SDL使用者可以使用http://faq.pygtk.org/index.py?file=faq23.042.htp&req=show中概述的代码手动嵌入
不幸的是,这不适合我需要多个屏幕的应用程序,所以我将考虑其他选项。
https://stackoverflow.com/questions/26798053
复制相似问题