Howdy, Stranger!

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

Supported by

[open] media_player_gst not working in fullscreen mode

edited September 2015 in OpenSesame

Hey there,

I encountered problems when using the media_player_gst item in certain modi:

  • With PsychoPy backend: Problems in test, window as well as fullscreen mode: Video suddenly stops and the screen turns white. Pressing another key finishes experiment regularly. No error messages.

  • With expyriment backend: Works fine in test and window mode. Same problem as with PsychoPy in fullscreen mode, but no white screen, experiment finishes instantly. If mp4 video is played that is smaller than screen resolution (no matter if fitted to screen), the last sketchpad screen flickers around the video.

  • With legacy backend: Works fine in test and window mode. Video finishes normally but is flickering/lagging in fullscreen mode . If mp4 video is played that is smaller than screen resolution (no matter if fitted to screen or not), the last sketchpad screen flickers around the video.

Since PsychoPy uses OpenGL in all modi and legacy/expyriment in fullscreen, I suppose this is a problem relating to the OpenGL implementation?!

I am using Windows 7 x64. The video formats I tested were .avi and .mp4.

Running the experiment in fullscreen mode is highly preferable as you can think, so help is really appreciated.

Cheers, Steffen

Comments

  • edited 9:00PM

    Hi Steffen,

    I'll pass this on to @dschreij, who's the developer of the media-player gst plugin.

    Cheers,
    Sebastiaan

  • edited 9:00PM

    Hi Steffen,

    could you tell me what OS you are running on, and which version of OpenSesame? In these cases it always helps if I can reproduce the problems. Can you send the experiment (with movies included in the file pool) to d.schreij (at) vu [dot] nl? I'll have a look and see if I can find what the problem is.

    Buy Me A Coffee

  • edited 9:00PM

    Hey thanks for getting back to me!

    I am working on Windows 7 x64 with the latest Version of OpenSesame (2.9.7)
    Alright, I will send you the file.

  • edited 9:00PM

    Ah, important to note is that I modified the Media_player_gst.py file: I replaced the original exec statement for individual python code in all handlers to:

    exec(self.custom_event_code, self.main_player.experiment.python_workspace._globals, locals())
    
  • edited 9:00PM

    I had a look at your experiment and it worked fine on my PC, which runs Windows 10 though. The movie played very smoothly with all backends, in both windowed and fullscreen mode, so I could not reproduce the flickering. Did you try running the experiment on another computer? What video card does the computer with problematic video rendering have?

    Regarding the change to the media_player_gst module, this should not be necessary if all you are trying to do is have access to global variables. The self.experiment or exp object is accessible in the event code section, so if you put all the variables you need in the exp object, you can access them through this object. Your preparation code then could be as follows:

    from multiprocessing.pool import ThreadPool
    from openexp.synth import synth
    from openexp.keyboard import keyboard
    
    #Initialise components
    exp.keybrd = keyboard(exp, keylist=['SPACE'], timeout=2000)
    exp.sound = synth(exp, length = 300)
    
    exp.sample_tms = [100,500]
    samples = len(exp.sample_tms)
    
    exp.prev_frame = 0
    
    #Initialise Threadpool
    exp.pool = ThreadPool(processes = 1)
    
    #Auditory response task for threads to run
    def play_sample(experiment, kbrd, snd):
        kbrd.flush()
        t1 = exp.time()
        snd.play()
        key, t2 = kbrd.get_key()
        rt = t2-t1
        if key == None:
            exp.set('rt_learn', 'timeout' )
        else:
            exp.set('rt_learn', t2-t1)
    
        print rt
        return
    
    exp.play_sample = play_sample
    

    The code in the media_player_gst event loop should then become

    if frame in exp.sample_tms and frame != exp.prev_frame:
        #Update previous frame
        exp.prev_frame = frame
    
        #Set frame and timestamp
        exp.set('frame_timestamp', exp.time())
        exp.set('frame', frame)
    
        #Play audio and collect response time in new thread
        exp.thread_result = exp.pool.apply_async(exp.play_sample, (exp, exp.keybrd, exp.sound))
    
        #Log all variables
        #log_vars()
    

    I commented log_vars() because I didn't understand exactly what you were trying to do there. It's best to just use the logger item for logging variables

    Buy Me A Coffee

  • edited 9:00PM

    Another thing that comes to my mind is that it might be a buffering setting of OpenGL. If you go to your graphic card properties page, see if you can play around with 'tripple buffering' settings and such of OpenGL

    Buy Me A Coffee

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games