vlc command to play a silent video mutes matlab
1 view (last 30 days)
Show older comments
Hello,
I am using MATLAB (2018b) and Cogent 2000 toolbox to prepare an experiment which will present a silent video + audio stimuli on the same time. So, within the code of the experiment I am using this command:
system('start "" "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" --play-and-exit instructionsANDstimuli\Donald.mp4 --no-qt-name-in-title -f -q --width 640 --height 480 --start-time 4 --stop-time 14 --no-osd --no-autoscale --no-keyboard-events --no-mouse-events --intf dummy --dummy-quiet &');
Then follows the for loop for the presentation of the audio stimuli.
So, what I am expecting is to watch the silent video while listening to the audio stimuli. Unfortunately, what is happenning is that I am watching only the video with no audio stimuli.
Note that:
- Donald.mp4 is a silent video
- When I am running the code without the video I can hear the audio stimuli properly.
- I have tried the following options with no success: --no-audio, --no-sout-audio, --spdif, --no-audio --no-sout-audio, --no-audio --spdif, --spdif --no-sout-audio, --no-audio --no-sout-audio --spdif, --spdif, --aout none.
- There is sound output from other applications (ex: spotify) while MATLAB is mute
Is there something wrong with the video or audio options in the command system(start ...)? Do you know what may resolve this issue?
Thank you very much for your time!!
0 Comments
Answers (1)
Munish Raj
on 1 Mar 2019
Hello Varvara,
The operating system is designed such that only one audio source is allocated all the child processes of a process.
MATLAB is the parent process and every code run from MATLAB is a child of MATLAB.
The system command is initiated from MATLAB, hence VLC which is initiated from MATLAB is also a child of MATLAB.
Only one(VLC/MATLAB code) can use the audio resource.
Even though there is no audio output from VLC, VLC uses the audio resource.
Hence MATLAB can not access the Audio resource.
However, external applications can play audio at the same time because these applications are not a a child process of MATLAB.
To achieve your task, you can use MATLAB’s in-buit video player instead of VLC.
To play a video stored in your computer using MATLAB’s movie player
implay(filename)
See Also
Categories
Find more on Audio and Video Data in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!