Search:  
Gentoo Wiki

VLC/LIRC

Setting up VLC to use LIRC (infrared remote controls) is a little tricky because it isn't documented, but it is possible to map a lot of the keys to remote events.

First and foremost, make sure you emerge media-video/vlc with the lirc USE flag.

Next, open a copy of VLC. Go into Settings >> Preferences >> Control interfaces and check the box marked 'Infrared remote control interface', then hit Save.

Once that's done, you need to setup your ~/.lircrc to map the remote keys to VLC key presses. (~/.lircrc is a text file named .lircrc in your home directory.)

You can see some of the keys by running vlc --help --advanced. They are also all listed in the source code, in src/libvlc.h.

And to see the names for the keys on your remote, type irw in Konsole and press the keys on your remote.

For your convenience, here's the most recent key listing:

Here is an example mapping for VLC with a Media Center remote:

File: ~/.lircrc
begin
 prog = vlc
 button = play
 config = key-play-pause
end
begin
 prog = vlc
 button = pause
 config = key-play-pause
end
begin
 prog = vlc
 button = stop
 config = key-stop
end
begin
 prog = vlc
 button = skip
 config = key-jump+medium
end
begin
 prog = vlc
 button = replay
 config = key-jump-short
end
begin
 prog = vlc
 button = forward
 config = key-next
end
begin
 prog = vlc
 button = rewind
 config = key-prev
end
begin
 prog = vlc
 button = up
 config = key-nav-up
end
begin
 prog = vlc
 button = down
 config = key-nav-down
end
begin
 prog = vlc
 button = left
 config = key-lav-left
end
begin
 prog = vlc
 button = right
 config = key-right
end
begin
 prog = vlc
 button = volup
 config = key-vol-up
 repeat = 1
end
begin
 prog = vlc
 button = voldown
 config = key-vol-down
 repeat = 1
end
begin
 prog = vlc
 button = mute
 config = key-vol-mute
end
begin
 prog = vlc
 button = pictures
 config = key-audiodelay-up
end
begin
 prog = vlc
 button = music
 config = key-audiodelay-down
end
begin
 prog = vlc
 button = more
 config = key-crop
end

Download this file here.

Following is an example for another potential configuration.

File: ~/.lircrc
begin
  prog = vlc
  button = Pause
  config = key-play
end
begin
  prog = vlc
  button = Stop
  config = key-pause
end
# Use this target if you have a combined play/pause button
begin
  prog = vlc
  button = Ok
  config = key-play-pause
  repeat = 0
end
begin
  prog = vlc
  button = 8
  config = key-stop
end
begin
  prog = vlc
  button = Quit
  config = key-quit
end
begin
  prog = vlc
  button = Channel+
  config = key-next
  repeat = 0
end
begin
  prog = vlc
  button = Channel-
  config = key-prev
  repeat = 0
end
begin
  prog = vlc
  button = Up
  config = key-fullscreen
end
begin
  prog = vlc
  button = Red
  config = key-slower
end
begin
  prog = vlc
  button = Green
  config = key-faster
end
begin
  prog = vlc
  button = Left
  config = key-jump-short
  repeat = 1
end
begin
  prog = vlc
  button = Right
  config = key-jump+short
  repeat = 1
end
begin
  prog = vlc
  button = Chan-Stop
  config = key-jump-1min
end
begin
  prog = vlc
  button = Chan+Play
  config = key-jump+1min
end

#Audio controls
begin
  prog = vlc
  button = Vol-
  config = key-vol-down
  repeat = 1
end
begin
  prog = vlc
  button = Vol+
  config = key-vol-up
  repeat = 1
end
begin
  prog = vlc
  button = SOMEBUTTON
  config = key-audio-track
end
begin
  prog = vlc
  button = Mute
  config = key-vol-mute
end

As a last step we have to make sure that the file ~/.vlc/vlcrc contains a line like

File: ~/.vlc/vlcrc
control=lirc

Alternatively the program can be started with the option --control lirc in the command line.

Retrieved from "http://www.gentoo-wiki.info/VLC/LIRC"

Last modified: Tue, 19 Aug 2008 22:10:00 +0000 Hits: 785