cannot open vlc from matlab using system command

3 次查看(过去 30 天)
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
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