# Reconstructing session video from .mwk2 file

**URL:** <https://mworks.discourse.group/t/reconstructing-session-video-from-mwk2-file/1075>\
**Category:** Support\
**Created:** [February 13, 2025, 5:49pm UTC](https://mworks.discourse.group/t/reconstructing-session-video-from-mwk2-file/1075 "2025-02-13T17:49:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![skmar](https://avatars.discourse-cdn.com/v4/letter/s/a87d85/32.png) [@skmar](https://mworks.discourse.group/u/skmar)\
**Post date:** [February 13, 2025, 5:49pm UTC](https://mworks.discourse.group/t/reconstructing-session-video-from-mwk2-file/1075/1 "2025-02-13T17:49:59Z")

</div>

Hi Chris,

I was wondering if you or others have worked out a way to reconstruct a video playback of a session (stimulus screen with eye traces overlaid) from the raw .mwk2 file?

Thank you,  
Sol

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [February 14, 2025, 4:16pm UTC](https://mworks.discourse.group/t/reconstructing-session-video-from-mwk2-file/1075/2 "2025-02-14T16:16:01Z")

</div>



---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [February 14, 2025, 4:16pm UTC](https://mworks.discourse.group/t/reconstructing-session-video-from-mwk2-file/1075/3 "2025-02-14T16:16:27Z")

</div>



---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [February 14, 2025, 4:34pm UTC](https://mworks.discourse.group/t/reconstructing-session-video-from-mwk2-file/1075/4 "2025-02-14T16:34:06Z")

</div>

Hi Sol,

[This discussion](https://mworks.discourse.group/t/making-movies-out-of-tasks/127) describes a way to do it. It also includes some example MATLAB code for generating the movie. However, it relies on the experiment [capturing](https://mworks.github.io/documentation/latest/components/stimulus_display.html#capture-format) the relevant stimulus display frames as it runs, so this wouldn’t work for data you’ve already collected.

In theory, you could use the stimulus info from [#stimDisplayUpdate](https://mworks.github.io/documentation/latest/reference/sysvars.html#stimdisplayupdate) events to recreate each display frame from the event file, but you would need to write your own drawing code to render the stimuli. That wouldn’t be too hard for images or simple shapes, but it could be tricky to impossible with other stimulus types. (The client eye window basically uses this approach, but it limits the stimulus rendering to simple outlines.)

Cheers,  
Chris

---

<div class="post-metadata">

**Author:** ![skmar](https://avatars.discourse-cdn.com/v4/letter/s/a87d85/32.png) [@skmar](https://mworks.discourse.group/u/skmar)\
**Post date:** [February 14, 2025, 7:42pm UTC](https://mworks.discourse.group/t/reconstructing-session-video-from-mwk2-file/1075/5 "2025-02-14T19:42:45Z")

</div>

Great I hadn’t seen this, thank you!

---

<div class="post-metadata">

**Author:** ![cstawarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/mworks.discourse.group/cstawarz/32/3_2.png) [@cstawarz](https://mworks.discourse.group/u/cstawarz)\
**Post date:** [May 1, 2025, 1:44pm UTC](https://mworks.discourse.group/t/reconstructing-session-video-from-mwk2-file/1075/6 "2025-05-01T13:44:22Z")

</div>


