Pavlovia experiment freezes during video playback

URL of experiment:

Description of the problem:

My experiment involves the random playback of a couple hundred videos. All of them are short (~3 seconds) and small (~100kb). One video per trial.

Currently I load a few hundred videos as resources at the beginning of the experiment. I use a .csv file to loop through them randomly by filename.

The issue is that every time I run the experiment in Pavlovia, it will run a few trials, then the whole experiment will freeze upon the beginning of a new trial. It freezes on what looks like the first frame of video, then won’t respond to anything but ESC to end the experiment.

Weirdly, when this freeze happens, there is no indication on my browser console that there was an error. Sample console output up until the point it freezes is below in bold.

It tends to happen around the trial 12 mark, although sometimes as early as trial 3 and I have gotten all the way to around trial 40 on occasion. There are 240 trials necessary in the experiment.

Is anyone aware why this could be happening?

Thanks in advance for any help!

DEBUG unknown | create a new MovieStim with name: StimVideo log4javascript.min.js:1:40074

DEBUG unknown | set the movie of MovieStim: StimVideo as: src= blob:, size= 640x480, duration= 3.033333s log4javascript.min.js:1:40074

DEBUG unknown | set the image of ImageStim: BlockImg as: src= blob:, size= 800x600 log4javascript.min.js:1:40074

DEBUG unknown | import attributes from: {“Vids”:“S028_K1_R3_A_FL-S028_K1_R3_B_FR_30.mp4”,“Conds”:“Original”,“Vid_Paths”:“stimuli/S028_K1_R3_A_FL-S028_K1_R3_B_FR_30.mp4”} log4javascript.min.js:1:40074

DEBUG unknown | create a new MovieStim with name: StimVideo log4javascript.min.js:1:40074

DEBUG unknown | set the movie of MovieStim: StimVideo as: src= blob:, size= 640x480, duration= 3.033334s log4javascript.min.js:1:40074


Can you tell if it’s failing on a particular movie file? If you make the order non-random, does it always fail in the same place?

Failing that, if you cut the number of movies in half (or make a copy of the experiment with half as many movies, which is probably safer), does it still happen?

This will help narrow down the possible issues. One salient possibility is that there’s some number of files among the few hundred you’re creating that are breaking things, for reasons as yet unclear. Another is that it’s a memory load issue of some kind. If we can narrow down that much we can start figuring out solutions.

Hi Johnathan,

Thanks for the help.

I’ve tried both suggestions, and it’s definitely freezing on the same video every time. I cut down the stimulus list to half, and it freezes on the same video.

It’s odd since all the videos were batch encoded at the same time, with the same settings.

The output of MediaInfo for the video in question is below. Any idea why this one in particular may be a problem? I can definitely remove it, or re-encode it, but I’m afraid there could be others that are causing the same issue.

Complete name : C:\Users\Vision Lab\Development\SocialConnection\socialconnection\html\resources\stimuli\S028_K1_R3_A_FL-S028_K1_R3_B_FR_30.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42 (isom/iso2/avc1/mp41)
File size : 111 KiB
Duration : 3 s 34 ms
Overall bit rate : 300 kb/s
Encoded date : UTC 2020-03-31 06:42:13
Tagged date : UTC 2020-03-31 06:42:13
Writing application : HandBrake 1.3.1 2020010400

ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L4
Format settings : CABAC / 4 Ref Frames
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 3 s 34 ms
Bit rate : 295 kb/s
Width : 640 pixels
Height : 480 pixels
Display aspect ratio : 4:3
Frame rate mode : Constant
Frame rate : 30.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.032
Stream size : 109 KiB (98%)
Writing library : x264 core 157 r2935 545de2f
Encoding settings : cabac=1 / ref=2 / deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=6 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=12 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=1 / keyint=300 / keyint_min=30 / scenecut=40 / intra_refresh=0 / rc_lookahead=30 / rc=crf / mbtree=1 / crf=22.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=20000 / vbv_bufsize=25000 / crf_max=0.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00
Encoded date : UTC 2020-03-31 06:42:13
Tagged date : UTC 2020-03-31 06:42:13
Color range : Limited
Color primaries : BT.601 NTSC
Transfer characteristics : BT.709
Matrix coefficients : BT.601

Nothing jumps out at me. You might compare that info to info from a movie that plays correctly and see if there are any notable differences (buffer size, frame rate, color space, bit rate, or one of the formats seem like plausible candidates). At a minimum, you’ve narrowed down the cause!

I think I’ve fixed this problem.

I realized that the two videos which were freezing were also played as examples in my experiment instruction routines. Even through they were different objects, the fact that the examples and the trials used the same video resource seemed to be causing the experiment to freeze on the second playback.

I followed the instructions in the thread below, adding a code object which runs “myVid.reset();;” at “Begin Routine” and myVid.stop(); at “end Routine”. As far as I can tell, this has resolved the issue.

It seemed necessary to add the reset() routine right before the play() routine in my case, although in the thread it says that play() should work by itself.

1 Like