# How to playback USB WebCam streams using PsychToolBox

**URL:** <https://psychtoolbox.discourse.group/t/how-to-playback-usb-webcam-streams-using-psychtoolbox/5109>\
**Category:** Programming Help\
**Tags:** windows\
**Created:** [September 27, 2023, 5:57am UTC](https://psychtoolbox.discourse.group/t/how-to-playback-usb-webcam-streams-using-psychtoolbox/5109 "2023-09-27T05:57:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![stadax](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@stadax](https://psychtoolbox.discourse.group/u/stadax)\
**Post date:** [September 27, 2023, 5:57am UTC](https://psychtoolbox.discourse.group/t/how-to-playback-usb-webcam-streams-using-psychtoolbox/5109/1 "2023-09-27T05:57:31Z")

</div>

Hello everyone,

I am now playing an mp4 video with this instruction.

Screen('OpenMovie’wnd,movieFileName);  
Screen(‘PlayMovie’,movieFileName,rate,1,1.0);  
Screen(‘CloseMovie’);

I would like to stream this using a USB WebCam instead of mp4 video,  
Does anyone know how to do this?  
I would be happy to have sample code.

The development environment is Windows 10 (Pro) and MATLAB (R2019b).

The parameters of the camera connected to the PC can be obtained with the following instruction.  
devices = Screen(‘VideoCaptureDevices’);

Thank you

---

<div class="post-metadata">

**Author:** ![stadax](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@stadax](https://psychtoolbox.discourse.group/u/stadax)\
**Post date:** [September 27, 2023, 2:00pm UTC](https://psychtoolbox.discourse.group/t/how-to-playback-usb-webcam-streams-using-psychtoolbox/5109/2 "2023-09-27T14:00:57Z")

</div>

[SOLVED]  
Problem has been solved.  
I execute the PTB sample ‘VideoCaptureDemo’ on another laptop PC (with built-in camera) and it worked correctly.  
Thank you for cooperation.
