LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices

Reply
 
Search this Thread
Old 06-28-2011, 01:04 AM   #3376
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,748

Rep: Reputation: 76

Quote:
Originally Posted by Theophile View Post
I noticed the grid also contains a feed labeled CLOUD_WIRED, which I'd been assuming was for NexDef. But it looks like Boxee directly accesses that feed for playback in 720p. Here's a Boxee info log indicating as much:

http://pastebin.com/2p8k0m8U

The thing to note about that is that this log is from my Linux box, which is NOT running the NexDef plugin at all. Moreover, the MLB.TV app for Boxee does not appear to package a separate version of it. And in any case, you'll note that the Boxee player uses ffmpeg for playback. So whatever Boxee is doing to "get at" the streams, mplayer should be able to handle it.
The NexDef plugin is basically an HTTP Live Streaming client. If there's an HLS client that can decrypt the segments and reassemble the stream, I could build the mlbviewer interface to it. It sounds like boxee/xbmc team has already figured that part out. I'm downloading their code tonight. Can you post me a link for the mlb.tv xbmc/boxee plugin? Also, if you know anyone who worked on the backend, can you put me in touch with them? I don't have nearly the time I used to for mlbviewer but maybe with some guidance on their code/implementation, I could figure out a way to leverage what they have already done.

Thanks!
 
Old 06-28-2011, 08:51 AM   #3377
Theophile
Member
 
Registered: Jan 2003
Posts: 283

Rep: Reputation: 35
Would this work?

http://code.google.com/p/hls-player/

Also, I did some digging and found that Boxee "rolled their own" HLS support. There's a related wiki page here. Of note is the email address at the bottom. I would suspect that's the guy to ask about how to approach this.

Some of the XBMC developers are working on a backport of the Boxee code to XBMC. In their ticket, they imply that there is HLS support in ffmpeg, but with limitations.

The spec is here.

If you can get as far as generating an M3U8 playlist, maybe we'll get lucky and HLS-player will work? If so, maybe that project can be used to create a client that can feed to mplayer.
 
Old 06-28-2011, 09:01 AM   #3378
Theophile
Member
 
Registered: Jan 2003
Posts: 283

Rep: Reputation: 35
By the way, I don't know how to download the MLV.TB Boxee app, except from inside Boxee itself. Once it does, I have compiled .pyo files. I decompiled the one that does all the hard work, and it's here:

http://pastebin.com/PKSM9V4q

EDIT: And divingmule in the XBMC forum has figured out how to get the .m3u8 file.

Last edited by Theophile; 06-28-2011 at 09:51 AM.
 
Old 06-29-2011, 02:59 AM   #3379
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,748

Rep: Reputation: 76
I know how to get the m3u8 file, and no, hls-player doesn't work. I suspect it's because the segments are encrypted. I don't know a great deal about encryption but the base64 chunk that is returned with a findUserMedia request for the HTTP_CLOUD_WIRED stream contains both the m3u8 URL and a crypto bit which must be used in conjunction with the key and IV in the m3u8 file. Unfortunately, my best try to reproduce the correct algorithm kept failing because the base64 seed and the base64 key in the m3u8 file was not coming out to a multiple of 16. I figure this is probably due to some python programming mistake I was making. In any case, I ran out of both time and desire to pursue this project.

I have actually be in contact with a developer who has a working HLS client for mlbviewer which, with his help, has been my model for my own project. Initially, I asked him to hold off on making it public. However, Boxee's implementation as you have explained it to me made me reconsider that request. In the end, I have decided that using an HLS client rather than the (un)official autobahn.jar plugin is no more dangerous than using rtmpdump rather than flash. I believe baseball fans, mlb.tv subscribers, and mlbviewer users are more interested in watching the games they paid for rather than stealing service they didn't or deconstructing the tools for purposes other than those granted by the terms of service. I like to err on the side of caution and prudence but I think implementing our own HLS will be within the realm of acceptable use.

Stay tuned. The author of that HLS client has agreed to release it but wants some time to clean it up first. In the meantime, I'll work on the mlbviewer interface to use it so there should be little lag between his release and mlbviewer's support of it. If I find a free moment between now and then, I'll see if I can have a look at the XBMC/Boxee implementation.
 
Old 06-29-2011, 09:50 AM   #3380
divingmule
LQ Newbie
 
Registered: Jun 2011
Posts: 1

Rep: Reputation: Disabled
I just wanted to personally say thanks for all your efforts and for sharing your wealth of knowledge.

Thank You.

Last edited by divingmule; 06-29-2011 at 09:52 AM.
 
