MythTV Lirc and Mplayer

Ranked #11,110 in Computers & Electronics, #224,426 overall

Customize MythTV and Lirc with Mplayer

I am the happy owner of a MythTV box that acts as Media Center in my living room.Once I installed my remote using lirc, I had all the default configurations for it: increasing or decreasing the volume, play, pause, stop... but I needed more. So I am going to tell you how to easily modify your mythtv lirc configuration to personalize the buttons on your remote control.

If you use mplayer as your video player and have a remote control configured with lirc... continue reading!

MythTV Lirc: Understand what mplayer can do for you

Well, if you type "man mplayer" in your terminal, you will get more than 9000 lines of pure fun... so mplayer can do a lot!
Anyway, let's focus on the keyboard controls:


seek [type=<0/:1/:2>]
Seek to some place in the movie. Type 0 is a relative seek of +/:- seconds. Type 1 seek to % in the movie. Type 2 is a seek to an absolute position of seconds.

audio_delay
Adjust the audio delay of value seconds

quit
Quit MPlayer

pause
Pause/:unpause the playback

pt_step [force=]
Go to next/:previous entry in the playtree.

pt_up_step [force=]
Like pt_step but it jumps to next/:previous in the parent list.

alt_src_step
When more than one source is available it selects the next/:previous one (only supported by asx playlist).

sub_delay [abs=]
Adjust the subtitles delay of +/:- seconds or set it to seconds when abs is non zero.

osd [level=]
Toggle osd mode or set it to level when level > 0.

volume
Increase/:decrease volume

[contrast|brightness|hue|saturation] <-100-100> [abs=]
Set/:Adjust video parameters.

frame_drop [type=]
Toggle/:Set frame dropping mode.

sub_visibility
Toggle subtitle visibility.

sub_pos
Adjust subtitles position.

vo_fullscreen
Switch to fullscreen mode.

tv_step_channel
Select next/:previous tv channel.

tv_step_norm
Change TV norm.

tv_step_chanlist
Change channel list.

gui_[loadsubtitle|about|play|stop]



To get the complete command list go to the mplayer man page.

Step 1: Know your MythTV lirc remote!

irw

First of all, you need to know what kind of remote control you have.
You can find out everything you need using the terminal, by executing "irw".

As you can see in the picture, I ran irw on a terminal, and pressed some buttons on my remote.
Here you can check the name of your remote (mceusb for me) and the name of the buttons you would like to modify.

What I would like to do is to assign to the keys "channel up" and "channel down" the functions to increase or decrease subtitle delays in mplayer. Let's see how to do that!

Compatible Remotes for MythTV

MythTV Lirc Remotes

Loading

Step 2: Edit your lirc file

I like using mplayer as my mythtv media player. So in my case, I am going to edit the file ~/.lirc/mplayer and add the configuration for the buttons Channel Up and Down. I just add these lines in the file:


begin
remote = mceusb
prog = mplayer
button = ChanDown
config = sub_delay -1
repeat = 0
delay = 0
end

begin
remote = mceusb
prog = mplayer
button = ChanUp
config = sub_delay 1
repeat = 0
delay = 0
end



As you can see, you just need the remote name and the button (that we got using irw), the program that will handle this configuration (mplayer) and the config, or function from the mplayer commands at the beginning of the article (sub_delay).

Learn How To Repair Laptops

repair laptops

Follow these guys on their HD videos and learn how to repair a laptop computer

MythTV Lirc Remote

More personalization!

Ok, let's say that I want to add the possibility to toggle subtitles. I just insert this in the same mplayer file:


begin
remote = mceusb
prog = mplayer
button = RecTV
config = sub_visibility
repeat = 0
delay = 0
end



I picked a button I wanted for that, and checked its name with irw. Piece of cake!

Which remote do you use?

by

Amarant

System & Network Engineer focused on Linux and Networking. I live in northeast Italy, near Venice. Computers and Electronics are my job and hobbies! more »

Feeling creative? Create a Lens!