Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
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.
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
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.
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...
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:
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.
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.
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:
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:
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!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.