Old 06-30-2011, 08:09 AM   #3381
sruchris
LQ Newbie
 
Registered: Apr 2009
Posts: 17

Rep: Reputation: 0
A few weeks ago I checked out the nexdef2011 branch. Since I only pay for the audio feeds, I successfully listened to several games using the mlbplay.py script. However, to my surprise, after a few system updates, neither mlbplay or mlbviewer works. Here's what I get when I run:

/usr/bin/python2.7 nexdef2011/mlbplay.py a=fla

RTMPDump v2.3
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
Connecting ...
INFO: Connected...
Starting download at: -0.001 kB
1.277 kB / 0.18 secmplayer: could not connect to socket
mplayer: No such file or directory
53729.738 kB / 13244.76 sec
Download complete
[flv @ 0x25da960] invalid stream
[flv @ 0x25da960] Could not find codec parameters (Video: [0][0][0][0] / 0x0000)
[flv @ 0x25da960] Estimating duration from bitrate, this may be inaccurate


Any ideas? I have mplayer version SVN-r33713-4.6.0 installed.
 
Old 07-12-2011, 11:44 PM   #3382
mkomko
Member
 
Registered: Mar 2010
Posts: 67

Rep: Reputation: 0
Hey daftcat,

could you maybe provide a quick update to be able to watch the all-star game? There is an error when opening mlbviewer, it obviously has a problem with the listings.

I think and hope it's a quick fix.
Thank you so much in advance!
 
Old 07-13-2011, 06:33 AM   #3383
chrisVV
Member
 
Registered: Aug 2010
Posts: 109

Rep: Reputation: 1
All Star patch

I had to apply this patch to play the all star game archive. The conditional in operator requires a valid value on its left side.

Chris
Attached Files
File Type: txt allstar.txt (1.4 KB, 17 views)
 
Old 07-13-2011, 03:20 PM   #3384
fang2415
Member
 
Registered: Jan 2007
Posts: 159

Rep: Reputation: 15
Awesome, thanks Chris! I had a quick look but couldn't see the fix without more digging. Looks great now!
 
Old 07-13-2011, 11:51 PM   #3385
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,748

Rep: Reputation: 76
Fixed and checked in as revision 310 on the mlbviewer branch.
 
Old 07-14-2011, 12:11 AM   #3386
mkomko
Member
 
Registered: Mar 2010
Posts: 67

Rep: Reputation: 0
Thank you very much guys!
I haven't tried it out yet - I was able to use the mlbplay.py-Script to watch the ASG.

You people are great, thanks.
 
Old 07-14-2011, 12:38 AM   #3387
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,748

Rep: Reputation: 76
Experimental support for nexdef (not autobahn.jar)

All-star Game fix got checked into nexdef2011 branch. Along with it came my first attempt to support a non-autobahn.jar method of watching games in HD (aka NexDef...though I hesitate to call it NexDef since we are no longer using the NexDef code developed for MLB.TV.)

A few notes:

1. First, use SVN to check out mlbtv-hls-nexdef from this link:

http://code.google.com/p/mlbtv-hls-n...ource/checkout

2. Type 'make' to build the mlbhd executable and copy it to /usr/bin (or somewhere else in your PATH.)

3. Add 'use_mlbhd=1' to your ~/.mlb/config file.

4. Manually set the speed you desire in "NEXDEF" mode using the max_bps config file setting.

Valid choices are:

128, 500, 800, 1200, 1800, 2200, 3000, 4500

Add three zeroes to get max_bps setting.

5. Either add 'use_nexdef=1' to ~/.mlb/config or use the 'n' key from within mlbviewer to enable NexDef mode.

This is a first attempt. It won't be perfect and this is the documentation so far. If you're not comfortable with using 'make' or editing the ~/.mlb/config file, please wait for me to get this stabilized or the next few revisions.

For those who want to try this out, mlbhd is an HLS client (not written by me) developed specifically for MLB.TV. It handles the parsing of the base64 nexdef URL, the m3u8 files, fetching the timestamp media files, decrypting them, and streaming them to a file or, in this case, stdout where mplayer reads from stdin. In other words, very similar to the way rtmpdump and mplayer are piped together for non-nexdef mode streams.

I'm not a mplayer or ffmpeg expert or HLS expert by any means. In most cases, I'm just stringing up some dirty python code to work with other people's code and this is no exception. The video frequently works and the streaming works well. Sometimes the audio works and sometimes it doesn't. Best to either try again or try a different speed. I find 800K works every time. Other speeds are a lottery ticket. Sometimes you get lucky. Maybe having extra eyes on this especially those of you who know more about mplayer/ffmpeg than I do will help find the missing piece.

Give it a go and good luck. Let's get some extra testing into this to get it working well enough for me to put together some proper documentation and get it ready for the rest of you.
 
Old 07-14-2011, 11:15 AM   #3388
Theophile
Member
 
Registered: Jan 2003
Posts: 283

Rep: Reputation: 35
So glad to see the MLB HLS player posted here. Since we at the XBMC forums have been playing around with it for a couple weeks, I'll share a few of my random observations for others trying it out for the first time.
  • If you're trying to build mlbhd on Ubuntu, you'll probably need to do this first:
    Code:
    sudo apt-get install libcurl4-gnutls-dev libconfig-dev
  • Unlike rtmpdump, mlbhd does not necessarily pull the video down in real time. It downloads the chunks as fast as it can, which means if you're grabbing a stream with a higher bitrate than your internet connection, mplayer will eventually bottom out even with a huge buffer. The author of mlbhd wrote patches for mplayer and mplayer2 to mitigate the damage caused by this phenomenon.
  • By default, mlbhd locks the target bitrate at the highest available, or whatever you specify with the -b option. But there's an experimental "stream switching" option using the -L option. Theoretically, it should adjust the bitrate according to your connection speed, but I haven't really given it a workout yet. Even so, it's possible that mplayer might have problems with such bitrate switching (mplayer2 supposedly has better support for this).
  • Streams fetched with mlbhd have the TV and radio audio stream embedded. You can watch the TV coverage but listen to the radio announcer using the -aid option in the mplayer command line.
 
Old 07-14-2011, 05:03 PM   #3389
mkomko
Member
 
Registered: Mar 2010
Posts: 67

Rep: Reputation: 0
Never mind.

Last edited by mkomko; 07-21-2011 at 03:15 AM.
 
Old 07-15-2011, 02:15 AM   #3390
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,748

Rep: Reputation: 76
Quote:
Originally Posted by Theophile View Post
So glad to see the MLB HLS player posted here. Since we at the XBMC forums have been playing around with it for a couple weeks, I'll share a few of my random observations for others trying it out for the first time.
  • If you're trying to build mlbhd on Ubuntu, you'll probably need to do this first:
    Code:
    sudo apt-get install libcurl4-gnutls-dev libconfig-dev
  • Unlike rtmpdump, mlbhd does not necessarily pull the video down in real time. It downloads the chunks as fast as it can, which means if you're grabbing a stream with a higher bitrate than your internet connection, mplayer will eventually bottom out even with a huge buffer. The author of mlbhd wrote patches for mplayer and mplayer2 to mitigate the damage caused by this phenomenon.
  • By default, mlbhd locks the target bitrate at the highest available, or whatever you specify with the -b option. But there's an experimental "stream switching" option using the -L option. Theoretically, it should adjust the bitrate according to your connection speed, but I haven't really given it a workout yet. Even so, it's possible that mplayer might have problems with such bitrate switching (mplayer2 supposedly has better support for this).
  • Streams fetched with mlbhd have the TV and radio audio stream embedded. You can watch the TV coverage but listen to the radio announcer using the -aid option in the mplayer command line.
Hi Theophile!

Thanks for getting back to me. Glad you have worked with this tool already.

So let's figure out why there is sometimes no sound. I will upload samples using dumpstream as soon as I figure out how to share a public link via sugarsync (instead of a referral URL )

I'm building mplayer2 right now from the source tarball for build-2.0.

I couldn't get past the ./init --shallow step when trying to build from git source. It exited with fatal error, something about no git repository found.

For your convenience, I have moved the mlbhd command up to the top of MLBviewer/mlbtv.py as "DEFAULT_HD_PLAYER". Through some trial and error, I have found the "-f 48" offset seems to work best (most reliably find the head of the stream.) Though sometimes I do have to wait awhile for the game part of the stream .

Let me know if you need any mplayer logs.

Thanks!

Last edited by daftcat; 07-15-2011 at 11:33 AM.
 
  


Reply

Tags
help, install, installation, instructions, seek, vlc, windows


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mlb.com gameday audio stream statmobile Linux - Newbie 6 05-06-2008 10:16 PM
link dies intermittently-seemingly at random- between win<->linux not linux<->linux?? takahaya Linux - Networking 10 03-09-2007 10:37 PM
triple boot linux/linux/linux No Windows involved toastermaker Linux - Newbie 12 03-02-2006 10:40 PM
Redhat (rhel v2.1) bootup problem with linux (linux vs linux-up) namgor Linux - Software 2 06-24-2004 02:49 PM


All times are GMT -5. The time now is 11:28 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration