*動画に画像を重ねて表示したい

Help(v14.9)より

以前はtrialの中にtime=0でpictureとvideoを両方記述して重ねて表示してくれていたが、新しいバージョンでは片方しか表示しなくなった。

で、トラブルの回避の仕方は以下の通り。pictureの定義にon_top = true;を入れる。

ついでに動画を使うときの注意点に気付いたので確認を。

以下は参考にしたヘルプの記述。

--------------------------------------------------------------------------------------------------------------------

Presentation Help : Help Guide : Stimuli : Visual Stimuli : Video Stimuli

Prev : Next

Video Attributes

Interaction with other stimuli <- これは下のほうにある。

Once a video stimulus starts to play, you may continue to present other stimuli including picture stimuli. Video stimuli appear and disappear independently of picture stimuli. Picture parts in picture stimuli can be drawn on top of the video or under the video, depending on the setting of the on_top picture part parameter. If a picture stimulus is showing when a video starts, it will remain on the screen unless you've defined the start_picture video parameter. Likewise, a picture stimulus will remain on the screen when a video stops.

#-- scenario file --#

begin; trial{ trial_duration = 1500; picture { text { caption = "+"; font_size = 36; font = "Courier"; transparent_color = 0,0,0; }; x = 0; y = 0; on_top = true; }; time = 0; code = "fix"; video { filename = "video1.avi"; x = 0; y = 0; }; time = 500; code = "video1"; }main; begin_pcl; main.present();

余談:動画と静止画の同時表示はtrialで記述する以外に、videoの記述にstart_pictureを入れることでもいけるらしい。

---------------------------------------------------------------------------------------------------------------------------------------------------

Help Guide : Stimuli : Visual Stimuli : Video Stimuli

Prev : Next

Video Attributes

Start picture

If you want to display a picture stimulus that starts with the first frame of the video, define the start_picture parameter. The value of this parameter must be the name of a previously defined picture stimulus. You can also set the start picture in PCL using the video::set_start_picture method.

#-- scenario file --#

begin; picture { box { color = 255,0,0; height = 50; width = 50; }; x = 0; y = 0; } red; picture { box { color = 0,255,0; height = 50; width = 50; }; x = 0; y = 0; on_top = true; } green; trial { picture red; time = 0; video { filename = "video1.mpg"; start_picture = green;#重ねて表示したい画像(pictureで定義) }; time = 1000; };