cannot open vlc from matlab using system command

조회 수: 3 (최근 30일)
ezekiel oyekanmi
ezekiel oyekanmi 2018년 5월 6일
댓글: Walter Roberson 2018년 5월 8일
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
Rik
Rik 2018년 5월 6일
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 2018년 5월 8일
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 &')

댓글을 달려면 로그인하십시오.

답변 (4개)

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

ezekiel oyekanmi
ezekiel oyekanmi 2018년 5월 6일
@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 2018년 5월 6일
[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
ezekiel oyekanmi
ezekiel oyekanmi 2018년 5월 7일
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

댓글을 달려면 로그인하십시오.


Nagarjuna Manchineni
Nagarjuna Manchineni 2018년 5월 8일
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

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by