Tuesday, October 03, 2006

Switching from Mplayer to VLC

In my previous post I mentioned how I wanted to switch from Mplayer for my MythTV video player to VLC so that my Google Video mpeg4 files in my iTunes library would play in MythTV.

1. Change your video player to VLC:
My existing mplayer command, as setup in MythTV's "Utilities/Setup" -> "SetUp" -> "Media Settings" -> "Video Settings" -> "Player Settings" used to be:

mplayer -framedrop -monitoraspect 16:9 -fs -zoom -quiet -vo xv -alang en -ao oss %s

I found a post somewhere that mentioned to use this for vlc:
vlc file://%s vlc:quit


2. Add handling for Mpeg4 files:
After changing your video player to VLC, it's now time to register the file extensions you may see mpeg4's come over as.

In "Utilities/Setup" -> "SetUp" -> "Media Settings" -> "Video Settings" -> "File Types", add the extensions "mp4" and "m4v". Set them up to use the default player.


3. Edit your VLC setup for LIRC and to default to fullscreen
Assuming you're using LIRC for your remote control handling, you'll need to tell VLC to hook into it. Edit your ~/.vlc/vlcrc, finding the "#control=" command. Un-comment it out by removing the "#", and set it to "control=lirc" (without the quotes).

Find the "#fullscreen=" command. Un-comment it out, and set it to "fullscreen=1" (without the quotes)

Save the file and exit.


4. Add your remote control bindings for Hauppauge remote
I'm using the remote control that comes with the Hauppauge 250 and 350. If you're not, then you can use the same setup that I am, but for each command, change the "button" setting with whatever you get while pressing a button when you're running "irw". The "irw" command will spit back the names of the buttons you're pressing - pretty cool little app.

Well, anyway, here's my VLC LIRC config. Each of these commands are listed in the VLC config, so if you want to modify them or add other settings, you should be able to figure out how with this example and your VLC setup file. By the way - I can't tell you how happy I am to now have audio sync'ing buttons on my remote! The few videos that have audio sync'ing problems can be fixed by delaying or advancing the audio track by increments of 50ms!!!

Also, the snapshot button is pretty cool - it lets you take screenshots of the video, which then drop them in ~/.vlc directory, or where ever you set your "snapshot-path=" setting. I've set mine to a directory inside my Myth Photo directory.

One more thing - Please leave a comment if you have further ideas for remote button mapping. These are all I could think of for VLC -- I'd love to find a use for my number buttons.

good luck! YMMV

### VLC config

# Pause playback
begin
prog = vlc
button = PAUSE
repeat = 3
config = key-play-pause
end

# Play
begin
prog = vlc
button = PLAY
repeat = 3
config = key-play
end

# Stop playback and exit
begin
prog = vlc
button = STOP
repeat = 3
config = key-quit
end

# Volume Down
begin
prog = vlc
button = Vol-
repeat = 3
config = key-vol-down
end

# Volume Up
begin
prog = vlc
button = Vol+
repeat = 3
config = key-vol-up
end

# Faster
begin
prog = vlc
button = Ch+
repeat = 3
config = key-faster
end

# Slower
begin
prog = vlc
button = Ch-
repeat = 3
config = key-slower
end

# Mute
begin
prog = vlc
button = MUTE
repeat = 3
config = key-vol-mute
end

# Seek back 10 seconds
begin
prog = vlc
button = Rewind
repeat = 3
config = key-jump-10sec
end

# Seek forward 10 seconds
begin
prog = vlc
button = Forward
repeat = 3
config = key-jump+10sec
end

# Quit
begin
prog = vlc
button = BACK/EXIT
repeat = 3
config = key-quit
end

# Seek forward 1 minute
begin
prog = vlc
button = SKIP
repeat = 3
config = key-jump+1min
end

# Seek backward 1 minute
begin
prog = vlc
button = REPLAY
repeat = 3
config = key-jump-1min
end

# Seek forward 5 minutes
begin
prog = vlc
button = Blue
repeat = 3
config = key-jump+5min
end

# Seek backward 5 minutes
begin
prog = vlc
button = Yellow
repeat = 3
config = key-jump-5min
end

# Toggle full-screen
begin
prog = vlc
button = FULL
repeat = 3
config = key-fullscreen
end

# Position - shows where you are in the video
begin
prog = vlc
button = Go
repeat = 3
config = key-position
end

# Subtitles
begin
prog = vlc
button = Blank
repeat = 3
config = key-subtitle-track
end

# Snapshots
begin
prog = vlc
button = Record
repeat = 3
config = key-snapshot
end

# Audio Sync'ing
# Audio Delay UP
begin
prog = vlc
button = Green
repeat = 3
config = key-audiodelay-up
end

# Audio Delay DOWN
begin
prog = vlc
button = Red
repeat = 3
config = key-audiodelay-down
end

7 comments:

Anonymous said...

How about implementing listenting ti internet radio or shoutcast with VLC?

As I enjoy both satellite and internet radio with VLC, I would recomend that radio stations can be programmed on the neumbers You mentioned (e.g. 1 - HRT, 2- Swiss radio classic, 3- Sky FM, etc.).

jetpeach said...

there is no "media player" options in my mythtv under setup - i can select decoders in side "playback" inside the video settings area, but no where to enter a command. could you update this for the newer version of mythtv? or if there isn't a way with the newer versions of mythtv, it'd be nice to know...
thanks!

Anonymous said...

You need Mythvideo plugin

Fabian said...

Thanks, buddy!

majesticnet said...

Thanks for the help, I hope someday to have a box with all of the Mythical features I think all of us in the AV community have wanted. I am enlisting anyone interested in expanding Blake mythtvbox to see what we are working on for the last couple of years, (same thing with added support and functionality) We are using Hava and sling. Where is everyone located?
-vwong at majesticnet.
Wishing you all well! anyone trying this is a friend of ours.

Anonymous said...

I have tried these commands under Debian Sid and Mythtv .22 but it simply doesn't work and is driving me a little bit nuts, any ideas?

Anonymous said...

Try looking under /home/yourname/.config/vlc in Debian and Ubuntu.

Setting up an IR remote can be tricky.