LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 03-08-2010, 01:47 PM   #2356
Theophile
Member
 
Registered: Jan 2003
Posts: 283

Rep: Reputation: 35

Okay, gameday audio streaming to Android is an absolute piece of cake (same method works for iPhone and iPod Touch too, by the way). I've been working on video and it is significantly more complicated. You apparently can't just point the web browser at a local video file, it has to be streamed over rtsp. I've got a vlc command line string that works to transcode and stream on the fly in a way that Android can read. I have successfully used it with several local video files. Problem is the h264 nal bug that prevented mplayer from playing these streams last year is still present in my builds of vlc. I'm trying to compile from source now to see if that addresses it. In short, I believe that if VLC can play the video, I can also get it to stream realtime to Android (and I'm pretty sure iPhone/Touch would work in this case too).
 
Old 03-08-2010, 02:45 PM   #2357
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,883

Rep: Reputation: 86
Last year I was working on a get_mlb_basic script that would be something like give it a team code and a flag or two and it would start up the stream. I'm really really really wanting to rewrite a ton of the code to clean it up. I have a basic class and inherited class for the listings window and I'd like to do the same for configuration, schedule, and gamestream. In other words, instead of having a dozen different if/else switches for the different types of audio and video, I can just create the correct object type ahead of time, and call play() and all the differences would be handled in the class itself. A major rewrite like this will take a lot of time but it would be a huge benefit for any spin-off projects, new features, new seasons, etc.

I am however nervous and hesitant about taking this on before I understand what this season's service is going to look like.

In the meantime, I'm sure you can hack something together with the mlblistings.py script and the scripts in the test directory like I did for someone's Yankees fan grandfather last year. Grep your teamcode from the listings and awk out the calendar event id to feed to the appropriate test tool.
 
Old 03-08-2010, 03:12 PM   #2358
Theophile
Member
 
Registered: Jan 2003
Posts: 283

Rep: Reputation: 35
My level of programming knowledge is so low that I don't think I could even do that. Am I correct that mlbviewer is basically a set of python scripts with a curses interface? If so, would it be possible to simply use a php interface in place of curses? Something like what this guy was trying to do?

http://www.experts-exchange.com/Web_..._24410754.html

If this would be non-trivial, then I may just use an ssh client on the phone and start the stream that way, then use a static HTML page on my home server with a hardcoded hyperlink to the local file.

I'd like to learn all this one day, I just don't think it will be soon. If you need me to wrangle media player issues and A/V codecs, I'm your guy (well, sort of.) ;-)
 
Old 03-08-2010, 05:53 PM   #2359
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,883

Rep: Reputation: 86
Definitely non-trivial with the current code. The curses would not work one bit no matter how much php you wrap around them.

Certainly something like this would work a lot better:

Code:
#!/bin/ksh

MLB_HOME=/home/user/mlbviewer
MY_TEAM=bos
MY_TOOL=test/gamedayaudio.py

EVENT_ID=`${MLB_HOME}/mlblistings.py | grep ${MY_TEAM} | awk -F: '{print $5}'`
echo "Playing game with event-id = ${EVENT_ID}"
${MLB_HOME}/${MY_TOOL} ${EVENT_ID}
You might have to Google some ksh/grep/awk to get that to work but that should yield some kind of result. I don't remember if gamedayaudio.py writes to a file or streams to mplayer.
 
Old 03-08-2010, 06:01 PM   #2360
Theophile
Member
 
Registered: Jan 2003
Posts: 283

Rep: Reputation: 35
I see. I'll have to look at some PHP and see if I can figure something out. Should be fun!
 
Old 03-09-2010, 12:06 PM   #2361
poorboywilly
Member
 
Registered: Apr 2009
Posts: 120

Rep: Reputation: 18
Quote:
Originally Posted by Theophile View Post
I've got a vlc command line string that works to transcode and stream on the fly in a way that Android can read. I have successfully used it with several local video files. Problem is the h264 nal bug that prevented mplayer from playing these streams last year is still present in my builds of vlc. I'm trying to compile from source now to see if that addresses it. In short, I believe that if VLC can play the video, I can also get it to stream realtime to Android (and I'm pretty sure iPhone/Touch would work in this case too).
Your VLC doesn't work with the feeds? Mine works perfectly with the rtmpdump/flvstreamer data. In fact, as of some point last year, the only problem I've had with VLC is with the nexdef feeds when the bitrate changed. Is your VLC really old?
 
Old 03-09-2010, 12:21 PM   #2362
Theophile
Member
 
Registered: Jan 2003
Posts: 283

Rep: Reputation: 35
Quote:
Originally Posted by poorboywilly View Post
Your VLC doesn't work with the feeds? Mine works perfectly with the rtmpdump/flvstreamer data. In fact, as of some point last year, the only problem I've had with VLC is with the nexdef feeds when the bitrate changed. Is your VLC really old?
I don't know what the deal was. I was using version 1.0.2 from the Ubuntu main repository and it would not play the video from archived spring training games grabbed with rtmpdump. I got those frame errors we used to get with mplayer. I just compiled vlc from source against x264 and ffmpeg svn and now I don't get those errors anymore. I'm still having problems restreaming h264 encoded video using VLC. The video plays locally fine, but when I use the streaming server, I get no video. The same command line works with xvid encoded video, but not h264. I guess I have to do some more testing.
 
Old 03-09-2010, 12:54 PM   #2363
poorboywilly
Member
 
Registered: Apr 2009
Posts: 120

Rep: Reputation: 18
Quote:
Originally Posted by Theophile View Post
I don't know what the deal was. I was using version 1.0.2 from the Ubuntu main repository and it would not play the video from archived spring training games grabbed with rtmpdump. I got those frame errors we used to get with mplayer. I just compiled vlc from source against x264 and ffmpeg svn and now I don't get those errors anymore. I'm still having problems restreaming h264 encoded video using VLC. The video plays locally fine, but when I use the streaming server, I get no video. The same command line works with xvid encoded video, but not h264. I guess I have to do some more testing.
The Ubuntu vlc must have been built against a very old ffmpeg.

Last edited by poorboywilly; 03-10-2010 at 06:09 PM.
 
Old 03-10-2010, 02:05 AM   #2364
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,883

Rep: Reputation: 86
Revision 220: Nothing special

Added keyboard bindings for RemotePad.
Added "Cancelled" status code.
Changed the stream name in stdout.py for 2010 Spring Training.

I use RemotePad for the iPhone to remotely control my older laptop that's connected to the wall mount LCD. It's not really a ten foot interface but I can read the basics from across the room (and a terminal with a huge font.) But the iPhone keypad doesn't have the arrow keys so I aliased the bottom row punctuation ('.' and ',' for down and up, '?', '!' for left and right.)
 
Old 03-10-2010, 07:44 AM   #2365
Theophile
Member
 
Registered: Jan 2003
Posts: 283

Rep: Reputation: 35
Well I did it. I managed to put together a video_player line that will enable realtime streaming video to Android devices. It works on both live and archived games. The key was to pass the output of rtmpdump to ffmpeg which handles the decoding of the elementary streams then pipes the output directly to vlc which re-encodes in an Android-friendly format and streams it over RTSP.

I'm not posting the line yet because I think it needs to be tweaked for quality optimization, plus I'm noticing so audio sync issues that I want to try to track down. If anyone is interested in helping me troubleshoot, drop me a PM.

(For the sake of posterity, I'm pretty sure this would have worked fine with the version of VLC in the Ubuntu repo.)
 
Old 03-10-2010, 01:02 PM   #2366
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,883

Rep: Reputation: 86
You're walking a dangerous line. I think it's cool but I don't think MLB.TV and the At Bat development team would appreciate it much. Keep the video_player line to PM, please.
 
Old 03-10-2010, 01:21 PM   #2367
Theophile
Member
 
Registered: Jan 2003
Posts: 283

Rep: Reputation: 35
Quote:
Originally Posted by daftcat View Post
You're walking a dangerous line. I think it's cool but I don't think MLB.TV and the At Bat development team would appreciate it much. Keep the video_player line to PM, please.
For the record, MLB At Bat for Android does not support live video. If it did, I wouldn't have bothered. ;-) So for the time being, this isn't stepping on any toes, at least none that I'm aware of.
 
Old 03-10-2010, 01:30 PM   #2368
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,883

Rep: Reputation: 86
Right now it doesn't, but a promised update will. At least the iPhone edition. I don't know about Android. Still better to err on the side of paranoia.
 
Old 03-10-2010, 01:55 PM   #2369
Theophile
Member
 
Registered: Jan 2003
Posts: 283

Rep: Reputation: 35
Nope, no video for Android. If you look at the mobile product page you'll see that they don't even advertise MLB.TV on the Android ap (but they do for iPhone). I read a thread in the support forum where the rep says Android doesn't support streaming video (read: doesn't mesh well with MLB.com's existing infrastructure). Then again, Android is about to get Flash 10.1 so it may not matter. We may be able to just go to mlb.com and watch the game in the browser as normal.
 
Old 03-10-2010, 02:00 PM   #2370
daftcat
mlbviewer Maintainer
 
Registered: Apr 2008
Posts: 1,883

Rep: Reputation: 86
In that case, hack away.

That's cool what Theo did for Nomar.
 
  


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:32 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration