[HOWTO] PLAY BALL! Enjoy the new MLB video this season on Linux with MLBVIEWER

[Updated 2 April: Deftcat, the developer of mlbviewer let me know that the section about NexDef and the detector aren't needed and mlbviewer no longer uses it. I've also added an important note about watching condensed games. Big thanks to daftcat for checking the article.]
[Updated 5 April: I goofed on the install instructions for mlbhls. I've corrected the steps below. I've also added a link at the bottom of the post to the support thread over at LinuxQuestions.org.]

The new baseball season opens tomorrow and with spring training over you’re probably looking forward to seeing your favorite team start playing games that count and start their march to October and the World Series. Last year I wrote a tutorial on how to enjoy the games in Linux with mlbviewer but I wrote it at the All-Star break so this year I wanted to make sure my fellow baseball fans are ready to watch the very first game of the season.

For those who aren’t familiar with mlbviewer, it’s a way for Linux fans to be able to watch games since Major League Baseball once again seems intent to completely ignore fans who don’t run Windows or the MacOS. You’ll need to run it in a terminal rather than having a pretty GUI but thanks to curses it’s easy to scroll through lists of available games and even dates. It turns out the MLB Advanced media is not only aware of mlbviewer but several of their devs have either used it in the past or continue to use it. This is not to say that mlbviewer is a way to get around parting with your hard earned money to watch the games, because the developer of mlbviewer is very clear that it isn’t his intention at all. After all, if someone uses his code to get past the MLB payment gates it could mean that the league could come down hard on mlbviewer and have their lawyers talk to his lawyers, and I think we can all agree that would be anything but welcome news.

There are several improvements for 2013, including a way to run the app without pyxml, one of the biggest pains of last year since it’s no longer in development. He’s also got some good news for us poor folks who can’t afford to buy a subscription to MLB.tv.

