首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用于MLT GTK+使用者的Python绑定

用于MLT GTK+使用者的Python绑定
EN

Stack Overflow用户
提问于 2014-11-07 09:29:09
回答 1查看 322关注 0票数 1

我想弄清楚如何在python中使用MLT的GTK2使用者。用户被概述为这里

含氧API中没有关于使用这个消费者的任何内容,我能找到的唯一细节就是C 代码本身

我尝试了以下基于play.py示例的代码,但是它给出了错误

代码语言:javascript
复制
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)

代码:

代码语言:javascript
复制
    #!/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屏幕的建议是很棒的:)

非常感谢!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-11-10 12:59:19

因此,经过进一步调查,GTK+消费者似乎使用了standard,因此标准SDL使用者可以使用http://faq.pygtk.org/index.py?file=faq23.042.htp&req=show中概述的代码手动嵌入

不幸的是,这不适合我需要多个屏幕的应用程序,所以我将考虑其他选项。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26798053

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档