cannot open vlc from matlab using system command

8 views (last 30 days)
cannot open vlc from matlab using system command i used this version of matlab: MATLAB Version: 9.0.0.341360 (R2016a) MATLAB License Number: rutracker.org Operating System: Linux 4.13.16-100.fc25.x86_64 #1 SMP Mon Nov 27 19:52:46 UTC 2017 x86_64 Java Version: Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot™ 64-Bit Server VM mixed mode
the code is as follows: >>[status, msg] = system('"/usr/bin/vlc" test.y4m &') Result given is as follows:
status =
0
msg =
''
My expectation:
Invoking a VLC that will automatically play the file. But the Vlc is not displaying.
What is the problem pls. thanks
  4 Comments
Rik
Rik on 6 May 2018
Please don't use the 'answer' field for comments.
You can use the exact code Chad posted here. You used double quotes (") inside the command. That is not usually needed under Unix systems. The system function should send the entire string (so all text between the single quote marks) to the terminal. If the code works there, it should work in this function as well.
Walter Roberson
Walter Roberson on 8 May 2018
The "" are not a problem in Unix. Using "" around a path is still the general form on Unix, as paths on Unix can contain spaces and other special characters, Using '' inside would be more robust but is a bit of a nuisance
[status, msg] = system('''/usr/bin/vlc'' test.y4m &')

Sign in to comment.

Answers (4)

ezekiel oyekanmi
ezekiel oyekanmi on 6 May 2018
>> [status, message] = system(/usr/bin/vlc &) [status, message] = system(/usr/bin/vlc &) ↑ Error: Unexpected MATLAB operator.

ezekiel oyekanmi
ezekiel oyekanmi on 6 May 2018
@Chad if the command are not in code the error displayed is wahat i posted recently. I think quote is needed. But the vlc is not showing. Pls can i get the full code of yours which show the VLC without quote so that i can also try it. Thanks

Wick
Wick on 6 May 2018
[status, msg] = system('/usr/bin/vlc test.y4m &')
Note the single quotes on either end of the command to be sent to the prompt. In your statement of the problem you have single & double quotes. In your above answer you have no quotes at all.
Highlight, copy, and paste what I wrote above into MATLAB and see if that works. If it doesn't, highlight and copy everything inside of the single quotes (not including those quotes) and paste that to a terminal. If that doesn't work, the problem is not in MATLAB but in the UNIX command.
  1 Comment
ezekiel oyekanmi
ezekiel oyekanmi on 7 May 2018
It works actually on terminal as you have said mr Chad. but i tried to even open just a vlc with matlab without playing file. yet it does not, but it does on the terminal. Kindly help me on what to do to the unix system. i'm using Fedora 25 as the OS. Thanks

Sign in to comment.


Nagarjuna Manchineni
Nagarjuna Manchineni on 8 May 2018
Hi Ezekiel,
I was able to launch the VLC player and play the video successfully by using the 'system' command on MATLAB R2018a. Can you try once using that release?
If this doesn't work, please contact MathWorks Technical Support

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!