Tuesday, October 03, 2006

Highlights of my new VLC setup

My previous post was kinda long, so I wanted to make a quick post about the new features that my new VLC setup affords me...

New features:

* Screenshots - I can now take screenshots of the video that's playing. In my vlc conf file, I set the snapshot directory to be in my MythImages location, in a VideoCaptures subdirectory. This way I can view them with MythImages. I also have access to that folder through a Samba share, so I can pull them down on my laptop. I mapped the "Record" button to the snapshot command:

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


* Audio Syncing - I can now delay/speed up audio at 50ms increments. This is huge, sometimes my video slides out of sync, or the video just plays out of sync. This way, with my remote buttons, I can adjust it at play time with my remote. I mapped the Green and Red buttons to audio syncing:

# 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


* Subtitles - This is pretty huge too... If you ever backup one of your DVDs to your myth box as VTS files, you may want to view subtitles. With my new vlc setup, I can now do this with the "Blank" button:

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


* Others - I also mapped keys for volume up/down, and for video speed-up/slow-down. The former is very helpful for quieter videos. In the past, I found myself logging in with my laptop and running alsamixer. This is much easier. For the latter, I haven't found much use, since the audio doesn't play with the speeded-up/slowed-down video.. But hey, I had extra buttons.

I might later on try setting up bookmarks with the number keys, but we'll see. I'm crossing my fingers that there are other commands that aren't listed in the vlc config file, because I'm having way too much fun mapping these to my remote!

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

iTunes Video & MythTV

Google's video site lets you download videos in mpeg4, which is playable on your iPod. I keep my iTunes library on my linux file server, which is the same box that MythTV uses for its storage. So, since the videos I download from Google Video are on the same box that MythTV accesses, of course it was only a matter of time before I got around to setting it up so MythTV had access to these videos through the Video player.

I was hoping all that was necessary to get this working was to create a symbolic link from my iTunes Movie directory to somewhere inside the MythTV video directory. This did make them accessible, but the problem was that my mplayer didn't seem to play these mpeg4 videos. The audio would come across correctly, but I'd get a still image for the video.

I tinkered a little bit and found that although my current mplayer command didn't seem to do the trick, VLC had no problem.

In my next post, I'll explain my VLC setup.