15

I wanted to play video file by doubling click on it by using omxplyaer. First time, I double-clicked on it, it asks me to choose an application to open the file. Since I cannot find omxplayer in installed application tab, I choose Custome Command Line tab and enter 'omxplyer' in command line to execute and again 'omxplayer' in Application name.

Now when I click on the video, it starts to play in omxplayer but hotkeys are no longer working. For example, I cannot quit video by hitting 'q' on keyboard and nothing of the hotkey works. This used to be working when I play a video file from lxterminal by typing 'omxplayer video.mp4'. But this is no longer the case.

If a video starts to play in full screen and since I no longer can quit omxplayer, I have to watch the video to end so that the player will quit. So my question is...

  1. How do I enable hotkey again when I play a video file with 'open with and then omxplayer' option?

  2. How do I delete the previous Command line to execute where I enter omxplayer so that when I click on a video file, it would ask me again to choose an application?

Zip
  • 253
  • 1
  • 2
  • 4

6 Answers6

6

From a terminal:

pid=$(pidof omxplayer)
kill $pid

If it still doesn't stop, kill -9 $pid.

You can also use killall omxplayer and killall -s 9 omxplayer, which should stop all running instances (if there can be more than one).

goldilocks
  • 60,325
  • 17
  • 117
  • 234
2

I just use the Alt+F4 to end the video.

Frank
  • 21
  • 2
1

While the other answers provide some inventive shell magic to kill a process running a specific command, there are actually two commands to do exactly this, and they are called pkill and killall. From the man pages:

pgrep,  pkill  -  look  up  or signal processes based on name and other
                  attributes

killall - kill processes by name

So

pkill omxplayer
killall omxplayer

should both do the trick.

Now, one could wonder why there are two commands to do the same thing. The reasons are mainly historical, dating back from a time when different unicies differed a little bit more than they usually do today.

There are also differences in what options they accept. For a longer discussion about the differences of pkill and killall, please see https://unix.stackexchange.com/questions/91527/whats-the-difference-between-pkill-and-killall

Bex
  • 2,929
  • 3
  • 26
  • 34
1

If you use the "Open with" option from the GUI you have to select "Execute in terminal emulator" option.

lxterminal -e omxplayer %F also works if you are on lxde,

Looks like the the the 'q' button and other shortcuts don't work if the terminal is not open. I had to power off the Pi a lot of times until I figured this out.

Ghanima
  • 15,958
  • 17
  • 65
  • 125
Wally
  • 111
  • 2
-1

Use this command in a terminal to kill omxplayer:

ps -ef | grep omxplayer | grep -v grep | awk '{print $2}' | xargs kill -9
Rubayet
  • 21
  • 4
-2

hey just try to run omxplayer in gui by linking it with tbo player it works perfectly