Errors running two movie objects back to back (white screen and audio problems for 2nd video)

David McFarlane mcfarla9 at msu.edu
Fri Apr 4 15:35:16 UTC 2014


Glad you got it (mostly) sorted, and thanks for writing back.

Perhaps I can explain a few things here...

First, "End Movie Action" specifies what action the MovieDisplay 
object will take in the event that the movie file reaches its end 
before the MovieDisplay object does.  "(none)" means, well, just 
continue as if nothing happened; "Terminate" means to terminate the 
MovieDisplay object (not clear to me what happens when this happens 
during the PreRelease period, perhaps someone could test that); as 
for "Jump", well, let's just save that for another discussion (it gets tricky).

"Stop After", by contrast, indicates whether or not movie playback 
will be stopped when the event indicated by "Stop After Mode" 
occurs.  With "Stop After Mode" set to NextOnsetTime, movie playback 
would be stopped at the OnsetTime of the next object; set to 
OffsetTime, it would be stopped at the OffsetTime of the MovieDisplay 
object.  Using a PreRelease with "Stop After Mode" set to OffsetTime 
means that the movie playback might be stopped while the next object 
is still waiting to start, so usually you would keep this set to 
NextOnsetTime unless you want to create some special effect and know 
what you are doing.

Now, as I recall (someone please run the tests for me to confirm or 
disconfirm), if movie playback reaches its end before anything else 
makes it stop, then the last frame of the movie will linger until 
something else replaces it.  If you do not want that, then you might 
set "End Movie Action" to "Terminate", and follow the MovieDisplay 
with a visual object that will overwrite the last frame.  Of course, 
then your trial timing will depend on the duration of your movie 
file.  If you want to make the trial timing constant for all movies, 
then you could use a little bit of inline code to adjust the duration 
between the end of the movie and the continuation of your 
trial.  There are several ways to do that (my own favorite technique, 
using SetNextTargetOnsetTime, is a bit esoteric), so if that 
interests you please write back.

Anyway, please give some of this a try and let me know whether I know 
what I am talking about :).

