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
Rick_A
(Rick A)
March 18, 2023, 10:45pm
2
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 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:
Is there a way to run vlc in Xojo without root privileges?
Rick_A
(Rick A)
March 18, 2023, 10:54pm
5
Kevin Bryson:
parameters
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!
Rick_A
(Rick A)
March 18, 2023, 11:01pm
7
Eugene Dakin:
Here is the message
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.
1 Like
Rick_A
(Rick A)
March 18, 2023, 11:12pm
8
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.
Rick_A
(Rick A)
March 19, 2023, 12:09am
10
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.
Rick A:
If it is for your machine only, you could hack your copy of vlc:
sudo sed -i 's/geteuid/getppid/' /usr/bin/vlc
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
1 Like
Rick_A
(Rick A)
March 19, 2023, 10:50am
12
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.