MLBViewer

Post Reply
Ahso!
Posts: 10215
Joined: Wed Nov 11, 2009 1:38 pm

MLBViewer

Post by Ahso! »

I've installed MLBViewer so I can watch MLB.TV with my computer. The advantage is that as opposed to buying the baseball package through cable or satellite, as a premium subscriber I get to view any game I want in HD either live or archived, and it's cheaper through MLB.TV than the MLB Sports Package television providers offer.

I've got everything set up to where archived games are not a problem but viewing live games has been elusive. The problem appears to be what's called Nexdef, which is the HD protocol MLB.TV uses for HD streaming. There is a script named mlbhls written by a baseball enthusiast to make the process as easy as possible because mlb.tv likes to make HD streaming a moving target.

There are a couple people here who can probably advise me with this so I'll post the readme file, install file and requirements file along with a link to the mlbhls site to view.

As I said, I'm good to go for archived games, it's the live ones that are proving difficult. On the mlbhls, I'm not sure if I need to go through the long process every time I want to watch a game.

Any help is greatly appreciated. The files will be in the following posts.
“Those who can make you believe absurdities can make you commit atrocities,”

Voltaire



I have only one thing to do and that's

Be the wave that I am and then

Sink back into the ocean

Fiona Apple
Ahso!
Posts: 10215
Joined: Wed Nov 11, 2009 1:38 pm

MLBViewer

Post by Ahso! »

Well that's not going to work because of that internal server error. So I'll just link to both mlbviewer download page and mlbhls page.

mlbviewer | Free Audio & Video software downloads at SourceForge.net

README - mlbtv-hls-nexdef - MLB.tv NexDef (HLS) App - Google Project Hosting
“Those who can make you believe absurdities can make you commit atrocities,”

Voltaire



I have only one thing to do and that's

Be the wave that I am and then

Sink back into the ocean

Fiona Apple
Ahso!
Posts: 10215
Joined: Wed Nov 11, 2009 1:38 pm

MLBViewer

Post by Ahso! »

No help, Spot? Too bad yaaarrrgg doesn't visit here much any longer.
“Those who can make you believe absurdities can make you commit atrocities,”

Voltaire



I have only one thing to do and that's

Be the wave that I am and then

Sink back into the ocean

Fiona Apple
User avatar
Bryn Mawr
Posts: 16117
Joined: Mon Feb 27, 2006 4:54 pm

MLBViewer

Post by Bryn Mawr »

It looks as though each live program has its own embedded ID that you have to find and plug in manually before you can watch the program - a PITA if ever I saw one.

Short of writing a script to automate the process, effectively a script to write the script you need to view the program, the long way round is the only way round.
Ahso!
Posts: 10215
Joined: Wed Nov 11, 2009 1:38 pm

MLBViewer

Post by Ahso! »

Bryn Mawr;1391945 wrote: It looks as though each live program has its own embedded ID that you have to find and plug in manually before you can watch the program - a PITA if ever I saw one.

Short of writing a script to automate the process, effectively a script to write the script you need to view the program, the long way round is the only way round.I appreciate that, Bryn. In past years all you had to do was have the Nexdef file in your home folder and open it with a terminal, leave it open and then open MLBViewer to watch. That's basically how it works now except the process is so much more complicated because MLB has a contract with adobe for flash and makes Linux users work extra hard. The games are horrible on the flash player.
“Those who can make you believe absurdities can make you commit atrocities,”

Voltaire



I have only one thing to do and that's

Be the wave that I am and then

Sink back into the ocean

Fiona Apple
yaaarrrgg
Posts: 1193
Joined: Fri Dec 21, 2007 9:29 pm

MLBViewer

Post by yaaarrrgg »

I'm not sure I totally understand the process of setting up a live stream, although sometimes it's not hard to write a quick bash script to string together a couple different command line tools. What would be an example of the commands used (and the output) to set up a stream?
Ahso!
Posts: 10215
Joined: Wed Nov 11, 2009 1:38 pm

MLBViewer

Post by Ahso! »

What I do is

cd mlbviewer

python mlbviewer.py

which brings up the listing of scheduled games for that particular date and choose one to watch. That's about all I understand about it. I'm just an end user.
“Those who can make you believe absurdities can make you commit atrocities,”

Voltaire



I have only one thing to do and that's

Be the wave that I am and then

Sink back into the ocean

Fiona Apple
Ahso!
Posts: 10215
Joined: Wed Nov 11, 2009 1:38 pm

MLBViewer

Post by Ahso! »

Install file

Requirements

See REQUIREMENTS-2012.txt file for 2012 requirements. This file is largely

out of date for the 2012 changes.

------------

For Linux and other *nixes:

* python (should be included in most modern Linux distributions)

* pyxml (should be available through package management in most Linux distros)

* rtmpdump (RTMPDump) for audio and basic service video

* mlbhls (mlbtv-hls-nexdef - MLB.tv NexDef (HLS) App - Google Project Hosting) for nexdef video

* mplayer2 is the recommended player for mlbviewer video streams

* An MLB.TV account (Watch Live Baseball Online, Stream MLB Games with MLB.TV | MLB.com: Subscriptions)

For Windows:

* cygwin (Cygwin)

* python

* pyxml

* rtmpdump