Before we get the mlbviewer code let’s make sure you get the dependencies met. You’re going to need to have these packages

  • python 2.x (Python 3 isn’t supported by mlbviewer, and you should use Python 2.7 if it’s available.)
  • rtmpdump (http://rtmpdump.mplayerhq.hu/) for audio and basic service video
  • mlbhls for NexDef video
  • mplayer2
  • Either an MLB.tv account for the whole enchilada or an MLB.com account for some basic free goodies. You no longer need an MLB.com account for the free content. You’ll see an error about an unsuccessful login but you can ignore it.

Since some of them are already available in the repositories for most distributions let’s fire up a terminal and make sure we have them installed. I’m going to give you the command based on the SolydXK repos since that’s what I’m running and I can see what they have available. Run this in your terminal

sudo apt-get install build-essential python2.7 subversion rtmpdump mplayer2

If you already have build-essential installed it won’t install again. RTMPDump may not be in your distro’s repos, and if it isn’t I’ll walk you through installing it below.

Now that you have those basics taken care of let’s get the programs installed that your distro doesn’t have.

Installing mlbhls and rtmpdump

If you don’t have a paid subscription to MLB.tv you don’t need these programs but you may get a chance to get a free trial of MLB.tv so I’d recommend installing them so they’re already installed when you need them. Unfortunately you can’t download mlbhls from their Google Code site any longer so you’ll have to grab the code with Subversion. Open a terminal in the folder you want to install it from (I prefer to use a folder called Installers) if you don’t already have one open and run these commands one line at a time. Updated 5 April to correct the steps required, including taking care of some additional dependencies. The changes are in bold.

sudo apt-get install libcurl4-openssl-dev libconfig8-dev
svn co https://mlbtv-hls-nexdef.googlecode.com/svn/branches/experimental mlbhls
cd experimental
make
sudo cp mlbhls /usr/bin

As I saw on SolydK, if you’re running Debian Linux or a distro that uses the Debian repositories installing rtmpdump is amazingly easy. You can simply run sudo apt-get install rtmpdump. If it’s not available in your repos you’ll need to use git to get the latest code. if you don’t already have it installed you can install it with sudo apt-get install git. Once it’s installed run these lines one at a time in your terminal, again pointing to the folder where you want to install programs from.

git clone git://git.ffmpeg.org/rtmpdump
cd rtmpdump/
make sys=posix

Before you close the terminal you should copy the rtmpdump binary to /usr/bin by running this in the terminal once you’ve run make:

sudo cp rtmpdump /usr/bin/rtmpdump

Finally, it’s time to install mlbviewer

There are two ways to install mlbviewer, getting it from the mlbviewer website or getting the very latest code via Subversion. If you choose to download it from the site you just have to extract it and it’s ready for it’s first run. If you want to grab the latest version with Subversion you’ll need to run this command in your terminal

svn checkout svn://svn.code.sf.net/p/mlbviewer/code/trunk mlbviewer-2013

Regardless of how you installed mlviewer point your terminal at the folder you installed it to (mlbviewer2013 if you download the code from the site, if you went with svn code use mlbviewer-2013). Then simply run

python mlbviewer.py

When it finishes it will tell you to review the settings of ~/.mlb/config and set your user name and password. Open that file in your favorite text editor and at the top you will see

# See README for explanation of these settings.
# user and pass are required except for Top Plays
user=
pass=

You’ll need to put your username (email address) and password associated with your MLB.TV or MLB.com account. There are a number of settings in this file, such as a way to note your favorite team(s), and to see what everything is look at the README file that came with mlbviewer. If you’ve installed mlbhls you want to change line 54 so it reads

use_nexdef=1

Once you’ve finished changing the settings (please try not to break anything) save it and go back to your terminal window. Once again run

python mlbviewer.py

Screenshot of the 2013 edition of mlbviewerAs you can see from the screenshot (showing yesterday’s games) I’ve set the LA Dodgers as a favorite team and set the favorite color to blue, and since I’ve scrolled down to that game you’ll see that the final video is available. If you want to watch the video for a particular game just use your up and down arrow keys to scroll down to the game you want and hit Enter. You can also change to the AWAY coverage of the game by hitting S anywhere on this screen, and if you want to get the audio for the game as I’m about to do just press A when your game is selected. If you have a paid subscription to MLB.tv you can watch a condensed version of some games. Simply scroll to the game you want and see if the Status says Final (Condensed Game Available). If it does press C for the condensed game.

Updated 2 April: If you don’t have a subscription to MLB.tv you need to leave the user and pass fields in the config file empty to be able to enjoy the condensed games.

If you have a favorite team specified mlbviewer will default to the team’s coverage, regardless whether they’re at home or on the road. If you want to change the date for the games shown you can use your left and right arrow keys to go back and forward one day and if you want to jump to a particular date just press J and enter the date.

Top Plays listing in mlbviewerYou can view all of the highlights available from the game by pressing T, and it will show a list of all of the highlights. You can go through the clips one at a time and press Enter to see them , and if you’re using mplayer or mplayer2 as the player for the Top Plays you can hit Y to get a playlist of all of the available highlights one after another.

There are a number of other keys you can use and they’re all listed in the README file, or you can simply press h. If you run into problems you can post them over on the mlbviewer thread over at LinuxQuestions.org. They’re really quick to respond and you may find that your problem has already been addressed by another user. Enjoy your baseball games, and may your beloved team win more than it loses. Unless they’re playing the Dodgers, of course.

Create a launcher for mlbviewerIn addition you can also create a launcher for mlbviewer. I used the KDE Menu Editor to create it and you can use whatever tool you prefer to create launchers. The important information is:

  • Name: I used mlbtv since that’s what I use mlbviewer to watch
  • Description: Watch MLB.tv with mlbviewer
  • Command: This is the path to where you have mlbviewer installed.
  • Go to the Advanced tab and click the box to run it in a terminal

I created a custom icon for the launcher that uses the league’s logo as a starting point.  I do not have permission to use this and if you download and use it you may be in violation of US copyright laws, but if you want to use it as well you can get it here.

Updated 17 May: If you’re wanting to see NexDef streams on the MLB.tv site you’ll need to run this in a terminal:

java -Xmx128m -jar /opt/nexdef-plugin/Library/Application\ Support/NexDef/lib/nexdef.jar

I’ve also uploaded the old debian-nexdef-installer script in my Dropbox for those wanting it. Simply make it executable and then run the script in a terminal, and then run the above line of code in a terminal to be able to see NexDef content on the MLB.tv website.

About these ads

About BostonPeng

Disabled SolydK user with KDE SC 4.9.5 Also big fan of NPR and the LA Dodgers.
This entry was posted in Baseball, GNU/Linux, Open Source and tagged , , , , , , , , , , , , , , . Bookmark the permalink.

7 Responses to [HOWTO] PLAY BALL! Enjoy the new MLB video this season on Linux with MLBVIEWER

  1. Pingback: MLB.TV in Linux - Page 258

  2. Pingback: [HOWTO] Enjoy MLB games in Linux, with NexDef! | Tux + Me

  3. Pingback: [HOWTO] Enjoy MLB games in Linux, with NexDef! | I'm Just an Avatar

  4. Grant says:

    Hello – i’m working through the steps and after running:
    svn co https://mlbtv-hls-nexdef.googlecode.com/svn/branches/experimental
    I don’t get MLBHLS. This is the return:
    A experimental/mlb.h
    A experimental/utils.c
    A experimental/output.c
    A experimental/utils.h
    A experimental/output.h
    A experimental/mlb.c
    A experimental/Makefile
    Checked out revision 64.
    user@LivingRoom-htpc:~/Desktop/Install$ mlbhls
    mlbhls: command not found

    any idea what i’m missing?

Comments are closed.