Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

New media player plugin based on GStreamer framework

edited December 2013 in OpenSesame

Because I have never been really happy with the limitations of the VLC based media player plugin, I have been working on a similar plugin based on the GStreamer framework. This is a well-maintained cross-platform media playing framework that has earned its merits and has been used in a lot of applications.

Benefits of the Gst based plugin are:

  • Works in all backends (best in the hardware accelerated backends: psychopy and experiment).
  • Works on Windows, Linux and Mac.
    On OSX the plugin still has some quirks such as freezing of 1080p movies on slower systems, and sometimes failure to play audio streams of a certain format.

  • OpenSesame renders the frames itself (opposed to the VLC plugin, which just 'hijacks' the display window from OpenSesame and dumps its video output in there). This offers a much larger degree of control and even enables the possibility of drawing items on top of the video or playing multiple movies concurrently in future!

The current version is based on GStreamer 0.10, but I'm going to see if I can port it to version 1.0 in the near future.

You can find the plugin and installation instructions at http://github.com/dschreij/media_player_gst. The latest release version can be downloaded from https://github.com/dschreij/media_player_gst/releases

If you have a chance to try it out, please let me know of your experiences and provide feedback!

Comments

  • edited 8:14AM

    Hi Daniel,

    Great work! Indeed, it works really well. When I package the next 2.8.0 pre-release, I'll include the media_player_gst plug-in as well.

    Cheers and merry Christmas,
    Sebastiaan

    There's much bigger issues in the world, I know. But I first have to take care of the world I know.
    cogsci.nl/smathot

  • edited 8:14AM

    Great work! Indeed, it works really well. When I package the next 2.8.0 pre-release, I'll include the media_player_gst plug-in as well.

    When I wrote this, it slipped my mind that the software stack that is required for the media_player_gst is a bit too large to include by default. But if we manage to trim this down, we can include the media_player_gst by default.

    There's much bigger issues in the world, I know. But I first have to take care of the world I know.
    cogsci.nl/smathot

  • edited 8:14AM

    No we need only a fraction of the plugins that are included with gstreamer. I'm certain we can trim it down quite a lot. I've started doing so, but with limited success up until now. Nevertheless I'll get there!

  • edited 8:14AM

    What's your limit on the file-size? I already managed to trim the whole framework down to 150 MB and that's just my first go. We can also sacrifice on some codecs, meaning that less file formats are supported, but if we were never going to use these in the first place why not?

  • edited 8:14AM

    Hello,
    I'm very new to OpenSesame and was hoping for some help. I installed the gst plugin, however, when I try to drag the icon into the experiment, the following message appears: "Failed to load plugin 'media_player_gst'. Error: cannot import name osexception". I'm using a mac. Any suggestions?
    Thanks,
    Mike

  • edited 8:14AM

    Hi Mike,

    The osexception class is only available in OpenSesame 2.8.0, i.e. the current development version. I added a small fix for backwards compatibility with earlier version of OpenSesame. To get this fix you should get the latest snapshot from my repository (Daniel is away the moment):

    The media_player_gst player has been tested mostly with OpenSesame 2.8.0 though, so there is a chance that you will run into more issues. But it's worth a shot to try the latest version from the repository linked to above.

    Cheers!
    Sebastiaan

    There's much bigger issues in the world, I know. But I first have to take care of the world I know.
    cogsci.nl/smathot

  • edited 8:14AM

    Does anyone have feedback on how this plugin works for them and if the above problems have been solved? I would really like to know.

  • edited 8:14AM
    Failed to load plug-in 'media_player_gst'
    line: 61
    exception message: __init__() got an unexpected keyword argument 'builtins'
    exception type: TypeError
    
    Traceback (also in debug window):
      File "/usr/lib/pymodules/python2.7/libqtopensesame/qtopensesame.py", line 1350, in add_item
        self.experiment, None, self.experiment.item_prefix())
      File "/usr/lib/pymodules/python2.7/libopensesame/plugins.py", line 295, in load_plugin
        item = item_class(item_name, experiment, string)
      File "/home/raid1/winklermax/plugins/media_player_gst/media_player_gst.py", line 923, in __init__
        qtautoplugin.__init__(self, __file__)
      File "/usr/lib/pymodules/python2.7/libqtopensesame/items/qtautoplugin.py", line 30, in __init__
        qtplugin.__init__(self, plugin_file)
      File "/usr/lib/pymodules/python2.7/libqtopensesame/items/qtplugin.py", line 62, in __init__
        qtitem.qtitem.__init__(self)
      File "/usr/lib/pymodules/python2.7/libqtopensesame/items/qtitem.py", line 47, in __init__
        self.init_edit_widget()
      File "/usr/lib/pymodules/python2.7/libqtopensesame/items/qtautoplugin.py", line 102, in init_edit_widget
        syntax=c[u'syntax'], tooltip=c[u'tooltip'])
      File "/usr/lib/pymodules/python2.7/libqtopensesame/items/qtplugin.py", line 362, in add_editor_control
        qprogedit.addTab(label)
      File "/usr/lib/pymodules/python2.7/QProgEdit/_qtabmanager.py", line 109, in addTab
        handler=self.handler, focusOutHandler=self.focusOutHandler)
      File "/usr/lib/pymodules/python2.7/QProgEdit/_qprogedit.py", line 69, in __init__
        self.editor = QEditor(self, lang=lang)
      File "/usr/lib/pymodules/python2.7/QProgEdit/_qeditor.py", line 50, in __init__
        self.setLang(lang)
      File "/usr/lib/pymodules/python2.7/QProgEdit/_qeditor.py", line 241, in setLang
        self.validate()
      File "/usr/lib/pymodules/python2.7/QProgEdit/_qeditor.py", line 289, in validate
        for l, s in validator(self.text()):
      File "/usr/lib/pymodules/python2.7/QProgEdit/validate/_python.py", line 61, in python
        for msg in Checker(c, builtins=_builtins).messages:
    TypeError: __init__() got an unexpected keyword argument 'builtins'
    

    This is all I get so far, just by inserting the module into my experiment.

  • edited 8:14AM

    This rather appears to be an error in QProgEdit to me. Are you running from source? If so, update that package by getting the latest version from https://github.com/smathot/QProgEdit and try again. Let me know if it works.

  • edited 8:14AM

    This is actually due to an outdated version of pyflakes, the module that is used by QProgEdit to validate Python code. See also:

    The solution would simply be to update pyflakes. At any rate, it's not due to the media_player_gst plug-in!

    There's much bigger issues in the world, I know. But I first have to take care of the world I know.
    cogsci.nl/smathot

  • edited March 2014

    The error is gone. Thanks :)

    All fine!

  • edited December 2014

    I'm trying to get GStreamer to run and I can't even get to the stage of the plugin appearing in Open Sesame. I've followed the instructions on both OSX and Win7. With a default installation of the GStreamer framework and copying the plugin files to the /opensesame/plugins/media_player_gst directory ... is there something else I need to do? Thanks.

  • edited 8:14AM

    ah, finally got it to work! I think something was funky in my windows installation (running on boot camp) that made open sesame unable to detect the plugin... all better now!

  • floflo
    edited 8:14AM

    Hi.

    I am about a year late to the party, but...

    I need to play a video at the beginning of my experiment. The default video_player item doesn't seem to work for me (see my post here).

    I am building the experiment using OpenSesame 2.9.6 on Mac OS Yosemite but I will run the experiment on a tablet using the droid back-end. Will this media player plugin allow me to do that?

    Thanks!

    • Florian
  • edited 8:14AM

    Hi Florian,
    Sadly no, there is no support for video playback on Android devices yet.

  • Hi Daniel,
    the link that reads " the GStreamer SDK website" in your original note of the plugin and installation instructions is a broken link. Could you please direct me to this site as I am trying to download!
    Best,
    J

  • Hi J,

    This here:https://gstreamer.freedesktop.org/ is there website. There are also download links.

    Good luck,

    Eduard

Sign In or Register to comment.