1

I'm quite new to raspberry, all I need to do is to play a video in loop from a local ssh connection. These are my step:

  1. start the Pi in Cli (so no x server but command line) with network
  2. open my windows terminal connect via ssh and launch the command omxplayer --loop myfile.mp4
  3. Let the video plays it's eternal loop close the terminal and go home.

Now, the first two step are working correctly, what I expect is that the video continues to run even if I close the connection.

Where is my mistake? Is it possible to let it plays?

4
  • @SteveRobillard Bacground processes are still tied to the shell and are closed when the shell closes. Actually, disown wound't work either, unless omxplayer doesn't need a terminal to run and ignores "SIGHUP". Jul 13 '21 at 8:15
  • @DmitryGrigoryev thanks for catching that I couldn't remember if that was the case or not, and was too tired/lazy to test it. Jul 13 '21 at 10:33
  • Does it work if you run nohup omxplayer --loop myfile.mp4?
    – Dougie
    Jul 14 '21 at 16:28
  • Yes you must add sudo Jul 15 '21 at 19:22
1

All commands you run via SSH are attached to the virtual SSH terminal and automatically closed when you disconnect. If you want a process to persist across sessions, you need to use nohup, tmux, screen or a similar command which either creates a persistent virtual terminal of replaces it with a file.

See this question for details and examples.

1
  • Thanks a lot nohup command made the works! Jul 14 '21 at 12:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.