Thanks,
-----
David McFarlane
E-Prime training 
online:  http://psychology.msu.edu/Workshops_Courses/eprime.aspx
Twitter:  @EPrimeMaster (https://twitter.com/EPrimeMaster )

/----
Stock reminder:  1) I do not work for PST.  2) PST's trained staff 
take any and all questions at https://support.pstnet.com , and they 
strive to respond to all requests in 24-48 hours, so make full use of 
it.  3) In addition, PST offers several instructional videos on their 
YouTube channel (http://www.youtube.com/user/PSTNET ).  4) If you do 
get an answer from PST staff, please extend the courtesy of posting 
their reply back here for the sake of others.
\----


At 4/4/2014 07:33 AM Friday, Katie Jankowski wrote:
>Hi David,
>I apologize for the delay.
>
>Thank you for your helpful advice!
>
>Changing the trial proc properties from "topofprocedure" to 
>"beforeobjectrun" solved my problem! (Note, I changed the trial proc 
>properties, not each objects' properties, which seemed to work 
>better for me). In fact, it sounds like changing the procedure 
>properties affects all the objects properties within the procedure, 
>when set to inherit 
>(<http://www.kent.ac.uk/psychology/downloads/EPrimeNewFeaturesGuide.pdf>new 
>features guide on pg. 18), although I am not positive. In my full 
>script, all movies ran without errors and both the auditory and 
>visual output were presented.
>
>Also, I just 
>found<http://www.pstnet.com/support/kb.asp?TopicID=4565> this post 
>on the EPRIME knowledge base, which sounded very similar to what I 
>was experiencing: "NOTE: Use of OffsetTime StopAfterMode option with 
>any PreRelease value including the default (same as duration) will 
>likely cause no sound or only a brief portion of the sound to occur. 
>" Setting the prerelease to 0 sounds like a good fix.
>
>My only remaining concern is that the last frame in the 1st movie of 
>each trial freezes, while the 2nd movie (last trial object) does 
>not. If you have any suggestions for how to avoid the last frame of 
>the movie from freezing and achieving a smoother transition, please 
>let me know. If I figure it out, I will post it here. One thought is 
>perhaps it is related to the "stopaftermode" set to "nextonsettime". 
>I dont know if this is ok, if it should be set to "stopoffsettime", 
>or if an inline script is necessary, as mentioned 
><http://www.pstnet.com/support/kb.asp?TopicID=2720>here.
>
>Again, thank you for your help.
>
>In summary, I changed the prerelease settings to "0", changed 
>generate prerun to "beforeobjectrun", and made sure my script was 
>saved as an EPRIME Professional file (I have Professional but I was 
>saving the script as EPRIME Standard.) Some changes may or may not 
>have been necessary, but I wanted to list them all here, in case 
>some people have similar problems in the future.
>
>
>On Tue, Apr 1, 2014 at 11:40 PM, David McFarlane 
><<mailto:mcfarla9 at msu.edu>mcfarla9 at msu.edu> wrote:
>To answer your first question, I am pretty sure that E-Prime can run 
>2 or more movies per trial, but I do not recall exactly if I have 
>ever tested that.  Perhaps I should.
>
>Next, please see 
><http://www.pstnet.com/support/kb.asp?TopicID=3299>http://www.pstnet.com/support/kb.asp?TopicID=3299 
>for "gotchas" that may happen with the new GeneratePreRun 
>feature.  (You may also look at the following 
>threads: 
><https://groups.google.com/d/topic/e-prime/IV1KWxm3Q-U>https://groups.google.com/d/topic/e-prime/IV1KWxm3Q-U 
>, 
><https://groups.google.com/d/topic/e-prime/Azi36c7sXSI>https://groups.google.com/d/topic/e-prime/Azi36c7sXSI 
>, 
><https://groups.google.com/d/topic/e-prime/0Yqv3FHXm6k>https://groups.google.com/d/topic/e-prime/0Yqv3FHXm6k 
>, and 
><https://groups.google.com/d/topic/e-prime/Q6si9tksg4Q>https://groups.google.com/d/topic/e-prime/Q6si9tksg4Q 
>.)
>
>Since you already set PreRelease to 0 in your demos (nicely done), 
>those gotchas should not hit you.  Still, just for fun, open the 
>Properties Pages for your Procedure, and set Generate PreRun to 
>"BeforeObjectRun" (I assume that objects in your Procedure have 
>their Generate PreRun set to the default of "Inherit").  Then try 
>your demos and see what happens.
>
>Beyond that, I have no ideas, other than trying to encode your 
>movies in another codec (see links above).  We had a case here of a 
>very simple E-Prime program that kept intermittently balking with 
>movies (running merely *one* movie per trial), with no apparent 
>pattern.  We gave up and redid the program in PsychoPy, and still 
>had problems.  The student finally recoded the movies using another 
>codec (sorry, don't remember which one), and then everything worked 
>in PsychoPy (and I bet would also work in E-Prime now).  So as I 
>said earlier, when you use movies with high-performance software, 
>you are asking for trouble.  Sorry,
>
>-- David McFarlane
>
>
>
>At 3/31/2014 10:52 PM Monday, Katie Jankowski wrote:
>One other question and update: Does EPRIME have problems presenting 
>2 movie objects in the same trial?
>
>The reason I ask is because I thought the problem was that the 
>second video didnt have enough time to load immediately following 
>video1. So, I made a simplified script where each trial included 
>just a fixation, video1, and video2; however, I rearranged the order 
>to be: video1 (~12000ms), fixation (~12000ms), video2 (~12000ms). 
>Here, I made sure that all objects had prerelease set to 0.. 
>However, video2 still had audio and visual problems.
>
>Finally, I thought perhaps that I had set the properties incorrectly 
>for the video2 movie object. So, I copied the video1 object (which 
>runs correctly) and renamed it video2. However, when I ran this new 
>script,  video2 still had audio and visual problems.
>
>In summary:
>In a simplified script, where each trial includes only 1 movie 
>object, so that all movies are presented back to back, the videos 
>run correctly if the pre-release is set to 0. (Setting the duration 
>of each video using an attribute "viddur1" does not affect the script).
>
>However, in another simplified script, where each trial includes 
>only 2 movie objects (whether these movie objects are either 
>presented back to back or separated with a fixation cross slide), 
>the 2nd video always has visual and audio problems. (Changing the 
>prerelease from 5000ms to 0s does not affect the script. Setting the 
>duration of each video using an attribute "viddur1" vs including a 
>set duration for all videos does not affect the script.)
>
>Thank you,
>Katie
>
>
>On Tue, Apr 1, 2014 at 11:18 AM, Katie Jankowski 
><<mailto:katie.jankowski at gmail.com><mailto:katie.jankowski at gmail.com>katie.jankowski at gmail.com> 
>wrote:
>Thank you very much for these suggestions. I had downloaded the 
>latest version of DivX 
>(<<http://www.divx.com/>http://www.divx.com/>http://www.divx.com), 
>selected create default mappings, and rendered the first two files 
>(video1 and videos2 of the first trial) and received no errors. This 
>lead me to believe that my problem was not related to the codecs.
>
>
>To confirm that the problem originated from my task, and not the 
>video files, I made a simplified version of the task that included 
>just 1 trial (fixation, intro slide, video1, and video2). When I ran 
>this simplified version with just 1 trial, video1 ran fine, but 
>video2 had the same errors (no visual, audio problematic). Next, I 
>switched the name of the specific files listed in the trial proc so 
>that the videos that originally played for video1 now played for 
>video2, and visa versa. Again, only video1 worked and video2 had 
>problems. This lead me to believe that the video files were not the 
>problem, and the problem was the script (or script properties) which 
>effected how video2 played.
>
>I took your advice and made a simple script (tester 1) which had 1 
>object (movie object video1) that played videos one after the other 
>with a set duration of 12000ms (keeping the prerelease 5000ms). Each 
>video played, starting at the beginning of the video (0s), but each 
>video cut off after ~6000ms. Since the duration was set to 12000ms 
>and the prerelease was set to 5000ms, could the pre-release, or how 
>the video is loaded, be the problem?
>
>I made another simple script (tester 2) which only played videos one 
>after the other (same as above), but this time I kept the attribute 
>VidDur1 to specify the duration of each video (keeping the 
>prerelease 5000ms). Similar to the above, each video played, 
>starting at the beginning of the video (0s), but each video cut off 
>after ~6000ms. The only difference between this simplified script 
>with a duration attribute and the above simplified script with a set 
>duration of 12000ms was that instead of immediately moving onto the 
>next video, the preceding video cut off and froze for ~5000ms before 
>moving onto the next video.
>
>Next, I investigated if the problem was caused by the prerelease 
>setting. I used the tester 2 script (which included the duration 
>attribute) and changed the prerelease for the movie object to "0". 
>This resolved the problem- all videos played back to back correctly 
>(good visual, good audio). However, when I changed my original 
>script (2 movie objects back to back in the same trial) to have the 
>prerelease set to 0 for video1 and video2, I continued to have 
>problems playing video2. So, it seems like the problem is related to 
>how video2 is loading/playing after video1 plays, when 2 movie 
>objects are presented consecutively in the same trial.
>
>Would it be helpful to attach my script?
>
>Thank you for your assistance
>
>
>On Tue, Apr 1, 2014 at 4:34 AM, David McFarlane 
><<mailto:mcfarla9 at msu.edu><mailto:mcfarla9 at msu.edu>mcfarla9 at msu.edu> wrote:
>Movies make life difficult for any experiment software I 
>know.  Often the problem comes from the movie files, not necessarily 
>the experiment software.  Remember that how a movie file works in 
>Windows Media Player or any other software tells you nothing about 
>how that file will work in E-Prime.  So first you need to find out 
>whether the problem pertains to your movie files, or to E-Prime.
>
>I would start by making a simple E-Prime program that does nothing 
>but play my movie files, in Sequential order.  Then I would try 
>running in Random order.  If all my movie files succeeded under 
>those conditions, then I would incrementally change my test program 
>(or actually, a copy of my test program) to make it more and more 
>like my experiment program, hoping to sneak up on the culprit that 
>breaks my experiment program.
>
>Oh, I would also use the Codec Config utility that comes with EP2.
>
>Just some general troubleshooting advice there.
>
>-----
>David McFarlane
>E-Prime training online: 
><<http://psychology.msu.edu/Workshops_Courses/eprime.aspx>http://psychology.msu.edu/Workshops_Courses/eprime.aspx>http://psychology.msu.edu/Workshops_Courses/eprime.aspx
>Twitter:  @EPrimeMaster 
>(<<https://twitter.com/EPrimeMaster>https://twitter.com/EPrimeMaster>https://twitter.com/EPrimeMaster 
>)
>
>/----
>Stock reminder:  1) I do not work for PST.  2) PST's trained staff 
>take any and all questions at 
><<https://support.pstnet.com>https://support.pstnet.com>https://support.pstnet.com 
>, and they strive to respond to all requests in 24-48 hours, so make 
>full use of it.  3) In addition, PST offers several instructional 
>videos on their YouTube channel 
>(<<http://www.youtube.com/user/PSTNET>http://www.youtube.com/user/PSTNET>http://www.youtube.com/user/PSTNET 
>).  4) If you do get an answer from PST staff, please extend the 
>courtesy of posting their reply back here for the sake of others.
>
>\----
>
>
>
>At 3/31/2014 04:35 AM Monday, Katie Jankowski wrote:
>I created an EPRIME task for an fMRI scan (timing is sensitive) but 
>I am having troubles running my video stimuli. In each trial, 
>participants view a fixation cross (text slide, 12000ms), a block 
>introduction (text slide, 2400ms) , video1 (movie object, ~12000ms), 
>and video2 (movie object, ~12000ms). Since I am using a block-design 
>fMRI task, not event-design, I want to treat Video1 and Video2 as 1 
>block. Thus, they are displayed back to back.
>
>
>Each video stimuli includes both audio and visual information. The 
>durations of each video are variable (approximately 11000ms-14000ms, 
>some 11500ms, others 13500ms, others 12000ms, so I included a 
>duration attribute [VidDur1] and [VidDur2] for video1 and video2. 
>respectively). The the final "block" (video1 and video2 combined) is 
>always 24000ms.
>
>
>I am having several issues running the movie files. Video1 runs 
>well, but video2 has both visual problems (blank white screen) and 
>audio problems (starts about 2s into the clip, then after about 2s 
>starts from the beginning at 0s, then runs through the audio but 
>ends early). I think my problems might be related to preloading the 
>stimuli, but I don't know what to do. I have been emailing support 
>for about 2 weeks without coming to a solution, so I thought I would 
>ask the google group. I have also looked on the knowledge base, but 
>I have not found a solution.
>
>
>Currently, pre-release for video1 is set to 5000ms and pre-release 
>for video2 is set to 0ms (but I have also tried 5000ms for video2 
>with similar results). Start and stop position are 0, stop after is 
>set to "yes", stop after mode is set to "nextonsettime", end movie 
>action is "none", duration is "[VidDur1]" and "[VidDur2]", and 
>timing is "event". Under experiment properties, "flip enabled" is 
>selected and both "display" and "sound" under "devices" are selected.
>
>
>I would greatly appreciate any advice!
>
>
>(As an aside, if I set "duration" to 12000ms for video1 and 
>"duration" to 12000ms for video2 (instead of relying on an attribute 
>to represent the duration, I have the same problems. If I set the 
>duration to "infinite" for video1 and "infinite" for video2, only 
>video1 runs, regardless if "stop after mode" is set to "offsettime" 
>or "nextonsettime".)

-- 
You received this message because you are subscribed to the Google Groups "E-Prime" group.
To unsubscribe from this group and stop receiving emails from it, send an email to e-prime+unsubscribe at googlegroups.com.
To post to this group, send email to e-prime at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/e-prime/533ed138.4294320a.31aa.17fdSMTPIN_ADDED_MISSING%40gmr-mx.google.com.
For more options, visit https://groups.google.com/d/optout.



More information about the Eprime mailing list