Advertisement
Tritonio

OMXPlayer Controls

Mar 15th, 2021
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.36 KB | None | 0 0
  1. Key bindings
  2. Key Action
  3. 1 Increase Speed
  4. 2 Decrease Speed
  5. j Previous Audio stream
  6. k Next Audio stream
  7. i Previous Chapter
  8. o Next Chapter
  9. n Previous Subtitle stream
  10. m Next Subtitle stream
  11. s Toggle subtitles
  12. q Exit OMXPlayer
  13. Space or p Pause/Resume
  14. - Decrease Volume
  15. + Increase Volume
  16. Left Seek -30
  17. Right Seek +30
  18. Down Seek -600
  19. Up Seek +600
  20.  
  21. I could not JeffHoogland's solution to work in Raspbian, but a couple of changes made it work for me:
  22.  
  23. sudo nano /usr/share/applications/omxplayer.desktop
  24.  
  25. For it's contents paste:
  26.  
  27. [Desktop Entry]
  28. Type=Application
  29. Name=OMXPlayer
  30. Categories=AudioVideo;Player;
  31. Exec=lxterminal --command "omxplayer -o hdmi %f"
  32. Terminal=false
  33. Icon=/usr/share/icons/nuoveXT2/96x96/categories/applications-multimedia.png
  34.  
  35. Save and close the file (ctrl+x in nano)
  36.  
  37. You can choose your own icon. Note that 'lxterminal' is the default terminal on Pi - change that if you are using something else.
  38.  
  39. tried framil's solution on my copy of Raspian wheezy. it worked as described.
  40.  
  41.  
  42. thanks framil. ;-)
  43.  
  44.  
  45. they only thing i changed was adding the -y option to the command line arguments. i have a 1680x1050 monitor I connected with an DVI-to-HDMI cable. for some reason nothing plays with omxplayer unless I use the -y option.
  46.  
  47. framil variant works well for me!
  48.  
  49. I'm just stuck on how to extend the menu option to .mpg files...
  50.  
  51. Code: Select all
  52. Categories=AudioVideo;Player;
  53.  
  54.  
  55.  
  56. is a bit generic, I wonder if it supports extension regex or what else shall I do...
  57.  
  58. thanx for the help
  59.  
  60. You can directly use "xterm".
  61.  
  62. Code: Select all
  63. [Desktop Entry]
  64. Type=Application
  65. Name=OMXPlayer-HDMI
  66. Categories=AudioVideo;Player;
  67. Exec=xterm -fullscreen -fg black -bg black -e omxplayer -o hdmi -r %f
  68. Terminal=false
  69. Icon=/usr/share/icons/nuoveXT2/96x96/categories/applications-multimedia.png
  70.  
  71.  
  72. And for playing using audio jack:
  73.  
  74. Code: Select all
  75. [Desktop Entry]
  76. Type=Application
  77. Name=OMXPlayer
  78. Categories=AudioVideo;Player;
  79. Exec=xterm -fullscreen -fg black -bg black -e omxplayer -o local -r %f
  80. Terminal=false
  81. Icon=/usr/share/icons/nuoveXT2/96x96/categories/applications-multimedia.png
  82.  
  83. my gui tboplayer will use omxplayer to play audio and video https://github.com/KenT2/tboplayer
  84.  
  85.  
  86. I think the confusion with why this solution seems to work sometimes and not others is that the [desktop entry] file passes the entire file name to the terminal via the %f variable, but there's no consideration for file names that have spaces or other special characters. If one tries to add quotes around %f in the [desktop entry] file to deal with this issue, the desktop entry won't work at all due to limitations of the desktop entry file with regards to quotes and variables.
  87.  
  88. Solution:
  89. Create a bash script that adds the quotes around the file name and call the bash script from the desktop entry file.
  90.  
  91. For Example...
  92. /home/pi/.local/share/applications/OMXlauncher.desktop
  93.  
  94. Code: Select all
  95. [Desktop Entry]
  96. Type=Application
  97. Name=OMXPlayer
  98. Exec=bash /home/pi/scripts/videoplayer %f
  99. Categories=AudioVideo;
  100. MimeType=video/mp4
  101. Terminal=false
  102. Encoding=UTF-8
  103. Icon=applications-multimedia
  104. NoDisplay=false
  105.  
  106.  
  107. /home/pi/scripts/videoplayer
  108.  
  109. Code: Select all
  110. #!/bin/bash
  111. lxterminal -t "OMXPlayer (Video Control)" -e "omxplayer -b --display :0 \"$1\""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement