Calling VLC with OsProcessStarter on windows

32 views
Skip to first unread message

Louis LaBrunda

unread,
Jul 4, 2024, 4:29:43 PMJul 4
to VAST Community Forum
Hi Guys,

Using OsProcessStarter to run VLC works if I use the desktop link for the command.  When I try to use the .exe that the link points to, it doesn't work.  I tried setting the #workingDirectory: but no joy there.

I haven't figured out how to direct any errors where I can see them.  I'm not sure any are reported.

Lou

This works:

[ | vlcCall chimePlayer |

vlcCall := OrderedCollection new.
vlcCall
add: '"c:\Users\Public\Desktop\VLC media player.lnk"';
add: 'c:\KSCVAST\WiFiClock\WiFiClock\sounds\Bong.wav'. "path to the sound file."
vlcCall add: 'vlc://quit'.
chimePlayer := OsProcessStarter new.
chimePlayer command: vlcCall.
chimePlayer shellMode: OsProcessConstants::ProcShellCmd.
chimePlayer inspect.
chimePlayer start.
] fork.

This doesn't:


[ | vlcCall chimePlayer |

vlcCall := OrderedCollection new.
vlcCall
add: '"C:\Program Files\VideoLAN\VLC\vlc.exe"';
add: 'c:\KSCVAST\WiFiClock\WiFiClock\sounds\Bong.wav'. "path to the sound file."
" vlcCall add: 'vlc://quit'."
chimePlayer := OsProcessStarter new.
chimePlayer command: vlcCall.
chimePlayer workingDirectory: 'C:\Program Files\VideoLAN\VLC'.
chimePlayer runInShell: true.
chimePlayer shellMode: OsProcessConstants::ProcShellCmd.
chimePlayer inspect.
chimePlayer start.
] fork.

Louis LaBrunda

unread,
Jul 4, 2024, 4:36:58 PMJul 4
to VAST Community Forum
I redirect errors to a file and suddenly it works.  So, I used #redirectErrorToNull and that works.  Go figure.

Lou

Richard Sargent

unread,
Jul 8, 2024, 2:43:35 PMJul 8
to VAST Community Forum
On Thursday, July 4, 2024 at 1:36:58 PM UTC-7 Louis LaBrunda wrote:
I redirect errors to a file and suddenly it works.  So, I used #redirectErrorToNull and that works.  Go figure.

Was there anything logged in the redirected stderr file?

Richard Sargent

unread,
Jul 8, 2024, 3:28:51 PMJul 8
to VAST Community Forum
I notice that "C:\Program Files\VideoLAN\VLC\vlc.exe" is exactly 40 bytes long.
Look at #asParameter implementations and senders. #callWith:with: and ilk often need to use #asParameter with non-primitive arguments.
For Strings, #asParameter makes sure the string passed to the call is zero terminated.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages