Shell vlc command not working

Hello,

I am trying to start vlc to view a h264 video and the shell does not seem to execute the command on the Raspberry Pi with Xojo 2022 r4.1,

In a terminal, successful code to view the video is:

vlc /home/pi/Desktop/cam.h264

My attempt at the code in Xojo that does not work is:

//Use Raspberry Pi Shell to show a video
Var s as Shell
s = New Shell
//Play the video
s.Execute("vlc /home/pi/Desktop/cam.h264")

What am I missing to show a vlc video with Xojo’s shell?

Edit: Fixed typing mistake

What do you get from

Var s as Shell
s = New Shell
s.Execute("vlc /home/pi/Desktop/cam.h264")
MessageBox "[" + s.Result + "] " + s.ExitCode.ToString

per this page: Shell — Xojo documentation

show.execute appears to have a second property called parameters… seems to be the parameters parameter :slight_smile: I wonder if it expects only the name of the binary as the first pproperty and as it can’t find a binary with the name of the whole first string it is failing to execute? On that same page is described an interactive shell where you can just write a line to the shell.

Kev

Here is the message:
vlcError

Is there a way to run vlc in Xojo without root privileges?

That’s for shell per se. Default to “-c”.

I will be darned if I can figure out what the -c is for (command-line?) after a 5 minute shallow-dive, but thank you for correcting me!

That’s what’s going on.

Don’t know easy ways to run it guaranteed as a non root.

Someone can take the problem from here. :wink:

1 Like

If it is for your machine only, you could hack your copy of vlc:

sudo sed -i 's/geteuid/getppid/' /usr/bin/vlc
1 Like

Thanks Rick,

I typed in the command:
sudo sed -i 's/geteuid/getppid/' /usr/bin/vlc

The good news is that Xojo played the movie, and after the movie the following error occurred.

Those were debug infos / warnings. Nothing the VLC dev said as “Fatal Error”, as the exit code he emitted was 0 (success)

Disable my debug // MessageBox "[" + s.Result + "] " + s.ExitCode.ToString

Check error codes <> 0 for something wrong.

Hi Rick,

Thank you for your help! The answer was your suggestion of sudo sed…

Your comment has been marked as the solution.

Warm regards :slight_smile:

1 Like

Note for future readers: that’s a hack. A patch that currently works and not future proof to produce a vlc binary able to run as root, and running as root is not a recommended setup. That was a workaround for a necessity, not a solution for a problem. The solution would be using an user account and not the root user.

Stay safe, semper fi. :wink: