LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-15-2014, 04:12 AM   #4516
pajamian
LQ Newbie
 
Registered: Oct 2009
Posts: 15

Rep: Reputation: 0

Quote:
Originally Posted by daftcat View Post
Yeah, sorry. That's not supported and I won't work on that. mlbviewer connects media streamer and media players to media but it is itself not in the media business itself. That would take a lower level of programming that I just don't want to undertake. You have the tools to do it yourself and you already understand the synchronization issue. I don't have any extra information or tricks in the media responses to do the kind of thing you're looking for or synchronize playback between processes.
I'm not expecting you to turn mlbviewer into a media player, but I'm hoping simply to be able to have a mechanism to select both audio and video sources at once and pass them to a custom command. I think that ffmpeg can be used in that command (as an intermediary) to combine the two sources into one, because it appears to have the ability to follow timestamps in both sources and keep them in sync. From there it's a matter of piping the single stream output from ffmpeg to mplayer. I'm not sure just how viable that solution would be, I should probably even play around with stringing together ffmpeg and mplayer in this way first before I ask for the means to select the streams, but I'm wondering if you would be open to such a solution if it would work this way?
 
Old 06-15-2014, 04:15 AM   #4517
lcvisser
LQ Newbie
 
Registered: Jun 2014
Posts: 7

Rep: Reputation: Disabled
Quote:
Originally Posted by lcvisser View Post
I created a "remote control" app for mlbplay that allows to select a game to watch via a webinterface. This lets you use a phone or tablet to start watching a game on a different computer (e.g. a media pc connected to the TV). It wraps very thinly around mlbplay and uses some of the functionality from mlbviewer to get a list of available games.

Since LQ doesn't allow me to post links in the first post, I will follow up with a link to the GitHub page and more details.
Now I can post the details

The source can be checked out from here: https://github.com/lcvisser/mlbviewer-remote

The application uses mlbplay.py for starting the stream, so it honors the settings you have set for mlbviewer (e.g. to use nexdef). When clicking on a game to watch, it will use the home team's broadcast, unless you have specified favorites or video_follow (favorites teams are preferred over video_follow).

I hope it is useful for some of you. Feedback is appreciated. If possible, post any issues on the Github page, otherwise in this thread.
 
Old 06-15-2014, 08:55 AM   #4518
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,746

Rep: Reputation: 76
Quote:
Originally Posted by pajamian View Post
I'm not expecting you to turn mlbviewer into a media player, but I'm hoping simply to be able to have a mechanism to select both audio and video sources at once and pass them to a custom command. I think that ffmpeg can be used in that command (as an intermediary) to combine the two sources into one, because it appears to have the ability to follow timestamps in both sources and keep them in sync. From there it's a matter of piping the single stream output from ffmpeg to mplayer. I'm not sure just how viable that solution would be, I should probably even play around with stringing together ffmpeg and mplayer in this way first before I ask for the means to select the streams, but I'm wondering if you would be open to such a solution if it would work this way?
Have a look at mlbplay.py. At least for nexdef, I have the n=1 nu=1 flags that will just spit out the base64 bit you need to feed to mlbhls. That should let you script something together to look into how feasible this would be. Let me know if you find a recipe that works.
 
Old 06-15-2014, 01:24 PM   #4519
Redbullsnation
LQ Newbie
 
Registered: Jun 2014
Posts: 15

Rep: Reputation: Disabled
Quote:
Originally Posted by daftcat View Post
As I said before, mlbviewer really wasn't designed for Windows. You're pretty much at the mercy of the media player and many of them do not support the nexdef mgeg-ts format at all or not very well. At least on Linux, the ffmpeg development is a bit swifter. If you're feeling brave, you can try to build your own mplayer2 or mpv in the cygwin environment. Though that is a lot of extra libraries you have to track down. I'm not posting instructions on that.

As for recording, it's a grey area of the Terms And Service. It is not explicitly forbidden (like using proxies to circumvent blackouts--don't even ask me for that), but it is also not a feature of the MLB.TV service. In fact, it may even step on a revenue stream as I believe individual games are available for purchase from iTunes. So I'll say it is possible to use mlbviewer to record, but I'm not going to say how. You may want to read the documentation of your media player.
Well, i hope one day someone makes a version for windows

I'll take a look and find the settings. Prolly need to edit config file like so in order to work
 
Old 06-15-2014, 01:42 PM   #4520
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,746

Rep: Reputation: 76
Quote:
Originally Posted by Redbullsnation View Post
Well, i hope one day someone makes a version for windows

I'll take a look and find the settings. Prolly need to edit config file like so in order to work
It looks like mpv builds are updated weekly. You could try updating to the next mpv build each week and see if it improves anything.
 
Old 06-15-2014, 02:00 PM   #4521
Redbullsnation
LQ Newbie
 
Registered: Jun 2014
Posts: 15

Rep: Reputation: Disabled
I have also found a way to record streams
put this after the cache settings

Code:
--stream-capture=%f
Will save a mp4 file that can easily be played on the xbox and such
 
Old 06-16-2014, 04:35 AM   #4522
pajamian
LQ Newbie
 
Registered: Oct 2009
Posts: 15

Rep: Reputation: 0
Quote:
Originally Posted by daftcat View Post
Have a look at mlbplay.py. At least for nexdef, I have the n=1 nu=1 flags that will just spit out the base64 bit you need to feed to mlbhls. That should let you script something together to look into how feasible this would be. Let me know if you find a recipe that works.
Thanks, I'll get back to you when I've done this. I may not have the time for a while.
 
Old 06-16-2014, 06:46 PM   #4523
Redbullsnation
LQ Newbie
 
Registered: Jun 2014
Posts: 15

Rep: Reputation: Disabled
The mlbclassics is not working for me here. When I try to play a game, all I get is "Failed to recognize file format"
 
Old 06-16-2014, 09:04 PM   #4524
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,746

Rep: Reputation: 76
Quote:
Originally Posted by Redbullsnation View Post
The mlbclassics is not working for me here. When I try to play a game, all I get is "Failed to recognize file format"
You need youtube-dl for mlbclassics. I can update the wiki later. For now,

Code:
wget https://yt-dl.org/downloads/2014.06.16/youtube-dl -O /usr/local/bin/youtube-dl

chmod a+x /usr/local/bin/youtube-dl
from a Cygwin terminal.

More info here: http://rg3.github.io/youtube-dl/download.html

Last edited by daftcat; 06-16-2014 at 09:07 PM.
 
Old 06-17-2014, 12:02 AM   #4525
Redbullsnation
LQ Newbie
 
Registered: Jun 2014
Posts: 15

Rep: Reputation: Disabled
I had that already and still getting that error..
 
Old 06-17-2014, 06:37 AM   #4526
fang2415
Member
 
Registered: Jan 2007
Posts: 159

Rep: Reputation: 15
FWIW, last year I used mlbviewer on Windows all the time with Cygwin and used VLC to watch the video. I'm not sure I ever tried the rtmpdump streams, and I think the mlbhls streams might only have worked after I figured out how to fix mlbhls's -F behavior (check upthread for the patch); but after that at least, VLC played the files fine.

I haven't tried it this year, but very little has changed as far as the media formats are concerned so I'd be surprised if there were any major changes...

Last edited by fang2415; 06-17-2014 at 06:43 AM.
 
Old 06-18-2014, 02:38 AM   #4527
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,746

Rep: Reputation: 76
Quote:
Originally Posted by Redbullsnation View Post
I had that already and still getting that error..
So I found that mlbclassics will work if the video_player= line in ~/.mlb/config is simply "video_player=mpv"

That however makes non-nexdef streams more susceptible to network delay, jitter, and loss. In other words, a sometimes choppy playback.

So I have added an option to ~/.mlb/config for mlbclassics.py called classics_player=. So now these are the settings I recommend to start with in ~/.mlb/config:

Code:
video_player=mpv -cache 4096

classics_player=mpv

use_nexdef=0
So we specify a cache setting for rtmpdump (SD mode or non-Nexdef mode) mlbviewer.py games and then we accept the default cache setting (don't remember what this is) for mlbclassics games. I recommend use_nexdef=0 to disable nexdef mode until I can figure out why it's not working on Windows. I'm not sure how much more time I am going to get to work on Cygwin as I am leaving my current job and have to return the Windows laptop soon.
 
Old 06-18-2014, 02:49 AM   #4528
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,746

Rep: Reputation: 76
If you have a modern PC/laptop (1 GB RAM, video chip with hardware acceleration), I have been working on a Linux LiveCD version of mlbviewer. It runs really well as virtual machine if you enable 3D video acceleration in the VM settings and run the VM in Full-Screen mode. But I test primarily with a quad-core i7 so let's see how it runs on a more modest Core2 Duo before I make claims about system requirements. I have run it as a LiveCD (not a virtual machine) on as low as a Thinkpad T41 (Intel Pentium M 1.6 Ghz, single core, 1.5 GB RAM) Honestly, I would rather it run as a VM than a LiveCD because I wouldn't have to bundle in all the extra drivers.

Give me a week or two to polish up the LiveCD/VM version and I'll see if I can upload it to SourceForge or if I need to host a file of that size somewhere else.
 
Old 06-18-2014, 03:03 PM   #4529
lcvisser
LQ Newbie
 
Registered: Jun 2014
Posts: 7

Rep: Reputation: Disabled
I'm running into problems with mlbhls (rev 67).

When I set "use_nexdef=1" in my mlbview config file, and then start a game, I get:
Code:
mlbhls: invalid option -- 'F'
Segmentation fault
After which I obviously don't get a game. Has someone else run into this error, or should I look into my particular setup?

For what it's worth, during compiling I got:
Code:
gcc -O2 mlb.c utils.c output.c -lm -lcurl -lcrypto -lconfig -o mlbhls
mlb.c: In function ‘mlb_hls_get_and_decrypt’:
mlb.c:881:5: warning: call to ‘_curl_easy_setopt_err_long’ declared with attribute warning: curl_easy_setopt expects a long argument for this option [enabled by default]
When I enable debug, I see that the following command is generated by mlbviewer:
Code:
mlbhls -B <base64url> -L -s 1200000 -F 23:00:01 -o - | mplayer -cache 2048 -really-quiet -
I think "-F 23:00:01" should be "-f NNN" (small letter 'f'), but I'm not sure what NNN should be.

Last edited by lcvisser; 06-18-2014 at 03:33 PM. Reason: Added more info
 
Old 06-18-2014, 11:06 PM   #4530
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,746

Rep: Reputation: 76
Quote:
Originally Posted by lcvisser View Post
I'm running into problems with mlbhls (rev 67).

When I set "use_nexdef=1" in my mlbview config file, and then start a game, I get:
Code:
mlbhls: invalid option -- 'F'
Segmentation fault
After which I obviously don't get a game. Has someone else run into this error, or should I look into my particular setup?

For what it's worth, during compiling I got:
Code:
gcc -O2 mlb.c utils.c output.c -lm -lcurl -lcrypto -lconfig -o mlbhls
mlb.c: In function ‘mlb_hls_get_and_decrypt’:
mlb.c:881:5: warning: call to ‘_curl_easy_setopt_err_long’ declared with attribute warning: curl_easy_setopt expects a long argument for this option [enabled by default]
When I enable debug, I see that the following command is generated by mlbviewer:
Code:
mlbhls -B <base64url> -L -s 1200000 -F 23:00:01 -o - | mplayer -cache 2048 -really-quiet -
I think "-F 23:00:01" should be "-f NNN" (small letter 'f'), but I'm not sure what NNN should be.
You need the mlbhls from the experimental branch. That's the one that has the -F option which is a time code to start playback from.

Code:
svn co https://mlbtv-hls-nexdef.googlecode.com/svn/branches/experimental mlbhls
This is superior to -f which is an integer number of video chunks to skip ahead before playback. The problem with -f is that even though the number of chunks can be converted to a seconds offset, that doesn't do us any good if we don't know how many seconds of lead into the actual broadcast is taken up by the, "Your Game is About To Start" screen. -F fixes that as the actual time of the beginning of the broadcast is published in one of the media location requests I make. No more guesswork!
 
  


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 07:11 PM.

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