* mlbhls

* mplayer or SMPlayer

Installation

------------

For local use:

python mlbviewer.py from this directory.



Note: Because MLB.TV has changed their service dramatically over the years,

mlbviewer no longer attempts backwards compatibility. If it is desired to

play a previous year's games, please ask in the LQ forum (see README file) to

find out what the last stable release was for that season and instructions

on how to check it out from SVN.

For help, wait for the listings to load and press the 'h' key.

For more information, including configuration file settings, read the README.
“Those who can make you believe absurdities can make you commit atrocities,”

Voltaire



I have only one thing to do and that's

Be the wave that I am and then

Sink back into the ocean

Fiona Apple
Ahso!
Posts: 10215
Joined: Wed Nov 11, 2009 1:38 pm

MLBViewer

Post by Ahso! »

Requirements file

REQUIREMENTS FOR MLBVIEWER 2012 SEASON

FOR 2011 USERS:

If you used mlbviewer in 2011, not much has changed.

1. Download mlbhls (if you plan to use nexdef), build it, install it.

svn co https://mlbtv-hls-nexdef.googlecode.com ... perimental mlbhls

cd mlbhls

make

sudo cp mlbhls /usr/bin

2. If you were using speed=800 in $HOME/.mlb/config, change that to 1200. The

800 stream may not exist in 2012.

Other than that, you should not have to do anything different for 2012.

NEW USERS:

To get going for the 2012 season, you will need the following packages:

OPTIONAL (but very helpful, especially for Linux beginners!):

Setuptools - setuptools 0.6c11 : Python Package Index

This will help you download and install the required python packages

REQUIRED:

PyXML - Python and XML Processing: Download Page

setuptools users: You can install these with the following commands (as root):

$ easy_install pyxml

Please read on for further requirements depending on whether you are an MLB.TV

Premium or MLB.TV Basic subscriber.

PREMIUM USERS

You will need mlbhls (see above) to access the higher bitrates.

NON-PREMIUM USERS (and Gameday Audio subscribers)

You will need rtmpdump version 1.7 or greater.

rtmpdump - RTMPDump

MPLAYER2 VS MPLAYER

Mplayer2 is fork of the mplayer project. It also seems to play the streams

and handle stream rate switches (important if you enable adaptive streaming

in nexdef mode - see README for more details) better than the original mplayer.

For this reason, it is recommended that you download, compile, and install

mplayer2 for use with mlbviewer and MLB.TV.

mplayer2 project



The basic instructions are:

1. Download a tarball.

2. Unpack it.

3. Run 'make -j 6'

4. Run 'make install'

The binary is statically linked so it will not replace the library files that

other players like vlc are using.

---------------------------------------------------------------------------

READ THE README FOR MORE HELP ON USING MLBVIEWER 2012.

Also, you can post any support questions either to the Sourceforge forum at:

https://sourceforge.net/forum/?group_id=224512

Or the Linux Questions thread here:

MLB.TV in Linux

No, you don't have to read all 200+ pages. Just skip to the last page

and post question to the end of the thread. There are several helpful

testers who have been with this project since the start.

“Those who can make you believe absurdities can make you commit atrocities,”

Voltaire



I have only one thing to do and that's

Be the wave that I am and then

Sink back into the ocean

Fiona Apple
Ahso!
Posts: 10215
Joined: Wed Nov 11, 2009 1:38 pm

MLBViewer

Post by Ahso! »

I can't get the readme file posted because of the internal server error the forum has.
“Those who can make you believe absurdities can make you commit atrocities,”

Voltaire



I have only one thing to do and that's

Be the wave that I am and then

Sink back into the ocean

Fiona Apple
yaaarrrgg
Posts: 1193
Joined: Fri Dec 21, 2007 9:29 pm

MLBViewer

Post by yaaarrrgg »

I did notice the note "Note: Because MLB.TV has changed their service dramatically over the years, mlbviewer no longer attempts backwards compatibility." So mlb.tv is changing the api frequently? Was mlbviewer installed through the repos or source? I wonder if manually downloading and compiling the newest version of mlbviewer might add support for live streams?

I'll look over the notes more, right now I don't know what the problem would be for live streaming ...
yaaarrrgg
Posts: 1193
Joined: Fri Dec 21, 2007 9:29 pm

MLBViewer

Post by yaaarrrgg »

I read through the notes some more. Assuming the live mlbtv script works, the process can be made a bit simpler with a little bash scripting. Something like this could work:



#!/bin/bash

# pull off last line of output to get base 64 url

# i have no idea what the nym 1 1 mean though

url=$(python mlbplay.py v=nym n=1 nu=1 | tail -n 1)

echo "found url $url"

# generate the .ts file from url

./mlbhls -o /tmp/output.ts -B $url

# then run the player on the generated file

mplayer -demuxer lavf /tmp/output.ts




Note, the executable's like "mlbhls" and "mlbplay.py" would need an absolute path like /full/path/to/mlbhls

Also the line "mlbhls -o /tmp/output.ts -B $url" might be blocking (stop execution of anything past it in the script). In this case, can be run in the background by add a "&" at the end of the line like:

./mlbhls -o output.ts -B $url &

Though this means the process would also need to be killed when it was no longer needed.
Post Reply

Return to “Computers Internet”