Howdy, Stranger!

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

Supported by

simultaneous-image-video-and-sound-presentation

Hello together,

I want to present a video and some images together simultaneously on one screen.

I've looked for a topic like that in the forum and found this one:

http://forum.cogsci.nl/index.php?p=/discussion/137/solved-simultaneous-image-video-and-sound-presentation

So I adapted the paths and created an inline script with the code I found in the link above.
But when I executed the experment I received an error.

You can see the structure of the experiment and the error-message in the debug-window in the attached image file.

I think the problem may be that openseame does not know in which window it should display the images and the video.
But I don't know how to program this (make a reference for example to the "mywin"- sketchpad defined before the inline script)

The installed openseame version is the "opensesame_3.1.9-py2.7-win32-1.exe" on a windows 8.1 machine.

Have anybody an idea to realize this ?

Best,
Carsten.

Comments

  • edited March 2018

    Hi there...

    I found out the last days how to fix this issure:

    First I had to do was to install OpenCV. You can get it from here:

    https://opencv.org/opencv-3-4-1.html

    I used the Windows self-extracting archive. How it is installed is described here:

    http://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_setup/py_setup_in_windows/py_setup_in_windows.html

    Some remarks about the installation:

    Please don't install a separate Python27. Copy the "cv2.pyd" to the openseame Python Path, in my case:

    d:\Schliewe\openseame\OpenSesame\Lib\site-packages\

    You find the "cv2.pyd" when you had extracted the archive you got from the first link

    You can find "Idle" in my installation here:

    d:\Schliewe\openseame\OpenSesame\Scripts\

    Then choose in Openseame under "New experiment"as Backend "legacy".

    Insert a new "Inline_script" and paste the following code in the Run-Section:

        import cv2
        import numpy
        import pygame
        # Video filename in file pool
        path_video = pool['VO1LHi12.mp4']
        # Eyetracking Marker oben links
        path_Marker_OL=pool['R1S1.png']``
        # Open the video
        video = cv2.VideoCapture(path_video)
        # Set returnvalue to True to get into the while loop
        retval=True
        # Set background to white
        white = [255, 255, 255]
        exp.surface.fill(white)
        # Do the while loop until the video is played
        while retval:
            # Get a frame
            retval, frame = video.read()
            ### if no frame is availble exit while loop,
            ### video is played
            if retval != True:
                break
            ###
            # rezize the video
            frame = cv2.resize(frame, (1280, 800)) 
            # Rotate it, because for some reason it otherwise appears flipped.
            frame = numpy.rot90(frame)
            # The video uses BGR colors and PyGame needs RGB
            frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
            # Create a PyGame surface
            video_surface = pygame.surfarray.make_surface(frame)
            # video is mirrored (x-axis) correcting this..
            video_surface = pygame.transform.flip(video_surface, True, False)
            # load the image with the Marker oben links
            image = pygame.image.load(path_Marker_OL)
            image_surface = image.copy()
            image_surface = pygame.transform.scale(image_surface , (150, 150))
            # calculations: x_pos=(BS_x_Exp - Videosize_x) / 2=(1680-1280) / 2 = 200
            #                       y_pos=(BS_y_Exp - Videosize_y) / 2=(1050-800) / 2 = 125
            surf1=exp.surface.blit(video_surface, (200, 125))
            surf1=exp.surface.blit(image_surface, (0, 0))
            pygame.display.flip()
    

    Be sure that the video and the image are in the filepool.

    Thats it...

    Best,
    Carsten

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